From 7fa3a789b13f94fbab45a4de9dffdd8dfc2df5c9 Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 17 Dec 2024 17:54:08 +0530 Subject: [PATCH] fix: buying rate for service item in gross profit report (cherry picked from commit 8d6e79a16f52723da3b494a2e863f8e77d4419ac) --- erpnext/accounts/report/gross_profit/gross_profit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: