Changed logic in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 29s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 39s
Laravel Larastan / larastan (pull_request) Failing after 4m58s
Laravel Pint / pint (pull_request) Successful in 5m9s

This commit is contained in:
dhanabalan
2026-10-26 18:44:22 +05:30
parent 58394901ac
commit 60d8460e5f

View File

@@ -448,18 +448,35 @@ class PanelBoxInspectionStock extends Page
$serialExists = PanelBoxValidation::where('plant_id', $plantId)->where('serial_number', $serialNumber)->where('panel_box_supplier', $supplier)->first(); $serialExists = PanelBoxValidation::where('plant_id', $plantId)->where('serial_number', $serialNumber)->where('panel_box_supplier', $supplier)->first();
if ($serialExists) { if ($serialExists) {
Notification::make()
->title('Already Scanned In Testing') if($serialExists->inspection_lot_number != '' && $serialExists->production_order != ''){
->body("Serial number already scanned '$serialNumber' with supplier number '$supplier'.<br>Please scan this serial number in Invoice Validation.") Notification::make()
->success() ->title('Already Scanned In Testing')
->send(); ->body("Serial number already scanned '$serialNumber' with supplier number '$supplier'.<br>Please scan this serial number in Invoice Validation.")
$this->dispatch('play-error-sound'); ->success()
$this->form->fill([ ->send();
'plant_id' => $plantId, $this->dispatch('play-error-sound');
'line_id' => $lineId, $this->form->fill([
'item_id' => null, 'plant_id' => $plantId,
]); 'line_id' => $lineId,
return; 'item_id' => null,
]);
return;
}
else{
Notification::make()
->title('Duplicate Serial Number')
->body("Duplicate Serial number '$serialNumber' with supplier number '$supplier'.")
->success()
->send();
$this->form->fill([
'plant_id' => $plantId,
'line_id' => $lineId,
'item_id' => null,
]);
return;
}
} }
$item = Item::where('code', $itemCode)->where('plant_id', $plantId)->first(); $item = Item::where('code', $itemCode)->where('plant_id', $plantId)->first();