Merge pull request 'Added validation for checking in customer po master' (#604) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

Reviewed-on: #604
This commit was merged in pull request #604.
This commit is contained in:
2026-05-15 07:10:53 +00:00

View File

@@ -109,7 +109,7 @@ class CreateWireMasterPacking extends CreateRecord
$materialCode = $matches[1];
$processOrderId = $matches[2];
$coilNo = $matches[3];
$coilNo = $matches[3];
$weight = $matches[4];
$icode = Item::where('code', $materialCode)->first();
@@ -164,6 +164,33 @@ class CreateWireMasterPacking extends CreateRecord
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();
if($processOrderAgaPlant)
@@ -220,7 +247,7 @@ class CreateWireMasterPacking extends CreateRecord
return;
}
if($weight > $customerPoRecord->quantity)
if((float)$weight > (float)$customerPoRecord->quantity)
{
Notification::make()
->title("Scanned Weight Exceeds PO Quantity")