Added validation in panel box page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 20s
Laravel Pint / pint (pull_request) Successful in 2m27s
Laravel Larastan / larastan (pull_request) Failing after 4m38s

This commit is contained in:
dhanabalan
2026-12-01 07:47:39 +05:30
parent 9377fd0010
commit 6849f59c64

View File

@@ -784,7 +784,6 @@ class PanelBoxValidationResource extends Resource
// return;
// }
$set('panel_box_supplier', $supplier);
$set('panel_box_serial_number', $panelBoxSerialNo);
$set('panel_box_code', $panelBoxCode);
@@ -1062,7 +1061,7 @@ class PanelBoxValidationResource extends Resource
$set('serial_exists', false);
}
$serialExistsPanel = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->where('panel_box_supplier', $supplier)->where('status', '!=', '')->whereNotNull('status')->where('status', 'Ok')->first();
$serialExistsPanel = PanelBoxValidation::where('plant_id', $plantId)->where('serial_number', $serialNumber)->where('panel_box_supplier', $supplier)->where('panel_box_code', $panelBoxCode)->where('status', '!=', '')->whereNotNull('status')->where('status', 'Ok')->first();
if($serialExistsPanel){
Notification::make()
@@ -1267,6 +1266,17 @@ class PanelBoxValidationResource extends Resource
})
->first();
// $alreadyExists = PanelBoxValidation::where('serial_number', $serialNumber)
// ->where('plant_id', $plantId)
// ->where(function ($query) use ($pOrder, $inspecLotNo) {
// $query->where('production_order', $pOrder);
// if (!empty($inspecLotNo)) {
// $query->orWhere('inspection_lot_number', $inspecLotNo);
// }
// })
// ->first();
$alreadyExistsSupplier = PanelBoxValidation::where('plant_id', $plantId)->where('serial_number', $serialNumber)
->where('panel_box_supplier', $supplierNo)
->first();