Sourced wnframework-modules from Google Code as erpnext

This commit is contained in:
Pratik Vyas
2011-06-08 14:37:15 +05:30
commit c1e6e4c752
1680 changed files with 162635 additions and 0 deletions

View File

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company,GL Entry\x01Lft,GL Entry\x01Rgt',
'creation': '2010-08-08 17:09:31',
'criteria_name': 'Account - Inputs (R.G. 23 A - PART II) Wrong One',
'custom_query': '',
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'GL Entry',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':'','GL Entry\x01Company':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-03-20 17:02:13',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'account_-_inputs_rg_23_a_-_part_ii_wrong_one',
'owner': 'jai@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': '',
'server_script': None,
'sort_by': 'ID',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,22 @@
report.customize_filters = function() {
this.hide_all_filters();
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.filter_hide = 0;
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Payable Voucher', report_default:'Aging Date'});
this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:30});
this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:45});
this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:60});
this.add_filter({fieldname:'range_4', label:'Range 4', fieldtype:'Data', ignore : 1, parent:'GL Entry', report_default:90});
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default']=sys_defaults.year_start_date;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default']=dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
this.dt.set_no_limit(1);
}
this.mytabs.items['Select Columns'].hide()

View File

@@ -0,0 +1,141 @@
# Check mandatory filters
# ------------------------------------------------------------------
if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
msgprint("Please select From Posting Date and To Posting Date ")
raise Exception
else:
from_date = filter_values.get('posting_date')
to_date = filter_values.get('posting_date1')
if not filter_values['range_1'] or not filter_values['range_2'] or not filter_values['range_3'] or not filter_values['range_4']:
msgprint("Please select aging ranges in no of days in 'More Filters' ")
raise Exception
# validate Range
range_list = ['range_1','range_2','range_3','range_4']
for r in range(len(range_list)-1):
if not cint(filter_values[range_list[r]]) < cint(filter_values[range_list[r + 1]]):
msgprint("Range %s should be less than Range %s." % (cstr(r+1),cstr(r+2)))
raise Exception
# Add columns
# ------------------------------------------------------------------
data = [['Aging Date','Date','80px',''],
['Transaction Date','Date','80px',''],
['Account','Data','120px',''],
['Against Voucher Type','Data','120px',''],
['Against Voucher','Data','120px',''],
['Voucher Type','Data','120px',''],
['Voucher No','Data','120px',''],
['Remarks','Data','160px',''],
['Supplier Type', 'Data', '80px', ''],
['Due Date', 'Data', '80px', ''],
['Bill No','Data','80px',''],
['Bill Date','Data','80px',''],
['Opening Amt','Currency','120px',''],
['Outstanding Amt','Currency','120px',''],
['Age (Days)', 'Currency', '150px', ''],
['0-'+cstr(filter_values['range_1']),'Currency','100px',''],
[cstr(cint(filter_values['range_1']) + 1)+ '-' +cstr(filter_values['range_2']),'Currency','100px',''],
[cstr(cint(filter_values['range_2']) + 1)+ '-' +cstr(filter_values['range_3']),'Currency','100px',''],
[cstr(cint(filter_values['range_3']) + 1)+ '-' +cstr(filter_values['range_4']),'Currency','100px',''],
[cstr(filter_values['range_4']) + '-Above','Currency','100px','']]
for d in data:
colnames.append(d[0])
coltypes.append(d[1])
colwidths.append(d[2])
coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1
# ageing based on
# ------------------------------------------------------------------
aging_based_on = 'Aging Date'
if filter_values.has_key('aging_based_on') and filter_values['aging_based_on']:
aging_based_on = filter_values['aging_based_on'].split(NEWLINE)[-1]
if len(res) > 600 and from_export == 0:
msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
raise Exception
# ------------------------------------------------------------------
# main loop starts here
# ------------------------------------------------------------------
out = []
total_booking_amt, total_outstanding_amt = 0,0
for r in res:
# get supplier type
supplier_type = sql("select t1.supplier_type from tabSupplier t1, tabAccount t2 where t1.name = t2.account_name and t2.name = '%s'" % r[col_idx['Account']])
r.append(supplier_type and cstr(supplier_type[0][0]) or '')
outstanding_amt, booking_amt, due_date, bill_no, bill_date, cond = 0,0, '','','', ''
# if entry against Payable Voucher
if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Payable Voucher':
due_date, bill_no, bill_date = [cstr(t) for t in sql("select due_date,bill_no,bill_date from `tabPayable Voucher` where name = %s", r[col_idx['Voucher No']])[0]]
# get opening
booking_amt = sql("select credit from `tabGL Entry` where account = %s and voucher_no = %s and is_cancelled = 'No'", (r[col_idx['Account']], r[col_idx['Voucher No']]))
booking_amt = booking_amt and flt(booking_amt[0][0]) or 0
cond = " and against_voucher = '%s' and against_voucher is not null" % r[col_idx['Against Voucher']]
# if entry against JV & and not adjusted within period
elif r[col_idx['Against Voucher Type']] == 'Payable Voucher' and sql("select name from `tabPayable Voucher` where name = '%s' and (posting_date < '%s' or posting_date > '%s') and docstatus = 1" % (r[col_idx['Against Voucher']], from_date, to_date)):
cond = " and voucher_no = '%s' and ifnull(against_voucher, '') = '%s'" % (r[col_idx['Voucher No']], r[col_idx['Against Voucher']])
# if un-adjusted
elif not r[col_idx['Against Voucher']]:
cond = " and ((voucher_no = '%s' and ifnull(against_voucher, '') = '') or (ifnull(against_voucher, '') = '%s' and voucher_type = 'Journal Voucher'))" % (r[col_idx['Voucher No']], r[col_idx['Voucher No']])
if cond:
outstanding_amt = flt(sql("select sum(ifnull(credit, 0))-sum(ifnull(debit, 0)) from `tabGL Entry` where account = '%s' and ifnull(is_cancelled, 'No') = 'No' and posting_date <= '%s' %s" % (r[col_idx['Account']], to_date, cond))[0][0] or 0)
# add to total outstanding
total_outstanding_amt += flt(outstanding_amt)
# add to total booking amount
if outstanding_amt and r[col_idx['Voucher Type']] == 'Payable Voucher' and r[col_idx['Against Voucher']]:
total_booking_amt += flt(booking_amt)
r += [due_date, bill_no, bill_date, booking_amt, outstanding_amt]
# split into date ranges
val_l1 = val_l2 = val_l3 = val_l4 = val_l5_above= 0
if r[col_idx[aging_based_on]]:
diff = (getdate(to_date) - getdate(r[col_idx[aging_based_on]])).days
if diff < cint(filter_values['range_1']):
val_l1 = outstanding_amt
if diff >= cint(filter_values['range_1']) and diff < cint(filter_values['range_2']):
val_l2 = outstanding_amt
if diff >= cint(filter_values['range_2']) and diff < cint(filter_values['range_3']):
val_l3 = outstanding_amt
if diff >= cint(filter_values['range_3']) and diff < cint(filter_values['range_4']):
val_l4 = outstanding_amt
if diff >= cint(filter_values['range_4']):
val_l5_above = outstanding_amt
r += [diff, val_l1, val_l2, val_l3, val_l4, val_l5_above]
# Only show that entry which has outstanding
if abs(flt(outstanding_amt)) > 0.001:
out.append(r)
if len(out) > 300 and from_export == 0:
msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
raise Exception
# Append Extra rows to RES
# ------------------------------------------------------------------
t_row = ['' for i in range(len(colnames))]
t_row[col_idx['Voucher No']] = 'Total'
t_row[col_idx['Opening Amt']] = total_booking_amt
t_row[col_idx['Outstanding Amt']] = total_outstanding_amt
out.append(t_row)

View File

@@ -0,0 +1,11 @@
SELECT DISTINCT `tabGL Entry`.`Aging_date`,`tabGL Entry`.`transaction_date`,`tabGL Entry`.`account`, `tabGL Entry`.`against_voucher_type`, `tabGL Entry`.`against_voucher`,`tabGL Entry`.`voucher_type`,`tabGL Entry`.`voucher_no`, `tabGL Entry`.remarks
FROM `tabGL Entry`,`tabAccount`
WHERE `tabGL Entry`.`posting_date`>= '%(posting_date)s'
AND `tabGL Entry`.`posting_date`<= '%(posting_date1)s'
AND `tabGL Entry`.`account` LIKE '%(account)s%%'
AND `tabGL Entry`.`company` LIKE '%(company)s%%'
AND ((ifnull(`tabGL Entry`.voucher_type,'') = 'Payable Voucher' and `tabGL Entry`.credit>0) OR `tabGL Entry`.voucher_type = 'Journal Voucher')
AND `tabGL Entry`.`is_cancelled` = 'No'
AND `tabAccount`.master_type = 'Supplier'
AND `tabAccount`.name = `tabGL Entry`.account
ORDER BY `tabGL Entry`.`posting_date`

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': '',
'add_tab': '',
'columns': 'GL Entry\x01Posting Date,GL Entry\x01Account,GL Entry\x01Against Voucher,GL Entry\x01Voucher No',
'creation': '2010-10-22 16:29:40',
'criteria_name': 'Accounts Payable',
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'GL Entry',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Is Cancelled':'','GL Entry\x01Fiscal Year':'','GL Entry\x01Company':'','Payable Voucher\x01Aging Based On':'Posting Date','GL Entry\x01Range 1':'30','GL Entry\x01Range 2':'45','GL Entry\x01Range 3':'60','GL Entry\x01Range 4':'90'}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-10-22 15:16:03',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'accounts_payable',
'owner': 'Administrator',
'page_len': None,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabGL Entry`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,22 @@
report.customize_filters = function() {
this.hide_all_filters();
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.filter_hide = 0;
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date'+NEWLINE+'Due Date',ignore : 1, parent:'Receivable Voucher', report_default:'Aging Date'});
this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'range_4', label:'Range 4', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default']=sys_defaults.year_start_date;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default']=dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
this.dt.set_no_limit(1);
}
this.mytabs.items['Select Columns'].hide()

View File

@@ -0,0 +1,132 @@
# Check mandatory filters
#------------------------------
if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
msgprint("Please select From Posting Date and To Posting Date in 'Set Filters' section")
raise Exception
else:
from_date = filter_values.get('posting_date')
to_date = filter_values.get('posting_date1')
if not filter_values['range_1'] or not filter_values['range_2'] or not filter_values['range_3'] or not filter_values['range_4']:
msgprint("Please select aging ranges in no of days in 'Set Filters' section")
raise Exception
# validate Range
range_list = ['range_1','range_2','range_3','range_4']
for r in range(len(range_list)-1):
if not cint(filter_values[range_list[r]]) < cint(filter_values[range_list[r + 1]]):
msgprint("Range %s should be less than Range %s." % (cstr(r+1),cstr(r+2)))
raise Exception
# Add columns
# -----------
data = [['Transaction Date','Date','80px',''],
['Aging Date','Date','80px',''],
['Account','Data','120px',''],
['Against Voucher Type','Data','120px',''],
['Against Voucher','Data','120px',''],
['Voucher Type','Data','120px',''],
['Voucher No','Data','120px',''],
['Remarks','Data','160px',''],
['Territory','Data','120px',''],
['Due Date', 'Date', '80px', ''],
['Opening Amt','Currency','120px',''],
['Outstanding Amt','Currency','120px',''],
['Age (Days)', 'Data', '60px', ''],
['0-'+cstr(filter_values['range_1']),'Currency','100px',''],
[cstr(cint(filter_values['range_1']) + 1)+ '-' +cstr(filter_values['range_2']),'Currency','100px',''],
[cstr(cint(filter_values['range_2']) + 1)+ '-' +cstr(filter_values['range_3']),'Currency','100px',''],
[cstr(cint(filter_values['range_3']) + 1)+ '-' +cstr(filter_values['range_4']),'Currency','100px',''],
[cstr(filter_values['range_4']) + '-Above','Currency','100px','']]
for d in data:
colnames.append(d[0])
coltypes.append(d[1])
colwidths.append(d[2])
coloptions.append(d[3])
col_idx[d[0]] = len(colnames)-1
# ageing based on
aging_based_on = filter_values.get('aging_based_on') and filter_values['aging_based_on'].split(NEWLINE)[-1] or 'Aging Date'
if len(res) > 600 and from_export == 0:
msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
raise Exception
# ------------------------------------------------------------------
# main loop starts here
# ------------------------------------------------------------------
out = []
total_opening_amt,total_outstanding_amt = 0,0
for r in res:
# get customer territory
terr = sql("select t1.territory from `tabCustomer` t1, `tabAccount` t2 where t1.name = t2.master_name and t2.name = '%s'" % r[col_idx['Account']])
r.append(terr and terr[0][0] or '')
outstanding_amt, opening_amt, cond, due_date = 0,0, '', ''
# if entry against Receivable Voucher
if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Receivable Voucher':
# get due date
due_date = sql("select due_date from `tabReceivable Voucher` where name = '%s'" % r[col_idx['Against Voucher']])
due_date = due_date and cstr(due_date[0][0]) or ''
# get booking amt
opening_amt = sql("select debit from `tabGL Entry` where account = '%s' and voucher_no = '%s' and is_cancelled = 'No'" % (r[col_idx['Account']], r[col_idx['Voucher No']]))
opening_amt = opening_amt and flt(opening_amt[0][0]) or 0
cond = "and against_voucher = '%s' and against_voucher is not null" % r[col_idx['Against Voucher']]
# if entry against JV & and not adjusted within period
elif r[col_idx['Against Voucher Type']] == 'Receivable Voucher' and sql("select name from `tabReceivable Voucher` where name = '%s' and (posting_date < '%s' or posting_date > '%s') and docstatus = 1" % (r[col_idx['Against Voucher']], from_date, to_date)):
cond = " and voucher_no = '%s' and ifnull(against_voucher, '') = '%s'" % (r[col_idx['Voucher No']], r[col_idx['Against Voucher']])
# if entry against JV and unadjusted
elif not r[col_idx['Against Voucher']]:
cond = " and ((voucher_no = '%s' and ifnull(against_voucher, '') = '') or (ifnull(against_voucher, '') = '%s' and voucher_type = 'Journal Voucher'))" % (r[col_idx['Voucher No']], r[col_idx['Voucher No']])
if cond:
outstanding_amt = flt(sql("select ifnull(sum(debit),0) - ifnull(sum(credit),0) from `tabGL Entry` where account = '%s' and ifnull(is_cancelled, 'No') = 'No' and posting_date <= '%s' %s" % (r[col_idx['Account']], to_date, cond))[0][0] or 0)
# add to total outstanding
total_outstanding_amt += flt(outstanding_amt)
# add to total booking amount
if outstanding_amt and r[col_idx['Voucher Type']] == 'Receivable Voucher' and r[col_idx['Against Voucher']]:
total_opening_amt += flt(opening_amt)
r += [due_date, opening_amt, outstanding_amt]
#Ageing Outstanding
val_l1 = val_l2 = val_l3 = val_l4 = val_l5_above = 0
diff = 0
if r[col_idx[aging_based_on]]:
diff = (getdate(to_date) - getdate(r[col_idx[aging_based_on]])).days
if diff < cint(filter_values['range_1']):
val_l1 = outstanding_amt
if diff >= cint(filter_values['range_1']) and diff < cint(filter_values['range_2']):
val_l2 = outstanding_amt
if diff >= cint(filter_values['range_2']) and diff < cint(filter_values['range_3']):
val_l3 = outstanding_amt
if diff >= cint(filter_values['range_3']) and diff < cint(filter_values['range_4']):
val_l4 = outstanding_amt
if diff >= cint(filter_values['range_4']):
val_l5_above = outstanding_amt
r += [diff, val_l1, val_l2, val_l3, val_l4, val_l5_above]
# Only show that entry which has outstanding
if abs(flt(outstanding_amt)) > 0.001:
out.append(r)
if len(out) > 300 and from_export == 0:
msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
raise Exception
# Append Extra rows to RES
if len(out) > 0:
t_row = ['' for i in range(len(colnames))]
t_row[col_idx['Voucher No']] = 'Total'
t_row[col_idx['Opening Amt']] = total_opening_amt
t_row[col_idx['Outstanding Amt']] = total_outstanding_amt
out.append(t_row)

View File

@@ -0,0 +1,11 @@
SELECT `tabGL Entry`.`transaction_date`,`tabGL Entry`.`aging_date`,`tabGL Entry`.`account`, `tabGL Entry`.`against_voucher_type`, `tabGL Entry`.`against_voucher`,`tabGL Entry`.`voucher_type`,`tabGL Entry`.`voucher_no`, `tabGL Entry`.remarks
FROM `tabGL Entry`,`tabAccount`
WHERE `tabGL Entry`.`posting_date`>= '%(posting_date)s'
AND `tabGL Entry`.`posting_date`<= '%(posting_date1)s'
AND `tabGL Entry`.`account` LIKE '%(account)s%%'
AND `tabGL Entry`.`company` LIKE '%(company)s%%'
AND ((`tabGL Entry`.voucher_type = 'Receivable Voucher' and `tabGL Entry`.debit>0) OR `tabGL Entry`.voucher_type = 'Journal Voucher')
AND `tabGL Entry`.`is_cancelled` = 'No'
AND `tabAccount`.master_type = 'Customer'
AND `tabAccount`.name = `tabGL Entry`.account
ORDER BY `tabGL Entry`.`posting_date`

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': '',
'add_tab': '',
'columns': 'GL Entry\x01Posting Date,GL Entry\x01Transaction Date,GL Entry\x01Account,GL Entry\x01Against Voucher,GL Entry\x01Voucher No',
'creation': '2010-10-19 10:32:38',
'criteria_name': 'Accounts Receivable',
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'GL Entry',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Is Cancelled':'No','GL Entry\x01Fiscal Year':'','GL Entry\x01Company':'','GL Entry\x01Range 1':'30','GL Entry\x01Range 2':'45','GL Entry\x01Range 3':'60','GL Entry\x01Range 4':'90'}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-10-19 10:29:38',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'accounts_receivable',
'owner': 'Administrator',
'page_len': None,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabGL Entry`.`name`',
'sort_order': 'ASC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,34 @@
report.customize_filters = function() {
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Voucher Type'].df.in_first_page = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Clearance Date'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Clearance Date'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'ID'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Owner'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Saved'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Submitted'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Cancelled'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Against Receivable'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'TDS Category'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Cost Center'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Against Payable'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Owner'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'TDS Applicable'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Is Opening'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Total Debit >='].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Total Debit <='].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Total Credit >='].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Total Credit <='].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'User Remark'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Voucher Date'].df.filter_hide = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Voucher Date'].df.filter_hide = 1;
}
this.mytabs.items['More Filters'].hide()

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'Journal Voucher\x01ID,Journal Voucher Detail\x01Account,Journal Voucher Detail\x01Debit,Journal Voucher Detail\x01Credit,Journal Voucher\x01Clearance Date,Journal Voucher\x01Cheque No,Journal Voucher\x01Cheque Date,Journal Voucher\x01Voucher Date,Journal Voucher\x01Posting Date,Journal Voucher Detail\x01Against Payable,Journal Voucher Detail\x01Against Receivable',
'creation': '2010-08-08 17:09:31',
'criteria_name': 'Bank Clearance report',
'custom_query': '',
'description': 'Bank Clearance report',
'dis_filters': 'fiscal_year',
'disabled': None,
'doc_type': 'Journal Voucher Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Fiscal Year':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-06-09 16:14:13',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'bank_clearance_report',
'owner': 'Administrator',
'page_len': 50,
'parent': None,
'parent_doc_type': 'Journal Voucher',
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': 'ID',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,18 @@
report.customize_filters = function() {
this.hide_all_filters();
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Clearance Date'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Clearance Date'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Clearance Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.dt.set_no_limit(1);
}
this.mytabs.items['More Filters'].hide();

