From aa4a9f68fa2c89989aa9e0cb0d218d15aaee501c Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 22 Jul 2026 11:59:52 +0530 Subject: [PATCH] altered logic for total quantity in wire master --- .../Pages/CreateWireMasterPacking.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Filament/Resources/WireMasterPackingResource/Pages/CreateWireMasterPacking.php b/app/Filament/Resources/WireMasterPackingResource/Pages/CreateWireMasterPacking.php index 5257fcc..bb4ef48 100644 --- a/app/Filament/Resources/WireMasterPackingResource/Pages/CreateWireMasterPacking.php +++ b/app/Filament/Resources/WireMasterPackingResource/Pages/CreateWireMasterPacking.php @@ -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'")