fix: absence of rounding causing discrepancy in the valuation rate calculation (backport #47700) (#47711)

fix: absence of rounding causing discrepancy in the valuation rate calculation (#47700)

(cherry picked from commit 1e8ed22421)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2025-05-24 17:27:20 +05:30
committed by GitHub
parent a6b1bdc78b
commit f41bcc6fec

View File

@@ -882,6 +882,12 @@ class update_entries_after:
self.wh_data.stock_value = flt(self.wh_data.qty_after_transaction) * flt(
self.wh_data.valuation_rate
)
if sle.actual_qty < 0 and self.wh_data.qty_after_transaction != 0:
self.wh_data.valuation_rate = flt(
self.wh_data.stock_value, self.currency_precision
) / flt(self.wh_data.qty_after_transaction, self.flt_precision)
else:
self.update_queue_values(sle)