View File

@@ -0,0 +1,46 @@
#get company
company = filter_values.get('company') or get_defaults()['company']
# To date
if not filter_values.get('clearance_date1'):
msgprint('Please enter To Clearance Date')
raise Exception
else:
to_date = filter_values['clearance_date1']
#Fiscal year and year start date
#----------------------------------
ysd, fiscal_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_add(year_start_date,interval 1 year)",to_date)[0]
# Account
if not filter_values.get('account'):
msgprint('Please select Account in filter section')
raise Exception
else:
acc_name = filter_values.get('account')
if len(res) > 300 and from_export == 0:
msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please select Account or click on 'Export' to open in excel")
raise Exception
acc = sql("select debit_or_credit, is_pl_account, lft, rgt from tabAccount where name = '%s'" % acc_name)
opening = get_obj('GL Control').get_as_on_balance(acc_name, fiscal_year, to_date, acc[0][0], acc[0][2], acc[0][3])[2]
total_debit, total_credit = 0,0
out = []
for r in res:
total_debit = flt(total_debit) + flt(r[col_idx['Debit']])
total_credit = flt(total_credit) + flt(r[col_idx['Credit']])
out.append(r)
if acc and acc[0][0] == 'Debit':
bank_bal = flt(opening)-flt(total_debit)+flt(total_credit)
else:
bank_bal = flt(opening)+flt(total_debit)-flt(total_credit)
out.append(['','','','','','<font color = "#000"><b>Balance as per Company Books: </b></font>', opening,'',''])
out.append(['','','','','','<font color = "#000"><b>Amounts not reflected in Bank: </b></font>', total_debit,total_credit,''])
out.append(['','','','','','<font color = "#000"><b>Balance as per Bank: </b></font>', bank_bal,'',''])

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': "(`tabJournal Voucher Detail`.credit >= 0 or `tabJournal Voucher Detail`.credit is null)\n(`tabJournal Voucher`.cheque_no is not null or `tabJournal Voucher`.cheque_no != '')\n(ifnull(`tabJournal Voucher`.clearance_date, '0000-00-00') >'%(clearance_date1)s' or `tabJournal Voucher`.clearance_date is null or `tabJournal Voucher`.clearance_date = '0000-00-00')\n(`tabJournal Voucher`.posting_date <= '%(clearance_date1)s')",
'add_tab': None,
'columns': 'Journal Voucher\x01ID,Journal Voucher\x01Posting Date,Journal Voucher\x01Cheque No,Journal Voucher\x01Cheque Date,Journal Voucher\x01Clearance Date,Journal Voucher Detail\x01Account,Journal Voucher Detail\x01Debit,Journal Voucher Detail\x01Credit,Journal Voucher Detail\x01Against Account',
'creation': '2010-11-01 10:56:13',
'criteria_name': 'Bank Reconciliation Statement',
'custom_query': '',
'description': None,
'dis_filters': 'clearance_date\nfiscal_year',
'disabled': None,
'doc_type': 'Journal Voucher Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-10-29 16:36:00',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'bank_reconciliation_statement',
'owner': 'Administrator',
'page_len': 50,
'parent': None,
'parent_doc_type': 'Journal Voucher',
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabJournal Voucher`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,17 @@
report.customize_filters = function() {
//this.hide_all_filters();
this.mytabs.items['Select Columns'].hide();
this.mytabs.items['More Filters'].hide();
this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Budget Detail'});
this.filter_fields_dict['Budget Detail'+FILTER_SEP +'Fiscal Year'].df.in_first_page = 1;
this.filter_fields_dict['Budget Detail'+FILTER_SEP +'Period'].df.in_first_page = 1;
this.filter_fields_dict['Budget Detail'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
}
report.aftertableprint = function(t) {
$yt(t,'*',1,{whiteSpace:'pre'});
}
this.mytabs.items['Select Columns'].hide();

View File

@@ -0,0 +1,173 @@
# validate Filters
flt_dict = {'fiscal_year': 'Fiscal Year', 'period': 'Period'}
for f in flt_dict:
if not filter_values.get(f):
msgprint("Please Select " + cstr(flt_dict[f]))
raise Exception
# Get Values from fliters
fiscal_year = filter_values.get('fiscal_year')
period = filter_values.get('period')
under = "GL Entry"
based_on = "Cost Center"
#add distributed id field
col = []
col.append([based_on,'Date','150px',''])
col.append(['Budget Allocated','Currency','150px',''])
col.append(['Distribution Id','Date','150px',''])
for c in col:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append(c[3])
col_idx[c[0]] = len(colnames)-1
def make_child_lst(based_on,name):
rg = sql("select lft, rgt from `tab%s` where name = '%s'"%(based_on,name))
ch_name = sql("select name from `tab%s` where lft between %d and %d"%(based_on,int(rg[0][0]),int(rg[0][1])))
chl ='('
flag = 1
for c in ch_name:
if flag == 1:
chl += "'%s'"%c[0]
flag = 2
else:
chl +=",'%s'"%c[0]
chl +=")"
return chl
for r in res:
cond1 =" t1.fiscal_year ='%s' and t1.parent=t2.name and t1.parenttype = '%s' and t1.docstatus !=2"
q = "select t1.name from `tabBudget Detail` t1, `tab%s` t2 where "+cond1+" and t2.name = '%s'"
ch = sql(q%(based_on,fiscal_year,based_on,r[0].strip()))
q1 = "select sum(t1.budget_allocated) from `tabBudget Detail` t1, `tab%s` t2, `tabAccount` t3 where "
cond2 = " t3.is_pl_account = 'Yes' and t3.debit_or_credit = 'Debit' and t3.name = t1.account and t1.docstatus != 2 and "
if ch:
qur = q1+cond2+cond1+" and t2.name = '%s'"
ret_amt = sql(qur%(based_on,fiscal_year,based_on,r[0].strip()))
#----------------------------------------------------------------
else:
node_lst = make_child_lst(based_on,r[0].strip())
qur = q1+cond1+' and '+cond2+" t2.name in %s"
ret_amt = sql(qur%(based_on,fiscal_year,based_on,node_lst))
#----------------------------------------------------------------
ret_dis_id = sql("select distribution_id from `tab%s` where name = '%s'"%(based_on,r[0].strip()))
target_amt = ret_amt and flt(ret_amt[0][0]) or 0
dis_id = ret_dis_id and ret_dis_id[0][0] or ''
r.append(target_amt)
r.append(dis_id)
# Set required field names
based_on_fn = 'cost_center'
date_fn = 'posting_date'
mon_list = []
data = {'start_date':0, 'end_date':1}
def make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx):
count = 1
if period == 'Quarterly' or period == 'Half Yearly' or period == 'Annual': mon_list.append([str(start_date)])
for m in range(12):
# get last date
last_date = str(sql("select LAST_DAY('%s')" % start_date)[0][0])
# make mon_list for Monthly Period
if period == 'Monthly' :
mon_list.append([start_date, last_date])
# add months as Column names
month_name = sql("select MONTHNAME('%s')" % start_date)[0][0]
append_colnames(str(month_name)[:3], colnames, coltypes, colwidths, coloptions, col_idx)
# get start date
start_date = str(sql("select DATE_ADD('%s',INTERVAL 1 DAY)" % last_date)[0][0])
# make mon_list for Quaterly Period
if period == 'Quarterly' and count % 3 == 0:
mon_list[len(mon_list) - 1 ].append(last_date)
# add Column names
append_colnames('Q '+ str(count / 3), colnames, coltypes, colwidths, coloptions, col_idx)
if count != 12: mon_list.append([start_date])
# make mon_list for Half Yearly Period
if period == 'Half Yearly' and count % 6 == 0 :
mon_list[len(mon_list) - 1 ].append(last_date)
# add Column Names
append_colnames('H'+str(count / 6), colnames, coltypes, colwidths, coloptions, col_idx)
if count != 12: mon_list.append([start_date])
# make mon_list for Annual Period
if period == 'Annual' and count % 12 == 0:
mon_list[len(mon_list) - 1 ].append(last_date)
# add Column Names
append_colnames('', colnames, coltypes, colwidths, coloptions, col_idx)
count = count +1
def append_colnames(name, colnames, coltypes, colwidths, coloptions, col_idx):
col = ['Target', 'Actual', 'Variance']
for c in col:
n = str(name) and ' (' + str(name) +')' or ''
colnames.append(str(c) + n)
coltypes.append('Currency')
colwidths.append('150px')
coloptions.append('')
col_idx[str(c) + n ] = len(colnames) - 1
# make default columns
#coltypes[col_idx[based_on]] = 'Link'
#coloptions[col_idx[based_on]]= based_on
# get start date
start_date = get_value('Fiscal Year', fiscal_year, 'year_start_date')
if not start_date:
msgprint("Please Define Year Start Date for Fiscal Year " + str(fiscal_year))
raise Exception
start_date = start_date.strftime('%Y-%m-%d')
# make month list and columns
make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx)
bc_obj = get_obj('Budget Control')
for r in res:
count = 0
for idx in range(3, len(colnames), 3):
cidx = 2
# ================= Calculate Target ==========================================
r.append(bc_obj.get_monthly_budget( r[cidx], fiscal_year, mon_list[count][data['start_date']], mon_list[count][data['end_date']], r[cidx-1]))
#================== Actual Amount =============================================
actual = 0
ch = make_child_lst(based_on,r[0].strip())
actual = sql("select sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) from `tabGL Entry` t1, `tabAccount` t2 where t2.is_pl_account = 'Yes' and t1.is_cancelled = 'No' and t1.cost_center in %s and t2.debit_or_credit = 'Debit' and t1.posting_date between '%s' and '%s' and t1.account = t2.name"%(ch, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
#----------------------------------------------------------
actual = flt(actual[0][0])
r.append(actual)
# ================ Variance ===================================================
r.append(r[idx] - r[idx + 1])
count = count +1

View File

@@ -0,0 +1 @@
SELECT CONCAT(REPEAT(' ', COUNT(parent.name) - 1), node.name) AS name FROM `tabCost Center` AS node,`tabCost Center` AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.docstatus !=2 GROUP BY node.name ORDER BY node.lft

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': '',
'creation': '2010-09-01 15:47:57',
'criteria_name': 'Budget Variance Report',
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'Budget Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Budget Detail\x01Fiscal Year':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-09-01 15:05:50',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'budget_variance_report',
'owner': 'harshada@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': 'Cost Center',
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabCost Center`.`lft`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,9 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', report_default:sys_defaults.fiscal_year, parent:'Budget Detail'});
this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company',report_default:sys_defaults.company, ignore : 1, parent:'Budget Detail'});
this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Budget Detail'});
this.add_filter({fieldname:'cost_center', label:'Cost Center', fieldtype:'Link', options:'Cost Center', parent:'Budget Detail'});
this.add_filter({fieldname:'account_head', label:'Account', fieldtype:'Link', options:'Account', parent:'Budget Detail'});
}
this.mytabs.items['Select Columns'].hide()

