Added validation for checking in customer po master
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

This commit is contained in:
dhanabalan
2026-05-15 12:40:27 +05:30
parent e09f6582e9
commit ec831f0fb9

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")