diff --git a/accounts/page/trial_balance/trial_balance.js b/accounts/page/trial_balance/trial_balance.js index 3504ae0c98..3f47758f04 100644 --- a/accounts/page/trial_balance/trial_balance.js +++ b/accounts/page/trial_balance/trial_balance.js @@ -22,5 +22,39 @@ wn.pages['trial-balance'].onload = function(wrapper) { title: 'Trial Balance', single_column: true }); - erpnext.trial_balance = new erpnext.AccountTreeGrid(wrapper, 'Trial Balance'); + var TrialBalance = erpnext.AccountTreeGrid.extend({ + export: function() { + var msgbox = msgprint('
Select To Download:
\ +Account Groups
\ +Account Ledgers
\ +');
+
+ var me = this;
+
+ $(msgbox.body).find("button").click(function() {
+ var with_groups = $(msgbox.body).find("[name='with_groups']").is(":checked");
+ var with_ledgers = $(msgbox.body).find("[name='with_ledgers']").is(":checked");
+
+ var data = wn.slickgrid_tools.get_view_data(me.columns, me.dataView,
+ function(row, item) {
+ if(with_groups) {
+ // pad row
+ for(var i=0; i