View File

@@ -0,0 +1,88 @@
# use This in Query
# AND `tabAccount`.debit_or_credit = "Debit" AND `tabAccount`.`is_pl_account` = "Yes"
# validate Filters
if not filter_values.get('fiscal_year'):
msgprint("Please Select Fiscal Year")
raise Exception
if not filter_values.get('period'):
msgprint("Please Select Period")
raise Exception
# Get Values from fliters
fiscal_year = filter_values.get('fiscal_year')
period = filter_values.get('period')
mon_list = []
data = {'start_date':0, 'end_date':1}
def make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx):
count = 1
if period == 'Quarterly' or period == 'Half Yearly' or period == 'Annual': mon_list.append([str(start_date)])
for m in range(12):
# get last date
last_date = str(sql("select LAST_DAY('%s')" % start_date)[0][0])
# make mon_list
if period == 'Monthly' :
mon_list.append([start_date, last_date])
# add months as Column names
month_name = sql("select MONTHNAME('%s')" % start_date)[0][0]
append_colnames(str(month_name)[:3], colnames, coltypes, colwidths, coloptions, col_idx)
# get start date
start_date = str(sql("select DATE_ADD('%s',INTERVAL 1 DAY)" % last_date)[0][0])
if period == 'Quarterly' and count % 3 == 0:
mon_list[len(mon_list) - 1 ].append(last_date)
# add Column names
append_colnames('Q '+ str(count / 3), colnames, coltypes, colwidths, coloptions, col_idx)
if count != 12: mon_list.append([start_date])
if period == 'Half Yearly' and count % 6 == 0 :
mon_list[len(mon_list) - 1 ].append(last_date)
# add Column Names
append_colnames('H'+str(count / 6), colnames, coltypes, colwidths, coloptions, col_idx)
if count != 12: mon_list.append([start_date])
if period == 'Annual' and count % 12 == 0:
mon_list[len(mon_list) - 1 ].append(last_date)
append_colnames('', colnames, coltypes, colwidths, coloptions, col_idx)
count = count +1
def append_colnames(name, colnames, coltypes, colwidths, coloptions, col_idx):
col = ['Budget', 'Actual', 'Variance']
for c in col:
colnames.append(str(c) + ' (' + str(name) +')' )
coltypes.append('Currency')
colwidths.append('150px')
coloptions.append('')
col_idx[str(c) + ' (' + str(name) +')' ] = len(colnames) - 1
col = ['Cost Center', 'Account', 'Budget Allocated', 'Distribution Id']
for c in col:
colnames.append(str(c))
coltypes.append((c=='Budget Allocated') and'Currency' or 'Link')
colwidths.append('150px')
coloptions.append((c=='Budget Allocated') and '' or (c == 'Distribution Id') and 'Budget Distribution' or c)
col_idx[str(c)] = len(colnames) - 1
start_date = get_value('Fiscal Year', fiscal_year, 'year_start_date')
if not start_date:
msgprint("Please Define Year Start Date for Fiscal Year " + str(fiscal_year))
raise Exception
start_date = start_date.strftime('%Y-%m-%d')
make_month_list(append_colnames, start_date, mon_list, period, colnames, coltypes, colwidths, coloptions, col_idx)
# Get Object Of GL Control
glc_obj = get_obj('GL Control')
bc_obj = get_obj('Budget Control')
for r in res:
count = 0
for idx in range(4, len(colnames), 3):
r.append(bc_obj.get_monthly_budget( r[3], fiscal_year, mon_list[count][data['start_date']], mon_list[count][data['end_date']], r[2]))
r.append(glc_obj.get_period_difference(r[1] + '~~~' + mon_list[count][data['start_date']] + '~~~' + mon_list[count][data['end_date']], r[0]))
r.append(r[idx] - r[idx + 1])
count = count +1

View File

@@ -0,0 +1 @@
select t2.name, t1.account, t1.budget_allocated, t1.distribution_id from `tabBudget Detail` t1, `tabCost Center` t2 where t1.fiscal_year = '%(fiscal_year)s' and t1.parent = t2.name and t2.name like '%(cost_center)s%%' and t1.account like '%(account_head)s%%' and t2.docstatus != 2

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'Cost Center\x01ID,Budget Detail\x01Account,Budget Detail\x01Fiscal Year,Budget Detail\x01Budget Allocated,Budget Detail\x01Actual,Budget Detail\x01Distribution ID',
'creation': '2010-08-08 17:09:31',
'criteria_name': 'Budget Variance Report1',
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'Budget Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Budget Detail\x01Fiscal Year':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-07-28 14:52:44',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'budget_variance_report1',
'owner': 'jai@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': 'Cost Center',
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabCost Center`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,10 @@
report.customize_filters = function() {
this.hide_all_filters();
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Sales Partner'].df.filter_hide = 0;
this.filter_fields_dict['Receivable Voucher'+FILTER_SEP +'Sales Partner'].df.in_first_page = 1;
}
this.mytabs.items['Select Columns'].hide();
this.mytabs.items['More Filters'].hide();

View File

@@ -0,0 +1,10 @@
colwidths[col_idx['Business Associate']] = '200px'
coltypes[col_idx['Average Commission Rate']] = 'Currency'
colwidths[col_idx['Average Commission Rate']] = '200px'
coltypes[col_idx['Net Total']] = 'Currency'
colwidths[col_idx['Net Total']] = '150px'
coltypes[col_idx['Total Commission']] = 'Currency'
colwidths[col_idx['Total Commission']] = '150px'

View File

@@ -0,0 +1,37 @@
[
{
'add_col': "SUM(`tabReceivable Voucher`.`total_commission`) AS 'Total Commission'\nSUM(`tabReceivable Voucher`.`net_total`) AS 'Net Total'\n((SUM(`tabReceivable Voucher`.`total_commission`) / SUM(`tabReceivable Voucher`.`net_total`)) * 100) AS 'Average Commission Rate'",
'add_cond': '`tabReceivable Voucher`.`net_total` > 0\n`tabReceivable Voucher`.`total_commission` > 0',
'add_tab': None,
'columns': 'Receivable Voucher\x01Business Associate',
'creation': '2010-08-26 11:52:27',
'criteria_name': 'Business Associate Commission Report',
'custom_query': '',
'description': 'Track total commission given to your Business Associate',
'dis_filters': None,
'disabled': None,
'doc_type': 'Receivable Voucher',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Receivable Voucher\x01Submitted':1}",
'graph_series': None,
'graph_values': None,
'group_by': '`tabReceivable Voucher`.sales_partner',
'idx': None,
'modified': '2010-08-26 11:49:50',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'business_associate_commission_report',
'owner': 'saumil@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,18 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'show_group_balance', label:'Show Group Balance', fieldtype:'Select', options:NEWLINE+'Yes'+NEWLINE+'No',ignore : 1, parent:'Account'});
this.add_filter({fieldname:'level', label:'Level', fieldtype:'Data', default:3,ignore : 1, parent:'Account'});
this.add_filter({fieldname:'from_date', label:'Date', fieldtype:'Date', parent:'Account'});
this.filter_fields_dict['Account'+FILTER_SEP +'Company'].df.filter_hide = 0;
//this.filter_fields_dict['Account'+FILTER_SEP +'From Date'].df.filter_hide = 0;
//this.filter_fields_dict['Account'+FILTER_SEP +'To Date'].df.filter_hide = 0;
//this.large_report = 1;
}
report.aftertableprint = function(t) {
$yt(t,'*',1,{whiteSpace:'pre'});
}

View File

@@ -0,0 +1,110 @@
cl = [['Account','Data', '200px'],['Debit/Credit', 'Data', '100px'], ['Group/Ledger', 'Data', '100px'], ['Opening','Data', '100px'],['Closing', 'Data', '100px'],['Inc in Cash','Data','100px']]
for c in cl:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append('')
col_idx[c[0]] = len(colnames)-1
company = filter_values['company']
# transaction date
if not filter_values.get('transaction_date') or not filter_values.get('transaction_date1'):
msgprint("Please enter From Date and To Date")
raise Exception
else:
from_date = add_days(filter_values['transaction_date'], -1)
to_date = filter_values['transaction_date1']
ysd, fiscal_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_add(year_start_date,interval 1 year)",from_date)[0]
if from_export == 0 and len(res) >250:
msgprint("This is very large report and cannot be shown in the browser as it is likely to make your browser very slow. Please click on 'Export' to open in excel")
raise Exception
total_debit, total_credit, total = 0,0,0
glc = get_obj('GL Control')
for r in res:
acc = r[col_idx['Account']].strip()
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % acc)
r.append(acc_det[0][0])
r.append(acc_det[0][4])
opening = glc.get_as_on_balance(acc, fiscal_year, from_date, acc_det[0][0], acc_det[0][2], acc_det[0][3])[2]
amount = sql("select sum(t1.debit), sum(t1.credit) from `tabGL Entry` t1, `tabAccount` t2 WHERE t1.posting_date >= '%s' AND t1.posting_date <= '%s' and ifnull(t1.is_opening,'No') = 'No' AND t1.account = t2.name AND t2.lft >= %s AND t2.rgt <= %s AND is_cancelled = 'No'" % (from_date,to_date, acc_det[0][2], acc_det[0][3]))
if acc_det[0][0] == 'Debit':
closing = opening + flt(amount[0][0]) - flt(amount[0][1])
else:
closing = opening + flt(amount[0][1]) - flt(amount[0][0])
r.append(fmt_money(flt(opening)))
r.append(fmt_money(flt(closing)))
diff = flt(closing) - flt(opening)
if acc_det[0][0]=='Debit':
r.append(fmt_money(-diff))
total -= diff
else:
r.append(fmt_money(diff))
total += diff
# net profit
# ------------------
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where account_name = %s AND company=%s", ('Income',company))
amount = sql("select sum(t1.debit), sum(t1.credit) from `tabGL Entry` t1, `tabAccount` t2 WHERE t1.posting_date >= '%s' AND t1.posting_date <= '%s' and ifnull(t1.is_opening,'No') = 'No' AND t1.account = t2.name AND t2.lft >= %s AND t2.rgt <= %s AND is_cancelled = 'No'" % (from_date,to_date, acc_det[0][2], acc_det[0][3]))
net_income = flt(amount[0][1]) - flt(amount[0][0])
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where account_name = %s AND company=%s", ('Expenses',company))
amount = sql("select sum(t1.debit), sum(t1.credit) from `tabGL Entry` t1, `tabAccount` t2 WHERE t1.posting_date >= '%s' AND t1.posting_date <= '%s' and ifnull(t1.is_opening,'No') = 'No' AND t1.account = t2.name AND t2.lft >= %s AND t2.rgt <= %s AND is_cancelled = 'No'" % (from_date,to_date, acc_det[0][2], acc_det[0][3]))
net_expenses = flt(amount[0][0]) - flt(amount[0][1])
t_row = ['' for i in range(len(colnames))]
t_row[col_idx['Account']] = 'Net Profit'
t_row[col_idx['Inc in Cash']] = fmt_money(net_income - net_expenses)
total += net_income - net_expenses
res.append(t_row)
# total row
# ------------------
t_row = ['' for i in range(len(colnames))]
t_row[col_idx['Account']] = 'Total Cash Generated'
t_row[col_idx['Inc in Cash']] = fmt_money(total)
res.append(t_row)
# Show Inc / Dec in Bank and Cash Accounts
# ----------------------------------------
t_row = ['' for i in range(len(colnames))]
res.append(t_row)
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger, name from tabAccount where account_type = 'Bank or Cash' AND company=%s AND level=%s", (company, cint(filter_values['level'])))
for acc in acc_det:
r = [acc[5],]
opening = glc.get_as_on_balance(acc[5], fiscal_year, from_date, acc[0], acc[2], acc[3])[2]
amount = sql("select sum(t1.debit), sum(t1.credit) from `tabGL Entry` t1, `tabAccount` t2 WHERE t1.posting_date >= '%s' AND t1.posting_date <= '%s' and ifnull(t1.is_opening,'No') = 'No' AND t1.account = t2.name AND t2.lft >= %s AND t2.rgt <= %s AND is_cancelled = 'No'" % (from_date,to_date, acc[2], acc[3]))
closing = opening + flt(amount[0][0]) - flt(amount[0][1])
diff = closing - opening
r.append(acc_det[0][0])
r.append(acc_det[0][4])
r.append(fmt_money(flt(opening)))
r.append(fmt_money(flt(closing)))
r.append(fmt_money(diff))
res.append(r)

View File

@@ -0,0 +1,9 @@
SELECT
DISTINCT node.name AS name
FROM tabAccount AS node, tabAccount AS parent
WHERE node.lft BETWEEN parent.lft AND parent.rgt
AND node.company = '%(company)s'
AND node.is_pl_account = 'No'
AND node.level=%(level)s
AND ifnull(node.account_type,'') != 'Bank or Cash'
ORDER BY node.lft

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': '',
'add_tab': None,
'columns': 'Account\x01ID',
'creation': '2010-11-01 10:56:13',
'criteria_name': 'Cash Flow Statement',
'custom_query': None,
'description': '',
'dis_filters': 'fiscal_year\ntransaction_date',
'disabled': None,
'doc_type': 'Account',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Account\x01Group or Ledger':'Ledger','Account\x01Is PL Account':'','Account\x01Is Active':'','Account\x01Account Type':'','Account\x01Company':'','Account\x01Fiscal Year':'','Account\x01Show Group Balance':'','Account\x01Level':'2'}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-10-29 16:39:19',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'cash_flow_statement',
'owner': 'Administrator',
'page_len': None,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabAccount`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,20 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'report', label:'Report Type', fieldtype:'Select', options:NEWLINE + 'CENVAT CREDIT ACCOUNT - INPUTS (R.G.23 A - PART II)' + NEWLINE + 'CAPITAL GOODS - INPUTS (R.G. 23 C - PART II)', ignore : 1, parent:'Journal Voucher Detail'})
this.add_filter({fieldname:'main_acc_head', label:'Main Account Head', fieldtype:'Link', options:'Account', ignore : 1, parent:'Journal Voucher Detail'});
this.add_filter({fieldname:'add_acc_head', label:'Additional Account Head', fieldtype:'Link', options:'Account', ignore : 1, parent:'Journal Voucher Detail'});
this.add_filter({fieldname:'cvd_acc_head', label:'CVD Account Head', fieldtype:'Link', options:'Account', ignore : 1, parent:'Journal Voucher Detail'});
this.add_filter({fieldname:'edu_cess_acc_head', label:'Edu Cess Account Head', fieldtype:'Link', options:'Account', ignore : 1, parent:'Journal Voucher Detail'});
this.add_filter({fieldname:'sh_edu_cess_acc_head', label:'S.H.Edu Cess Account Head', fieldtype:'Link', options:'Account', ignore : 1, parent:'Journal Voucher Detail'});
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
//this.large_report = 1;
}

