fix: precision calculation causing 0.1 discrepancy (#44431)
(cherry picked from commit 7f7564b581)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -432,8 +432,6 @@ class SerialandBatchBundle(Document):
|
||||
valuation_field = "rate"
|
||||
child_table = "Subcontracting Receipt Item"
|
||||
|
||||
precision = frappe.get_precision(child_table, valuation_field) or 2
|
||||
|
||||
if not rate and self.voucher_detail_no and self.voucher_no:
|
||||
rate = frappe.db.get_value(child_table, self.voucher_detail_no, valuation_field)
|
||||
|
||||
@@ -443,9 +441,9 @@ class SerialandBatchBundle(Document):
|
||||
elif (d.incoming_rate == rate) and d.qty and d.stock_value_difference:
|
||||
continue
|
||||
|
||||
d.incoming_rate = flt(rate, precision)
|
||||
d.incoming_rate = rate
|
||||
if d.qty:
|
||||
d.stock_value_difference = flt(d.qty) * flt(d.incoming_rate)
|
||||
d.stock_value_difference = d.qty * d.incoming_rate
|
||||
|
||||
if save:
|
||||
d.db_set(
|
||||
|
||||
Reference in New Issue
Block a user