Skip to content

Commit

Permalink
fix(gp): SLEs not fetched for correct warehouse
Browse files Browse the repository at this point in the history
(cherry picked from commit f958e8b)
  • Loading branch information
rtdany10 authored and ruthra-kumar committed Apr 17, 2024
1 parent 33b6244 commit 881dc02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/accounts/report/gross_profit/gross_profit.py
Expand Up @@ -656,13 +656,13 @@ def get_buying_amount(self, row, item_code):
elif self.delivery_notes.get((row.parent, row.item_code), None):
# check if Invoice has delivery notes
dn = self.delivery_notes.get((row.parent, row.item_code))
parenttype, parent, item_row, warehouse = (
parenttype, parent, item_row, dn_warehouse = (
"Delivery Note",
dn["delivery_note"],
dn["item_row"],
dn["warehouse"],
)
my_sle = self.get_stock_ledger_entries(item_code, row.warehouse)
my_sle = self.get_stock_ledger_entries(item_code, dn_warehouse)
return self.calculate_buying_amount_from_sle(
row, my_sle, parenttype, parent, item_row, item_code
)
Expand Down

0 comments on commit 881dc02

Please sign in to comment.