brotherton-erpnext/selling/search_criteria/itemwise_sales_details/itemwise_sales_details.py
2011-07-01 13:34:41 +05:30

19 lines
506 B
Python

out=[]
qty,amt,del_qty,bil_qty=0,0,0,0
for r in res:
qty += flt(r[col_idx['Quantity']])
amt += flt(r[col_idx['Amount*']])
del_qty += flt(r[col_idx['Delivered Qty']])
bil_qty += flt(r[col_idx['Billed Qty']])
out.append(r)
#Add the totals row
l_row = ['' for i in range(len(colnames))]
l_row[col_idx['Item Name']] = '<b>TOTALS</b>'
l_row[col_idx['Quantity']] = qty
l_row[col_idx['Amount*']] = amt
l_row[col_idx['Delivered Qty']] = del_qty
l_row[col_idx['Billed Qty']] = bil_qty
out.append(l_row)