mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-09 08:02:51 +00:00
first cut for lazy loading framework
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
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()
|
||||
@@ -1,152 +0,0 @@
|
||||
# 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
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
# get supplier type
|
||||
supp_type_dict = {}
|
||||
for each in sql("select t2.name, t1.supplier_type from tabSupplier t1, tabAccount t2 where t1.name = t2.account_name group by t2.name"):
|
||||
supp_type_dict[each[0]] = each[1]
|
||||
|
||||
# get due_date, bill_no, bill_date from PV
|
||||
pv_dict = {}
|
||||
for t in sql("select name, due_date, bill_no, bill_date from `tabPayable Voucher` group by name"):
|
||||
pv_dict[t[0]] = [cstr(t[1]), t[2], cstr(t[3])]
|
||||
|
||||
# pv outside this period
|
||||
pv_outside_period = [d[0] for d in sql("select distinct name from `tabPayable Voucher` where (posting_date < '%s' or posting_date > '%s') and docstatus = 1" % (from_date, to_date))]
|
||||
|
||||
|
||||
out = []
|
||||
total_booking_amt, total_outstanding_amt = 0,0
|
||||
|
||||
for r in res:
|
||||
outstanding_amt, due_date, bill_no, bill_date, cond = 0, '','','', ''
|
||||
booking_amt = r.pop(8)
|
||||
|
||||
# supplier type
|
||||
r.append(supp_type_dict.get(r[col_idx['Account']], ''))
|
||||
|
||||
# if entry against Payable Voucher
|
||||
if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Payable Voucher':
|
||||
r += pv_dict.get(r[col_idx['Voucher No']], ['', '', ''])
|
||||
cond = " and ifnull(against_voucher, '') = '%s'" % r[col_idx['Against Voucher']]
|
||||
|
||||
# if entry against JV & and not adjusted within period
|
||||
elif r[col_idx['Against Voucher Type']] == 'Payable Voucher' and r[col_idx['Against Voucher']] in pv_outside_period:
|
||||
booking_amt = 0
|
||||
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']]:
|
||||
booking_amt = 0
|
||||
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 += [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)
|
||||
@@ -1,11 +0,0 @@
|
||||
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`, `tabGL Entry`.`credit`
|
||||
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`
|
||||
@@ -1,32 +0,0 @@
|
||||
# Search Criteria, accounts_payable
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-10-22 16:28:49',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-10-22 15:16:03',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'GL Entry\x01Posting Date,GL Entry\x01Account,GL Entry\x01Against Voucher,GL Entry\x01Voucher No',
|
||||
'criteria_name': 'Accounts Payable',
|
||||
'doc_type': 'GL Entry',
|
||||
'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'}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'sort_by': '`tabGL Entry`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, accounts_payable
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'accounts_payable'
|
||||
}
|
||||
]
|
||||
@@ -1,22 +0,0 @@
|
||||
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()
|
||||
@@ -1,132 +0,0 @@
|
||||
|
||||
# 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)
|
||||
@@ -1,11 +0,0 @@
|
||||
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`
|
||||
@@ -1,32 +0,0 @@
|
||||
# Search Criteria, accounts_receivable
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-10-19 10:32:39',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-10-19 10:29:38',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'GL Entry\x01Posting Date,GL Entry\x01Transaction Date,GL Entry\x01Account,GL Entry\x01Against Voucher,GL Entry\x01Voucher No',
|
||||
'criteria_name': 'Accounts Receivable',
|
||||
'doc_type': 'GL Entry',
|
||||
'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'}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'sort_by': '`tabGL Entry`.`name`',
|
||||
'sort_order': 'ASC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, accounts_receivable
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'accounts_receivable'
|
||||
}
|
||||
]
|
||||
@@ -1,34 +0,0 @@
|
||||
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()
|
||||
@@ -1,36 +0,0 @@
|
||||
# Search Criteria, bank_clearance_report
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-08-08 17:09:31',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-06-09 16:14:13',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'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',
|
||||
'criteria_name': 'Bank Clearance report',
|
||||
'description': 'Bank Clearance report',
|
||||
'dis_filters': 'fiscal_year',
|
||||
'doc_type': 'Journal Voucher Detail',
|
||||
'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':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': 'Journal Voucher',
|
||||
'sort_by': 'ID',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, bank_clearance_report
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'bank_clearance_report'
|
||||
}
|
||||
]
|
||||
@@ -1,18 +0,0 @@
|
||||
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();
|
||||
@@ -1,46 +0,0 @@
|
||||
#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,'',''])
|
||||
@@ -1,36 +0,0 @@
|
||||
# Search Criteria, bank_reconciliation_statement
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-11-01 10:56:14',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-10-29 16:36:00',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'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')",
|
||||
'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',
|
||||
'criteria_name': 'Bank Reconciliation Statement',
|
||||
'dis_filters': 'clearance_date\nfiscal_year',
|
||||
'doc_type': 'Journal Voucher Detail',
|
||||
'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':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': 'Journal Voucher',
|
||||
'sort_by': '`tabJournal Voucher`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, bank_reconciliation_statement
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'bank_reconciliation_statement'
|
||||
}
|
||||
]
|
||||
@@ -1,15 +0,0 @@
|
||||
report.customize_filters = function() {
|
||||
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:'company', label:'Company', fieldtype:'Link', options:'Company', report_default:sys_defaults.company, ignore : 1, parent:'Budget Detail', in_first_page:1});
|
||||
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['More Filters'].hide();
|
||||
this.mytabs.items['Select Columns'].hide();
|
||||
@@ -1,167 +0,0 @@
|
||||
# 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
|
||||
|
||||
|
||||
# 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 ifnull(t2.is_pl_account, 'No') = 'Yes' and ifnull(t1.is_cancelled, 'No') = '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
|
||||
@@ -1,10 +0,0 @@
|
||||
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
|
||||
AND node.company_name like '%(company)s%%'
|
||||
GROUP BY node.name
|
||||
ORDER BY node.lft
|
||||
@@ -1,33 +0,0 @@
|
||||
# Search Criteria, budget_variance_report
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-09-01 15:48:09',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-05-23 16:07:41',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'harshada@webnotestech.com'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'criteria_name': 'Budget Variance Report',
|
||||
'doc_type': 'Budget Detail',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Budget Detail\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': 'Cost Center',
|
||||
'sort_by': '`tabCost Center`.`lft`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, budget_variance_report
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'budget_variance_report'
|
||||
}
|
||||
]
|
||||
@@ -1,10 +0,0 @@
|
||||
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();
|
||||
@@ -1,10 +0,0 @@
|
||||
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'
|
||||
@@ -1,36 +0,0 @@
|
||||
# Search Criteria, business_associate_commission_report
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-08-26 11:52:28',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-08-26 11:49:50',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'saumil@webnotestech.com'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'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',
|
||||
'columns': 'Receivable Voucher\x01Business Associate',
|
||||
'criteria_name': 'Business Associate Commission Report',
|
||||
'description': 'Track total commission given to your Business Associate',
|
||||
'doc_type': 'Receivable Voucher',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Receivable Voucher\x01Submitted':1}",
|
||||
'group_by': '`tabReceivable Voucher`.sales_partner',
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, business_associate_commission_report
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'business_associate_commission_report'
|
||||
}
|
||||
]
|
||||
@@ -1,18 +0,0 @@
|
||||
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'});
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
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)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
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
|
||||
@@ -1,33 +0,0 @@
|
||||
# Search Criteria, cash_flow_statement
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-11-01 10:56:14',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-10-29 16:39:19',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'Account\x01ID',
|
||||
'criteria_name': 'Cash Flow Statement',
|
||||
'dis_filters': 'fiscal_year\ntransaction_date',
|
||||
'doc_type': 'Account',
|
||||
'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'}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'sort_by': '`tabAccount`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, cash_flow_statement
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'cash_flow_statement'
|
||||
}
|
||||
]
|
||||
@@ -1,20 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
# 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
|
||||
@@ -1,31 +0,0 @@
|
||||
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`
|
||||
@@ -1,34 +0,0 @@
|
||||
# Search Criteria, cenvat_credit_-_input_or_capital_goods
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-11-01 10:56:14',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-10-29 16:42:14',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'jai@webnotestech.com'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'criteria_name': 'Cenvat Credit - Input or Capital Goods',
|
||||
'dis_filters': 'fiscal_year',
|
||||
'doc_type': 'Journal Voucher Detail',
|
||||
'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)'}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': 'Journal Voucher',
|
||||
'sort_by': 'ID',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, cenvat_credit_-_input_or_capital_goods
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'cenvat_credit_-_input_or_capital_goods'
|
||||
}
|
||||
]
|
||||
@@ -1,24 +0,0 @@
|
||||
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()
|
||||
@@ -1,90 +0,0 @@
|
||||
#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)
|
||||
@@ -1,13 +0,0 @@
|
||||
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`
|
||||
@@ -1,33 +0,0 @@
|
||||
# Search Criteria, collection_report
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-10-05 12:51:20',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-10-01 11:29:51',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'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',
|
||||
'criteria_name': 'Collection Report',
|
||||
'doc_type': 'Journal Voucher Detail',
|
||||
'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'}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'parent_doc_type': 'Journal Voucher',
|
||||
'sort_by': '`tabJournal Voucher`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, collection_report
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'collection_report'
|
||||
}
|
||||
]
|
||||
@@ -1,23 +0,0 @@
|
||||
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();
|
||||
@@ -1,13 +0,0 @@
|
||||
# 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
|
||||
@@ -1,12 +0,0 @@
|
||||
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`
|
||||
@@ -1,33 +0,0 @@
|
||||
# Search Criteria, cost_center_wise_expense
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-08-08 17:09:31',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-06-10 13:19:39',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'swarnalata@webnotestech.com'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'criteria_name': 'Cost Center wise Expense',
|
||||
'dis_filters': 'fiscal_year',
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Fiscal Year':'','GL Entry\x01Company':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'sort_by': '`tabGL Entry`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, cost_center_wise_expense
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'cost_center_wise_expense'
|
||||
}
|
||||
]
|
||||
@@ -1,24 +0,0 @@
|
||||
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'});
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
#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>"
|
||||
@@ -1,15 +0,0 @@
|
||||
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
|
||||
@@ -1,31 +0,0 @@
|
||||
# Search Criteria, creditors_ledger
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-12-14 10:23:28',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-11-22 17:05:46',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'nabin@webnotestech.com'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'criteria_name': "Creditor's Ledger",
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, creditors_ledger
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'creditors_ledger'
|
||||
}
|
||||
]
|
||||
@@ -1,24 +0,0 @@
|
||||
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'});
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
#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>"
|
||||
@@ -1,15 +0,0 @@
|
||||
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
|
||||
@@ -1,31 +0,0 @@
|
||||
# Search Criteria, debtors_ledger
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-12-14 10:23:28',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-11-22 17:02:05',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'nabin@webnotestech.com'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'criteria_name': "Debtor's Ledger",
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'No','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, debtors_ledger
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'debtors_ledger'
|
||||
}
|
||||
]
|
||||
@@ -1,23 +0,0 @@
|
||||
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'});
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
#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']
|
||||
|
||||
from_date_year = sql("select 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][0]
|
||||
#to_date_year = sql("select name from `tabFiscal Year` where %s between year_start_date and date_sub(date_add(year_start_date,interval 1 year), interval 1 day)",to_date)[0][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 not account:
|
||||
msgprint('Select an account to proceed',raise_exception=0,small=1)
|
||||
|
||||
|
||||
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, from_date, acc_det[0][0], acc_det[0][2], acc_det[0][3])[2]
|
||||
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
|
||||
opening_bal = -1*opening_bal
|
||||
|
||||
out = []
|
||||
|
||||
t_row = ['' for i in range(len(colnames))]
|
||||
t_row[1] = 'Opening as on '+formatdate(from_date)
|
||||
t_row[col_idx['Debit']-1] = opening_bal
|
||||
out.append(t_row)
|
||||
|
||||
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 ' + formatdate(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>"
|
||||
@@ -1,13 +0,0 @@
|
||||
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
|
||||
@@ -1,32 +0,0 @@
|
||||
# Search Criteria, general_ledger
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-12-14 10:23:28',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-11-30 16:26:42',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'criteria_name': 'General Ledger',
|
||||
'doc_type': 'GL Entry',
|
||||
'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':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'sort_by': '`tabGL Entry`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, general_ledger
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'general_ledger'
|
||||
}
|
||||
]
|
||||
@@ -1,17 +0,0 @@
|
||||
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
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
# Search Criteria, itemwise_purchase_register
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2010-09-10 16:53:49',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-06-20 13:25:29',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'Payable Voucher\x01ID,Payable Voucher\x01Credit To,Payable Voucher\x01Company,PV Detail\x01Item,PV Detail\x01Item Name,PV Detail\x01Expense Head,PV Detail\x01Cost Center,PV Detail\x01Qty,PV Detail\x01Rate (Default Curr.),PV Detail\x01Amount (Default Curr.)',
|
||||
'criteria_name': 'Itemwise Purchase Register',
|
||||
'description': 'Itemwise Purchase Register',
|
||||
'dis_filters': 'fiscal_year',
|
||||
'doc_type': 'PV Detail',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Payable Voucher\x01Submitted':1,'Payable Voucher\x01Is Opening':'No','Payable Voucher\x01Company':'','Payable Voucher\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': 'Payable Voucher',
|
||||
'sort_by': '`tabPayable Voucher`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, itemwise_purchase_register
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'itemwise_purchase_register'
|
||||
}
|
||||
]
|
||||
@@ -1,19 +0,0 @@
|
||||
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
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
# Search Criteria, itemwise_sales_register
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-01-19 17:33:33',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-06-20 16:30:41',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'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\x01Income Account,RV Detail\x01Qty,RV Detail\x01Basic Rate*,RV Detail\x01Amount*',
|
||||
'criteria_name': 'Itemwise Sales Register',
|
||||
'doc_type': 'RV Detail',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Receivable Voucher\x01Submitted':1,'Receivable Voucher\x01From Posting Date\x01lower':'','Receivable Voucher\x01To Posting Date\x01upper':'','Receivable Voucher\x01Is Opening':'','Receivable Voucher\x01Company':'','Receivable Voucher\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': 'Receivable Voucher',
|
||||
'sort_by': '`tabRV Detail`.`income_account`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, itemwise_sales_register
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'itemwise_sales_register'
|
||||
}
|
||||
]
|
||||
@@ -1,11 +0,0 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=sys_defaults.year_start_date;
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
}
|
||||
|
||||
$dh(this.mytabs.tabs['More Filters']);
|
||||
$dh(this.mytabs.tabs['Select Columns']);
|
||||
@@ -1,13 +0,0 @@
|
||||
data =[
|
||||
['Agreement No.','Data','100px',''],
|
||||
['Lessee Name','Data','300px',''],
|
||||
['Amount','Currency','120px','']
|
||||
]
|
||||
|
||||
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
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
select la.name, la.account, la.invoice_amount
|
||||
from `tabLease Agreement` la
|
||||
where start_date between '%(date)s' and '%(date1)s' order by la.name
|
||||
@@ -1,30 +0,0 @@
|
||||
# Search Criteria, lease_agreement_list
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-07-27 16:17:04',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-27 16:17:04',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,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',
|
||||
'criteria_name': 'Lease Agreement List',
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, lease_agreement_list
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'lease_agreement_list'
|
||||
}
|
||||
]
|
||||
@@ -1,14 +0,0 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1;
|
||||
|
||||
}
|
||||
|
||||
$dh(this.mytabs.tabs['More Filters']);
|
||||
$dh(this.mytabs.tabs['Select Columns']);
|
||||
@@ -1,13 +0,0 @@
|
||||
data =[
|
||||
['Month','Data','100px',''],
|
||||
['Year','Data','100px',''],
|
||||
['Amount','Currency','120px','']
|
||||
]
|
||||
|
||||
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
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
select date_format(due_date,'%M') as mnt,year(due_date),sum(amount)
|
||||
|
||||
from `tabLease Agreement` la,`tabLease Installment` lai
|
||||
|
||||
where la.name=lai.parent and (lai.cheque_date is null or lai.cheque_date > '%(date)s')
|
||||
|
||||
group by date_format(due_date,'%M-%Y')
|
||||
|
||||
order by year(due_date),month(due_date)
|
||||
@@ -1,30 +0,0 @@
|
||||
# Search Criteria, lease_monthly_future_installment_inflows
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-08-29 13:45:35',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-08-29 13:45:35',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,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',
|
||||
'criteria_name': 'Lease Monthly Future Installment Inflows',
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, lease_monthly_future_installment_inflows
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'lease_monthly_future_installment_inflows'
|
||||
}
|
||||
]
|
||||
@@ -1,14 +0,0 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1;
|
||||
|
||||
}
|
||||
|
||||
$dh(this.mytabs.tabs['More Filters']);
|
||||
$dh(this.mytabs.tabs['Select Columns']);
|
||||
@@ -1,14 +0,0 @@
|
||||
data =[
|
||||
['Agreement No.','Data','100px',''],
|
||||
['Lessee Name','Data','300px',''],
|
||||
['Amount','Currency','120px',''],
|
||||
['Age','Data','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
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
select la.name,la.account,lai.amount,cast('%(date)s' as date)-due_date as age
|
||||
|
||||
from `tabLease Agreement` la,`tabLease Installment` lai
|
||||
|
||||
where la.name=lai.parent and lai.due_date<cast('%(date)s' as date) and (lai.cheque_date is null or lai.cheque_date > cast('%(date)s' as date))
|
||||
|
||||
order by cast('%(date)s' as date)-due_date desc
|
||||
@@ -1,30 +0,0 @@
|
||||
# Search Criteria, lease_over_due_list
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-08-29 13:45:35',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-08-29 13:45:35',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,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',
|
||||
'criteria_name': 'Lease Over Due List',
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, lease_over_due_list
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'lease_over_due_list'
|
||||
}
|
||||
]
|
||||
@@ -1,14 +0,0 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1;
|
||||
|
||||
}
|
||||
|
||||
$dh(this.mytabs.tabs['More Filters']);
|
||||
$dh(this.mytabs.tabs['Select Columns']);
|
||||
@@ -1,16 +0,0 @@
|
||||
data =[
|
||||
['Lessee Name','Data','300px',''],
|
||||
['Below 30 Days','Currency','120px',''],
|
||||
['Below 90 Days','Currency','120px',''],
|
||||
['Below 180 Days','Currency','120px',''],
|
||||
['Below 360 Days','Currency','120px',''],
|
||||
['Above 360 Days','Currency','120px',''],
|
||||
]
|
||||
|
||||
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
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
select account,sum(od_30)as od_30,sum(od_90)as od_90,sum(od_180)as od_180,sum(od_360)as od_360,sum(od_1yr)as od_1yr from
|
||||
(
|
||||
select account,case when age<=30 then amount end as od_30,case when age between 31 and 90 then amount end as od_90,case when age between 91 and 180 then amount end as od_180,case when age between 181 and 360 then amount end as od_360,case when age>360 then amount end as od_1yr from
|
||||
(
|
||||
select la.account,lai.amount,cast('%(date)s' as date)-due_date as age
|
||||
from `tabLease Agreement` la,`tabLease Installment` lai
|
||||
where la.name=lai.parent and lai.due_date<'%(date)s' and (lai.cheque_date is null or lai.cheque_date > '%(date)s')
|
||||
)a
|
||||
)b group by account order by account
|
||||
@@ -1,30 +0,0 @@
|
||||
# Search Criteria, lease_overdue_age_wise
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-08-29 13:45:35',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-08-29 13:45:35',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,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',
|
||||
'criteria_name': 'Lease Overdue Age Wise',
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, lease_overdue_age_wise
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'lease_overdue_age_wise'
|
||||
}
|
||||
]
|
||||
@@ -1,11 +0,0 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=sys_defaults.year_start_date;
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
}
|
||||
|
||||
$dh(this.mytabs.tabs['More Filters']);
|
||||
$dh(this.mytabs.tabs['Select Columns']);
|
||||
@@ -1,13 +0,0 @@
|
||||
data =[
|
||||
['Month','Data','100px',''],
|
||||
['Year','Data','100px',''],
|
||||
['Amount','Currency','120px','']
|
||||
]
|
||||
|
||||
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
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
SELECT date_format(gl.posting_date,'%M'),year(gl.posting_date),sum(gl.credit) as amount
|
||||
FROM `tabGL Entry` gl, `tabAccount` a
|
||||
WHERE gl.account=a.name and a.master_type='Customer' and gl.credit>0 and gl.posting_date between '%(date)s' and '%(date1)s'
|
||||
GROUP BY month(gl.posting_date),year(gl.posting_date)
|
||||
ORDER BY year(gl.posting_date),month(gl.posting_date)
|
||||
@@ -1,30 +0,0 @@
|
||||
# Search Criteria, lease_receipt_summary_month_wise
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-07-27 16:17:04',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-27 16:17:04',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,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',
|
||||
'criteria_name': 'Lease Receipt Summary Month Wise',
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, lease_receipt_summary_month_wise
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'lease_receipt_summary_month_wise'
|
||||
}
|
||||
]
|
||||
@@ -1,11 +0,0 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=sys_defaults.year_start_date;
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
}
|
||||
|
||||
$dh(this.mytabs.tabs['More Filters']);
|
||||
$dh(this.mytabs.tabs['Select Columns']);
|
||||
@@ -1,12 +0,0 @@
|
||||
data =[
|
||||
['Lessee Name','Data','300px',''],
|
||||
['Amount','Currency','120px','']
|
||||
]
|
||||
|
||||
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
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
SELECT gl.account,sum(gl.credit) as amount
|
||||
FROM `tabGL Entry` gl, `tabAccount` a
|
||||
WHERE gl.account=a.name and a.master_type='Customer' and gl.posting_date between '%(date)s' and '%(date1)s'
|
||||
GROUP BY gl.account
|
||||
ORDER BY posting_date
|
||||
@@ -1,31 +0,0 @@
|
||||
# Search Criteria, lease_receipts_client_wise
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-08-29 13:45:36',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-08-29 13:45:36',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'GL Entry\x01ID,GL Entry\x01Owner,GL Entry\x01Posting Date,GL Entry\x01Aging Date,GL Entry\x01Account,GL Entry\x01Cost Center,GL Entry\x01Against,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',
|
||||
'criteria_name': 'Lease Receipts Client Wise',
|
||||
'doc_type': 'GL Entry',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
|
||||
'module': 'Accounts',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'standard': 'Yes'
|
||||
},
|
||||
|
||||
# Search Criteria, lease_receipts_client_wise
|
||||
{
|
||||
'doctype': 'Search Criteria',
|
||||
'name': 'lease_receipts_client_wise'
|
||||
}
|
||||
]
|
||||
@@ -1,14 +0,0 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
this.add_filter({fieldname:'date', label:'Date', fieldtype:'Date', options:'',ignore : 1, parent:'GL Entry', 'in_first_page':1});
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'From Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
// this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df['report_default']=dateutil.obj_to_str(new Date());
|
||||
|
||||
this.filter_fields_dict['GL Entry'+FILTER_SEP +'To Date'].df.filter_hide=1;
|
||||
|
||||
}
|
||||
|
||||
$dh(this.mytabs.tabs['More Filters']);
|
||||
$dh(this.mytabs.tabs['Select Columns']);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user