1
0
forked from poc/pds

altered logic for total quantity in wire master

This commit is contained in:
dhanabalan
2026-07-22 11:59:52 +05:30
parent d6a683b9c1
commit aa4a9f68fa

View File

@@ -250,10 +250,12 @@ class CreateWireMasterPacking extends CreateRecord
->selectRaw('SUM(CAST(weight AS NUMERIC)) as total_weight')
->value('total_weight');
$totalQty = (float)$alreadyScannedQty + (float)$weight;
$totalQty = round((float)$alreadyScannedQty + (float)$weight, 3);
if($totalQty > (float)$customerPoRecord->quantity)
if($totalQty > round((float)$customerPoRecord->quantity, 3))
{
Notification::make()
->title("Scanned Weight Exceeds PO Quantity")
->body("Scanned weight '$weight' and already scanned weight '$alreadyScannedQty' exceeds allowed quantity '{$customerPoRecord->quantity}' for PO '$customerPoRecord->customer_po' and Item '$materialCode'")