diff --git a/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php b/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php index a18dfe89..fc41f97c 100644 --- a/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php +++ b/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php @@ -4041,6 +4041,8 @@ class CreateInvoiceValidation extends CreateRecord $supplierSNo = implode('/', array_slice($matches, 3)); $panelBoxCode = $matches[2]; + $pBoxSNo = $matches[3] . '/' . $matches[4]; + $record = InvoiceValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first(); if (! $record) { @@ -4094,7 +4096,7 @@ class CreateInvoiceValidation extends CreateRecord return; } - $notOkPanelBox = PanelBoxValidation::where('plant_id', $plantId)->where('panel_box_supplier', $supplierNo)->where('panel_box_serial_number', $supplierSNo)->first(); + $notOkPanelBox = PanelBoxValidation::where('plant_id', $plantId)->where('panel_box_supplier', $supplierNo)->where('panel_box_serial_number', $pBoxSNO)->first(); if($notOkPanelBox->status == 'NotOK'){ Notification::make()