[Report][Quotation Trend]

This commit is contained in:
Saurabh
2013-06-11 18:06:58 +05:30
parent 66f10cd14f
commit bcbd9a4800
3 changed files with 110 additions and 36 deletions

View File

@@ -155,10 +155,8 @@ for r in res:
for d in range(len(colnames) - cr):
r.append(flt(main_det[0][d]))
out.append(r)
if group_by:
flag = 1
# check for root nodes
if based_on in ['Item Group','Customer Group','Territory']:
is_grp = sql("select is_group from `tab%s` where name = '%s'" % (based_on, cstr(r[col_idx[based_on]]).strip()))
is_grp = is_grp and cstr(is_grp[0][0]) or ''
@@ -167,11 +165,11 @@ for r in res:
if flag == 1:
det = [x[0] for x in sql("SELECT DISTINCT %s FROM %s where %s" % (sel_col, add_tab, add_cond % {'value':cstr(r[col_idx[based_on]]).strip()}))]
for des in range(len(det)):
t_row = ['' for i in range(len(colnames))]
t_row[col_idx[group_by]] = cstr(det[des])
gr_det = sql("SELECT %s FROM %s WHERE %s = '%s' and %s" % (query_val, add_tab, sel_col, cstr(det[des]), add_cond % {'value':cstr(r[col_idx[based_on]]).strip()}))
webnotes.errprint(cstr(r[col_idx[based_on]]).strip())
for d in range(len(col_names)):
t_row[col_idx[col_names[d]]] = flt(gr_det[0][d])
out.append(t_row)
out.append(t_row)