total gross profit % in gross profit report

This commit is contained in:
Nabin Hait 2012-09-24 16:12:01 +05:30
parent acd39fd957
commit 9b4ffcb507

View File

@ -77,8 +77,10 @@ for r in res:
# Add Total Row
l_row = ['' for i in range(len(colnames))]
l_row[col_idx['Quantity']] = '<b>TOTALS</b>'
l_row[col_idx['Project Name']] = '<b>TOTALS</b>'
l_row[col_idx['Amount']] = fmt_money(tot_amount)
l_row[col_idx['Purchase Cost']] = fmt_money(tot_pur_cost)
l_row[col_idx['Gross Profit']] = fmt_money(flt(tot_amount) - flt(tot_pur_cost))
l_row[col_idx['Gross Profit (%)']] = round((flt(tot_amount) - flt(tot_pur_cost))*100/ \
flt(tot_pur_cost), 2)
out.append(l_row)