From 9be5717f6c3b3098bb8b960e30d9f8becc937b77 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 26 Sep 2012 11:30:30 +0530 Subject: [PATCH] fixes in gross profit report --- erpnext/selling/search_criteria/gross_profit/gross_profit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/search_criteria/gross_profit/gross_profit.py b/erpnext/selling/search_criteria/gross_profit/gross_profit.py index 53a5fdbe5e..5b4d3fabac 100644 --- a/erpnext/selling/search_criteria/gross_profit/gross_profit.py +++ b/erpnext/selling/search_criteria/gross_profit/gross_profit.py @@ -71,7 +71,8 @@ for r in res: r.append(purchase_cost) gp = flt(r[col_idx['Amount']]) - flt(purchase_cost) - gp_percent = purchase_cost and round((gp*100/flt(r[col_idx['Amount']])), 2) or 0 + gp_percent = r[col_idx['Amount']] and purchase_cost and \ + round((gp*100/flt(r[col_idx['Amount']])), 2) or 0 r.append(fmt_money(gp)) r.append(fmt_money(gp_percent)) out.append(r)