View File

@@ -0,0 +1,138 @@
# Add columns
# -----------
row_list = [['Date', 'Date', '150px', '']
,['ARI/INVOICE/Other Approved document/Bill of entry No.', 'Date', '150px', '']
,['Date', 'Date', '150px', '']
,['Baisc Excise Duty', 'Currency', '150px', '']
,['Additional Duty', 'Currency', '150px', '']
,['Education Cess', 'Currency', '150px', '']
,['S.H.Education Cess', 'Currency', '150px', '']
,[' Basic Excise Duty', 'Currency', '150px', '']
,[' Education Cess', 'Currency', '150px', '']
,[' S.H.Education Cess', 'Currency', '150px', '']
,['Basic Excise Duty ', 'Currency', '150px', '']
,['Education Cess ', 'Currency', '150px', '']
,['S.H.Education Cess ', 'Currency', '150px', '']
,['Remarks', 'Data', '150px', '']
]
if not filter_values['report']:
msgprint("Please Select Report Type. ")
raise Exception
if 'CAPITAL' not in filter_values['report']:
row_list.insert(3,['Range/ Divsion/ Custom House from where received', 'Data', '150px', ''])
row_list.insert(4,['Folio No. & Entry No. in Part I', 'Data', '150px', ''])
row_list.insert(7,['CVD', 'Currency', '150px', ''])
row_list.insert(10,['ARI/INVOICE/ Other Approved document/Bill of entry No.', 'Data', '100px', ''])
row_list.insert(11,['Date', 'Date', '150px', ''])
elif 'CAPITAL' in filter_values['report']:
row_list.insert(7,[' Basic Excise Duty ', 'Currency', '150px', ''])
row_list.insert(8,[' Education Cess ', 'Currency', '150px', ''])
row_list.insert(9,[' S.H.Education Cess ', 'Currency', '150px', ''])
row_list.insert(10,['ARI/INVOICE/ Other Approved document/Bill of entry No.', 'Data', '100px', ''])
row_list.insert(11,['Date', 'Date', '150px', ''])
for r in row_list:
colnames.append(r[0])
coltypes.append(r[1])
colwidths.append(r[2])
coloptions.append(r[3])
col_idx[r[0]] = len(colnames)-1
# get as_on_date for opening
as_on_date = ''
if filter_values.get('posting_date'):
as_on_date = add_days(filter_values['posting_date'], -1)
ysd, from_date_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_add(year_start_date,interval 1 year)",as_on_date)[0]
# Get Opening Balance
def get_opening_balance(acc, fy, as_on_date, ysd, get_opening_balance, get_obj):
glc = get_obj('GL Control')
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % acc)
return glc.get_as_on_balance(acc, fy, as_on_date, acc_det[0][0], acc_det[0][2], acc_det[0][3])[2]
cum_sum_main_acc_head = cum_sum_add_acc_head = cum_sum_cvd_acc_head = cum_sum_edu_cess_acc_head = cum_sum_sh_edu_cess_acc_head = 0
openg_main_acc_head = openg_add_acc_head = openg_cvd_acc_head = openg_edu_cess_acc_head = openg_sh_edu_cess_acc_head = 0
# Get Opening of Basic Excise Duty
if not filter_values['main_acc_head']:
msgprint("Please Enter Main Account Head")
raise Exception
cum_sum_main_acc_head = openg_main_acc_head = get_opening_balance(filter_values['main_acc_head'], from_date_year, as_on_date, ysd, get_opening_balance, get_obj)
# Get Opening of add_acc_head
if filter_values['add_acc_head'] : cum_sum_add_acc_head = openg_add_acc_head = get_opening_balance(filter_values['add_acc_head'], from_date_year, as_on_date, ysd, get_opening_balance, get_obj)
# Get Opening of cvd_acc_head
if filter_values['cvd_acc_head'] : cum_sum_cvd_acc_head = openg_cvd_acc_head = get_opening_balance(get_opening_balance, filter_values['cvd_acc_head'], from_date_year, as_on_date, ysd, get_opening_balance, get_obj)
# Get Opening of edu_cess_acc_head
if not filter_values['edu_cess_acc_head'] :
msgprint("Please Enter Edu Cess Account Head")
raise Exception
cum_sum_edu_cess_acc_head = openg_edu_cess_acc_head = get_opening_balance(filter_values['edu_cess_acc_head'], from_date_year, as_on_date, ysd, get_opening_balance, get_obj)
# Get Opening of sh_edu_cess_acc_head
if not filter_values['sh_edu_cess_acc_head'] :
msgprint("Please Enter S.H.Edu Cess Account Head")
raise Exception
cum_sum_sh_edu_cess_acc_head = openg_sh_edu_cess_acc_head = get_opening_balance(filter_values['sh_edu_cess_acc_head'], from_date_year, as_on_date, ysd, get_opening_balance, get_obj)
for r in res:
remarks = r[col_idx['ARI/INVOICE/ Other Approved document/Bill of entry No.']]
r[col_idx['ARI/INVOICE/ Other Approved document/Bill of entry No.']] = ''
r.append('')
if 'CAPITAL' not in filter_values['report']:
r.append(0.00)
r.append(0.00)
r.append(0.00)
cum_sum_main_acc_head = flt(cum_sum_main_acc_head) + flt(r[col_idx['Baisc Excise Duty']])
cum_sum_add_acc_head = flt(cum_sum_add_acc_head) + flt(r[col_idx['Additional Duty']])
cum_sum_cvd_acc_head = flt(cum_sum_cvd_acc_head) + flt(r[col_idx['CVD']])
r.append( cum_sum_main_acc_head + cum_sum_add_acc_head + cum_sum_cvd_acc_head)
cum_sum_edu_cess_acc_head = flt(cum_sum_edu_cess_acc_head) + flt(r[col_idx['Education Cess']])
r.append(cum_sum_edu_cess_acc_head)
cum_sum_sh_edu_cess_acc_head = flt(cum_sum_sh_edu_cess_acc_head) + flt(r[col_idx['S.H.Education Cess']])
r.append(cum_sum_sh_edu_cess_acc_head)
elif 'CAPITAL' in filter_values['report']:
# As there is no range and Folio No
r[col_idx['Baisc Excise Duty']] = r[col_idx['Education Cess']]
r[col_idx['Additional Duty']] = r[col_idx['S.H.Education Cess']]
r[col_idx['Education Cess']] = r[col_idx[' Education Cess ']]
r[col_idx['S.H.Education Cess']] = r[col_idx[' S.H.Education Cess ']]
cum_sum_main_acc_head = flt(cum_sum_main_acc_head) + flt(r[col_idx['Baisc Excise Duty']])
cum_sum_add_acc_head = flt(cum_sum_add_acc_head) + flt(r[col_idx['Additional Duty']])
r[col_idx[' Basic Excise Duty ']]= flt(cum_sum_main_acc_head) + flt(cum_sum_add_acc_head)
cum_sum_edu_cess_acc_head = flt(cum_sum_edu_cess_acc_head) + flt(r[col_idx['Education Cess']])
r[col_idx[' Education Cess ']]= flt(cum_sum_edu_cess_acc_head)
cum_sum_sh_edu_cess_acc_head = flt(cum_sum_sh_edu_cess_acc_head) + flt(r[col_idx['S.H.Education Cess']])
r[col_idx[' S.H.Education Cess ']]= flt(cum_sum_sh_edu_cess_acc_head)
r.append(0.00)
r.append(0.00)
r.append(0.00)
r.append( cum_sum_main_acc_head + cum_sum_add_acc_head)
r.append(cum_sum_edu_cess_acc_head)
r.append(cum_sum_sh_edu_cess_acc_head)
r.append(remarks)
out = []
if 'CAPITAL' not in cstr(filter_values['report']):
out.append(['Opening Balance of Duty in Credit', '', '', '', '', '', '', '', '', '', '', '','','','', flt(openg_main_acc_head) + flt(openg_add_acc_head) + flt(openg_cvd_acc_head), flt(openg_edu_cess_acc_head), flt(openg_sh_edu_cess_acc_head),''])
elif 'CAPITAL' in filter_values['report']:
out.append(['Opening Balance of Duty in Credit', '', '', '', '', '', '', '', '', '', '', '', '', '', '', flt(openg_main_acc_head) + flt(openg_add_acc_head) , flt(openg_edu_cess_acc_head), flt(openg_sh_edu_cess_acc_head)])
out += res
#if from_export == 0:
# msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please click on 'Export' to open in a spreadsheet")
# raise Exception

View File

