Compare commits
34 Commits
renovate/l
...
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'),
|
->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')
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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'] = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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;
|
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>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
<style>
|
<style>
|
||||||
@page {
|
@page {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
<style>
|
<style>
|
||||||
@page {
|
@page {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
<style>
|
<style>
|
||||||
@page {
|
@page {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user