mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 08:35:00 +00:00
fix: precision issue
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user