Browse Source

moved js and py file from itemwise_sales_register1 to itemwise_sales_register

develop
nabinhait 14 years ago
parent
commit
a1c0148472
  1. 19
      accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.js
  2. 26
      accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.py

19
accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.js

@ -0,0 +1,19 @@
report.customize_filters = function() {
this.hide_all_filters();
filter_list = ['From Voucher Date', 'To Voucher Date', 'Debit To', 'From Posting Date', 'To Posting Date']
for(var i=0;i<filter_list.length;i++)
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +filter_list[i]].df.filter_hide = 0;
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Item'].df.filter_hide = 0;
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Item Group'].df.filter_hide = 0;
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Brand Name'].df.filter_hide = 0;
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Cost Center'].df.filter_hide = 0;
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['RV Detail'+FILTER_SEP +'Item'].df.in_first_page = 1;
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company
}

26
accounts/search_criteria/itemwise_sales_register/itemwise_sales_register.py

@ -0,0 +1,26 @@
#adding columns
cl = [c[0] for c in sql("select distinct account_head from `tabRV Tax Detail` where parenttype='Receivable Voucher' and docstatus=1 order by idx asc")]
cl+=['Total Tax', 'Grand Total']
for c in cl:
colnames.append(c)
coltypes.append('Currency')
colwidths.append('100px')
coloptions.append('')
cl = cl[:-2]
for r in res:
total_tax = 0
qty = flt(r[col_idx['Qty']] or 0)
amt = flt(r[col_idx['Amount*']] or 0)
for c in cl:
val = sql("select t1.tax_amount, t2.net_total from `tabRV Tax Detail` t1, `tabReceivable Voucher` t2 where t2.name = %s and t1.parent = %s and t1.parenttype='Receivable Voucher' and t1.account_head = %s", (r[col_idx['ID']],r[col_idx['ID']], c))
tax = val and flt(val[0][0]) or 0
net_total = val and flt(val[0][1]) or 0
if tax != 0:
tax = amt*tax/net_total
total_tax += tax
r.append(tax)
r.append(total_tax)
r.append(amt + total_tax)
Loading…
Cancel
Save