@@ -0,0 +1,31 @@
SELECT t1.posting_date, t1.bill_no, t1.bill_date, t1.range, t1.name, SUM(CASE WHEN t2.account_head like '%(main_acc_head)s%' THEN t2.tax_amount ELSE 0.00 END), SUM(CASE WHEN t2.account_head like '%(add_acc_head)s%' THEN t2.tax_amount ELSE 0.00 END), SUM(CASE WHEN t2.account_head like '%(cvd_acc_head)s%' THEN t2.tax_amount ELSE 0.00 END), SUM(CASE WHEN t2.account_head like '%(edu_cess_acc_head)s' THEN t2.tax_amount ELSE 0.00 END), SUM(CASE WHEN t2.account_head like '%(sh_edu_cess_acc_head)s' THEN t2.tax_amount ELSE 0.00 END), t1.`remarks`
FROM `tabPurchase Receipt` t1, `tabPurchase Tax Detail` t2
WHERE t2.parent = t1.name
AND t2.parent = 'Purchase Reciept'
AND (t2.account_head LIKE '%(main_acc_head)s' and '%(main_acc_head)s%%' or '~~~~'
OR t2.account_head LIKE '%(add_acc_head)s' and '%(add_acc_head)s%%' or '~~~~'
OR t2.account_head LIKE '%(cvd_acc_head)s' and '%(cvd_acc_head)s%%' or '~~~~'
OR t2.account_head LIKE '%(edu_cess_acc_head)s' and '%(edu_cess_acc_head)s%%' or '~~~~'
OR t2.account_head LIKE '%(sh_edu_cess_acc_head)s%' and '%(sh_edu_cess_acc_head)s%%' or '~~~~')
AND t1.`posting_date` >= '%(posting_date)s'
AND t1.`posting_date` <= '%(posting_date1)s'
AND t1.docstatus =1
GROUP BY t1.`name`
UNION
SELECT t1.posting_date, t1.bill_no, t1.bill_date, '' AS 'Range', t1.name, SUM(CASE WHEN t2.account like '%(main_acc_head)s%' THEN t2.debit ELSE 0.00 END), SUM(CASE WHEN t2.account like '%(add_acc_head)s%' THEN t2.debit ELSE 0.00 END), SUM(CASE WHEN t2.account like '%(cvd_acc_head)s%' THEN t2.debit ELSE 0.00 END), SUM(CASE WHEN t2.account like '%(edu_cess_acc_head)s' THEN t2.debit ELSE 0.00 END), SUM(CASE WHEN t2.account like '%(sh_edu_cess_acc_head)s' THEN t2.debit ELSE 0.00 END), t1.`remark`
FROM `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2
WHERE (t2.debit is not NULL OR t2.debit != '')
AND t2.debit > 0
AND t2.parent = t1.name
AND (t2.account LIKE '%(main_acc_head)s' and '%(main_acc_head)s%%' or '~~~~'
OR t2.account LIKE '%(add_acc_head)s' and '%(add_acc_head)s%%' or '~~~~'
OR t2.account LIKE '%(cvd_acc_head)s' and '%(cvd_acc_head)s%%' or '~~~~'
OR t2.account LIKE '%(edu_cess_acc_head)s' and '%(edu_cess_acc_head)s%%' or '~~~~'
OR t2.account LIKE '%(sh_edu_cess_acc_head)s%' and '%(sh_edu_cess_acc_head)s%%' or '~~~~') AND t1.`posting_date` >= '%(posting_date)s'
AND t1.`posting_date` <= '%(posting_date1)s'
AND t1.docstatus =1
GROUP BY t1.`name`
ORDER BY `posting_date`,`name`

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': '',
'creation': '2010-11-01 10:56:13',
'criteria_name': 'Cenvat Credit - Input or Capital Goods',
'custom_query': None,
'description': None,
'dis_filters': 'fiscal_year',
'disabled': None,
'doc_type': 'Journal Voucher Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Fiscal Year':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':'','Receivable Voucher\x01Aging Based On':'','Payable Voucher\x01Aging Based On':'Transaction Date','Journal Voucher Detail\x01Report Type':'CENVAT CREDIT ACCOUNT - INPUTS (R.G.23 A - PART II)'}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-10-29 16:42:14',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'cenvat_credit_-_input_or_capital_goods',
'owner': 'jai@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': 'Journal Voucher',
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': 'ID',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,24 @@
report.customize_filters = function() {
this.hide_all_filters();
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Is Opening'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.filter_hide = 0;
this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'range_4', label:'Range 4', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date',ignore : 1, parent:'Receivable Voucher', 'report_default': 'Aging Date'});
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
}
this.mytabs.items['Select Columns'].hide()

View File

@@ -0,0 +1,90 @@
#check mandatory
if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
msgprint("Please select From Posting Date and To Posting Date ")
raise Exception
else:
from_date = filter_values.get('posting_date')
to_date = filter_values.get('posting_date1')
if not filter_values['range_1'] or not filter_values['range_2'] or not filter_values['range_3'] or not filter_values['range_4']:
msgprint("Please select aging ranges in no of days in 'Set Filters' section")
raise Exception
# ageing based on
aging_based_on = 'Aging Date'
if filter_values.get('aging_based_on'):
aging_based_on = filter_values['aging_based_on'].split(NEWLINE)[-1]
# Add columns
# -----------
row_list = [['ID','Data','150px',''],
['Account','Data','150px',''],
['Credit','Data','150px',''],
['Debit','Data','150px',''],
['Against Receivable','Data','150px',''],
['Is Advance','Data','150px',''],
['Transaction Date','Date','150px',''],
['Aging Date','Date','150px',''],
['Company','Data','150px',''],
['Cheque No','Data','100px',''],
['Cheque Date','Date','150px',''],
['Territory','Data','150px',''],
['Remark','Data','250px',''],
['Advance','Data','250px',''],
['RV Transaction Date','Date','150px',''],
['RV Aging Date','Date','150px',''],
['Age (Days)','Data','50px',''],
['0-'+cstr(filter_values['range_1']),'Currency','100px',''],
[cstr(cint(filter_values['range_1']) + 1)+ '-' +cstr(filter_values['range_2']),'Currency','100px',''],
[cstr(cint(filter_values['range_2']) + 1)+ '-' +cstr(filter_values['range_3']),'Currency','100px',''],
[cstr(cint(filter_values['range_3']) + 1)+ '-' +cstr(filter_values['range_4']),'Currency','100px',''],
[cstr(filter_values['range_4']) + '-Above','Currency','100px','']]
for r in row_list:
colnames.append(r[0])
coltypes.append(r[1])
colwidths.append(r[2])
coloptions.append(r[3])
col_idx[r[0]] = len(colnames)-1
for r in res:
if r[col_idx['Against Receivable']]:
dt=sql("select voucher_date, Aging_date from `tabReceivable Voucher` where name='%s'"%r[col_idx['Against Receivable']])
r.append('')
r.append(dt and cstr(dt[0][0]) or '')
r.append(dt and cstr(dt[0][1]) or '')
else:
r.append(r[col_idx['Credit']])
r.append('')
r.append('')
# Aging Credit Amount
val_l1 = val_l2 = val_l3 = val_l4 = val_l5_above = diff = 0
if r[col_idx['Against Receivable']]:
amt = flt(r[col_idx['Credit']]) or (-1)*flt(r[col_idx['Debit']])
if aging_based_on == 'Transaction Date' and r[col_idx['RV Transaction Date']]:
diff = (getdate(r[col_idx['Transaction Date']]) - getdate(r[col_idx['RV Transaction Date']])).days
elif aging_based_on == 'Aging Date' and r[col_idx['RV Aging Date']]:
diff = (getdate(r[col_idx['Aging Date']]) - getdate(r[col_idx['RV Aging Date']])).days
if diff < cint(filter_values['range_1']):
val_l1 = amt
if diff >= cint(filter_values['range_1']) and diff < cint(filter_values['range_2']):
val_l2 = amt
if diff >= cint(filter_values['range_2']) and diff < cint(filter_values['range_3']):
val_l3 = amt
if diff >= cint(filter_values['range_3']) and diff < cint(filter_values['range_4']):
val_l4 = amt
if diff >= cint(filter_values['range_4']):
val_l5_above = amt
r.append(diff)
r.append(val_l1)
r.append(val_l2)
r.append(val_l3)
r.append(val_l4)
r.append(val_l5_above)

View File

@@ -0,0 +1,13 @@
SELECT `tabJournal Voucher`.`name`,`tabJournal Voucher Detail`.`account`,`tabJournal Voucher Detail`.`credit`,`tabJournal Voucher Detail`.`debit`,`tabJournal Voucher Detail`.`against_invoice`,`tabJournal Voucher Detail`.`is_advance`,`tabJournal Voucher`.`voucher_date`,`tabJournal Voucher`.`aging_date`,`tabJournal Voucher`.`company`,`tabJournal Voucher`.`cheque_no`,`tabJournal Voucher`.`cheque_date`,`tabCustomer`.`territory`, `tabJournal Voucher`.`remark`
FROM `tabJournal Voucher Detail`,`tabJournal Voucher`,`tabAccount`,`tabCustomer`
WHERE `tabJournal Voucher`.docstatus=1
AND `tabJournal Voucher`.`posting_date`>='%(posting_date)s'
AND `tabJournal Voucher`.`posting_date`<='%(posting_date1)s'
AND `tabJournal Voucher`.`company` LIKE '%(company)s%%'
AND `tabJournal Voucher`.`is_opening` LIKE '%(is_opening)s%%'
AND `tabJournal Voucher Detail`.`account` LIKE '%(account)s%%'
AND `tabAccount`.master_type = 'Customer'
AND `tabAccount`.`account_name` = `tabCustomer`.`name`
AND `tabJournal Voucher Detail`.`account` = `tabAccount`.`name`
AND `tabJournal Voucher Detail`.`parent` = `tabJournal Voucher`.`name`
ORDER BY `tabJournal Voucher`.`name`

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'Journal Voucher\x01ID,Journal Voucher\x01Posting Date,Journal Voucher\x01Company,Journal Voucher\x01Cheque No,Journal Voucher\x01Cheque Date,Journal Voucher Detail\x01Account,Journal Voucher Detail\x01Credit,Journal Voucher Detail\x01Against Receivable,Journal Voucher Detail\x01Is Advance',
'creation': '2010-10-05 12:51:18',
'criteria_name': 'Collection Report',
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'Journal Voucher Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Journal Voucher\x01Saved':1,'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':'','GL Entry\x01Range 1':'30','GL Entry\x01Range 2':'45','GL Entry\x01Range 3':'60','GL Entry\x01Range 4':'90'}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-10-01 11:29:51',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'collection_report',
'owner': 'Administrator',
'page_len': None,
'parent': None,
'parent_doc_type': 'Journal Voucher',
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabJournal Voucher`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,23 @@
report.customize_filters = function() {
this.hide_all_filters();
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Cost Center'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.filter_hide = 0;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Cost Center'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
}
this.mytabs.items['Select Columns'].hide();
this.mytabs.items['More Filters'].hide();

View File

@@ -0,0 +1,13 @@
# Add columns
# -----------
row_list = [['Cost Center','Data','160px'],
['Account','Data','160px'],
['Debit','Data','120px'],
['Credit','Data','120px'],
['Expense','Currency','120px']]
for r in row_list:
colnames.append(r[0])
coltypes.append(r[1])
colwidths.append(r[2])
col_idx[r[0]] = len(colnames)-1

View File

@@ -0,0 +1,12 @@
SELECT `tabGL Entry`.`cost_center`,`tabAccount`.`parent_account`,sum(`tabGL Entry`.`debit`),sum(`tabGL Entry`.`credit`),sum(`tabGL Entry`.`debit`)-sum(`tabGL Entry`.`credit`)
FROM `tabGL Entry`,`tabAccount`
WHERE `tabGL Entry`.`account`=`tabAccount`.`name`
AND ifnull(`tabGL Entry`.`is_cancelled`,'No')='No'
AND `tabAccount`.is_pl_account='Yes'
AND `tabAccount`.debit_or_credit='Debit'
AND `tabGL Entry`.`posting_date`>='%(posting_date)s'
AND `tabGL Entry`.`posting_date`<='%(posting_date1)s'
AND `tabGL Entry`.`company` LIKE '%(company)s%%'
AND `tabAccount`.`parent_account` LIKE '%(account)s%%'
AND `tabGL Entry`.`cost_center` LIKE '%(cost_center)s%%'
GROUP BY `tabGL Entry`.`cost_center` , `tabAccount`.`parent_account`

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': '',
'creation': '2010-08-08 17:09:31',
'criteria_name': 'Cost Center wise Expense',
'custom_query': None,
'description': None,
'dis_filters': 'fiscal_year',
'disabled': None,
'doc_type': 'GL Entry',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Fiscal Year':'','GL Entry\x01Company':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-06-10 13:19:39',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'cost_center_wise_expense',
'owner': 'swarnalata@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabGL Entry`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,24 @@
report.customize_filters = function() {
//to hide all filters
this.hide_all_filters();
field_list=['Voucher Type', 'Voucher No', 'From Posting Date','To Posting Date','Account','Company', 'Remarks', 'Is Cancelled', 'Is Opening']
for(var i=0;i<field_list.length;i++){
this.filter_fields_dict['GL Entry'+FILTER_SEP +field_list[i]].df.filter_hide = 0;
}
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
}
this.mytabs.tabs['Select Columns'].hide()
report.aftertableprint = function(t) {
$yt(t,'*',2,{whiteSpace:'pre'});
$yt(t,'*',3,{whiteSpace:'pre'});
}

View File

@@ -0,0 +1,113 @@
#get company
company = filter_values.get('company') or get_defaults()['company']
#get company letter head
l_head = sql("select letter_head from `tabCompany` where name='%s'" % company)
l_head = l_head and l_head[0][0] or ''
# Posting date, fiscal year and year start date
#-----------------------------------------------
if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
msgprint("Please enter From Date and To Date")
raise Exception
else:
from_date = filter_values['posting_date']
to_date = filter_values['posting_date1']
ysd, from_date_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_add(year_start_date,interval 1 year)",from_date)[0]
# define columns
#---------------
col = []
col.append(['Date','Date','80px',''])
col.append(['Detail','Text','475px',''])
col.append(['Debit','Currency','75px',''])
col.append(['Credit','Currency','75px',''])
for c in col:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append(c[3])
col_idx[c[0]] = len(colnames)
total_debit, total_credit, total_opening, total_diff = 0,0,0,0
#total query
q = query.split('WHERE')[1].split('LIMIT')
if len(q) > 2:
query_where_clause = 'LIMIT'.join(q[:-1])
else:
query_where_clause = q[0]
tot = sql('select sum(`tabGL Entry`.debit),sum(`tabGL Entry`.credit) from `tabGL Entry`, tabAccount where %s' % query_where_clause)
for t in tot:
total_debit += t and flt(t[0]) or 0
total_credit += t and flt(t[1]) or 0
total_diff = total_debit - total_credit
# opening
account = filter_values.get('account')
if account:
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % account)
opening_bal = get_obj('GL Control').get_as_on_balance(account, from_date_year, add_days(from_date, -1), acc_det[0][0], acc_det[0][2], acc_det[0][3])[2]
if acc_det[0][0] == 'Credit':
opening_bal = -1*opening_bal
out = []
count = 0
for r in res:
count +=1
det = r[1].split('~~~')
if from_export == 1:
a = "Account: " + det[0] + NEWLINE + det[1] + NEWLINE + "Against: " + det[2] + NEWLINE + "Voucher No: " + det[4]
else:
a = "Account: <b>" + det[0]+ "</b>" + NEWLINE + "<div class='comment'>" +det[1]+ "</div><div class = 'comment' style='padding-left:12px'>Against: <b>" + det[2] + "</b></div><div class = 'comment' style='padding-left:12px'>Voucher No: <span class='link_type' onclick='loaddoc(" + '"' + det[3] +'", ' + '"' + det[4] +'"' + ")'>" + det[4] + "</span></div>"
r[1] = a
out.append(r)
if total_debit != 0 or total_credit != 0:
# Total debit/credit
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Total'
t_row[col_idx['Debit']-1] = total_debit
t_row[col_idx['Credit']-1] = total_credit
out.append(t_row)
# opening
if account:
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Opening Balance on '+ from_date
t_row[col_idx['Debit']-1] = opening_bal
out.append(t_row)
# diffrence (dr-cr)
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Total(Dr-Cr)'
t_row[col_idx['Debit']-1] = total_diff
out.append(t_row)
# closing
if account:
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Closing Balance on ' + to_date
t_row[col_idx['Debit']-1] = flt(opening_bal) + flt(total_diff )
out.append(t_row)
# Print Format
myheader = """<table width = '100%%'><tr><td>"""+l_head+"""</td>
</tr>
<tr> <td>
<div><h3> %(acc)s </h3></div>
<div>Ledger Between %(fdt)s and %(tdt)s </div></td></tr></table><br>
""" % {'acc':account,
'fdt':from_date,
'tdt':to_date}
page_template = myheader+"<div>%(table)s</div>"

