Skip to content

Commit

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

fix: buying rate for service item in gross profit report (backport #44751)
  • Loading branch information
ruthra-kumar authored Dec 23, 2024
2 parents 5984140 + a55aaea commit 1a9dfec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion erpnext/accounts/report/gross_profit/gross_profit.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,13 @@ def get_last_purchase_rate(self, item_code, row):
.inner_join(purchase_invoice)
.on(purchase_invoice.name == purchase_invoice_item.parent)
.select(
purchase_invoice.name,
purchase_invoice_item.base_rate / purchase_invoice_item.conversion_factor,
)
.where(purchase_invoice.docstatus == 1)
.where(purchase_invoice.posting_date <= self.filters.to_date)
.where(purchase_invoice_item.item_code == item_code)
.where(purchase_invoice.is_return == 0)
.where(purchase_invoice_item.parenttype == "Purchase Invoice")
)

if row.project:
Expand Down

0 comments on commit 1a9dfec

Please sign in to comment.