Skip to content

Commit

Permalink
fix: stock_value_change for legacy serial nos (#41825)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure authored Jun 7, 2024
1 parent 3956354 commit f6a4d39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion erpnext/stock/stock_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ def get_serialized_values(self, sle):
)

outgoing_value = sn_obj.get_incoming_rate()
stock_value_change = -1 * outgoing_value
stock_value_change = actual_qty * outgoing_value
else:
stock_value_change = actual_qty * sle.outgoing_rate

Expand Down Expand Up @@ -1312,6 +1312,7 @@ def update_batched_values(self, sle):
# future entries will correct the overall accounting as each
# batch individually uses moving average rates.
outgoing_rate = self.get_fallback_rate(sle)

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)
Expand Down

0 comments on commit f6a4d39

Please sign in to comment.