Added supplier 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 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 2m39s
Laravel Larastan / larastan (pull_request) Failing after 5m49s
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 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Laravel Pint / pint (pull_request) Successful in 2m39s
Laravel Larastan / larastan (pull_request) Failing after 5m49s
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user