34 Commits

Author SHA1 Message Date
58b2df8d94 Merge pull request 'Added body in import transit mail of mail' (#735) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #735
2026-06-09 08:58:20 +00:00
dhanabalan
4bade21e10 Added body in import transit mail of mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 5m52s
Laravel Larastan / larastan (pull_request) Failing after 15m48s
2026-06-09 14:28:06 +05:30
e9eb5539d3 Merge pull request 'Added logic for fetch against visitor names' (#734) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #734
2026-06-09 07:13:27 +00:00
dhanabalan
e103755a8b Added logic for fetch against visitor names
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Larastan / larastan (pull_request) Failing after 7m11s
Laravel Pint / pint (pull_request) Failing after 15m27s
2026-06-09 12:43:07 +05:30
aa403f00c0 Merge pull request 'ranjith-dev' (#733) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #733
2026-06-09 05:54:12 +00:00
dhanabalan
2ec549019e Added In and out logic in gate out entry page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Larastan / larastan (pull_request) Failing after 15m44s
Laravel Pint / pint (pull_request) Failing after 15m43s
2026-06-09 11:23:51 +05:30
dhanabalan
72274d6f47 solved issue in entering mobile number logic in visitor create page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-09 11:23:11 +05:30
dhanabalan
9d23f7f3e8 Added mode of travel in visitor resource page and only shows todays records
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-09 11:22:27 +05:30
dhanabalan
e0ab003852 Added column in model file of visitor entry page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-09 11:19:56 +05:30
dhanabalan
769a034167 Added mode of travel column in visitor entry page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
2026-06-09 11:18:50 +05:30
c5fe2379e7 Merge pull request 'Chnaged logic in create visitor entry page' (#732) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Reviewed-on: #732
2026-06-09 04:19:45 +00:00
dhanabalan
12490c0a23 Chnaged logic in create visitor entry page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 24s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 22s
Laravel Pint / pint (pull_request) Failing after 4m46s
Laravel Larastan / larastan (pull_request) Failing after 27m19s
2026-06-09 09:48:49 +05:30
03d620607d Merge pull request 'remove dfe columns and adjusted alignment in import transit mail' (#731) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #731
2026-06-08 13:19:11 +00:00
dhanabalan
461188788b remove dfe columns and adjusted alignment in import transit mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 7m14s
Laravel Larastan / larastan (pull_request) Failing after 8m53s
2026-06-08 18:48:56 +05:30
bfdaef7cec Merge pull request 'Added logic in part validation 1 for pipeline' (#730) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 23s
Reviewed-on: #730
2026-06-08 12:31:34 +00:00
dhanabalan
27fc3e2cbf Added logic in part validation 1 for pipeline
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 7m47s
Laravel Larastan / larastan (pull_request) Failing after 8m49s
2026-06-08 18:01:17 +05:30
bd15298ee8 Merge pull request 'Added logic to show plant names in visitor entry page' (#729) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #729
2026-06-08 11:15:20 +00:00
dhanabalan
24865267a2 Added logic to show plant names in visitor entry page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Larastan / larastan (pull_request) Failing after 4m16s
Laravel Pint / pint (pull_request) Failing after 4m23s
2026-06-08 16:45:03 +05:30
14ec323086 Merge pull request 'added three columns in import transit exporter' (#728) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 25s
Reviewed-on: #728
2026-06-08 08:49:26 +00:00
dhanabalan
be0a0cc78e added three columns in import transit exporter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 8m9s
Laravel Larastan / larastan (pull_request) Failing after 8m56s
2026-06-08 14:19:09 +05:30
ab2211cf85 Merge pull request 'changed logic in visitor badge blade file' (#727) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #727
2026-06-08 06:34:04 +00:00
dhanabalan
9ce11ed5ff changed logic in visitor badge blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 28s
Laravel Pint / pint (pull_request) Successful in 8m28s
Laravel Larastan / larastan (pull_request) Failing after 8m57s
2026-06-08 12:03:49 +05:30
20de7e9b71 Merge pull request 'Added logic for gate out entry for out time' (#726) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #726
2026-06-08 05:27:49 +00:00
dhanabalan
f7bfc1373d Added logic for gate out entry for out time
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 34s
Laravel Pint / pint (pull_request) Successful in 13m14s
Laravel Larastan / larastan (pull_request) Failing after 15m42s
2026-06-08 10:56:35 +05:30
d935e5044d Merge pull request 'Added company and in table list in visitor resource page' (#725) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #725
2026-06-08 05:14:42 +00:00
dhanabalan
f00cc4c386 Added company and in table list in visitor resource page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Failing after 4m38s
Laravel Larastan / larastan (pull_request) Failing after 8m1s
2026-06-08 10:44:25 +05:30
deaeaa4754 Merge pull request 'Added charset in print panel in production order' (#724) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 41s
Reviewed-on: #724
2026-06-08 03:57:57 +00:00
dhanabalan
e59acd6458 Added charset in print panel in production order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 31s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 23s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Larastan / larastan (pull_request) Failing after 8m5s
Laravel Pint / pint (pull_request) Successful in 4m48s
2026-06-08 09:27:39 +05:30
97aed0a4b1 Merge pull request 'added logic in print item of production order' (#723) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #723
2026-06-08 03:53:59 +00:00
dhanabalan
84634302b1 added logic in print item of production order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 34s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 27s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Larastan / larastan (pull_request) Failing after 7m18s
Laravel Pint / pint (pull_request) Successful in 8m12s
2026-06-08 09:23:37 +05:30
acab42ee6b Merge pull request 'issue solved of showing 1/2 inch number in item description of producion order' (#722) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 50s
Reviewed-on: #722
2026-06-08 03:50:36 +00:00
dhanabalan
46e5a46121 issue solved of showing 1/2 inch number in item description of producion order
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 38s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 39s
Laravel Pint / pint (pull_request) Failing after 13s
Laravel Larastan / larastan (pull_request) Failing after 10m56s
2026-06-08 09:20:20 +05:30
16f1937e9c Merge pull request 'changed updated logic for import transit' (#721) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #721
2026-06-07 09:07:50 +00:00
dhanabalan
59e6bd7b10 changed updated logic for import transit
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Failing after 9m50s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 4m2s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 13m47s
Laravel Larastan / larastan (pull_request) Failing after 6m35s
Laravel Pint / pint (pull_request) Failing after 6m34s
2026-06-07 14:37:35 +05:30
15 changed files with 414 additions and 135 deletions

View File

@@ -36,12 +36,18 @@ class ImportTransitExporter extends Exporter
->label('SHIPPER INVOICE'), ->label('SHIPPER INVOICE'),
ExportColumn::make('shipper_invoice_date') ExportColumn::make('shipper_invoice_date')
->label('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') ExportColumn::make('customs_agent_name')
->label('CUSTOMS AGENT NAME'), ->label('CUSTOMS AGENT NAME'),
ExportColumn::make('eta_date') ExportColumn::make('eta_date')
->label('ETA DATE'), ->label('ETA DATE'),
ExportColumn::make('status') ExportColumn::make('status')
->label('STATUS'), ->label('STATUS'),
ExportColumn::make('insurance_status')
->label('Insurance Status'),
ExportColumn::make('delivery_location') ExportColumn::make('delivery_location')
->label('DELIVERY LOCATION'), ->label('DELIVERY LOCATION'),
ExportColumn::make('etd_date') ExportColumn::make('etd_date')

View File

@@ -75,7 +75,7 @@ class ImportTransitImporter extends Importer
->label('Status'), ->label('Status'),
ImportColumn::make('insurance_status') ImportColumn::make('insurance_status')
->exampleHeader('Insurance Status') ->exampleHeader('Insurance Status')
->example('Receipted') ->example('Yes')
->label('Insurance Status'), ->label('Insurance Status'),
ImportColumn::make('delivery_location') ImportColumn::make('delivery_location')
->exampleHeader('Delivery Location') ->exampleHeader('Delivery Location')
@@ -176,6 +176,7 @@ class ImportTransitImporter extends Importer
return ImportTransit::updateOrCreate([ return ImportTransit::updateOrCreate([
'cri_rfq_number' => $criRfqNumber, 'cri_rfq_number' => $criRfqNumber,
'shipper_invoice' => $shipperInvoice,
], ],
[ [
'mail_received_date' => $this->formatDate($mailRecDate), 'mail_received_date' => $this->formatDate($mailRecDate),
@@ -187,7 +188,6 @@ class ImportTransitImporter extends Importer
'requester' => $requester, 'requester' => $requester,
'shipper' => $shipper, 'shipper' => $shipper,
'shipper_location' => $shipperLocation, 'shipper_location' => $shipperLocation,
'shipper_invoice' => $shipperInvoice,
'inv_value' => $invValue, 'inv_value' => $invValue,
'freight_charge' => $freightCharge, 'freight_charge' => $freightCharge,
'custom_agent_name' => $customsAgentname, 'custom_agent_name' => $customsAgentname,

View File

@@ -4,6 +4,7 @@ namespace App\Filament\Pages;
use App\Models\Plant; use App\Models\Plant;
use App\Models\VisitorEntry; use App\Models\VisitorEntry;
use Carbon\Carbon;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Pages\Page; use Filament\Pages\Page;
use Filament\Forms\Contracts\HasForms; use Filament\Forms\Contracts\HasForms;
@@ -37,38 +38,172 @@ class GateOutEntry extends Page implements HasForms
->schema([ ->schema([
Section::make('') // You can give your section a title or leave it blank Section::make('') // You can give your section a title or leave it blank
->schema([ ->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') ->label('Scan Out Gate Pass')
->required() ->required()
->reactive() ->reactive()
->visible(fn ($get) => $get('scan_out_gate_pass') == 'Out')
->extraAttributes([ ->extraAttributes([
'wire:keydown.enter' => 'processGatePass($event.target.value)', 'wire:keydown.enter' => 'processGatePassOut($event.target.value)',
]), ]),
]) ])
->columns(5) ->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) { if ($entry)
$entry->out_time = now(); {
$entry->save(); 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() $this->filters['scan_out_gate_pass_in'] = '';
->title('Gate Pass Processed') return;
->body('Gate pass has been successfully processed. Visitor marked as exited.') }
->success() else{
->send(); $newEntry = $entry->replicate();
$this->filters['scan_out_gate_pass'] = ''; $newEntry->in_time = now();
} else { $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() Notification::make()
->title('Invalid Gate Pass') ->title('Invalid Gate Pass')
->body('The scanned gate pass is not valid. Please try again.') ->body('Scanned gate in pass is not valid.')
->danger() ->danger()
->send(); ->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'] = '';
}
} }
} }

View File

@@ -3507,6 +3507,17 @@ class QualityValidationResource extends Resource
return; 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) { if ($state == $expectedValue) {
$set('part_validation1_error', null); $set('part_validation1_error', null);
} else { } else {

View File

@@ -187,6 +187,15 @@ class VisitorEntryResource extends Resource
->numeric() ->numeric()
->default(1) ->default(1)
->required(), ->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') Forms\Components\DateTimePicker::make('in_time')
->label('In Time') ->label('In Time')
->required() ->required()
@@ -214,6 +223,7 @@ class VisitorEntryResource extends Resource
public static function table(Table $table): Table public static function table(Table $table): Table
{ {
return $table return $table
// ->modifyQueryUsing(fn (Builder $query) => $query->whereDate('created_at', today()))
->columns([ ->columns([
Tables\Columns\TextColumn::make('No.') Tables\Columns\TextColumn::make('No.')
->label('NO') ->label('NO')
@@ -244,15 +254,25 @@ class VisitorEntryResource extends Resource
->alignCenter() ->alignCenter()
->searchable() ->searchable()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('mobile_number')
->label('Visitor Mobile Number')
->alignCenter()
->searchable()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('name') Tables\Columns\TextColumn::make('name')
->label('Visitor Name') ->label('Visitor Name')
->sortable() ->sortable()
->alignCenter() ->alignCenter()
->searchable(), ->searchable(),
Tables\Columns\TextColumn::make('mobile_number') Tables\Columns\TextColumn::make('company')
->label('Visitor Mobile Number') ->label('Visitor Company')
->sortable()
->alignCenter()
->searchable(),
Tables\Columns\TextColumn::make('employeeMaster.plant.name')
->label('Visited Plant')
->alignCenter() ->alignCenter()
->searchable()
->searchable() ->searchable()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('employeeMaster.name') Tables\Columns\TextColumn::make('employeeMaster.name')
@@ -275,6 +295,16 @@ class VisitorEntryResource extends Resource
->searchable() ->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->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') Tables\Columns\TextColumn::make('in_time')
->label('In Time') ->label('In Time')
->searchable() ->searchable()
@@ -405,9 +435,23 @@ class VisitorEntryResource extends Resource
]) ])
->query(function ($query, array $data) { ->query(function ($query, array $data) {
// Hide all records initially if no filters are applied // 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'])) { // 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) { // $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'])) { 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'])) { if (! empty($data['name'])) {
$query->where('name', 'like', '%'.$data['name'].'%'); $query->whereRaw(
'LOWER(name) LIKE ?',
['%' . strtolower($data['name']) . '%']
);
} }
if (! empty($data['company'])) { if (! empty($data['company'])) {
@@ -621,4 +672,5 @@ class VisitorEntryResource extends Resource
SoftDeletingScope::class, SoftDeletingScope::class,
]); ]);
} }
} }

View File

@@ -21,36 +21,42 @@ class CreateVisitorEntry extends CreateRecord
public function processMobile($mobile) 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) { if ($visitor) {
$employee = EmployeeMaster::where('id', $visitor->employee_master_id)->first(); $employee = EmployeeMaster::where('id', $visitor->employee_master_id)->first();
$this->form->fill([ $this->form->fill([
'register_id' => $visitor->register_id ?? '', 'register_id' => $registerId ?? '',
'mobile_number' => $mobile ?? '', 'mobile_number' => $visitor->mobile_number,
'name' => $visitor->name ?? '', 'name' => $visitor->name ?? '',
'company' => $visitor->company ?? '', 'company' => $visitor->company ?? '',
'type' => $visitor->type ?? '', 'type' => $visitor->type ?? '',
'department' => $employee->department ?? '', 'department' => $employee?->department ?? '',
'employee_master_id' => $visitor->employee_master_id->name ?? '', 'employee_master_id' => $visitor->employee_master_id,
'code' => $employee->code ?? '', 'code' => $employee?->code ?? '',
'purpose_of_visit' => '',
'in_time' => now(),
'out_time' => null,
'valid_upto' => null,
]); ]);
} }
else { else {
$registerId = $this->form->getState()['register_id'] ?? '';
$this->form->fill([ $this->form->fill([
'register_id' => $registerId ?? '', 'register_id' => $registerId ?? '',
'mobile_number' => $mobile ?? '', 'mobile_number' => $mobile,
'name' => $visitor->name ?? '', 'name' => '',
'company' => $visitor->company ?? '', 'company' => '',
'type' => $visitor->type ?? '', 'type' => '',
'department' => $employee->department ?? '', 'department' => '',
'employee_master_id' => $visitor->employee_master_id->name ?? '', 'employee_master_id' => null,
'code' => $employee->code ?? '', 'code' => '',
'purpose_of_visit' => '',
'in_time' => now(),
'out_time' => null,
'valid_upto' => null,
]); ]);
} }
} }

View File

@@ -45,7 +45,9 @@ class ImportTransitMail extends Mailable
*/ */
public function content(): Content 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'; //$greeting1 = 'Dear C.R.I Branch Team, <br><br> Please follow and ensure the same';

View File

@@ -23,6 +23,7 @@ class VisitorEntry extends Model
'employee_master_id', 'employee_master_id',
'number_of_person', 'number_of_person',
'valid_upto', 'valid_upto',
'mode_of_travel',
]; ];
public function employeeMaster(): BelongsTo public function employeeMaster(): BelongsTo

View File

@@ -20,7 +20,7 @@
"laravel/tinker": "^2.9", "laravel/tinker": "^2.9",
"league/flysystem-ftp": "^3.31", "league/flysystem-ftp": "^3.31",
"league/flysystem-sftp-v3": "^3.30", "league/flysystem-sftp-v3": "^3.30",
"livewire/livewire": "^4.0", "livewire/livewire": "^3.6",
"maatwebsite/excel": "^3.1", "maatwebsite/excel": "^3.1",
"mike42/escpos-php": "^4.0", "mike42/escpos-php": "^4.0",
"mpdf/mpdf": "^8.2", "mpdf/mpdf": "^8.2",

View File

@@ -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) {
// //
// });
}
};

View File

@@ -41,6 +41,13 @@
background-color: #f3f4f6; background-color: #f3f4f6;
} }
.status-column {
text-align: left !important;
white-space: normal !important;
min-width: 250px;
width: 250px;
vertical-align: top;
}
.footer { .footer {
text-align: center; text-align: center;
font-size: 13px; font-size: 13px;
@@ -64,7 +71,6 @@
<tr> <tr>
<th>No</th> <th>No</th>
<th>CRI RFQ Number</th> <th>CRI RFQ Number</th>
<th>Ref Number</th>
<th>Requestor</th> <th>Requestor</th>
<th>Shipper</th> <th>Shipper</th>
<th>Shipper Location</th> <th>Shipper Location</th>
@@ -85,7 +91,7 @@
<td>{{ $row['cri_rfq_number'] }}</td> <td>{{ $row['cri_rfq_number'] }}</td>
{{-- <td>{{ $row['mail_received_date'] }}</td> --}} {{-- <td>{{ $row['mail_received_date'] }}</td> --}}
{{-- <td>{{ \Carbon\Carbon::parse($row['mail_received_date'])->format('Y-m-d') }}</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['requester'] }}</td>
<td>{{ $row['shipper'] }}</td> <td>{{ $row['shipper'] }}</td>
<td>{{ $row['shipper_location'] }}</td> <td>{{ $row['shipper_location'] }}</td>
@@ -95,7 +101,10 @@
<td>{{ $row['customs_agent_name'] }}</td> <td>{{ $row['customs_agent_name'] }}</td>
{{-- <td>{{ $row['eta_date'] }}</td> --}} {{-- <td>{{ $row['eta_date'] }}</td> --}}
<td>{{ \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') }}</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['delivery_location'] }}</td>
{{-- <td>{{ $row['etd_date'] }}</td> --}} {{-- <td>{{ $row['etd_date'] }}</td> --}}
<td>{{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }}</td> <td>{{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }}</td>

View File

@@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8">
<style> <style>
@page { @page {
margin: 0; margin: 0;

View File

@@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8">
<style> <style>
@page { @page {
margin: 0; margin: 0;

View File

@@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8">
<style> <style>
@page { @page {
margin: 0; margin: 0;

View File

@@ -41,32 +41,26 @@
.badge-header { .badge-header {
background: #1a1a2e; background: #1a1a2e;
color: #fff; color: #fff;
text-align: center; padding: 1.5mm 2mm;
padding: 2mm 2mm 1.5mm;
font-size: 8pt; font-size: 8pt;
font-weight: bold; font-weight: bold;
letter-spacing: 1px; letter-spacing: 1px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-shrink: 0;
} }
.badge-header .type { .badge-header .type { font-size: 9pt; letter-spacing: 2px; }
font-size: 9pt; .badge-header .badge-id { font-size: 7pt; opacity: 0.85; }
letter-spacing: 2px;
}
.badge-header .badge-id {
font-size: 7pt;
opacity: 0.85;
}
/* ── Body ── */ /* ── Body ── */
.badge-body { .badge-body {
display: flex; display: flex;
flex: 1; flex: 1;
padding: 2mm; padding: 1.5mm 2mm;
gap: 2mm; gap: 2mm;
overflow: hidden;
} }
/* ── Fields (left) ── */ /* ── Fields (left) ── */
@@ -74,82 +68,104 @@
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.2mm; overflow: hidden;
} }
.field-row { .field-row {
display: grid; display: grid;
grid-template-columns: 16mm 3mm 1fr; grid-template-columns: 16mm 3mm 1fr;
line-height: 1.3; line-height: 1.25;
margin-bottom: 0.7mm; margin-bottom: 0.6mm;
align-items: start;
} }
.field-label { .field-label {
color: #000; /* was #555 — now pure black */ color: #000;
font-size: 6.5pt; font-size: 6.5pt;
font-weight: 700; /* was normal — now bold */ font-weight: 700;
white-space: nowrap;
} }
.field-colon { .field-colon {
color: #000; /* was #555 — now pure black */ color: #000;
font-size: 6.5pt; font-size: 6.5pt;
font-weight: 700; /* added bold */ font-weight: 700;
text-align: center; text-align: center;
} }
.field-value { .field-value {
font-weight: 700; /* was 600 — now fully bold */ font-weight: 700;
font-size: 6.5pt; 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 { .badge-photo {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 1mm;
width: 18mm; width: 18mm;
flex-shrink: 0;
gap: 0.5mm;
} }
.badge-photo img { .badge-photo img {
width: 16mm; width: 16mm;
height: 18mm; height: 16mm;
object-fit: cover; object-fit: cover;
border: 1px solid #ccc; border: 1px solid #000;
} }
.badge-photo .no-photo { .badge-photo .no-photo {
width: 16mm; width: 16mm;
height: 18mm; height: 16mm;
border: 1.5px dashed #000; /* was #aaa — darker border */ border: 1.5px dashed #000;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 6pt; /* slightly larger */ font-size: 6pt;
color: #000; /* was #aaa */ color: #000;
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
} }
.host-sign { .host-sign {
font-size: 6pt; /* was 5.5pt — slightly larger */ font-size: 6pt;
color: #000; /* was #555 — now pure black */ color: #000;
font-weight: 700; /* added bold */ font-weight: 700;
text-align: center; text-align: center;
border-top: 1px solid #000; /* was 0.5px #aaa — darker line */ border-top: 1px solid #000;
padding-top: 0.5mm; padding-top: 0.5mm;
width: 100%; 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 ── */ /* ── Footer ── */
.badge-footer { .badge-footer {
border-top: 1px solid #000; /* was 0.5px #ddd — darker line */ border-top: 1px solid #000;
padding: 1mm 2mm; padding: 0.8mm 2mm;
text-align: right; text-align: right;
font-size: 6pt; /* was 5.5pt — slightly larger */ font-size: 6pt;
color: #000; /* was #888 — now pure black */ color: #000;
font-weight: 700; /* added bold */ font-weight: 700;
flex-shrink: 0;
} }
@media print { @media print {
@@ -158,9 +174,9 @@
} }
</style> </style>
</head> </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;"> <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;"> <button onclick="window.print()" style="padding:6px 18px; background:#1a1a2e; color:#fff; border:none; border-radius:6px; cursor:pointer; font-size:13px;">
🖨️ Print Badge 🖨️ Print Badge
@@ -175,7 +191,7 @@
{{-- Header --}} {{-- Header --}}
<div class="badge-header"> <div class="badge-header">
<span class="type">{{ strtoupper($visitor->type ?? 'VISITOR') }}</span> <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> </div>
{{-- Body --}} {{-- Body --}}
@@ -183,61 +199,62 @@
{{-- Left: fields --}} {{-- Left: fields --}}
<div class="badge-fields"> <div class="badge-fields">
<div class="field-row"> <div class="field-row">
<span class="field-label">Name</span> <span class="field-label">Name</span>
<span class="field-colon">:</span> <span class="field-colon">:</span>
<span class="field-value">{{ strtoupper($visitor->name) }}</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> </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"> <div class="badge-photo">
@if($photoUrl) @if($photoUrl)
<img src="{{ $photoUrl }}" alt="Visitor Photo" /> <img src="{{ $photoUrl }}" alt="Visitor Photo" />
@else @else
<div class="no-photo">No Photo</div> <div class="no-photo">No Photo</div>
@endif @endif
<div class="host-sign">Host Sign</div> <div class="host-sign">Host Sign</div>
<div class="visitor-qr" style="margin-top:2mm;">
{{-- {!! QrCode::size(25) {{-- QR Code high res, with quiet zone and high error correction --}}
->margin(0) @if(!empty($visitor->register_id))
->generate($visitor->register_id) !!} --}} <div class="visitor-qr">
@if(!empty($visitor->register_id)) {!! QrCode::size(300)
{!! QrCode::size(35) ->margin(2)
->margin(0) ->errorCorrection('H')
->generate((string) $visitor->register_id) !!} ->generate((string) $visitor->register_id) !!}
@endif </div>
</div> @endif
</div> </div>
</div> </div>
@@ -247,5 +264,11 @@
</div> </div>
<script>
window.addEventListener('load', function () {
setTimeout(function () { window.print(); }, 300);
});
</script>
</body> </body>
</html> </html>