From 3845ddde765e0bf16fb9c939031bb94cb8aea7db Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 10 Oct 2026 11:24:20 +0530 Subject: [PATCH] added duplicate panel box in invoice validation --- app/Livewire/InvoiceDataTable.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Livewire/InvoiceDataTable.php b/app/Livewire/InvoiceDataTable.php index 1e5d227e..66b01173 100644 --- a/app/Livewire/InvoiceDataTable.php +++ b/app/Livewire/InvoiceDataTable.php @@ -863,18 +863,21 @@ class InvoiceDataTable extends Component return; } - } - if($categoryExist?->category == 'Panel Box'){ - $panelExistInvoice = InvoiceValidation::where('plant_id', $this->plantId)->where('panel_box_serial_number', $serialNumber)->where('panel_box_code', $itemCode)->where('panel_box_supplier', $supplier)->first(); + $panelExistsInvoice = InvoiceValidation::where('plant_id', $this->plantId) + ->where('panel_box_serial_number', $serialNumber) + ->where('panel_box_code', $itemCode) + ->where('panel_box_supplier', $supplier) + ->first(); - if($panelExistInvoice){ + if ($panelExistsInvoice) { Notification::make() ->title('Duplicate Panel') - ->body("Duplicate panel already exist.
Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.
") + ->body("Duplicate panel already exists.
Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.") ->danger() ->seconds(2) ->send(); + $this->capacitorInput = ''; return; -- 2.49.1