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;