// Copyright (c) 2015, Frappe 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 frappe.pages["Accounts Browser"].on_page_load = function(wrapper){ frappe.ui.make_app_page({ parent: wrapper, single_column: true }) frappe.breadcrumbs.add("Accounts"); var main = wrapper.page.main, chart_area = $("
") .css({"margin-bottom": "15px", "min-height": "200px"}) .appendTo(main), help_area = $('
'+ '

'+__('Quick Help')+'

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

'+__('Please setup your chart of accounts before you start Accounting Entries')+'

').appendTo(main); if (frappe.boot.user.can_create.indexOf("Company") !== -1) { wrapper.page.add_menu_item(__('New Company'), function() { newdoc('Company'); }, true); } wrapper.page.add_menu_item(__('Refresh'), function() { wrapper.$company_select.change(); }); wrapper.page.set_primary_action(__('New'), function() { erpnext.account_chart && erpnext.account_chart.make_new(); }, "octicon octicon-plus"); // company-select wrapper.$company_select = wrapper.page.add_select("Company", []) .change(function() { var ctype = frappe.get_route()[1] || 'Account'; erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(), chart_area.get(0), wrapper.page); }) // load up companies return frappe.call({ method: 'erpnext.accounts.page.accounts_browser.accounts_browser.get_companies', callback: function(r) { wrapper.$company_select.empty(); $.each(r.message, function(i, v) { $('