1 Commits

Author SHA1 Message Date
090bcff02a Update dependency concurrently to v10
Some checks failed
renovate/artifacts Artifact file update failure
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 33s
Laravel Pint / pint (pull_request) Successful in 4m32s
Laravel Larastan / larastan (pull_request) Failing after 20m45s
2026-06-07 00:01:29 +00:00
22 changed files with 213 additions and 655 deletions

View File

@@ -337,7 +337,7 @@ class Scheduler extends Command
} }
break; break;
case 'Daily': case 'Daily':
if (now()->format('H:i') == '11:30') { if (now()->format('H:i') == '11:10') {
try { try {
\Artisan::call('send-import-transit', [ \Artisan::call('send-import-transit', [
'schedule_type' => $rule->schedule_type, 'schedule_type' => $rule->schedule_type,

View File

@@ -7,8 +7,6 @@ use App\Models\AlertMailRule;
use App\Models\ImportTransit; use App\Models\ImportTransit;
use App\Models\Plant; use App\Models\Plant;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Maatwebsite\Excel\Facades\Excel;
use App\Exports\ImportTransitReportExport;
class SendImportTransit extends Command class SendImportTransit extends Command
{ {
@@ -60,45 +58,37 @@ class SendImportTransit extends Command
// return; // return;
// } // }
// $tableData = ImportTransit::select([ $tableData = ImportTransit::select([
// 'cri_rfq_number', 'cri_rfq_number',
// 'mail_received_date', 'mail_received_date',
// 'pricol_ref_number', 'pricol_ref_number',
// 'requester', 'requester',
// 'shipper', 'shipper',
// 'shipper_location', 'shipper_location',
// 'shipper_invoice', 'shipper_invoice',
// 'shipper_invoice_date', 'shipper_invoice_date',
// 'customs_agent_name', 'customs_agent_name',
// 'eta_date', 'eta_date',
// 'status', 'status',
// 'delivery_location', 'delivery_location',
// 'etd_date', 'etd_date',
// 'mode', 'mode',
// 'inco_terms', 'inco_terms',
// 'port_of_loading', 'port_of_loading',
// 'port_of_discharge', 'port_of_discharge',
// 'delivery_city', 'delivery_city',
// 'packages', 'packages',
// 'type_of_package', 'type_of_package',
// 'gross_weight', 'gross_weight',
// 'volume', 'volume',
// 'bill_number', 'bill_number',
// 'bill_received_date', 'bill_received_date',
// 'vessel_number', 'vessel_number',
// 'remark', 'remark',
// 'is_transit_identified', 'is_transit_identified',
// ]) ])
// ->where('status', '!=', 'Delivered') ->where('status', '!=', 'Delivered')
// ->get(); ->get();
$tableData = ImportTransit::where('status', '!=', 'Delivered')->orderByRaw("
CAST(
regexp_replace(cri_rfq_number, '.*-([0-9]+).*', '\\1')
AS INTEGER
)
")->get();
if ($tableData->isEmpty()) { if ($tableData->isEmpty()) {
$this->info('No pending Import Transit records found. Mail skipped.'); $this->info('No pending Import Transit records found. Mail skipped.');
@@ -111,19 +101,10 @@ class SendImportTransit extends Command
$mailSubject = 'Daily Import Transit Report'; $mailSubject = 'Daily Import Transit Report';
$fileName = 'reports/pending_import_shipment_' . now()->format('Ymd_His') . '.xlsx';
Excel::store(
new ImportTransitReportExport($tableData),
$fileName,
'local'
);
$mail = new ImportTransitMail( $mail = new ImportTransitMail(
$scheduleType, $scheduleType,
$tableData, $tableData,
$mailSubject, $mailSubject
$fileName
); );
$toEmails = collect(explode(',', $rule->email)) $toEmails = collect(explode(',', $rule->email))

View File

@@ -1,97 +0,0 @@
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithEvents;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use Illuminate\Support\Facades\Log;
use Maatwebsite\Excel\Events\AfterSheet;
class ImportTransitReportExport implements FromCollection, WithHeadings, WithMapping, WithEvents
{
protected $data;
public function __construct($data)
{
$this->data = $data;
}
public function headings(): array
{
return [
'No',
'CRI RFQ Number',
'Requestor',
'Shipper',
'Shipper Location',
'Shipper Invoice',
'Shipper Invoice Date',
'Custom Agent Name',
'ETA',
'Status',
'Delivery Location',
'ETD Date',
'Remark',
];
}
public function collection()
{
return collect($this->data);
}
public function map($row): array
{
static $srNo = 0;
$srNo++;
return [
$srNo,
$row->cri_rfq_number,
$row->requester,
$row->shipper,
$row->shipper_location,
$row->shipper_invoice,
$row->shipper_invoice_date,
$row->customs_agent_name,
$row->eta_date,
$row->status,
$row->delivery_location,
$row->etd_date,
$row->remark,
];
}
public function registerEvents(): array
{
return [
AfterSheet::class => function (AfterSheet $event) {
$rowNumber = 2; // Excel row starts after header
foreach ($this->data as $row) {
if ((int) $row->is_transit_identified == 1) {
$event->sheet
->getStyle("A{$rowNumber}:M{$rowNumber}")
->applyFromArray([
'fill' => [
'fillType' => Fill::FILL_SOLID,
'startColor' => [
'rgb' => 'FFFF00',
],
],
]);
}
$rowNumber++;
}
},
];
}
}

View File

@@ -36,18 +36,12 @@ 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('Yes') ->example('Receipted')
->label('Insurance Status'), ->label('Insurance Status'),
ImportColumn::make('delivery_location') ImportColumn::make('delivery_location')
->exampleHeader('Delivery Location') ->exampleHeader('Delivery Location')
@@ -176,7 +176,6 @@ 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),
@@ -188,6 +187,7 @@ 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,7 +4,6 @@ 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;
@@ -38,172 +37,38 @@ 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([
Select::make('scan_out_gate_pass') TextInput::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' => 'processGatePassOut($event.target.value)', 'wire:keydown.enter' => 'processGatePass($event.target.value)',
]), ]),
]) ])
->columns(5) ->columns(5)
]); ]);
} }
public function processGatePassIn($gatePass) public function processGatePass($gatePass)
{ {
$entry = VisitorEntry::where('register_id', $gatePass)->latest()->first(); $entry = VisitorEntry::where('register_id', $gatePass)->first();
if ($entry) if ($entry) {
{ $entry->out_time = now();
if($entry->in_time && !$entry->out_time && (empty($entry->valid_upto) || $entry->valid_upto == '' || $entry->valid_upto == null)){ $entry->save();
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();
$this->filters['scan_out_gate_pass_in'] = ''; Notification::make()
return; ->title('Gate Pass Processed')
} ->body('Gate pass has been successfully processed. Visitor marked as exited.')
else{ ->success()
$newEntry = $entry->replicate(); ->send();
$newEntry->in_time = now(); $this->filters['scan_out_gate_pass'] = '';
$newEntry->out_time = null; } else {
$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('Scanned gate in pass is not valid.') ->body('The scanned gate pass is not valid. Please try again.')
->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

@@ -285,27 +285,27 @@ class AsrsItemValidationResource extends Resource
$status = $data['status'] ?? 'NotUpdated'; $status = $data['status'] ?? 'NotUpdated';
// Hide all records initially if no filters are applied // Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['item_code']) && empty($data['uom']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) { // if (empty($data['Plant']) && empty($data['item_code']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
return $query->whereRaw('1 = 0'); // // return $query->whereRaw('1 = 0');
// $query->where('status', 'NotUpdated'); // $query->where('status', 'NotUpdated');
}
// if (
// empty($data['Plant']) &&
// empty($data['item_code']) &&
// empty($data['uom']) &&
// empty($data['status']) &&
// empty($data['created_from']) &&
// empty($data['created_to'])
// ) {
// // $query->where('status', 'NotUpdated');
// $query->where(function ($q) {
// $q->where('status', 'NotUpdated')
// ->orWhereNull('status')
// ->orWhere('status', '');
// });
// } // }
if (
empty($data['Plant']) &&
empty($data['item_code']) &&
empty($data['uom']) &&
empty($data['status']) &&
empty($data['created_from']) &&
empty($data['created_to'])
) {
// $query->where('status', 'NotUpdated');
$query->where(function ($q) {
$q->where('status', 'NotUpdated')
->orWhereNull('status')
->orWhere('status', '');
});
}
if (! empty($data['Plant'])) { if (! empty($data['Plant'])) {
$query->where('plant_id', $data['Plant']); $query->where('plant_id', $data['Plant']);
} }
@@ -387,12 +387,11 @@ class AsrsItemValidationResource extends Resource
Tables\Actions\ViewAction::make(), Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(), Tables\Actions\EditAction::make(),
// ->hidden(function ($record): bool { // ->hidden(function ($record): bool {
// if (auth()->user()?->hasRole('Super Admin')) { // if (auth()->user()?->hasRole('SuperAdmin')) {
// return false; // return false;
// } // }
// else{
// return trim(($record->status)) == 'Updated'; // return trim(strtolower($record->status)) == 'updated';
// }
// }), // }),
// ->visible(function ($record): bool { // ->visible(function ($record): bool {
// return auth()->user()?->hasRole('SuperAdmin') // return auth()->user()?->hasRole('SuperAdmin')

View File

@@ -40,16 +40,16 @@ class ImportTransitResource extends Resource
->schema([ ->schema([
Forms\Components\TextInput::make('cri_rfq_number') Forms\Components\TextInput::make('cri_rfq_number')
->label('CRI/RFQ Number') ->label('CRI/RFQ Number')
->required() ->disabled(fn ($operation) => $operation == 'edit')
->disabled(fn ($operation) => $operation == 'edit'), ->unique(ignoreRecord: true),
Forms\Components\DatePicker::make('mail_received_date') Forms\Components\DatePicker::make('mail_received_date')
->label('Mail Received Date') ->label('Mail Received Date')
->required(), ->required(),
// Forms\Components\TextInput::make('pricol_ref_number') Forms\Components\TextInput::make('pricol_ref_number')
// ->label('Ref Number') ->label('Pricol Ref Number')
// ->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
// $set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
// }), }),
Forms\Components\TextInput::make('requester') Forms\Components\TextInput::make('requester')
->label('Requester') ->label('Requester')
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
@@ -75,7 +75,7 @@ class ImportTransitResource extends Resource
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}), }),
Forms\Components\TextInput::make('inv_value') Forms\Components\DatePicker::make('inv_value')
->label('Inv Value') ->label('Inv Value')
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
@@ -220,158 +220,128 @@ class ImportTransitResource extends Resource
}), }),
Tables\Columns\TextColumn::make('cri_rfq_number') Tables\Columns\TextColumn::make('cri_rfq_number')
->label('CRI/RFQ Number') ->label('CRI/RFQ Number')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('mail_received_date') Tables\Columns\TextColumn::make('mail_received_date')
->label('Mail Received Date') ->label('Mail Received Date')
->searchable()
->date() ->date()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('pricol_ref_number') Tables\Columns\TextColumn::make('pricol_ref_number')
->label('Ref Number') ->label('Pricol Ref Number')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('requester') Tables\Columns\TextColumn::make('requester')
->label('Requester') ->label('Requester')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('shipper') Tables\Columns\TextColumn::make('shipper')
->label('Shipper') ->label('Shipper')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('shipper_location') Tables\Columns\TextColumn::make('shipper_location')
->label('Shipper Location') ->label('Shipper Location')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('shipper_invoice') Tables\Columns\TextColumn::make('shipper_invoice')
->label('Shipper Invoice') ->label('Shipper Invoice')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('shipper_invoice_date') Tables\Columns\TextColumn::make('shipper_invoice_date')
->label('Shipper Invoice Date') ->label('Shipper Invoice Date')
->searchable()
->date() ->date()
->formatStateUsing(fn ($state) => $state?->format('Y-m-d')) ->formatStateUsing(fn ($state) => $state?->format('Y-m-d'))
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('inv_value') Tables\Columns\TextColumn::make('inv_value')
->label('Inv Value') ->label('Inv Value')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('freight_charge') Tables\Columns\TextColumn::make('freight_charge')
->label('Freight Charge') ->label('Freight Charge')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('customs_agent_name') Tables\Columns\TextColumn::make('customs_agent_name')
->label('Customs Agent Name') ->label('Customs Agent Name')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('eta_date') Tables\Columns\TextColumn::make('eta_date')
->label('ETA Date') ->label('ETA Date')
->searchable()
->date() ->date()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('status') Tables\Columns\TextColumn::make('status')
->label('Status') ->label('Status')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('insurance_status') Tables\Columns\TextColumn::make('insurance_status')
->label('Insurance Status') ->label('Insurance Status')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('delivery_location') Tables\Columns\TextColumn::make('delivery_location')
->label('Delivery Location') ->label('Delivery Location')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('etd_date') Tables\Columns\TextColumn::make('etd_date')
->label('ETD Date') ->label('ETD Date')
->searchable()
->date() ->date()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('mode') Tables\Columns\TextColumn::make('mode')
->label('Mode') ->label('Mode')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('inco_terms') Tables\Columns\TextColumn::make('inco_terms')
->label('Inco Terms') ->label('Inco Terms')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('port_of_loading') Tables\Columns\TextColumn::make('port_of_loading')
->label('Port of Loading') ->label('Port of Loading')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('port_of_discharge') Tables\Columns\TextColumn::make('port_of_discharge')
->label('Port of Discharge') ->label('Port of Discharge')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('delivery_city') Tables\Columns\TextColumn::make('delivery_city')
->label('Delivery City') ->label('Delivery City')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('packages') Tables\Columns\TextColumn::make('packages')
->label('Packages') ->label('Packages')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('type_of_package') Tables\Columns\TextColumn::make('type_of_package')
->label('Type of Package') ->label('Type of Package')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('gross_weight') Tables\Columns\TextColumn::make('gross_weight')
->label('Gross Weight') ->label('Gross Weight')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('volume') Tables\Columns\TextColumn::make('volume')
->label('Volume') ->label('Volume')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('bill_number') Tables\Columns\TextColumn::make('bill_number')
->label('Bill Number') ->label('Bill Number')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('bill_received_date') Tables\Columns\TextColumn::make('bill_received_date')
->label('Bill Received Date') ->label('Bill Received Date')
->searchable()
->alignCenter() ->alignCenter()
->date() ->date()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('vessel_number') Tables\Columns\TextColumn::make('vessel_number')
->label('Vessel Number') ->label('Vessel Number')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('remark') Tables\Columns\TextColumn::make('remark')
->label('Remark') ->label('Remark')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('is_transit_identified') Tables\Columns\TextColumn::make('is_transit_identified')
->label('Is Transit Identified') ->label('Is Transit Identified')
->searchable()
->alignCenter() ->alignCenter()
->sortable(), ->sortable(),
Tables\Columns\TextColumn::make('created_at') Tables\Columns\TextColumn::make('created_at')

