Added Duplicate : Panel Box QR warning message on panel box invoice
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 4m57s
Laravel Larastan / larastan (pull_request) Failing after 6m28s

This commit is contained in:
dhanabalan
2026-12-02 19:41:41 +05:30
parent bcf23f99a0
commit c2647b1c56

View File

@@ -4183,6 +4183,28 @@ class CreateInvoiceValidation extends CreateRecord
return;
}
if ($hasValidPanelCode?->scanned_status == 'Scanned') {
Notification::make()
->title('Duplicate : Panel Box QR')
->body("Scanned Panel Box Serial Number : '{$serialNumber}' already completed the scanning process.")
->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;
}
$panelBoxExist = PanelBoxValidation::where('plant_id', $plantId)->where('panel_box_supplier', $supplierNo)->where('panel_box_serial_number', $pBoxSNo)->first();
if (! $panelBoxExist) {