Merge pull request 'Added supplier logic in panel box validation' (#1021) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s

Reviewed-on: #1021
This commit was merged in pull request #1021.
This commit is contained in:
2026-09-12 04:00:27 +00:00

View File

@@ -607,6 +607,19 @@ class PanelBoxValidationResource extends Resource
return;
}
$sticker = StickerMaster::where('plant_id', $plantId)->where('item_id', $iId->id)->first();
if(!$sticker){
Notification::make()
->title('Unknown Item Code')
->body("Item code not found '{$iId->code}' in sticker master.")
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
$existInMaster = PanelGrMaster::where('document_number', $pOrder)->where('inspection_lot_number', $inspecLotNo)->where('item_id', $iId->id)->where('plant_id', $plantId)->first();
if(!$existInMaster){
@@ -670,19 +683,6 @@ class PanelBoxValidationResource extends Resource
return;
}
$sticker = StickerMaster::where('plant_id', $plantId)->where('item_id', $iId->id)->first();
if(!$sticker){
Notification::make()
->title('Unknown Item Code')
->body("Item code not found '{$iId->code}' in sticker master.")
->danger()
->send();
$set('item_id', null);
$set('serial_exists', false);
return;
}
$existQuanInPanel = PanelBoxValidation::where('plant_id', $plantId)->where('production_order', $pOrder)->where('inspection_lot_number', $inspecLotNo)->where('sticker_master_id', $sticker->id)->count();
if ($existQuanInPanel >= (int) $existInMaster->quantity) {
@@ -812,7 +812,7 @@ class PanelBoxValidationResource extends Resource
}
}
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first();
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->where('panel_box_supplier', $supplier)->first();
if ($serialExists) {
$set('serial_exists', true);