diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.js b/erpnext/accounts/page/financial_analytics/financial_analytics.js index 7d2cfb1179..df30d83861 100644 --- a/erpnext/accounts/page/financial_analytics/financial_analytics.js +++ b/erpnext/accounts/page/financial_analytics/financial_analytics.js @@ -17,8 +17,9 @@ frappe.pages['financial-analytics'].onload = function(wrapper) { erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({ filters: [ { - fieldtype:"Select", label: __("PL or BS"), - options:["Profit and Loss", "Balance Sheet"], + fieldtype:"Select", label: __("PL or BS"), fieldname: "pl_or_bs", + options:[{"label": __("Profit and Loss"), "value": "Profit and Loss"}, + {"label": __("Balance Sheet"), "value": "Balance Sheet"}], filter: function(val, item, opts, me) { if(item._show) return true; @@ -31,19 +32,21 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({ } }, { - fieldtype:"Select", label: __("Company"), - link:"Company", default_value: "Select Company...", + fieldtype:"Select", label: __("Company"), fieldname: "company", + link:"Company", default_value: __("Select Company..."), filter: function(val, item, opts) { return item.company == val || val == opts.default_value || item._show; } }, - {fieldtype:"Select", label: __("Fiscal Year"), link:"Fiscal Year", - default_value: "Select Fiscal Year..."}, - {fieldtype:"Date", label: __("From Date")}, + {fieldtype:"Select", label: __("Fiscal Year"), link:"Fiscal Year", fieldname: "fiscal_year", + default_value: __("Select Fiscal Year...")}, + {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"}, {fieldtype:"Label", label: __("To")}, - {fieldtype:"Date", label: __("To Date")}, - {fieldtype:"Select", label: __("Range"), - options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, + {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"}, + {fieldtype:"Select", label: __("Range"), fieldname: "range", + options:[{label: __("Daily"), value: "Daily"}, {label: __("Weekly"), value: "Weekly"}, + {label: __("Monthly"), value: "Monthly"}, {label: __("Quarterly"), value: "Quarterly"}, + {label: __("Yearly"), value: "Yearly"}]}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"} ], diff --git a/erpnext/accounts/page/trial_balance/trial_balance.js b/erpnext/accounts/page/trial_balance/trial_balance.js index 95818093f6..e73e1d4f3a 100644 --- a/erpnext/accounts/page/trial_balance/trial_balance.js +++ b/erpnext/accounts/page/trial_balance/trial_balance.js @@ -3,7 +3,7 @@ frappe.require("assets/erpnext/js/account_tree_grid.js"); -frappe.pages['trial-balance'].onload = function(wrapper) { +frappe.pages['trial-balance'].onload = function(wrapper) { frappe.ui.make_app_page({ parent: wrapper, title: __('Trial Balance'), @@ -13,26 +13,26 @@ frappe.pages['trial-balance'].onload = function(wrapper) { init: function(wrapper, title) { var me = this; this._super(wrapper, title); - + // period closing entry checkbox this.wrapper.bind("make", function() { $('
' + + class="with_period_closing_entry">' + __("With period closing entry") + '
') .appendTo(me.wrapper) .find("input").click(function() { me.refresh(); }); }); }, - + 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, + // 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) { @@ -44,8 +44,8 @@ frappe.pages['trial-balance'].onload = function(wrapper) { }, }) erpnext.trial_balance = new TrialBalance(wrapper, 'Trial Balance'); - + wrapper.appframe.add_module_icon("Accounts") - -} \ No newline at end of file + +} diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.js b/erpnext/buying/page/purchase_analytics/purchase_analytics.js index 2e29d01a0a..f1c050d1ff 100644 --- a/erpnext/buying/page/purchase_analytics/purchase_analytics.js +++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.js @@ -86,21 +86,24 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({ this.columns = std_columns.concat(this.columns); }, filters: [ - {fieldtype:"Select", label: __("Tree Type"), options:["Supplier Type", "Supplier", - "Item Group", "Item"], + {fieldtype:"Select", label: __("Tree Type"), fieldname: "tree_type", + options:["Supplier Type", "Supplier", "Item Group", "Item"], filter: function(val, item, opts, me) { return me.apply_zero_filter(val, item, opts, me); }}, - {fieldtype:"Select", label: __("Based On"), options:["Purchase Invoice", - "Purchase Order", "Purchase Receipt"]}, - {fieldtype:"Select", label: __("Value or Qty"), options:["Value", "Quantity"]}, - {fieldtype:"Select", label: __("Company"), link:"Company", - default_value: "Select Company..."}, - {fieldtype:"Date", label: __("From Date")}, + {fieldtype:"Select", label: __("Based On"), fieldname: "based_on", + options:["Purchase Invoice", "Purchase Order", "Purchase Receipt"]}, + {fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty", + options:["Value", "Quantity"]}, + {fieldtype:"Select", label: __("Company"), link:"Company", fieldname: "company", + default_value: __("Select Company...")}, + {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"}, {fieldtype:"Label", label: __("To")}, - {fieldtype:"Date", label: __("To Date")}, - {fieldtype:"Select", label: __("Range"), - options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, + {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"}, + {fieldtype:"Select", label: __("Range"), fieldname: "range", + options:[{label: __("Daily"), value: "Daily"}, {label: __("Weekly"), value: "Weekly"}, + {label: __("Monthly"), value: "Monthly"}, {label: __("Quarterly"), value: "Quarterly"}, + {label: __("Yearly"), value: "Yearly"}]}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"} ], @@ -126,7 +129,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({ // Set parent supplier type for tree view $.each(frappe.report_dump.data["Supplier Type"], function(i, v) { - v['parent_supplier_type'] = "All Supplier Types" + v['parent_supplier_type'] = __("All Supplier Types") }) frappe.report_dump.data["Supplier Type"] = [{ @@ -136,7 +139,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({ frappe.report_dump.data["Supplier"].push({ name: __("Not Set"), - parent_supplier_type: "All Supplier Types", + parent_supplier_type: __("All Supplier Types"), id: "Not Set", }); @@ -219,7 +222,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({ $.each(this.data, function(i, item) { var parent = me.parent_map[item.name]; while(parent) { - parent_group = me.item_by_name[parent]; + var parent_group = me.item_by_name[parent]; $.each(me.columns, function(c, col) { if (col.formatter == me.currency_formatter) { diff --git a/erpnext/public/js/account_tree_grid.js b/erpnext/public/js/account_tree_grid.js index 7002c1a1c5..87fb7a986b 100644 --- a/erpnext/public/js/account_tree_grid.js +++ b/erpnext/public/js/account_tree_grid.js @@ -55,18 +55,19 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({ }, filters: [ - {fieldtype: "Select", label: __("Company"), link:"Company", default_value: "Select Company...", + {fieldtype: "Select", label: __("Company"), link:"Company", fieldname: "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", - default_value: "Select Fiscal Year..."}, - {fieldtype: "Date", label: __("From Date")}, + {fieldtype: "Select", label: "Fiscal Year", link:"Fiscal Year", fieldname: "fiscal_year", + default_value: __("Select Fiscal Year...")}, + {fieldtype: "Date", label: __("From Date"), fieldname: "from_date"}, {fieldtype: "Label", label: __("To")}, - {fieldtype: "Date", label: __("To Date")}, + {fieldtype: "Date", label: __("To Date"), fieldname: "to_date"}, {fieldtype: "Button", label: __("Refresh"), icon:"icon-refresh icon-white", cssClass:"btn-info"}, {fieldtype: "Button", label: __("Reset Filters"), icon: "icon-filter"}, @@ -83,7 +84,7 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({ me.filter_inputs.to_date.val(dateutil.str_to_user(v.year_end_date)); } }); - me.set_route(); + me.refresh(); }); me.show_zero_check() if(me.ignore_closing_entry) me.ignore_closing_entry(); diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js index 7c15dba2a5..d4f43e98b9 100644 --- a/erpnext/public/js/stock_analytics.js +++ b/erpnext/public/js/stock_analytics.js @@ -10,11 +10,11 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({ page: wrapper, parent: $(wrapper).find('.layout-main'), appframe: wrapper.appframe, - doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", + doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand", "Fiscal Year", "Serial No"], tree_grid: { - show: true, - parent_field: "parent_item_group", + show: true, + parent_field: "parent_item_group", formatter: function(item) { if(!item.is_group) { return repl("