1
0
forked from poc/pds

Changed logic for checking exustng weight with total quantity

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