From 34b62d226c5290158bc8baa37c21f4b1be817639 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 2 Jun 2025 13:24:41 +0530 Subject: [PATCH] fix: decimal issue (#47839) (cherry picked from commit 0dbd9efc9189d7efb6258adef727764c3f865f4a) --- .../serial_and_batch_bundle/serial_and_batch_bundle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py index af2915692ce..b83f3c58df9 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py @@ -722,19 +722,19 @@ class SerialandBatchBundle(Document): def reset_qty(self, row, qty_field=None): qty_field = self.get_qty_field(row, qty_field=qty_field) - qty = abs(row.get(qty_field)) + qty = abs(flt(row.get(qty_field), self.precision("total_qty"))) idx = None while qty > 0: for d in self.entries: - row_qty = abs(d.qty) + row_qty = abs(flt(d.qty, d.precision("qty"))) if row_qty >= qty: d.db_set("qty", qty if self.type_of_transaction == "Inward" else qty * -1) qty = 0 idx = d.idx break else: - qty -= row_qty + qty = flt(qty - row_qty, d.precision("qty")) idx = d.idx if idx and len(self.entries) > idx: