1
0
forked from poc/pds

added duplicate panel box in invoice validation

This commit is contained in:
dhanabalan
2026-10-10 11:24:20 +05:30
parent f37b327ecf
commit 3845ddde76

View File

@@ -863,18 +863,21 @@ class InvoiceDataTable extends Component
return; 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() Notification::make()
->title('Duplicate Panel') ->title('Duplicate Panel')
->body("Duplicate panel already exist.<br>Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.</br>") ->body("Duplicate panel already exists.<br>Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.")
->danger() ->danger()
->seconds(2) ->seconds(2)
->send(); ->send();
$this->capacitorInput = ''; $this->capacitorInput = '';
return; return;