From efccb8a704c5041b5f74a1efe30bebe114908084 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Fri, 27 May 2016 13:24:02 +0530 Subject: [PATCH] Fixed error in Gross Profit report --- erpnext/accounts/report/gross_profit/gross_profit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 4ae0e6794d..aa0232b3cb 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -215,7 +215,7 @@ class GrossProfitGenerator(object): def get_average_buying_rate(self, item_code): if not item_code in self.average_buying_rate: if item_code in self.non_stock_items: - self.average_buying_rate[item_code] = flt(frappe.db.sql("""select sum(base_net_amount) / sum(qty) + self.average_buying_rate[item_code] = flt(frappe.db.sql("""select sum(base_net_amount) / sum(qty * conversion_factor) from `tabPurchase Invoice Item` where item_code = %s and docstatus=1""", item_code)[0][0]) else: