From d68fa3b95373baf28c775f1cf4479cba7cad54cb Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 1 Jan 2013 12:05:13 +0530 Subject: [PATCH 1/2] fixes in website utils --- website/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/utils.py b/website/utils.py index b7fd88da35..96fbdc8dc9 100644 --- a/website/utils.py +++ b/website/utils.py @@ -145,7 +145,7 @@ def prepare_args(page_name): if page_name in get_template_pages(): args = webnotes._dict({ - 'template': 'pages/%s' % page_name, + 'template': 'pages/%s.html' % page_name, 'name': page_name, }) if page_name in page_settings_map: From 3882db03e2cd0587efee929e49fde181614dbd1f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 1 Jan 2013 13:48:40 +0530 Subject: [PATCH 2/2] Trial Balance : with/without closing entry --- accounts/page/trial_balance/trial_balance.js | 33 ++++++++++++++++++++ public/js/account_tree_grid.js | 16 +++++----- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/accounts/page/trial_balance/trial_balance.js b/accounts/page/trial_balance/trial_balance.js index 9ea7666617..e5cfe5e405 100644 --- a/accounts/page/trial_balance/trial_balance.js +++ b/accounts/page/trial_balance/trial_balance.js @@ -23,6 +23,20 @@ wn.pages['trial-balance'].onload = function(wrapper) { single_column: true }); var TrialBalance = erpnext.AccountTreeGrid.extend({ + init: function(wrapper, title) { + var me = this; + this._super(wrapper, title); + + // period closing entry checkbox + this.wrapper.bind("make", function() { + $('
\ + With period closing entry
') + .appendTo(me.wrapper) + .find("input").click(function() { me.refresh(); }); + }); + }, + export: function() { var msgbox = msgprint('

Select To Download:

\

Account Groups

\ @@ -53,6 +67,25 @@ wn.pages['trial-balance'].onload = function(wrapper) { return false; }, + + prepare_balances: function() { + // store value of with closing entry + this.with_period_closing_entry = this.wrapper + .find(".with_period_closing_entry input:checked").length; + this._super(); + }, + + update_balances: function(account, posting_date, v) { + // for period closing voucher, + // only consider them when adding "With Closing Entry is checked" + if(v.voucher_type === "Period Closing Voucher") { + if(this.with_period_closing_entry) { + this._super(account, posting_date, v); + } + } else { + this._super(account, posting_date, v); + } + }, }) erpnext.trial_balance = new TrialBalance(wrapper, 'Trial Balance'); diff --git a/public/js/account_tree_grid.js b/public/js/account_tree_grid.js index 4c669a9d9e..a893a52f00 100644 --- a/public/js/account_tree_grid.js +++ b/public/js/account_tree_grid.js @@ -51,20 +51,21 @@ erpnext.AccountTreeGrid = wn.views.TreeGridReport.extend({ }, filters: [ - {fieldtype:"Select", label: "Company", link:"Company", default_value: "Select Company...", + {fieldtype: "Select", label: "Company", link:"Company", default_value: "Select Company...", filter: function(val, item, opts, me) { if (item.company == val || val == opts.default_value) { return me.apply_zero_filter(val, item, opts, me); } return false; }}, - {fieldtype:"Select", label: "Fiscal Year", link:"Fiscal Year", + {fieldtype: "Select", label: "Fiscal Year", link:"Fiscal Year", default_value: "Select Fiscal Year..."}, - {fieldtype:"Date", label: "From Date"}, - {fieldtype:"Label", label: "To"}, - {fieldtype:"Date", label: "To Date"}, - {fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"}, - {fieldtype:"Button", label: "Reset Filters"} + {fieldtype: "Date", label: "From Date"}, + {fieldtype: "Label", label: "To"}, + {fieldtype: "Date", label: "To Date"}, + {fieldtype: "Button", label: "Refresh", icon:"icon-refresh icon-white", + cssClass:"btn-info"}, + {fieldtype: "Button", label: "Reset Filters"}, ], setup_filters: function() { this._super(); @@ -81,6 +82,7 @@ erpnext.AccountTreeGrid = wn.views.TreeGridReport.extend({ me.set_route(); }); me.show_zero_check() + if(me.ignore_closing_entry) me.ignore_closing_entry(); }, prepare_data: function() { var me = this;