chnaged logic in invoice validation #1524

Merged
jothi merged 1 commits from ranjith-dev into master 2026-11-25 12:09:47 +00:00

View File

@@ -4097,12 +4097,12 @@ class CreateInvoiceValidation extends CreateRecord
return; return;
} }
$notOkPanelBox = PanelBoxValidation::where('plant_id', $plantId)->where('panel_box_supplier', $supplierNo)->where('panel_box_serial_number', $pBoxSNo)->first(); $panelBoxExist = PanelBoxValidation::where('plant_id', $plantId)->where('panel_box_supplier', $supplierNo)->where('panel_box_serial_number', $pBoxSNo)->first();
if($notOkPanelBox->status == 'NotOk'){ if(!$panelBoxExist){
Notification::make() Notification::make()
->title('Not Ok Serial Number') ->title('Unknwon : Serial Number')
->body("scanned panel box serial number '$serNo' failed testing (NOT OK). Please scan the serial number of an OK panel box..") ->body("Scanned Panel Box Serial Number '$serNo' was not found in Panel Box Validation.<br>Please complete the testing process for this Panel Box before proceeding.")
->danger() ->danger()
->seconds(3) ->seconds(3)
->send(); ->send();
@@ -4121,6 +4121,30 @@ class CreateInvoiceValidation extends CreateRecord
return; return;
} }
// $notOkPanelBox = PanelBoxValidation::where('plant_id', $plantId)->where('panel_box_supplier', $supplierNo)->where('panel_box_serial_number', $pBoxSNo)->first();
// if($notOkPanelBox->status == 'NotOk'){
// Notification::make()
// ->title('Not Ok Serial Number')
// ->body("scanned panel box serial number '$serNo' failed testing (NOT OK). Please scan the serial number of an OK panel box..")
// ->danger()
// ->seconds(3)
// ->send();
// $this->dispatch('playWarnSound');
// $this->form->fill([
// 'plant_id' => $plantId,
// 'invoice_number' => $invoiceNumber,
// 'serial_number' => null,
// 'total_quantity' => $totQuan,
// 'update_invoice' => false,
// 'scanned_quantity' => $scanSQuan,
// ]);
// return;
// }
$invoiceUpdate = InvoiceValidation::where('plant_id', $plantId) $invoiceUpdate = InvoiceValidation::where('plant_id', $plantId)
->where('invoice_number', $invoiceNumber) ->where('invoice_number', $invoiceNumber)
->where('sticker_master_id', $record1->sticker_master_id) ->where('sticker_master_id', $record1->sticker_master_id)