Skip to content

Commit

Permalink
Merge pull request #31889 from frappe/mergify/bp/version-13-hotfix/pr…
Browse files Browse the repository at this point in the history
…-31871

fix: incorrect buying amount in Gross Profit rpt (backport #31871)
  • Loading branch information
deepeshgarg007 authored Aug 22, 2022
2 parents fc7285c + 6405a93 commit 75d57c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/accounts/report/gross_profit/gross_profit.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def get_buying_amount(self, row, item_code):
previous_stock_value = len(my_sle) > i + 1 and flt(my_sle[i + 1].stock_value) or 0.0

if previous_stock_value:
return (previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
return abs(previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
else:
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
else:
Expand Down

0 comments on commit 75d57c1

Please sign in to comment.