Added duplicate panel box validation check in invoice #1216

Merged
jothi merged 1 commits from ranjith-dev into master 2026-10-10 05:08:51 +00:00

View File

@@ -850,7 +850,7 @@ class InvoiceDataTable extends Component
if($categoryExist?->category == 'Panel Box'){ if($categoryExist?->category == 'Panel Box'){
$panelExist = PanelBoxValidation::where('panel_box_serial_number', $serialNumber)->where('panel_box_code', $itemCode)->where('panel_box_supplier', $supplier)->first(); $panelExist = PanelBoxValidation::where('plant_id', $this->plantId)->where('panel_box_serial_number', $serialNumber)->where('panel_box_code', $itemCode)->where('panel_box_supplier', $supplier)->first();
if(!$panelExist){ if(!$panelExist){
Notification::make() Notification::make()
@@ -864,6 +864,22 @@ 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();
if($panelExistInvoice){
Notification::make()
->title('Duplicate Panel')
->body("Duplicate panel already exist.<br>Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.</br>")
->danger()
->seconds(2)
->send();
$this->capacitorInput = '';
return;
}
}
$this->package = InvoiceValidation::with('stickerMasterRelation') $this->package = InvoiceValidation::with('stickerMasterRelation')
->where('invoice_number', $this->invoiceNumber) ->where('invoice_number', $this->invoiceNumber)