diff --git a/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py index 3554f6401e7..2dd1a98e148 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py @@ -1314,7 +1314,7 @@ class TestStockLedgerEntry(IntegrationTestCase, StockTestMixin): # To deliver 100 qty we fall short of 11.0073 qty (11.007 with precision 3) # Stock up with 11.007 (balance in db becomes 99.9997, on UI it will show as 100) make_stock_entry(item_code=item_code, target=warehouse, qty=11.007, rate=100) - self.assertEqual(get_stock_balance(item_code, warehouse), 99.9997) + self.assertEqual(get_stock_balance(item_code, warehouse), 100.0) # See if delivery note goes through # Negative qty error should not be raised as 99.9997 is 100 with precision 3 (system precision) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index ab83b54ce51..2ebe57eeb94 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -898,7 +898,7 @@ class update_entries_after: self.wh_data.prev_stock_value = self.wh_data.stock_value # update current sle - sle.qty_after_transaction = self.wh_data.qty_after_transaction + sle.qty_after_transaction = flt(self.wh_data.qty_after_transaction, self.flt_precision) sle.valuation_rate = self.wh_data.valuation_rate sle.stock_value = self.wh_data.stock_value sle.stock_queue = json.dumps(self.wh_data.stock_queue)