View File

@@ -0,0 +1,15 @@
SELECT `tabGL Entry`.`posting_date`, CONCAT(`tabGL Entry`.`account`, "~~~", ifnull(`tabGL Entry`.`remarks`, ''), "~~~", ifnull(`tabGL Entry`.`against`,''), "~~~", ifnull(`tabGL Entry`.`voucher_type`, ''), "~~~", ifnull(`tabGL Entry`.`voucher_no`, '')), sum(`tabGL Entry`.`debit`), sum(`tabGL Entry`.`credit`)
FROM `tabGL Entry`, `tabAccount`
WHERE `tabGL Entry`.`is_cancelled` LIKE '%(is_cancelled)s%%'
AND `tabGL Entry`.`posting_date`>='%(posting_date)s'
AND `tabGL Entry`.`posting_date`<='%(posting_date1)s'
AND `tabGL Entry`.`company` LIKE '%(company)s%%'
AND `tabGL Entry`.`account` LIKE '%(account)s%%'
AND `tabGL Entry`.`remarks` LIKE '%(remarks)s%%'
AND `tabGL Entry`.`is_opening` LIKE '%(is_opening)s%%'
AND `tabGL Entry`.`voucher_no` LIKE '%(voucher_no)s%%'
AND `tabGL Entry`.`voucher_type` LIKE '%(voucher_type)s%%'
AND `tabGL Entry`.`account` = `tabAccount`.`name`
AND `tabAccount`.`master_type` = 'Supplier'
GROUP BY `tabGL Entry`.`voucher_no`,`tabGL Entry`.`account`
ORDER BY `tabGL Entry`.`posting_date` DESC

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': '',
'creation': '2010-12-14 10:33:09',
'criteria_name': "Creditor's Ledger",
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'GL Entry',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-11-22 17:05:46',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'creditors_ledger',
'owner': 'nabin@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,24 @@
report.customize_filters = function() {
//to hide all filters
this.hide_all_filters();
field_list=['Voucher Type', 'Voucher No', 'From Posting Date','To Posting Date','Account','Company', 'Remarks', 'Is Cancelled', 'Is Opening']
for(var i=0;i<field_list.length;i++){
this.filter_fields_dict['GL Entry'+FILTER_SEP +field_list[i]].df.filter_hide = 0;
}
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
}
this.mytabs.tabs['Select Columns'].hide()
report.aftertableprint = function(t) {
$yt(t,'*',2,{whiteSpace:'pre'});
$yt(t,'*',3,{whiteSpace:'pre'});
}

View File

@@ -0,0 +1,113 @@
#get company
company = filter_values.get('company') or get_defaults()['company']
#get company letter head
l_head = sql("select letter_head from `tabCompany` where name='%s'" % company)
l_head = l_head and l_head[0][0] or ''
# Posting date, fiscal year and year start date
#-----------------------------------------------
if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
msgprint("Please enter From Date and To Date")
raise Exception
else:
from_date = filter_values['posting_date']
to_date = filter_values['posting_date1']
ysd, from_date_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_add(year_start_date,interval 1 year)",from_date)[0]
# define columns
#---------------
col = []
col.append(['Date','Date','80px',''])
col.append(['Detail','Text','475px',''])
col.append(['Debit','Currency','75px',''])
col.append(['Credit','Currency','75px',''])
for c in col:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append(c[3])
col_idx[c[0]] = len(colnames)
total_debit, total_credit, total_opening, total_diff = 0,0,0,0
#total query
q = query.split('WHERE')[1].split('LIMIT')
if len(q) > 2:
query_where_clause = 'LIMIT'.join(q[:-1])
else:
query_where_clause = q[0]
tot = sql('select sum(`tabGL Entry`.debit),sum(`tabGL Entry`.credit) from `tabGL Entry`, tabAccount where %s' % query_where_clause)
for t in tot:
total_debit += t and flt(t[0]) or 0
total_credit += t and flt(t[1]) or 0
total_diff = total_debit - total_credit
# opening
account = filter_values.get('account')
if account:
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % account)
opening_bal = get_obj('GL Control').get_as_on_balance(account, from_date_year, add_days(from_date, -1), acc_det[0][0], acc_det[0][2], acc_det[0][3])[2]
if acc_det[0][0] == 'Credit':
opening_bal = -1*opening_bal
out = []
count = 0
for r in res:
count +=1
det = r[1].split('~~~')
if from_export == 1:
a = "Account: " + det[0] + NEWLINE + det[1] + NEWLINE + "Against: " + det[2] + NEWLINE + "Voucher No: " + det[4]
else:
a = "Account: <b>" + det[0]+ "</b>" + NEWLINE + "<div class='comment'>" +det[1]+ "</div><div class = 'comment' style='padding-left:12px'>Against: <b>" + det[2] + "</b></div><div class = 'comment' style='padding-left:12px'>Voucher No: <span class='link_type' onclick='loaddoc(" + '"' + det[3] +'", ' + '"' + det[4] +'"' + ")'>" + det[4] + "</span></div>"
r[1] = a
out.append(r)
if total_debit != 0 or total_credit != 0:
# Total debit/credit
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Total'
t_row[col_idx['Debit']-1] = total_debit
t_row[col_idx['Credit']-1] = total_credit
out.append(t_row)
# opening
if account:
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Opening Balance on '+ from_date
t_row[col_idx['Debit']-1] = opening_bal
out.append(t_row)
# diffrence (dr-cr)
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Total(Dr-Cr)'
t_row[col_idx['Debit']-1] = total_diff
out.append(t_row)
# closing
if account:
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Closing Balance on ' + to_date
t_row[col_idx['Debit']-1] = flt(opening_bal) + flt(total_diff )
out.append(t_row)
# Print Format
myheader = """<table width = '100%%'><tr><td>"""+l_head+"""</td>
</tr>
<tr> <td>
<div><h3> %(acc)s </h3></div>
<div>Ledger Between %(fdt)s and %(tdt)s </div></td></tr></table><br>
""" % {'acc':account,
'fdt':from_date,
'tdt':to_date}
page_template = myheader+"<div>%(table)s</div>"

View File

@@ -0,0 +1,15 @@
SELECT `tabGL Entry`.`posting_date`, CONCAT(`tabGL Entry`.`account`, "~~~", ifnull(`tabGL Entry`.`remarks`, ''), "~~~", ifnull(`tabGL Entry`.`against`,''), "~~~", ifnull(`tabGL Entry`.`voucher_type`, ''), "~~~", ifnull(`tabGL Entry`.`voucher_no`, '')), sum(`tabGL Entry`.`debit`), sum(`tabGL Entry`.`credit`)
FROM `tabGL Entry`, `tabAccount`
WHERE `tabGL Entry`.`is_cancelled` LIKE '%(is_cancelled)s%%'
AND `tabGL Entry`.`posting_date`>='%(posting_date)s'
AND `tabGL Entry`.`posting_date`<='%(posting_date1)s'
AND `tabGL Entry`.`company` LIKE '%(company)s%%'
AND `tabGL Entry`.`account` LIKE '%(account)s%%'
AND `tabGL Entry`.`remarks` LIKE '%(remarks)s%%'
AND `tabGL Entry`.`is_opening` LIKE '%(is_opening)s%%'
AND `tabGL Entry`.`voucher_no` LIKE '%(voucher_no)s%%'
AND `tabGL Entry`.`voucher_type` LIKE '%(voucher_type)s%%'
AND `tabGL Entry`.`account` = `tabAccount`.`name`
AND `tabAccount`.`master_type` = 'Customer'
GROUP BY `tabGL Entry`.`voucher_no`,`tabGL Entry`.`account`
ORDER BY `tabGL Entry`.`posting_date` DESC

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': '',
'creation': '2010-12-14 10:33:09',
'criteria_name': "Debtor's Ledger",
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'GL Entry',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'No','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-11-22 17:02:05',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'debtors_ledger',
'owner': 'nabin@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,23 @@
report.customize_filters = function() {
this.mytabs.tabs['Select Columns'].hide();
//to hide all filters
this.hide_all_filters();
field_list=['Voucher Type', 'Voucher No', 'From Posting Date','To Posting Date','Account','Company', 'Remarks', 'Is Cancelled', 'Is Opening']
for(var i=0;i<field_list.length;i++){
this.filter_fields_dict['GL Entry'+FILTER_SEP +field_list[i]].df.filter_hide = 0;
}
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Account'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
}
report.aftertableprint = function(t) {
$yt(t,'*',2,{whiteSpace:'pre'});
$yt(t,'*',3,{whiteSpace:'pre'});
}

View File

@@ -0,0 +1,103 @@
#get company letter head
l_head = sql("select content from `tabLetter Head` where ifnull(is_default, 0) = 1 and ifnull(disabled, 0) = 0")
l_head = l_head and l_head[0][0] or ''
# Posting date, fiscal year and year start date
#-----------------------------------------------
if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
msgprint("Please enter From Date and To Date")
raise Exception
else:
from_date = filter_values['posting_date']
to_date = filter_values['posting_date1']
ysd, from_date_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_sub(date_add(year_start_date,interval 1 year), interval 1 day)",from_date)[0]
# define columns
#---------------
col = []
col.append(['Date','Date','80px',''])
col.append(['Detail','Text','475px',''])
col.append(['Debit','Currency','75px',''])
col.append(['Credit','Currency','75px',''])
for c in col:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append(c[3])
col_idx[c[0]] = len(colnames)
total_debit, total_credit, total_opening, total_diff = 0,0,0,0
#total query
q = query.split('WHERE')[1].split('LIMIT')
if len(q) > 2:
query_where_clause = 'LIMIT'.join(q[:-1])
else:
query_where_clause = q[0]
tot = sql('select sum(debit),sum(credit) from `tabGL Entry` where %s' % query_where_clause)
for t in tot:
total_debit += t and flt(t[0]) or 0
total_credit += t and flt(t[1]) or 0
total_diff = total_debit - total_credit
# opening
account = filter_values.get('account')
if account:
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % account)
closing_bal = get_obj('GL Control').get_as_on_balance(account, from_date_year, to_date, acc_det[0][0], acc_det[0][2], acc_det[0][3])[2]
if acc_det[0][0] == 'Credit':
closing_bal = -1*closing_bal
out = []
count = 0
for r in res:
count +=1
det = r[1].split('~~~')
if from_export == 1:
a = "Account: " + det[0] + NEWLINE + det[1] + NEWLINE + "Against: " + det[2] + NEWLINE + "Voucher No: " + det[4]
else:
a = "Account: <b>" + det[0]+ "</b>" + NEWLINE + "<div class='comment'>" +det[1]+ "</div><div class = 'comment' style='padding-left:12px'>Against: <b>" + det[2] + "</b></div><div class = 'comment' style='padding-left:12px'>Voucher No: <span class='link_type' onclick='loaddoc(" + '"' + det[3] +'", ' + '"' + det[4] +'"' + ")'>" + det[4] + "</span></div>"
r[1] = a
out.append(r)
if total_debit != 0 or total_credit != 0:
# Total debit/credit
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Total'
t_row[col_idx['Debit']-1] = total_debit
t_row[col_idx['Credit']-1] = total_credit
out.append(t_row)
# diffrence (dr-cr)
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Total(Dr-Cr)'
t_row[col_idx['Debit']-1] = total_diff
out.append(t_row)
# closing
if account:
t_row = ['' for i in range(len(colnames))]
t_row[1] = 'Closing Balance on ' + to_date
t_row[col_idx['Debit']-1] = flt(closing_bal)
out.append(t_row)
# Print Format
myheader = """<table width = '100%%'><tr><td>"""+l_head+"""</td>
</tr>
<tr> <td>
<div><h3> %(acc)s </h3></div>
<div>Ledger Between %(fdt)s and %(tdt)s </div></td></tr></table><br>
""" % {'acc':account,
'fdt':from_date,
'tdt':to_date}
page_template = myheader+"<div>%(table)s</div>"

View File

