fixes in gross profit report

This commit is contained in:
Nabin Hait 2012-09-26 11:30:30 +05:30
parent 052a5e85e0
commit 9be5717f6c

View File

@ -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)