View File

@@ -3507,17 +3507,6 @@ 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,15 +187,6 @@ 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()
@@ -223,7 +214,6 @@ 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')
@@ -254,26 +244,16 @@ 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('company') Tables\Columns\TextColumn::make('mobile_number')
->label('Visitor Company') ->label('Visitor Mobile Number')
->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')
->label('Recipient Name') ->label('Recipient Name')
@@ -295,16 +275,6 @@ 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()
@@ -435,23 +405,9 @@ 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'])) {
@@ -467,15 +423,8 @@ class VisitorEntryResource extends Resource
} }
} }
// if (! empty($data['name'])) {
// $query->where('name', 'like', '%'.$data['name'].'%');
// }
if (! empty($data['name'])) { if (! empty($data['name'])) {
$query->whereRaw( $query->where('name', 'like', '%'.$data['name'].'%');
'LOWER(name) LIKE ?',
['%' . strtolower($data['name']) . '%']
);
} }
if (! empty($data['company'])) { if (! empty($data['company'])) {
@@ -672,5 +621,4 @@ class VisitorEntryResource extends Resource
SoftDeletingScope::class, SoftDeletingScope::class,
]); ]);
} }
} }

View File

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

View File

@@ -520,7 +520,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];
@@ -673,7 +673,7 @@ class CharacteristicsController extends Controller
// 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!", // 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!",
// ], 404); // ], 404);
} }
} elseif (! Str::contains($curHead, 'PUMP SET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPS', ignoreCase: true)) { } elseif (! Str::contains($curHead, 'PUMPS', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true)) {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!", 'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!",
@@ -1562,7 +1562,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];
@@ -1941,7 +1941,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];
@@ -2399,7 +2399,7 @@ class CharacteristicsController extends Controller
// 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!", // 'status_description' => "Serial number '{$serialNumber}' doesn't have pumpset model to proceed!",
// ], 404); // ], 404);
} }
} elseif (! Str::contains($curHead, 'PUMP SET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true) && ! Str::contains($curHead, 'PUMPS', ignoreCase: true)) { } elseif (! Str::contains($curHead, 'PUMPS', ignoreCase: true) && ! Str::contains($curHead, 'PUMPSET', ignoreCase: true)) {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!", 'status_description' => "Serial number '{$serialNumber}' doesn't have valid model type to proceed!",
@@ -3666,7 +3666,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];
@@ -4701,7 +4701,7 @@ class CharacteristicsController extends Controller
if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) { if (Str::contains($modelHeading, 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE']; $typesToCreate = ['MOTOR', 'PUMP', 'NAME_PLATE'];
} elseif (Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) || Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMPS', ignoreCase: true) || Str::contains($modelHeading, 'PUMPSET', ignoreCase: true)) {
$typesToCreate = ['MOTOR', 'PUMP']; $typesToCreate = ['MOTOR', 'PUMP'];
} elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) { } elseif (Str::contains($modelHeading, 'PUMP', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMP SET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPSET', ignoreCase: true) && ! Str::contains($modelHeading, 'PUMPS', ignoreCase: true)) {
$typesToCreate = ['PUMP']; $typesToCreate = ['PUMP'];

View File

@@ -9,7 +9,6 @@ use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content; use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope; use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Mail\Mailables\Attachment;
class ImportTransitMail extends Mailable class ImportTransitMail extends Mailable
{ {
@@ -21,17 +20,14 @@ class ImportTransitMail extends Mailable
public $mailSubject; public $mailSubject;
public $excelPath;
/** /**
* Create a new message instance. * Create a new message instance.
*/ */
public function __construct($scheduleType, $tableData, $mailSubject, $excelPath) public function __construct($scheduleType, $tableData, $mailSubject)
{ {
$this->scheduleType = $scheduleType; $this->scheduleType = $scheduleType;
$this->tableData = $tableData ?? []; $this->tableData = $tableData ?? [];
$this->mailSubject = $mailSubject ?? 'Import Transit'; $this->mailSubject = $mailSubject ?? 'Import Transit';
$this->excelPath = $excelPath;
} }
/** /**
@@ -40,7 +36,7 @@ class ImportTransitMail extends Mailable
public function envelope(): Envelope public function envelope(): Envelope
{ {
return new Envelope( return new Envelope(
subject: 'Import Shipment InTransit Mail', subject: 'Import Transit Mail',
); );
} }
@@ -49,9 +45,7 @@ class ImportTransitMail extends Mailable
*/ */
public function content(): Content public function content(): Content
{ {
$now = now(); $greeting = '<b>Dear Sir</b>';
$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 will be commenced post ETA. 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';
@@ -94,14 +88,6 @@ class ImportTransitMail extends Mailable
*/ */
public function attachments(): array public function attachments(): array
{ {
return [ return [];
Attachment::fromStorageDisk(
'local',
$this->excelPath
)->as('Import_Transit_Report.xlsx')
->withMime(
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
),
];
} }
} }

View File

@@ -23,7 +23,6 @@ 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

@@ -1,31 +0,0 @@
<?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

@@ -9,7 +9,7 @@
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"axios": "^1.7.4", "axios": "^1.7.4",
"chartjs-plugin-datalabels": "^2.2.0", "chartjs-plugin-datalabels": "^2.2.0",
"concurrently": "^9.0.1", "concurrently": "^10.0.0",
"laravel-vite-plugin": "^1.2.0", "laravel-vite-plugin": "^1.2.0",
"postcss": "^8.4.47", "postcss": "^8.4.47",
"tailwindcss": "^3.4.13", "tailwindcss": "^3.4.13",

View File

@@ -1,11 +1,7 @@
<div class="fixed inset-0 flex items-center justify-center z-50"> <div class="fixed inset-0 flex items-center justify-center z-50">
{{-- <div class="bg-white max-h-[80vh] overflow-hidden p-6 rounded-lg shadow-lg pointer-events-auto" <div class="bg-white max-h-[80vh] overflow-hidden p-6 rounded-lg shadow-lg pointer-events-auto"
style="width:30vw !important; max-width:none !important;"> --}} style="width:30vw !important; max-width:none !important;">
<div
class="bg-white rounded-lg shadow-lg pointer-events-auto
w-full max-w-2xl max-h-[90vh] flex flex-col">
{{-- @if($records && $records->count()) --}} {{-- @if($records && $records->count()) --}}
@if(!empty($records) && count($records)) @if(!empty($records) && count($records))

View File

@@ -19,13 +19,13 @@
table { table {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
font-size: 10px; font-size: 14px;
white-space: nowrap !important; white-space: nowrap !important;
} }
th, td { th, td {
border: 1px solid #020813da; border: 1px solid #020813da;
padding: 8px 10px; padding: 8px 10px;
text-align: left; text-align: center;
white-space: nowrap !important; white-space: nowrap !important;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
@@ -41,13 +41,6 @@
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;
@@ -71,6 +64,7 @@
<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>
@@ -91,7 +85,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>
@@ -101,10 +95,7 @@
<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,7 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8">
<style> <style>
@page { @page {
margin: 0; margin: 0;

View File

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

View File

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

View File

@@ -41,26 +41,32 @@
.badge-header { .badge-header {
background: #1a1a2e; background: #1a1a2e;
color: #fff; color: #fff;
padding: 1.5mm 2mm; text-align: center;
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 { font-size: 9pt; letter-spacing: 2px; } .badge-header .type {
.badge-header .badge-id { font-size: 7pt; opacity: 0.85; } font-size: 9pt;
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: 1.5mm 2mm; padding: 2mm;
gap: 2mm; gap: 2mm;
overflow: hidden;
} }
/* ── Fields (left) ── */ /* ── Fields (left) ── */
@@ -68,104 +74,82 @@
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; gap: 1.2mm;
} }
.field-row { .field-row {
display: grid; display: grid;
grid-template-columns: 16mm 3mm 1fr; grid-template-columns: 16mm 3mm 1fr;
line-height: 1.25; line-height: 1.3;
margin-bottom: 0.6mm; margin-bottom: 0.7mm;
align-items: start;
} }
.field-label { .field-label {
color: #000; color: #000; /* was #555 — now pure black */
font-size: 6.5pt; font-size: 6.5pt;
font-weight: 700; font-weight: 700; /* was normal — now bold */
white-space: nowrap;
} }
.field-colon { .field-colon {
color: #000; color: #000; /* was #555 — now pure black */
font-size: 6.5pt; font-size: 6.5pt;
font-weight: 700; font-weight: 700; /* added bold */
text-align: center; text-align: center;
} }
.field-value { .field-value {
font-weight: 700; font-weight: 700; /* was 600 — now fully bold */
font-size: 6.5pt; font-size: 6.5pt;
color: #000; color: #000; /* was #111 — now pure black */
/* Prevent wrapping — truncate with ellipsis if too long */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
/* ── Photo column (right) ── */ /* ── Photo (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: 16mm; height: 18mm;
object-fit: cover; object-fit: cover;
border: 1px solid #000; border: 1px solid #ccc;
} }
.badge-photo .no-photo { .badge-photo .no-photo {
width: 16mm; width: 16mm;
height: 16mm; height: 18mm;
border: 1.5px dashed #000; border: 1.5px dashed #000; /* was #aaa — darker border */
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 6pt; font-size: 6pt; /* slightly larger */
color: #000; color: #000; /* was #aaa */
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
} }
.host-sign { .host-sign {
font-size: 6pt; font-size: 6pt; /* was 5.5pt — slightly larger */
color: #000; color: #000; /* was #555 — now pure black */
font-weight: 700; font-weight: 700; /* added bold */
text-align: center; text-align: center;
border-top: 1px solid #000; border-top: 1px solid #000; /* was 0.5px #aaa — darker line */
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; border-top: 1px solid #000; /* was 0.5px #ddd — darker line */
padding: 0.8mm 2mm; padding: 1mm 2mm;
text-align: right; text-align: right;
font-size: 6pt; font-size: 6pt; /* was 5.5pt — slightly larger */
color: #000; color: #000; /* was #888 — now pure black */
font-weight: 700; font-weight: 700; /* added bold */
flex-shrink: 0;
} }
@media print { @media print {
@@ -174,9 +158,9 @@
} }
</style> </style>
</head> </head>
<body> <body onload="window.print()">
{{-- ── Print / Close buttons (screen only) ── --}} {{-- ── Print button (visible on screen only, hidden when printing) ── --}}
<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
@@ -191,7 +175,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">#{{ $visitor->register_id ?? str_pad($visitor->id, 5, '0', STR_PAD_LEFT) }}</span> <span class="badge-id">#{{ str_pad($visitor->register_id, 5, '0', STR_PAD_LEFT) }}</span>
</div> </div>
{{-- Body --}} {{-- Body --}}
@@ -199,62 +183,61 @@
{{-- 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 + QR --}} {{-- Right: photo + host sign --}}
<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;">
{{-- QR Code high res, with quiet zone and high error correction --}} {{-- {!! QrCode::size(25)
@if(!empty($visitor->register_id)) ->margin(0)
<div class="visitor-qr"> ->generate($visitor->register_id) !!} --}}
{!! QrCode::size(300) @if(!empty($visitor->register_id))
->margin(2) {!! QrCode::size(35)
->errorCorrection('H') ->margin(0)
->generate((string) $visitor->register_id) !!} ->generate((string) $visitor->register_id) !!}
</div> @endif
@endif </div>
</div> </div>
</div> </div>
@@ -264,11 +247,5 @@
</div> </div>
<script>
window.addEventListener('load', function () {
setTimeout(function () { window.print(); }, 300);
});
</script>
</body> </body>
</html> </html>