@@ -0,0 +1,13 @@
SELECT `tabGL Entry`.`posting_date`, CONCAT(`tabGL Entry`.`account`, "~~~", ifnull(`tabGL Entry`.`remarks`, ''), "~~~", ifnull(`tabGL Entry`.`against`,''), "~~~", ifnull(`tabGL Entry`.`voucher_type`, ''), "~~~", ifnull(`tabGL Entry`.`voucher_no`, '')), sum(`tabGL Entry`.`debit`), sum(`tabGL Entry`.`credit`)
FROM `tabGL Entry`
WHERE `tabGL Entry`.`is_cancelled` LIKE '%(is_cancelled)s%%'
AND `tabGL Entry`.`posting_date`>='%(posting_date)s'
AND `tabGL Entry`.`posting_date`<='%(posting_date1)s'
AND `tabGL Entry`.`company` LIKE '%(company)s%%'
AND `tabGL Entry`.`account` LIKE '%(account)s%%'
AND `tabGL Entry`.`remarks` LIKE '%(remarks)s%%'
AND `tabGL Entry`.`is_opening` LIKE '%(is_opening)s%%'
AND `tabGL Entry`.`voucher_no` LIKE '%(voucher_no)s%%'
AND `tabGL Entry`.`voucher_type` LIKE '%(voucher_type)s%%'
GROUP BY `tabGL Entry`.`voucher_no`,`tabGL Entry`.`account`
ORDER BY `tabGL Entry`.`posting_date` DESC

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': '',
'creation': '2010-12-14 10:33:08',
'criteria_name': 'General Ledger',
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'GL Entry',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01From Posting Date\x01lower':'','GL Entry\x01To Posting Date\x01upper':'','GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'No','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':'','GL Entry\x01Company':''}",
'graph_series': None,
'graph_values': None,
'group_by': '',
'idx': None,
'modified': '2010-11-30 16:26:42',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'general_ledger',
'owner': 'Administrator',
'page_len': 50,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabGL Entry`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,17 @@
report.customize_filters = function() {
this.hide_all_filters();
filter_list = ['From Voucher Date', 'To Voucher Date', 'Credit To', 'Is Opening', 'From Posting Date', 'To Posting Date']
for(var i=0;i<filter_list.length;i++)
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +filter_list[i]].df.filter_hide = 0;
this.filter_fields_dict['PV Detail'+FILTER_SEP +'Item'].df.filter_hide = 0;
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['PV Detail'+FILTER_SEP +'Item'].df.in_first_page = 1;
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['Payable Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company
}

View File

@@ -0,0 +1,28 @@
#adding columns
cl = [c[0] for c in sql("select distinct account_head from `tabPurchase Tax Detail` where parenttype='Payable 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
amt = flt(r[col_idx['Amount (Default Curr.)']] or 0)
qty = flt(r[col_idx['Qty']] or 0)
for c in cl:
val = sql("select t1.tax_amount, t2.net_total from `tabPurchase Tax Detail` t1, `tabPayable Voucher` t2 where t2.name = %s and t1.parent = %s and t1.parenttype='Payable 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)

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'Payable Voucher\x01ID,Payable Voucher\x01Credit To,Payable Voucher\x01Company,PV Detail\x01Item,PV Detail\x01Item Name,PV Detail\x01Qty,PV Detail\x01Rate (Default Curr.),PV Detail\x01Amount (Default Curr.)',
'creation': '2010-09-10 16:53:48',
'criteria_name': 'Itemwise Purchase Register',
'custom_query': '',
'description': 'Itemwise Purchase Register',
'dis_filters': 'fiscal_year',
'disabled': None,
'doc_type': 'PV Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Payable Voucher\x01Submitted':1,'Payable Voucher\x01From Posting Date\x01lower':'2010-04-01','Payable Voucher\x01To Posting Date\x01upper':'2010-09-10','Payable Voucher\x01Is Opening':'No','Payable Voucher\x01Fiscal Year':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-09-10 16:51:50',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'itemwise_purchase_register',
'owner': 'Administrator',
'page_len': 50,
'parent': None,
'parent_doc_type': 'Payable Voucher',
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabPayable Voucher`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'RV Detail\x01Item,RV Detail\x01Item Name,RV Detail\x01Item Group,Receivable Voucher\x01ID,Receivable Voucher\x01Voucher Date,Receivable Voucher\x01Posting Date,Receivable Voucher\x01Debit To,RV Detail\x01Cost Center,Receivable Voucher\x01Territory,RV Detail\x01Qty,RV Detail\x01Basic Rate*,RV Detail\x01Amount*',
'creation': '2011-01-19 17:47:20',
'criteria_name': 'Itemwise Sales Register',
'custom_query': '',
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'RV Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Receivable Voucher\x01Submitted':1,'Receivable Voucher\x01Is Opening':'','Receivable Voucher\x01Fiscal Year':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2011-01-19 15:56:31',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'itemwise_sales_register',
'owner': 'Administrator',
'page_len': 50,
'parent': None,
'parent_doc_type': 'Receivable Voucher',
'parentfield': None,
'parenttype': None,
'report_script': '',
'server_script': None,
'sort_by': '`tabReceivable Voucher`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

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

View File

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

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'RV Detail\x01Item,RV Detail\x01Item Name,RV Detail\x01Item Group,Receivable Voucher\x01ID,Receivable Voucher\x01Voucher Date,Receivable Voucher\x01Posting Date,Receivable Voucher\x01Debit To,RV Detail\x01Cost Center,Receivable Voucher\x01Territory,RV Detail\x01Qty,RV Detail\x01Basic Rate*,RV Detail\x01Amount*',
'creation': '2011-01-20 12:49:18',
'criteria_name': 'Itemwise Sales Register',
'custom_query': '',
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'RV Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Receivable Voucher\x01Submitted':1,'Receivable Voucher\x01Is Opening':'','Receivable Voucher\x01Fiscal Year':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2011-01-19 15:56:31',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'itemwise_sales_register1',
'owner': 'Administrator',
'page_len': 50,
'parent': None,
'parent_doc_type': 'Receivable Voucher',
'parentfield': None,
'parenttype': None,
'report_script': '',
'server_script': None,
'sort_by': '`tabReceivable Voucher`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,11 @@
report.customize_filters = function() {
flds = ['ID','Owner','Cost Center','From Posting Date', 'To Posting Date', 'Against Voucher','Voucher Type','Voucher No','Is Cancelled','Is Opening','Remarks', 'From Aging Date', 'To Aging Date', 'Company']
for(i=0;i<flds.length;i++){
this.filter_fields_dict['GL Entry'+FILTER_SEP +flds[i]].df.filter_hide = 1;
}
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Fiscal Year'].df['report_default']=sys_defaults.fiscal_year;
this.filter_fields_dict['GL Entry'+FILTER_SEP +'Fiscal Year'].df.in_first_page = 1;
}
this.mytabs.items['Select Columns'].hide();
this.mytabs.items['More Filters'].hide();

View File

@@ -0,0 +1,13 @@
if not filter_values['account']:
msgprint("Please Enter filter value for Account")
raise Exception
colwidths[col_idx['Fiscal Month']] = '120px'
colwidths[col_idx['Debit']] = '120px'
colwidths[col_idx['Credit']] = '120px'
month_lst={'1':'Jan','2':'Feb','3':'Mar','4':'Apr','5':'May','6':'Jun','7':'Jul','8':'Aug','9':'Sept','10':'Oct','11':'Nov','12':'Dec'}
for r in res:
mnt = '%s'%r[col_idx['Fiscal Month']]
r[col_idx['Fiscal Month']]=month_lst[mnt]

View File

@@ -0,0 +1,37 @@
[
{
'add_col': "month(`tabGL Entry`.posting_date) AS 'Fiscal Month'\nsum(`tabGL Entry`.debit) AS 'Debit'\nsum(`tabGL Entry`.credit) AS 'Credit'",
'add_cond': '(`tabGL Entry`.debit > 0 or `tabGL Entry`.credit > 0)',
'add_tab': None,
'columns': '',
'creation': '2010-08-08 17:09:31',
'criteria_name': 'Monthly Ledger Summary Report',
'custom_query': '',
'description': None,
'dis_filters': 'company',
'disabled': None,
'doc_type': 'GL Entry',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':''}",
'graph_series': None,
'graph_values': None,
'group_by': 'month(`tabGL Entry`.posting_date)',
'idx': None,
'modified': '2010-06-09 16:30:43',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'monthly_ledger_summary_report',
'owner': 'Administrator',
'page_len': 50,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`Fiscal Month`',
'sort_order': 'ASC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,27 @@
if not filter_values.get('posting_date'):
msgprint("Enter From Posting Date.")
raise Exception
if not filter_values.get('posting_date1'):
msgprint("Enter To Posting Date.")
raise Exception
if not filter_values.get('company'):
msgprint("Select Comapny.")
raise Exception
#for r in res:
# par_acc = sql("SELECT parent.name FROM `tabAccount` AS node,`tabAccount` AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.name = '%s' and parent.cash_flow_level = 'Yes' ORDER BY parent.lft DESC"% r[0])
# r.append(par_acc and par_acc[0][0] or '')
col_list = [['Account', 'Link', '150px', 'Account']
,['Total', 'Currency', '150px', '']
# ,['Parent Account', 'Link', '150px', 'Account']
]
for c in col_list:
colnames.append(c[0])
coltypes.append(c[1])
colwidths.append(c[2])
coloptions.append(c[3])
col_idx[c[0]] = len(colnames) - 1

View File

@@ -0,0 +1 @@
select t1.account, sum(if(t2.debit_or_credit = 'Debit', ifnull(t1.debit,0) - ifnull(t1.credit,0), ifnull(t1.credit,0) - ifnull(t1.debit,0))) from `tabGL Entry` t1, `tabAccount` t2 where t1.account = t2.name and t2.account_type != 'Bank or Cash' and t1.name in (select t1.name from `tabGL Entry` t1, `tabAccount` t2 where t1.against = t2.name and t2.account_type = 'Bank or Cash' and posting_date >= '%(posting_date)s' and posting_date <= '%(posting_date1)s') group by t1.account

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against Voucher,GL Entry\x01Voucher Type,GL Entry\x01Voucher No,GL Entry\x01Remarks,GL Entry\x01Is Cancelled,GL Entry\x01Is Opening,GL Entry\x01Fiscal Year,GL Entry\x01Company',
'creation': '2010-08-08 17:09:31',
'criteria_name': 'Payment Receipt Report',
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'GL Entry',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-06-11 17:00:54',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'payment_receipt_report',
'owner': 'jai@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': '',
'server_script': None,
'sort_by': '`tabGL Entry`.`name`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,26 @@
report.customize_filters = function() {
this.hide_all_filters();
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Voucher Type'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Is Opening'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.filter_hide = 0;
this.add_filter({fieldname:'range_1', label:'Range 1', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'range_2', label:'Range 2', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'range_3', label:'Range 3', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'range_4', label:'Range 4', fieldtype:'Data', ignore : 1, parent:'GL Entry'});
this.add_filter({fieldname:'aging_based_on', label:'Aging Based On', fieldtype:'Select', options:NEWLINE+'Transaction Date'+NEWLINE+'Aging Date',ignore : 1, parent:'Payable Voucher', 'report_default':'Aging Date'});
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher Detail'+FILTER_SEP +'Account'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df['report_default']=sys_defaults.company;
}
this.mytabs.items['Select Columns'].hide()

View File

@@ -0,0 +1,89 @@
#check mendatory
if not filter_values.get('posting_date') or not filter_values.get('posting_date1'):
msgprint("Please select From Posting Date and To Posting Date in 'Set Filters' section")
raise Exception
else:
from_date = filter_values.get('posting_date')
to_date = filter_values.get('posting_date1')
if not filter_values['range_1'] or not filter_values['range_2'] or not filter_values['range_3'] or not filter_values['range_4']:
msgprint("Please select aging ranges in no of days in 'Set Filters' section")
raise Exception
# ageing based on
aging_based_on = 'Aging Date'
if filter_values.has_key('aging_based_on') and filter_values['aging_based_on']:
aging_based_on = filter_values['aging_based_on'].split(NEWLINE)[-1]
# Add columns
# -----------
row_list = [['ID','Data','150px',''],
['Account','Data','150px',''],
['Credit','Data','150px',''],
['Debit','Data','150px',''],
['Against Payable','Data','150px',''],
['Is Advance','Data','150px',''],
['Transaction Date','Date','150px',''],
['Aging Date','Date','150px',''],
['Cheque No','Data','100px',''],
['Cheque Date','Date','150px',''],
['Supplier Type','Data','150px',''],
['Remark','Data','250px',''],
['Advance','Data','250px',''],
['PV Transaction Date','Date','150px',''],
['PV Aging Date','Date','150px',''],
['Age (Days)','Data','100px',''],
['0-'+cstr(filter_values['range_1']),'Currency','100px',''],
[cstr(cint(filter_values['range_1']) + 1)+ '-' +cstr(filter_values['range_2']),'Currency','100px',''],
[cstr(cint(filter_values['range_2']) + 1)+ '-' +cstr(filter_values['range_3']),'Currency','100px',''],
[cstr(cint(filter_values['range_3']) + 1)+ '-' +cstr(filter_values['range_4']),'Currency','100px',''],
[cstr(filter_values['range_4']) + '-Above','Currency','100px','']]
for r in row_list:
colnames.append(r[0])
coltypes.append(r[1])
colwidths.append(r[2])
coloptions.append(r[3])
col_idx[r[0]] = len(colnames)-1
for r in res:
if r[col_idx['Against Payable']]:
dt=sql("select voucher_date, aging_date from `tabPayable Voucher` where name='%s'"%r[col_idx['Against Payable']])
r.append('')
r.append(dt and cstr(dt[0][0]) or '')
r.append(dt and cstr(dt[0][1]) or '')
else:
r.append(r[col_idx['Debit']])
r.append('')
r.append('')
# Aging Credit Amount
val_l1 = val_l2 = val_l3 = val_l4 = val_l5_above = diff = 0
if r[col_idx['Against Payable']]:
amt = flt(r[col_idx['Debit']]) or (-1)*flt(r[col_idx['Credit']])
if aging_based_on == 'Transaction Date' and r[col_idx['PV Transaction Date']]:
diff = (getdate(r[col_idx['Transaction Date']]) - getdate(r[col_idx['PV Transaction Date']])).days
elif aging_based_on == 'Aging Date' and r[col_idx['PV Aging Date']]:
diff = (getdate(r[col_idx['Aging Date']]) - getdate(r[col_idx['PV Aging Date']])).days
if diff < cint(filter_values['range_1']):
val_l1 = amt
if diff >= cint(filter_values['range_1']) and diff < cint(filter_values['range_2']):
val_l2 = amt
if diff >= cint(filter_values['range_2']) and diff < cint(filter_values['range_3']):
val_l3 = amt
if diff >= cint(filter_values['range_3']) and diff < cint(filter_values['range_4']):
val_l4 = amt
if diff >= cint(filter_values['range_4']):
val_l5_above = amt
r.append(diff)
r.append(val_l1)
r.append(val_l2)
r.append(val_l3)
r.append(val_l4)
r.append(val_l5_above)

View File

@@ -0,0 +1,12 @@
SELECT `tabJournal Voucher`.`name`,`tabJournal Voucher Detail`.`account`,`tabJournal Voucher Detail`.`credit`,`tabJournal Voucher Detail`.`debit`,`tabJournal Voucher Detail`.`against_voucher`,`tabJournal Voucher Detail`.`is_advance`,`tabJournal Voucher`.`voucher_date`,`tabJournal Voucher`.`aging_date`,`tabJournal Voucher`.`cheque_no`,`tabJournal Voucher`.`cheque_date`,`tabSupplier`.`supplier_type`,`tabJournal Voucher`.`remark`
FROM `tabJournal Voucher Detail`,`tabJournal Voucher`,`tabAccount`,`tabSupplier`
WHERE `tabJournal Voucher`.docstatus=1
AND `tabJournal Voucher`.`posting_date`>='%(posting_date)s'
AND `tabJournal Voucher`.`posting_date`<='%(posting_date1)s'
AND `tabJournal Voucher`.`company` LIKE '%(company)s%%'
AND `tabJournal Voucher Detail`.`account` LIKE '%(account)s%%'
AND `tabAccount`.`master_type` = 'Supplier'
AND `tabAccount`.`account_name` = `tabSupplier`.`name`
AND `tabJournal Voucher Detail`.`account` = `tabAccount`.`name`
AND `tabJournal Voucher Detail`.`parent` = `tabJournal Voucher`.`name`
ORDER BY `tabJournal Voucher`.`name`

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'Journal Voucher\x01ID,Journal Voucher\x01Posting Date,Journal Voucher\x01Company,Journal Voucher\x01Cheque No,Journal Voucher\x01Cheque Date,Journal Voucher Detail\x01Account,Journal Voucher Detail\x01Debit,Journal Voucher Detail\x01Against Payable,Journal Voucher Detail\x01Is Advance',
'creation': '2010-08-08 17:09:31',
'criteria_name': 'Payment Report',
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'Journal Voucher Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':'','GL Entry\x01Range 1':'30','GL Entry\x01Range 2':'45','GL Entry\x01Range 3':'60','GL Entry\x01Range 4':'90','Receivable Voucher\x01Aging Based On':'','Payable Voucher\x01Aging Based On':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-06-10 09:48:52',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'payment_report',
'owner': 'Administrator',
'page_len': None,
'parent': None,
'parent_doc_type': 'Journal Voucher',
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': '`tabJournal Voucher`.`aging_date`',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,28 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'main_acc_head', label:'Main Account Head', fieldtype:'Link', options:'Account', ignore : 1, parent:'Journal Voucher Detail'});
this.add_filter({fieldname:'edu_cess_acc_head', label:'Edu Cess Account Head', fieldtype:'Link', options:'Account', ignore : 1, parent:'Journal Voucher Detail'});
this.add_filter({fieldname:'sh_edu_cess_acc_head', label:'S.H.Edu Cess Account Head', fieldtype:'Link', options:'Account', ignore : 1, parent:'Journal Voucher Detail'});
// un-hide fields
//this.add_filter({fieldname:'company', label:'Company', fieldtype:'Link', options:'Company', ignore : 1, parent:'Journal Voucher Detail'});
//this.add_filter({fieldname:'fiscal_year', label:'Fiscal Year', fieldtype:'Link', options:'Fiscal Year', ignore : 1, parent:'Journal Voucher Detail'});
//this.add_filter({fieldname:'posting_date', label:'Posting Date', fieldtype:'Date', ignore : 1, parent:'Journal Voucher Detail'});
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Company'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'Fiscal Year'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.filter_hide = 0;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.filter_hide = 0;
// set defaults
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df.in_first_page = 1;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'From Posting Date'].df['report_default'] = sys_defaults.year_start_date;
this.filter_fields_dict['Journal Voucher'+FILTER_SEP +'To Posting Date'].df['report_default'] = dateutil.obj_to_str(new Date());
//this.large_report = 1;
}

