Compare commits
34 Commits
renovate/a
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 58b2df8d94 | |||
|
|
4bade21e10 | ||
| e9eb5539d3 | |||
|
|
e103755a8b | ||
| aa403f00c0 | |||
|
|
2ec549019e | ||
|
|
72274d6f47 | ||
|
|
9d23f7f3e8 | ||
|
|
e0ab003852 | ||
|
|
769a034167 | ||
| c5fe2379e7 | |||
|
|
12490c0a23 | ||
| 03d620607d | |||
|
|
461188788b | ||
| bfdaef7cec | |||
|
|
27fc3e2cbf | ||
| bd15298ee8 | |||
|
|
24865267a2 | ||
| 14ec323086 | |||
|
|
be0a0cc78e | ||
| ab2211cf85 | |||
|
|
9ce11ed5ff | ||
| 20de7e9b71 | |||
|
|
f7bfc1373d | ||
| d935e5044d | |||
|
|
f00cc4c386 | ||
| deaeaa4754 | |||
|
|
e59acd6458 | ||
| 97aed0a4b1 | |||
|
|
84634302b1 | ||
| acab42ee6b | |||
|
|
46e5a46121 | ||
| 16f1937e9c | |||
|
|
59e6bd7b10 |
@@ -36,12 +36,18 @@ class ImportTransitExporter extends Exporter
|
||||
->label('SHIPPER INVOICE'),
|
||||
ExportColumn::make('shipper_invoice_date')
|
||||
->label('SHIPPER INVOICE DATE'),
|
||||
ExportColumn::make('inv_value')
|
||||
->label('Inv Value'),
|
||||
ExportColumn::make('freight_charge')
|
||||
->label('Freight Charge'),
|
||||
ExportColumn::make('customs_agent_name')
|
||||
->label('CUSTOMS AGENT NAME'),
|
||||
ExportColumn::make('eta_date')
|
||||
->label('ETA DATE'),
|
||||
ExportColumn::make('status')
|
||||
->label('STATUS'),
|
||||
ExportColumn::make('insurance_status')
|
||||
->label('Insurance Status'),
|
||||
ExportColumn::make('delivery_location')
|
||||
->label('DELIVERY LOCATION'),
|
||||
ExportColumn::make('etd_date')
|
||||
|
||||
@@ -75,7 +75,7 @@ class ImportTransitImporter extends Importer
|
||||
->label('Status'),
|
||||
ImportColumn::make('insurance_status')
|
||||
->exampleHeader('Insurance Status')
|
||||
->example('Receipted')
|
||||
->example('Yes')
|
||||
->label('Insurance Status'),
|
||||
ImportColumn::make('delivery_location')
|
||||
->exampleHeader('Delivery Location')
|
||||
@@ -176,6 +176,7 @@ class ImportTransitImporter extends Importer
|
||||
|
||||
return ImportTransit::updateOrCreate([
|
||||
'cri_rfq_number' => $criRfqNumber,
|
||||
'shipper_invoice' => $shipperInvoice,
|
||||
],
|
||||
[
|
||||
'mail_received_date' => $this->formatDate($mailRecDate),
|
||||
@@ -187,7 +188,6 @@ class ImportTransitImporter extends Importer
|
||||
'requester' => $requester,
|
||||
'shipper' => $shipper,
|
||||
'shipper_location' => $shipperLocation,
|
||||
'shipper_invoice' => $shipperInvoice,
|
||||
'inv_value' => $invValue,
|
||||
'freight_charge' => $freightCharge,
|
||||
'custom_agent_name' => $customsAgentname,
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Filament\Pages;
|
||||
|
||||
use App\Models\Plant;
|
||||
use App\Models\VisitorEntry;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Forms\Contracts\HasForms;
|
||||
@@ -37,38 +38,172 @@ class GateOutEntry extends Page implements HasForms
|
||||
->schema([
|
||||
Section::make('') // You can give your section a title or leave it blank
|
||||
->schema([
|
||||
TextInput::make('scan_out_gate_pass')
|
||||
Select::make('scan_out_gate_pass')
|
||||
->label('Scan Gate Pass')
|
||||
->required()
|
||||
->reactive()
|
||||
->options([
|
||||
'In' => 'In',
|
||||
'Out' => 'Out',
|
||||
]),
|
||||
TextInput::make('scan_out_gate_pass_in')
|
||||
->label('Scan In Gate Pass')
|
||||
->required()
|
||||
->reactive()
|
||||
->visible(fn ($get) => $get('scan_out_gate_pass') == 'In')
|
||||
->extraAttributes([
|
||||
'wire:keydown.enter' => 'processGatePassIn($event.target.value)',
|
||||
]),
|
||||
TextInput::make('scan_out_gate_pass_out')
|
||||
->label('Scan Out Gate Pass')
|
||||
->required()
|
||||
->reactive()
|
||||
->visible(fn ($get) => $get('scan_out_gate_pass') == 'Out')
|
||||
->extraAttributes([
|
||||
'wire:keydown.enter' => 'processGatePass($event.target.value)',
|
||||
'wire:keydown.enter' => 'processGatePassOut($event.target.value)',
|
||||
]),
|
||||
])
|
||||
->columns(5)
|
||||
]);
|
||||
}
|
||||
|
||||
public function processGatePass($gatePass)
|
||||
public function processGatePassIn($gatePass)
|
||||
{
|
||||
$entry = VisitorEntry::where('register_id', $gatePass)->first();
|
||||
$entry = VisitorEntry::where('register_id', $gatePass)->latest()->first();
|
||||
|
||||
if ($entry) {
|
||||
$entry->out_time = now();
|
||||
$entry->save();
|
||||
if ($entry)
|
||||
{
|
||||
if($entry->in_time && !$entry->out_time && (empty($entry->valid_upto) || $entry->valid_upto == '' || $entry->valid_upto == null)){
|
||||
Notification::make()
|
||||
->title('Already Entered')
|
||||
->body('Gate pass In has already been processed for entry.')
|
||||
->warning()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass_in'] = '';
|
||||
return;
|
||||
}
|
||||
elseif (
|
||||
!empty($entry->valid_upto) &&
|
||||
Carbon::parse($entry->valid_upto)->endOfDay()->gte(now())
|
||||
){
|
||||
if (empty($entry->out_time)) {
|
||||
Notification::make()
|
||||
->title('Gate In Not Allowed')
|
||||
->body("Previous gate-out has not been punched. Please complete gate-out first for ID ' . $gatePass . '.")
|
||||
->warning()
|
||||
->send();
|
||||
|
||||
Notification::make()
|
||||
->title('Gate Pass Processed')
|
||||
->body('Gate pass has been successfully processed. Visitor marked as exited.')
|
||||
->success()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass'] = '';
|
||||
} else {
|
||||
$this->filters['scan_out_gate_pass_in'] = '';
|
||||
return;
|
||||
}
|
||||
else{
|
||||
$newEntry = $entry->replicate();
|
||||
$newEntry->in_time = now();
|
||||
$newEntry->out_time = null;
|
||||
|
||||
$newEntry->save();
|
||||
|
||||
Notification::make()
|
||||
->title('Gate In')
|
||||
->body('Gate in has been successfully processed. Visitor marked as entered.')
|
||||
->success()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass_in'] = '';
|
||||
}
|
||||
}
|
||||
else{
|
||||
Notification::make()
|
||||
->title('Visitor Pass Expired')
|
||||
->body('Your visitor pass validity has expired.')
|
||||
->danger()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass_in'] = '';
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Notification::make()
|
||||
->title('Invalid Gate Pass')
|
||||
->body('The scanned gate pass is not valid. Please try again.')
|
||||
->body('Scanned gate in pass is not valid.')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function processGatePassOut($gatePass)
|
||||
{
|
||||
$entry = VisitorEntry::where('register_id', $gatePass)->latest()->first();
|
||||
|
||||
if (!$entry) {
|
||||
Notification::make()
|
||||
->title('Invalid Gate Pass')
|
||||
->body('Scanned gate out pass is not valid.')
|
||||
->danger()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass_out'] = '';
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($entry->valid_upto) || $entry->valid_upto == '' || $entry->valid_upto == null) {
|
||||
|
||||
if (!empty($entry->out_time)) {
|
||||
Notification::make()
|
||||
->title('Already Exited')
|
||||
->body('Gate pass has already been processed.')
|
||||
->warning()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass_out'] = '';
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$entry->out_time = now();
|
||||
$entry->save();
|
||||
|
||||
Notification::make()
|
||||
->title('Gate Pass Processed')
|
||||
->body('Visitor marked as exited.')
|
||||
->success()
|
||||
->send();
|
||||
|
||||
$this->filters['scan_out_gate_pass_out'] = '';
|
||||
return;
|
||||
}
|
||||
}
|
||||
elseif ((empty($entry->valid_upto) || $entry->valid_upto != '' || $entry->valid_upto != null))
|
||||
{
|
||||
if (Carbon::parse($entry->valid_upto)->endOfDay()->lt(now()))
|
||||
{
|
||||
Notification::make()
|
||||
->title('Visitor Pass Expired')
|
||||
->body('Your visitor pass validity has expired.')
|
||||
->danger()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass_out'] = '';
|
||||
return;
|
||||
}
|
||||
if (!empty($entry->out_time)) {
|
||||
Notification::make()
|
||||
->title('Already Exited')
|
||||
->body('Gate pass has already been processed.')
|
||||
->warning()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass_out'] = '';
|
||||
return;
|
||||
}
|
||||
else{
|
||||
$entry->out_time = now();
|
||||
$entry->save();
|
||||
|
||||
Notification::make()
|
||||
->title('Gate Out')
|
||||
->body('Visitor marked as exited.')
|
||||
->success()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass_out'] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3507,6 +3507,17 @@ class QualityValidationResource extends Resource
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (strpos($state, '|') !== false) {
|
||||
$state = explode('|', $state)[0];
|
||||
if ($state != $expectedValue){
|
||||
$set('part_validation1_error', 'Invalid input for part validation 1.');
|
||||
}
|
||||
else{
|
||||
$set('part_validation1', $state);
|
||||
$set('part_validation1_error', null);
|
||||
}
|
||||
}
|
||||
if ($state == $expectedValue) {
|
||||
$set('part_validation1_error', null);
|
||||
} else {
|
||||
|
||||
@@ -187,6 +187,15 @@ class VisitorEntryResource extends Resource
|
||||
->numeric()
|
||||
->default(1)
|
||||
->required(),
|
||||
Forms\Components\Select::make('mode_of_travel')
|
||||
->label('Mode of Travel')
|
||||
->options([
|
||||
'Rental' => 'Rental',
|
||||
'Car' => 'Car',
|
||||
'Bike' => 'Bike',
|
||||
])
|
||||
->reactive()
|
||||
->placeholder('Select Mode of Travel'),
|
||||
Forms\Components\DateTimePicker::make('in_time')
|
||||
->label('In Time')
|
||||
->required()
|
||||
@@ -214,6 +223,7 @@ class VisitorEntryResource extends Resource
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
// ->modifyQueryUsing(fn (Builder $query) => $query->whereDate('created_at', today()))
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('No.')
|
||||
->label('NO')
|
||||
@@ -244,15 +254,25 @@ class VisitorEntryResource extends Resource
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('mobile_number')
|
||||
->label('Visitor Mobile Number')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('name')
|
||||
->label('Visitor Name')
|
||||
->sortable()
|
||||
->alignCenter()
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('mobile_number')
|
||||
->label('Visitor Mobile Number')
|
||||
Tables\Columns\TextColumn::make('company')
|
||||
->label('Visitor Company')
|
||||
->sortable()
|
||||
->alignCenter()
|
||||
->searchable(),
|
||||
Tables\Columns\TextColumn::make('employeeMaster.plant.name')
|
||||
->label('Visited Plant')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('employeeMaster.name')
|
||||
@@ -275,6 +295,16 @@ class VisitorEntryResource extends Resource
|
||||
->searchable()
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('purpose_of_visit')
|
||||
->label('Purpose of Visit')
|
||||
->searchable()
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('mode_of_travel')
|
||||
->label('Mode of Travel')
|
||||
->searchable()
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('in_time')
|
||||
->label('In Time')
|
||||
->searchable()
|
||||
@@ -405,9 +435,23 @@ class VisitorEntryResource extends Resource
|
||||
])
|
||||
->query(function ($query, array $data) {
|
||||
// Hide all records initially if no filters are applied
|
||||
if (empty($data['register_id']) && empty($data['type']) && empty($data['name']) && empty($data['company']) && empty($data['employee_master_id']) && empty($data['created_from']) && empty($data['created_to'])) {
|
||||
$query->where(function ($q) {
|
||||
});
|
||||
// if (empty($data['register_id']) && empty($data['type']) && empty($data['name']) && empty($data['company']) && empty($data['employee_master_id']) && empty($data['created_from']) && empty($data['created_to'])) {
|
||||
// $query->where(function ($q) {
|
||||
// });
|
||||
// }
|
||||
|
||||
$hasAnyFilter = !empty($data['register_id'])
|
||||
|| !empty($data['type'])
|
||||
|| !empty($data['name'])
|
||||
|| !empty($data['company'])
|
||||
|| !empty($data['employee_master_id'])
|
||||
|| !empty($data['employee_department'])
|
||||
|| !empty($data['created_from'])
|
||||
|| !empty($data['created_to']);
|
||||
|
||||
if (!$hasAnyFilter) {
|
||||
$query->whereDate('created_at', today());
|
||||
return;
|
||||
}
|
||||
|
||||
if (! empty($data['register_id'])) {
|
||||
@@ -423,8 +467,15 @@ class VisitorEntryResource extends Resource
|
||||
}
|
||||
}
|
||||
|
||||
// if (! empty($data['name'])) {
|
||||
// $query->where('name', 'like', '%'.$data['name'].'%');
|
||||
// }
|
||||
|
||||
if (! empty($data['name'])) {
|
||||
$query->where('name', 'like', '%'.$data['name'].'%');
|
||||
$query->whereRaw(
|
||||
'LOWER(name) LIKE ?',
|
||||
['%' . strtolower($data['name']) . '%']
|
||||
);
|
||||
}
|
||||
|
||||
if (! empty($data['company'])) {
|
||||
@@ -621,4 +672,5 @@ class VisitorEntryResource extends Resource
|
||||
SoftDeletingScope::class,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,36 +21,42 @@ class CreateVisitorEntry extends CreateRecord
|
||||
|
||||
public function processMobile($mobile)
|
||||
{
|
||||
$visitor = VisitorEntry::where('mobile_number', $mobile)->latest()->first();
|
||||
$registerId = $this->data['register_id'] ?? null;
|
||||
|
||||
$visitor = VisitorEntry::where('mobile_number', $mobile)->latest()->first();
|
||||
if ($visitor) {
|
||||
|
||||
$employee = EmployeeMaster::where('id', $visitor->employee_master_id)->first();
|
||||
|
||||
$this->form->fill([
|
||||
'register_id' => $visitor->register_id ?? '',
|
||||
'mobile_number' => $mobile ?? '',
|
||||
'name' => $visitor->name ?? '',
|
||||
'company' => $visitor->company ?? '',
|
||||
'type' => $visitor->type ?? '',
|
||||
'department' => $employee->department ?? '',
|
||||
'employee_master_id' => $visitor->employee_master_id->name ?? '',
|
||||
'code' => $employee->code ?? '',
|
||||
'register_id' => $registerId ?? '',
|
||||
'mobile_number' => $visitor->mobile_number,
|
||||
'name' => $visitor->name ?? '',
|
||||
'company' => $visitor->company ?? '',
|
||||
'type' => $visitor->type ?? '',
|
||||
'department' => $employee?->department ?? '',
|
||||
'employee_master_id' => $visitor->employee_master_id,
|
||||
'code' => $employee?->code ?? '',
|
||||
'purpose_of_visit' => '',
|
||||
'in_time' => now(),
|
||||
'out_time' => null,
|
||||
'valid_upto' => null,
|
||||
]);
|
||||
}
|
||||
else {
|
||||
|
||||
$registerId = $this->form->getState()['register_id'] ?? '';
|
||||
|
||||
$this->form->fill([
|
||||
'register_id' => $registerId ?? '',
|
||||
'mobile_number' => $mobile ?? '',
|
||||
'name' => $visitor->name ?? '',
|
||||
'company' => $visitor->company ?? '',
|
||||
'type' => $visitor->type ?? '',
|
||||
'department' => $employee->department ?? '',
|
||||
'employee_master_id' => $visitor->employee_master_id->name ?? '',
|
||||
'code' => $employee->code ?? '',
|
||||
'register_id' => $registerId ?? '',
|
||||
'mobile_number' => $mobile,
|
||||
'name' => '',
|
||||
'company' => '',
|
||||
'type' => '',
|
||||
'department' => '',
|
||||
'employee_master_id' => null,
|
||||
'code' => '',
|
||||
'purpose_of_visit' => '',
|
||||
'in_time' => now(),
|
||||
'out_time' => null,
|
||||
'valid_upto' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,9 @@ class ImportTransitMail extends Mailable
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
$greeting = '<b>Dear Sir</b>';
|
||||
$now = now();
|
||||
$reportDate = $now->format('d/m/Y');
|
||||
$greeting = '<b>Dear Sir/Madam</b>,<br>Kindly find attached the Pending Import Shipment Status Report as on ' . $reportDate . ' for your reference.<br>We request you to review the shipments highlighted in <span style="background-color: yellow; font-weight: bold;">yellow</span> and arrange for their clearance at the earliest to avoid further delays and additional charges.<br>Please note that for shipments pending under <b>Telex Release</b> and <b>Duty Payment</b>, CFS charges have already commenced. We therefore urge you to expedite the necessary actions at your end.';
|
||||
|
||||
//$greeting1 = 'Dear C.R.I Branch Team, <br><br> Please follow and ensure the same';
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ class VisitorEntry extends Model
|
||||
'employee_master_id',
|
||||
'number_of_person',
|
||||
'valid_upto',
|
||||
'mode_of_travel',
|
||||
];
|
||||
|
||||
public function employeeMaster(): BelongsTo
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"alperenersoy/filament-export": "^4.0",
|
||||
"alperenersoy/filament-export": "^3.0",
|
||||
"althinect/filament-spatie-roles-permissions": "^2.3",
|
||||
"diogogpinto/filament-auth-ui-enhancer": "^1.0",
|
||||
"erag/laravel-pwa": "^1.9",
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql1 = <<<'SQL'
|
||||
ALTER TABLE visitor_entries
|
||||
ADD COLUMN mode_of_travel TEXT DEFAULT NULL
|
||||
SQL;
|
||||
|
||||
DB::statement($sql1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Schema::table('visitor_entries', function (Blueprint $table) {
|
||||
// //
|
||||
// });
|
||||
}
|
||||
};
|
||||
@@ -41,6 +41,13 @@
|
||||
background-color: #f3f4f6;
|
||||
}
|
||||
|
||||
.status-column {
|
||||
text-align: left !important;
|
||||
white-space: normal !important;
|
||||
min-width: 250px;
|
||||
width: 250px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.footer {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
@@ -64,7 +71,6 @@
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>CRI RFQ Number</th>
|
||||
<th>Ref Number</th>
|
||||
<th>Requestor</th>
|
||||
<th>Shipper</th>
|
||||
<th>Shipper Location</th>
|
||||
@@ -85,7 +91,7 @@
|
||||
<td>{{ $row['cri_rfq_number'] }}</td>
|
||||
{{-- <td>{{ $row['mail_received_date'] }}</td> --}}
|
||||
{{-- <td>{{ \Carbon\Carbon::parse($row['mail_received_date'])->format('Y-m-d') }}</td> --}}
|
||||
<td>{{ $row['pricol_ref_number'] }}</td>
|
||||
{{-- <td>{{ $row['pricol_ref_number'] }}</td> --}}
|
||||
<td>{{ $row['requester'] }}</td>
|
||||
<td>{{ $row['shipper'] }}</td>
|
||||
<td>{{ $row['shipper_location'] }}</td>
|
||||
@@ -95,7 +101,10 @@
|
||||
<td>{{ $row['customs_agent_name'] }}</td>
|
||||
{{-- <td>{{ $row['eta_date'] }}</td> --}}
|
||||
<td>{{ \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') }}</td>
|
||||
<td>{{ $row['status'] }}</td>
|
||||
{{-- <td>{{ $row['status'] }}</td> --}}
|
||||
<td class="status-column">
|
||||
{{ $row['status'] }}
|
||||
</td>
|
||||
<td>{{ $row['delivery_location'] }}</td>
|
||||
{{-- <td>{{ $row['etd_date'] }}</td> --}}
|
||||
<td>{{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }}</td>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
@page {
|
||||
margin: 0;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
@page {
|
||||
margin: 0;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
@page {
|
||||
margin: 0;
|
||||
|
||||
@@ -41,32 +41,26 @@
|
||||
.badge-header {
|
||||
background: #1a1a2e;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
padding: 2mm 2mm 1.5mm;
|
||||
padding: 1.5mm 2mm;
|
||||
font-size: 8pt;
|
||||
font-weight: bold;
|
||||
letter-spacing: 1px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.badge-header .type {
|
||||
font-size: 9pt;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.badge-header .badge-id {
|
||||
font-size: 7pt;
|
||||
opacity: 0.85;
|
||||
}
|
||||
.badge-header .type { font-size: 9pt; letter-spacing: 2px; }
|
||||
.badge-header .badge-id { font-size: 7pt; opacity: 0.85; }
|
||||
|
||||
/* ── Body ── */
|
||||
.badge-body {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
padding: 2mm;
|
||||
padding: 1.5mm 2mm;
|
||||
gap: 2mm;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ── Fields (left) ── */
|
||||
@@ -74,82 +68,104 @@
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.2mm;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.field-row {
|
||||
display: grid;
|
||||
grid-template-columns: 16mm 3mm 1fr;
|
||||
line-height: 1.3;
|
||||
margin-bottom: 0.7mm;
|
||||
line-height: 1.25;
|
||||
margin-bottom: 0.6mm;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.field-label {
|
||||
color: #000; /* was #555 — now pure black */
|
||||
color: #000;
|
||||
font-size: 6.5pt;
|
||||
font-weight: 700; /* was normal — now bold */
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.field-colon {
|
||||
color: #000; /* was #555 — now pure black */
|
||||
color: #000;
|
||||
font-size: 6.5pt;
|
||||
font-weight: 700; /* added bold */
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.field-value {
|
||||
font-weight: 700; /* was 600 — now fully bold */
|
||||
font-weight: 700;
|
||||
font-size: 6.5pt;
|
||||
color: #000; /* was #111 — now pure black */
|
||||
color: #000;
|
||||
/* Prevent wrapping — truncate with ellipsis if too long */
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* ── Photo (right) ── */
|
||||
/* ── Photo column (right) ── */
|
||||
.badge-photo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 1mm;
|
||||
width: 18mm;
|
||||
flex-shrink: 0;
|
||||
gap: 0.5mm;
|
||||
}
|
||||
|
||||
.badge-photo img {
|
||||
width: 16mm;
|
||||
height: 18mm;
|
||||
height: 16mm;
|
||||
object-fit: cover;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.badge-photo .no-photo {
|
||||
width: 16mm;
|
||||
height: 18mm;
|
||||
border: 1.5px dashed #000; /* was #aaa — darker border */
|
||||
height: 16mm;
|
||||
border: 1.5px dashed #000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 6pt; /* slightly larger */
|
||||
color: #000; /* was #aaa */
|
||||
font-size: 6pt;
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.host-sign {
|
||||
font-size: 6pt; /* was 5.5pt — slightly larger */
|
||||
color: #000; /* was #555 — now pure black */
|
||||
font-weight: 700; /* added bold */
|
||||
font-size: 6pt;
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
border-top: 1px solid #000; /* was 0.5px #aaa — darker line */
|
||||
border-top: 1px solid #000;
|
||||
padding-top: 0.5mm;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* ── QR code ── */
|
||||
.visitor-qr {
|
||||
margin-top: 1mm;
|
||||
width: 18mm;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.visitor-qr svg {
|
||||
width: 16mm !important;
|
||||
height: 16mm !important;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* ── Footer ── */
|
||||
.badge-footer {
|
||||
border-top: 1px solid #000; /* was 0.5px #ddd — darker line */
|
||||
padding: 1mm 2mm;
|
||||
border-top: 1px solid #000;
|
||||
padding: 0.8mm 2mm;
|
||||
text-align: right;
|
||||
font-size: 6pt; /* was 5.5pt — slightly larger */
|
||||
color: #000; /* was #888 — now pure black */
|
||||
font-weight: 700; /* added bold */
|
||||
font-size: 6pt;
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@media print {
|
||||
@@ -158,9 +174,9 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="window.print()">
|
||||
<body>
|
||||
|
||||
{{-- ── Print button (visible on screen only, hidden when printing) ── --}}
|
||||
{{-- ── Print / Close buttons (screen only) ── --}}
|
||||
<div class="no-print" style="padding: 8px; text-align:center; background:#f3f4f6;">
|
||||
<button onclick="window.print()" style="padding:6px 18px; background:#1a1a2e; color:#fff; border:none; border-radius:6px; cursor:pointer; font-size:13px;">
|
||||
🖨️ Print Badge
|
||||
@@ -175,7 +191,7 @@
|
||||
{{-- Header --}}
|
||||
<div class="badge-header">
|
||||
<span class="type">{{ strtoupper($visitor->type ?? 'VISITOR') }}</span>
|
||||
<span class="badge-id">#{{ str_pad($visitor->register_id, 5, '0', STR_PAD_LEFT) }}</span>
|
||||
<span class="badge-id">#{{ $visitor->register_id ?? str_pad($visitor->id, 5, '0', STR_PAD_LEFT) }}</span>
|
||||
</div>
|
||||
|
||||
{{-- Body --}}
|
||||
@@ -183,61 +199,62 @@
|
||||
|
||||
{{-- Left: fields --}}
|
||||
<div class="badge-fields">
|
||||
<div class="field-row">
|
||||
<span class="field-label">Name</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ strtoupper($visitor->name) }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">Company</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ $visitor->company }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">To Meet</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ strtoupper($visitor->employeeMaster?->name ?? '—') }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">Dept</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ strtoupper($visitor->employeeMaster?->department ?? $visitor->department ?? '—') }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">Valid Upto</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ $visitor->valid_upto ? \Carbon\Carbon::parse($visitor->valid_upto)->format('d/m/Y H:i:s') : '—' }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">Date & Time</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ $visitor->in_time ? \Carbon\Carbon::parse($visitor->in_time)->format('d/m/Y H:i:s') : '—' }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">No of Visitors</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ $visitor->number_of_person ?? 1 }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">Name</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ strtoupper($visitor->name) }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">Company</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ $visitor->company }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">To Meet</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ strtoupper($visitor->employeeMaster?->name ?? '—') }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">Dept</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ strtoupper($visitor->employeeMaster?->department ?? $visitor->department ?? '—') }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">Valid Upto</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ $visitor->valid_upto ? \Carbon\Carbon::parse($visitor->valid_upto)->format('d/m/Y H:i:s') : '—' }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">Date & Time</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ $visitor->in_time ? \Carbon\Carbon::parse($visitor->in_time)->format('d/m/Y H:i:s') : '—' }}</span>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<span class="field-label">No of Visitors</span>
|
||||
<span class="field-colon">:</span>
|
||||
<span class="field-value">{{ $visitor->number_of_person ?? 1 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Right: photo + host sign --}}
|
||||
{{-- Right: photo + host sign + QR --}}
|
||||
<div class="badge-photo">
|
||||
@if($photoUrl)
|
||||
<img src="{{ $photoUrl }}" alt="Visitor Photo" />
|
||||
@else
|
||||
<div class="no-photo">No Photo</div>
|
||||
@endif
|
||||
|
||||
<div class="host-sign">Host Sign</div>
|
||||
<div class="visitor-qr" style="margin-top:2mm;">
|
||||
{{-- {!! QrCode::size(25)
|
||||
->margin(0)
|
||||
->generate($visitor->register_id) !!} --}}
|
||||
@if(!empty($visitor->register_id))
|
||||
{!! QrCode::size(35)
|
||||
->margin(0)
|
||||
|
||||
{{-- QR Code — high res, with quiet zone and high error correction --}}
|
||||
@if(!empty($visitor->register_id))
|
||||
<div class="visitor-qr">
|
||||
{!! QrCode::size(300)
|
||||
->margin(2)
|
||||
->errorCorrection('H')
|
||||
->generate((string) $visitor->register_id) !!}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -247,5 +264,11 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.addEventListener('load', function () {
|
||||
setTimeout(function () { window.print(); }, 300);
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user