diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 15617a53cdf..5539954231a 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -726,12 +726,13 @@ class GrossProfitGenerator: .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: