Changed logic for checking exustng weight with total quantity
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:48:00 +05:30
parent ec831f0fb9
commit 62259d4afe

View File

@@ -247,7 +247,14 @@ class CreateWireMasterPacking extends CreateRecord
return;
}
if((float)$weight > (float)$customerPoRecord->quantity)
$alreadyScannedQty = WireMasterPacking::where('customer_po_master_id', $customerPo)
->where('plant_id', $plantId)
->where('item_id', $itemId)
->sum('weight');
$totalQty = (float)$alreadyScannedQty + (float)$weight;
if($totalQty > (float)$customerPoRecord->quantity)
{
Notification::make()
->title("Scanned Weight Exceeds PO Quantity")