Added supplier logic in panel box validation #1021
@@ -607,6 +607,19 @@ class PanelBoxValidationResource extends Resource
|
|||||||
return;
|
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();
|
$existInMaster = PanelGrMaster::where('document_number', $pOrder)->where('inspection_lot_number', $inspecLotNo)->where('item_id', $iId->id)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
if(!$existInMaster){
|
if(!$existInMaster){
|
||||||
@@ -670,19 +683,6 @@ class PanelBoxValidationResource extends Resource
|
|||||||
return;
|
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();
|
$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) {
|
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) {
|
if ($serialExists) {
|
||||||
$set('serial_exists', true);
|
$set('serial_exists', true);
|
||||||
|
|||||||
Reference in New Issue
Block a user