View File

@@ -0,0 +1,70 @@
# Add columns
# -----------
row_list = [['Date', 'Date', '150px', '']
,['INVOICE', 'Date', '150px', '']
,['Baisc Excise Duty', 'Currency', '150px', '']
,['Education Cess', 'Currency', '150px', '']
,['S.H.Education Cess', 'Currency', '150px', '']
,['Remarks', 'Data', '150px', '']
]
for r in row_list:
colnames.append(r[0])
coltypes.append(r[1])
colwidths.append(r[2])
coloptions.append(r[3])
col_idx[r[0]] = len(colnames)-1
# Get Object Of GL Control
#import webnotes
#import webnotes.model.code
#from webnotes.model.code import get_obj
#glc = webnotes.model.code.get_obj('GL Control')
# Get Year Start Date
ysd = sql("select year_start_date from `tabFiscal Year` where name='%s'" % filter_values['fiscal_year'])
ysd = ysd and ysd[0][0] or ''
# get as_on_date for opening
as_on_date = ''
if filter_values.get('posting_date'):
as_on_date = add_days(filter_values['posting_date'], -1)
# Get Opening Balance
def get_opening_balance(acc, fy, as_on_date, ysd, get_opening_balance):
#import webnotes
#import webnotes.model.code
#from webnotes.model.code import get_obj
#glc = webnotes.model.code.get_obj('GL Control')
glc = get_obj('GL Control')
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % acc)
return glc.get_as_on_balance(acc, fy, as_on_date, acc_det[0][0], acc_det[0][2], acc_det[0][3])[2]
cum_sum_main_acc_head = cum_sum_add_acc_head = cum_sum_cvd_acc_head = cum_sum_edu_cess_acc_head = cum_sum_sh_edu_cess_acc_head = 0
openg_main_acc_head = openg_add_acc_head = openg_cvd_acc_head = openg_edu_cess_acc_head = openg_sh_edu_cess_acc_head = 0
# Get Opening of Basic Excise Duty
if not filter_values['main_acc_head']:
msgprint("Please Enter Main Account Head")
raise Exception
cum_sum_main_acc_head = openg_main_acc_head = get_opening_balance(filter_values['main_acc_head'], filter_values['fiscal_year'], as_on_date, ysd, get_opening_balance)
# Get Opening of edu_cess_acc_head
if not filter_values['edu_cess_acc_head'] :
msgprint("Please Enter Edu Cess Account Head")
raise Exception
cum_sum_edu_cess_acc_head = openg_edu_cess_acc_head = get_opening_balance(filter_values['edu_cess_acc_head'], filter_values['fiscal_year'], as_on_date, ysd, get_opening_balance)
# Get Opening of sh_edu_cess_acc_head
if not filter_values['sh_edu_cess_acc_head'] :
msgprint("Please Enter S.H.Edu Cess Account Head")
raise Exception
cum_sum_sh_edu_cess_acc_head = openg_sh_edu_cess_acc_head = get_opening_balance(filter_values['sh_edu_cess_acc_head'], filter_values['fiscal_year'], as_on_date, ysd, get_opening_balance)
out = []
out.append(['Opening Balance of Duty in Credit', '', flt(openg_main_acc_head) + flt(openg_add_acc_head) , flt(openg_edu_cess_acc_head), flt(openg_sh_edu_cess_acc_head),''])
out += res
#if from_export == 0:
# msgprint("This is a very large report and cannot be shown in the browser as it is likely to make your browser very slow.Please click on 'Export' to open in a spreadsheet")
# raise Exception

View File

@@ -0,0 +1,28 @@
SELECT t1.posting_date, t1.name, SUM(CASE WHEN t2.account_head like '%(main_acc_head)s%' THEN t2.tax_amount ELSE 0.00 END), SUM(CASE WHEN t2.account_head like '%(edu_cess_acc_head)s' THEN t2.tax_amount ELSE 0.00 END), SUM(CASE WHEN t2.account_head like '%(sh_edu_cess_acc_head)s' THEN t2.tax_amount ELSE 0.00 END), '' AS remarks
FROM `tabDelivery Note` t1, `tabRV Tax Detail` t2
WHERE t2.parent = t1.name
AND t2.parenttype = 'Delivery Note'
AND (t2.account_head LIKE '%(main_acc_head)s%%'
OR t2.account_head LIKE '%(edu_cess_acc_head)s%%'
OR t2.account_head LIKE '%(sh_edu_cess_acc_head)s%%')
AND t1.`posting_date` >= '%(posting_date)s'
AND t1.`posting_date` <= '%(posting_date1)s'
AND t1.docstatus =1
GROUP BY t1.`name`
UNION
SELECT t1.posting_date, t1.name, SUM(CASE WHEN t2.account like '%(main_acc_head)s' THEN t2.credit ELSE 0.00 END), SUM(CASE WHEN t2.account like '%(edu_cess_acc_head)s' THEN t2.credit ELSE 0.00 END), SUM(CASE WHEN t2.account like '%(sh_edu_cess_acc_head)s' THEN t2.credit ELSE 0.00 END), t1.`remark`
FROM `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2
WHERE (t2.credit is not NULL OR t2.credit != '')
AND t2.credit > 0
AND t2.parent = t1.name
AND (t2.account LIKE '%(main_acc_head)s%'
OR t2.account LIKE '%(edu_cess_acc_head)s%'
OR t2.account LIKE '%(sh_edu_cess_acc_head)s%')
AND t1.`posting_date` >= '%(posting_date)s'
AND t1.`posting_date` <= '%(posting_date1)s'
AND t1.docstatus =1
GROUP BY t2.`parent`
ORDER BY `posting_date`,`name`

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': None,
'add_tab': None,
'columns': 'Journal Voucher\x01ID,Journal Voucher\x01Owner,Journal Voucher\x01Voucher Type,Journal Voucher\x01Voucher Date,Journal Voucher\x01Posting Date,Journal Voucher\x01Is Opening,Journal Voucher\x01Fiscal Year,Journal Voucher\x01Company,Journal Voucher\x01Cheque No,Journal Voucher\x01Clearance Date,Journal Voucher\x01TDS Applicable,Journal Voucher\x01TDS Category,Journal Voucher Detail\x01Account,Journal Voucher Detail\x01Cost Center,Journal Voucher Detail\x01Against Payable,Journal Voucher Detail\x01Against Receivable',
'creation': '2010-11-01 10:56:13',
'criteria_name': 'Progressive Total Excise Duty',
'custom_query': None,
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'Journal Voucher Detail',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Journal Voucher\x01Saved':1,'Journal Voucher\x01Submitted':1,'Journal Voucher\x01Voucher Type':'','Journal Voucher\x01Is Opening':'','Journal Voucher\x01Fiscal Year':'','Journal Voucher\x01Company':'','Journal Voucher\x01TDS Applicable':'','Journal Voucher\x01TDS Category':''}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2010-10-29 16:44:43',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'progressive_total_excise_duty',
'owner': 'jai@webnotestech.com',
'page_len': 50,
'parent': None,
'parent_doc_type': 'Journal Voucher',
'parentfield': None,
'parenttype': None,
'report_script': None,
'server_script': None,
'sort_by': 'ID',
'sort_order': 'DESC',
'standard': 'Yes'
}
]

View File

@@ -0,0 +1,49 @@
# add expense head columns
expense_acc = [c[0] for c in sql("select distinct expense_head from `tabPV Detail` where parenttype='Payable Voucher' and docstatus=1 order by idx asc")]
expense_acc.append('Net Total')
for i in expense_acc:
colnames.append(i)
coltypes.append('Currency')
colwidths.append('100px')
coloptions.append('')
# Add tax head columns
tax_acc = [c[0] for c in sql("select distinct account_head from `tabPurchase Tax Detail` where parenttype='Payable Voucher' and category in ('For Total', 'For Both') and add_deduct_tax = 'Add' and docstatus=1 order by idx asc")]
tax_acc.append('Total Tax')
tax_acc.append('GrandTotal')
for c in tax_acc:
if c:
colnames.append(c)
coltypes.append('Currency')
colwidths.append('100px')
coloptions.append('')
# remove total columns from the list
expense_acc = expense_acc[:-1]
tax_acc = tax_acc[:-2]
# add the values
for r in res:
net_total = 0
# get expense amount
for i in expense_acc:
val = sql("select sum(amount) from `tabPV Detail` where parent = %s and parenttype='Payable Voucher' and expense_head = %s", (r[col_idx['ID']], i))
val = flt(val and val[0][0] or 0)
net_total += val
r.append(val)
r.append(net_total)
# get tax amount
total_tax = 0
grand_total = 0
for c in tax_acc:
if c:
val = sql("select tax_amount from `tabPurchase Tax Detail` where parent = %s and parenttype='Payable Voucher' and account_head = %s and category in ('For Total', 'For Both') and add_deduct_tax = 'Add'", (r[col_idx['ID']], c))
val = flt(val and val[0][0] or 0)
total_tax += val
r.append(val)
r.append(total_tax)
r.append(total_tax+net_total) # grand total

View File

@@ -0,0 +1,37 @@
[
{
'add_col': None,
'add_cond': "`tabPayable Voucher`.is_opening != 'Yes'\n`tabPayable Voucher`.name not like 'OP/%'",
'add_tab': None,
'columns': 'Payable Voucher\x01ID,Payable Voucher\x01Voucher Date,Payable Voucher\x01Posting Date,Payable Voucher\x01Credit To,Payable Voucher\x01Expense Head',
'creation': '2010-12-15 08:39:24',
'criteria_name': 'Purchase Register',
'custom_query': '',
'description': None,
'dis_filters': None,
'disabled': None,
'doc_type': 'Payable Voucher',
'docstatus': 0,
'doctype': 'Search Criteria',
'filters': "{'Payable Voucher\x01Submitted':1}",
'graph_series': None,
'graph_values': None,
'group_by': None,
'idx': None,
'modified': '2011-06-06 14:37:00',
'modified_by': 'Administrator',
'module': 'Accounts',
'name': 'purchase_register',
'owner': 'Administrator',
'page_len': None,
'parent': None,
'parent_doc_type': None,
'parentfield': None,
'parenttype': None,
'report_script': '',
'server_script': None,
'sort_by': None,
'sort_order': None,
'standard': 'Yes'
}
]

Some files were not shown because too many files have changed in this diff Show More