Added validation in invoice validation page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 3m52s
Laravel Larastan / larastan (pull_request) Failing after 6m53s

This commit is contained in:
dhanabalan
2026-11-26 08:44:41 +05:30
parent fde66185ae
commit 4aaf0714c9

View File

@@ -4097,53 +4097,53 @@ class CreateInvoiceValidation extends CreateRecord
return;
}
// $panelBoxExist = 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(!$panelBoxExist){
// Notification::make()
// ->title('Unknwon : Serial Number')
// ->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()
// ->seconds(3)
// ->send();
if(!$panelBoxExist){
Notification::make()
->title('Unknwon : Serial Number')
->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()
->seconds(3)
->send();
// $this->dispatch('playWarnSound');
$this->dispatch('playWarnSound');
// $this->form->fill([
// 'plant_id' => $plantId,
// 'invoice_number' => $invoiceNumber,
// 'serial_number' => null,
// 'total_quantity' => $totQuan,
// 'update_invoice' => false,
// 'scanned_quantity' => $scanSQuan,
// ]);
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity' => $scanSQuan,
]);
// return;
// }
return;
}
// $notOkPanelBox = PanelBoxValidation::where('plant_id', $plantId)->where('panel_box_supplier', $supplierNo)->where('panel_box_serial_number', $pBoxSNo)->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()
// ->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();
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->dispatch('playWarnSound');
// $this->form->fill([
// 'plant_id' => $plantId,
// 'invoice_number' => $invoiceNumber,
// 'serial_number' => null,
// 'total_quantity' => $totQuan,
// 'update_invoice' => false,
// 'scanned_quantity' => $scanSQuan,
// ]);
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity' => $scanSQuan,
]);
// return;
// }
return;
}
$invoiceUpdate = InvoiceValidation::where('plant_id', $plantId)
->where('invoice_number', $invoiceNumber)