fix: stock_value_change for legacy serial nos (backport #41825) (#41826)

fix: stock_value_change for legacy serial nos (#41825)

(cherry picked from commit f6a4d391c0)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-06-07 23:05:50 +05:30
committed by GitHub
parent 3f1d97259a
commit a7971cf844

View File

@@ -837,7 +837,7 @@ class update_entries_after:
) )
outgoing_value = sn_obj.get_incoming_rate() outgoing_value = sn_obj.get_incoming_rate()
stock_value_change = -1 * outgoing_value stock_value_change = actual_qty * outgoing_value
else: else:
stock_value_change = actual_qty * sle.outgoing_rate stock_value_change = actual_qty * sle.outgoing_rate
@@ -1312,6 +1312,7 @@ class update_entries_after:
# future entries will correct the overall accounting as each # future entries will correct the overall accounting as each
# batch individually uses moving average rates. # batch individually uses moving average rates.
outgoing_rate = self.get_fallback_rate(sle) outgoing_rate = self.get_fallback_rate(sle)
stock_value_difference = outgoing_rate * actual_qty stock_value_difference = outgoing_rate * actual_qty
self.wh_data.stock_value = round_off_if_near_zero(self.wh_data.stock_value + stock_value_difference) self.wh_data.stock_value = round_off_if_near_zero(self.wh_data.stock_value + stock_value_difference)