Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
024c60741a
@ -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() {
|
||||
$('<div style="margin: 10px 0px; "\
|
||||
class="with_period_closing_entry"><input type="checkbox" checked="checked">\
|
||||
With period closing entry</div>')
|
||||
.appendTo(me.wrapper)
|
||||
.find("input").click(function() { me.refresh(); });
|
||||
});
|
||||
},
|
||||
|
||||
export: function() {
|
||||
var msgbox = msgprint('<p>Select To Download:</p>\
|
||||
<p><input type="checkbox" name="with_groups" checked> Account Groups</p>\
|
||||
@ -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');
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user