Added validation for checking in customer po master #604
@@ -109,7 +109,7 @@ class CreateWireMasterPacking extends CreateRecord
|
|||||||
|
|
||||||
$materialCode = $matches[1];
|
$materialCode = $matches[1];
|
||||||
$processOrderId = $matches[2];
|
$processOrderId = $matches[2];
|
||||||
$coilNo = $matches[3];
|
$coilNo = $matches[3];
|
||||||
$weight = $matches[4];
|
$weight = $matches[4];
|
||||||
|
|
||||||
$icode = Item::where('code', $materialCode)->first();
|
$icode = Item::where('code', $materialCode)->first();
|
||||||
@@ -164,6 +164,33 @@ class CreateWireMasterPacking extends CreateRecord
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$itemId = Item::where('code', $materialCode)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->value('id');
|
||||||
|
|
||||||
|
$icodeAgaCPoPlant = CustomerPoMaster::where('item_id', $itemId)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
|
if(!$icodeAgaCPoPlant)
|
||||||
|
{
|
||||||
|
Notification::make()
|
||||||
|
->title("Unknown Item Code in Customer PO")
|
||||||
|
->body("Item Code '$materialCode' not found in any active Customer PO against Plant Code '$plantcode'")
|
||||||
|
->danger()
|
||||||
|
->duration(5000)
|
||||||
|
->send();
|
||||||
|
|
||||||
|
$this->form->fill([
|
||||||
|
'process_order' => null,
|
||||||
|
'plant_id' => $plantId,
|
||||||
|
'customer_po_master_id' => $customerPo,
|
||||||
|
'wire_packing_number' => $wirePackNo,
|
||||||
|
'Sno_quantity' => 0,
|
||||||
|
'created_by' => $operatorName,
|
||||||
|
'scanned_by' => $operatorName,
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$processOrderAgaPlant = WireMasterPacking::where('process_order', $processOrderId . '-' . $coilNo)->where('plant_id', $plantId)->first();
|
$processOrderAgaPlant = WireMasterPacking::where('process_order', $processOrderId . '-' . $coilNo)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
if($processOrderAgaPlant)
|
if($processOrderAgaPlant)
|
||||||
@@ -220,7 +247,7 @@ class CreateWireMasterPacking extends CreateRecord
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($weight > $customerPoRecord->quantity)
|
if((float)$weight > (float)$customerPoRecord->quantity)
|
||||||
{
|
{
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title("Scanned Weight Exceeds PO Quantity")
|
->title("Scanned Weight Exceeds PO Quantity")
|
||||||
|
|||||||
Reference in New Issue
Block a user