// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt // tree of chart of accounts / cost centers // multiple companies // add node // edit node // see ledger pscript['onload_Accounts Browser'] = function(wrapper){ console.log($(wrapper).html()); wn.ui.make_app_page({ parent: wrapper, single_column: true }) wrapper.appframe.add_module_icon("Accounts"); var main = $(wrapper).find(".layout-main"), chart_area = $("
") .css({"margin-bottom": "15px", "min-height": "200px"}) .appendTo(main), help_area = $('
'+ '

'+wn._('Quick Help')+'

'+ '
    '+ '
  1. '+wn._('To add child nodes, explore tree and click on the node under which you want to add more nodes.')+'
  2. '+ '
  3. '+ wn._('Accounting Entries can be made against leaf nodes, called')+ '' +wn._('Ledgers')+'.'+ wn._('Entries against') + '' +wn._('Groups') + ''+ wn._('are not allowed.')+ '
  4. '+ '
  5. '+wn._('Please do NOT create Account (Ledgers) for Customers and Suppliers. They are created directly from the Customer / Supplier masters.')+'
  6. '+ '
  7. '+ ''+wn._('To create a Bank Account:')+''+ wn._('Go to the appropriate group (usually Application of Funds > Current Assets > Bank Accounts)')+ wn._('and create a new Account Ledger (by clicking on Add Child) of type "Bank or Cash"')+ '
  8. '+ '
  9. '+ ''+wn._('To create a Tax Account:')+''+ wn._('Go to the appropriate group (usually Source of Funds > Current Liabilities > Taxes and Duties)')+ wn._('and create a new Account Ledger (by clicking on Add Child) of type "Tax" and do mention the Tax rate.')+ '
  10. '+ '
'+ '

'+wn._('Please setup your chart of accounts before you start Accounting Entries')+'

').appendTo(main); if (wn.boot.profile.can_create.indexOf("Company") !== -1) { wrapper.appframe.add_button(wn._('New Company'), function() { newdoc('Company'); }, 'icon-plus'); } wrapper.appframe.set_title_right('Refresh', function() { wrapper.$company_select.change(); }); // company-select wrapper.$company_select = wrapper.appframe.add_select("Company", []) .change(function() { var ctype = wn.get_route()[1] || 'Account'; erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(), chart_area.get(0)); pscript.set_title(wrapper, ctype, $(this).val()); }) // load up companies return wn.call({ method:'accounts.page.accounts_browser.accounts_browser.get_companies', callback: function(r) { wrapper.$company_select.empty(); $.each(r.message, function(i, v) { $('