mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
synced timestamps
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
report.customize_filters = function() {
|
||||
|
||||
//this.hide_all_filters();
|
||||
this.mytabs.items['Select Columns'].hide();
|
||||
this.mytabs.items['More Filters'].hide();
|
||||
|
||||
|
||||
this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Budget Detail'});
|
||||
this.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();
|
||||
|
||||
@@ -131,11 +131,6 @@ def append_colnames(name, colnames, coltypes, colwidths, coloptions, col_idx):
|
||||
col_idx[str(c) + n ] = len(colnames) - 1
|
||||
|
||||
|
||||
|
||||
# make default columns
|
||||
#coltypes[col_idx[based_on]] = 'Link'
|
||||
#coloptions[col_idx[based_on]]= based_on
|
||||
|
||||
# get start date
|
||||
start_date = get_value('Fiscal Year', fiscal_year, 'year_start_date')
|
||||
if not start_date:
|
||||
@@ -162,7 +157,7 @@ for r in res:
|
||||
|
||||
ch = make_child_lst(based_on,r[0].strip())
|
||||
|
||||
actual = sql("select sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) from `tabGL Entry` t1, `tabAccount` t2 where t2.is_pl_account = 'Yes' and t1.is_cancelled = 'No' and t1.cost_center in %s and t2.debit_or_credit = 'Debit' and t1.posting_date between '%s' and '%s' and t1.account = t2.name"%(ch, mon_list[count][data['start_date']], mon_list[count][data['end_date']]))
|
||||
actual = 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])
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
SELECT CONCAT(REPEAT(' ', COUNT(parent.name) - 1), node.name) AS name FROM `tabCost Center` AS node,`tabCost Center` AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.docstatus !=2 GROUP BY node.name ORDER BY node.lft
|
||||
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
|
||||
|
||||
@@ -11,8 +11,8 @@ else:
|
||||
from_date = filter_values['posting_date']
|
||||
to_date = filter_values['posting_date1']
|
||||
|
||||
ysd, from_date_year = sql("select year_start_date, name from `tabFiscal Year` where %s between year_start_date and date_sub(date_add(year_start_date,interval 1 year), interval 1 day)",from_date)[0]
|
||||
|
||||
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
|
||||
#---------------
|
||||
@@ -49,13 +49,25 @@ total_diff = total_debit - total_credit
|
||||
|
||||
# opening
|
||||
account = filter_values.get('account')
|
||||
if account:
|
||||
acc_det = sql("select debit_or_credit, is_pl_account, lft, rgt, group_or_ledger from tabAccount where name = '%s'" % account)
|
||||
closing_bal = get_obj('GL Control').get_as_on_balance(account, from_date_year, to_date, acc_det[0][0], acc_det[0][2], acc_det[0][3])[2]
|
||||
if acc_det[0][0] == 'Credit':
|
||||
closing_bal = -1*closing_bal
|
||||
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
|
||||
@@ -71,24 +83,24 @@ 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
|
||||
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
|
||||
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[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>
|
||||
@@ -99,5 +111,5 @@ myheader = """<table width = '100%%'><tr><td>"""+l_head+"""</td>
|
||||
""" % {'acc':account,
|
||||
'fdt':from_date,
|
||||
'tdt':to_date}
|
||||
|
||||
|
||||
page_template = myheader+"<div>%(table)s</div>"
|
||||
|
||||
@@ -3,15 +3,10 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
'creation': '2011-07-27 16:17:04',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-27 16:17:04',
|
||||
=======
|
||||
'creation': '2011-07-26 17:01:34',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-28 12:55:50',
|
||||
>>>>>>> d075a6c53dc2c832a363409cd4b32ff5a6482e5a
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-07-27 16:17:04',
|
||||
'creation': '2011-08-29 13:45:35',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-27 16:17:04',
|
||||
'modified': '2011-08-29 13:45:35',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-07-26 18:11:47',
|
||||
'creation': '2011-08-29 13:45:35',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-26 18:27:01',
|
||||
'modified': '2011-08-29 13:45:35',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-07-27 16:17:04',
|
||||
'creation': '2011-08-29 13:45:35',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-27 16:17:04',
|
||||
'modified': '2011-08-29 13:45:35',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
@@ -3,15 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
'creation': '2011-07-27 16:17:04',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-27 16:17:04',
|
||||
=======
|
||||
'creation': '2011-07-27 18:48:29',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-28 12:56:35',
|
||||
>>>>>>> d075a6c53dc2c832a363409cd4b32ff5a6482e5a
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
@@ -3,15 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
'creation': '2011-07-27 16:17:04',
|
||||
'creation': '2011-08-29 13:45:36',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-27 16:17:04',
|
||||
=======
|
||||
'creation': '2011-07-28 12:13:41',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-28 12:56:47',
|
||||
>>>>>>> d075a6c53dc2c832a363409cd4b32ff5a6482e5a
|
||||
'modified': '2011-08-29 13:45:36',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2011-07-27 16:17:04',
|
||||
'creation': '2011-08-29 13:45:36',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-07-27 16:17:04',
|
||||
'modified': '2011-08-29 13:45:36',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user