From c2647b1c56d0e29266e59c3f371e9cbac18820f4 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 2 Dec 2026 19:41:41 +0530 Subject: [PATCH] Added Duplicate : Panel Box QR warning message on panel box invoice --- .../Pages/CreateInvoiceValidation.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php b/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php index 675b1d6d..e4cce4a2 100644 --- a/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php +++ b/app/Filament/Resources/InvoiceValidationResource/Pages/CreateInvoiceValidation.php @@ -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) {