From f577b09b3b974e1c8bb2282d07c7936db6f948a1 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 23 Jul 2013 11:01:27 +0530 Subject: [PATCH] [minor] [fix] sales and purchase analytics --- buying/page/purchase_analytics/purchase_analytics.js | 4 ++-- selling/page/sales_analytics/sales_analytics.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buying/page/purchase_analytics/purchase_analytics.js b/buying/page/purchase_analytics/purchase_analytics.js index 96b88b3115..2b869a6725 100644 --- a/buying/page/purchase_analytics/purchase_analytics.js +++ b/buying/page/purchase_analytics/purchase_analytics.js @@ -121,7 +121,7 @@ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({ var me = this; this._super(); - this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on"]); + this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on", "company"]); this.show_zero_check() this.setup_plot_check(); @@ -216,7 +216,7 @@ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({ var is_val = this.value_or_qty == 'Value'; $.each(this.tl[this.based_on], function(i, tl) { - if (me.is_default('company') ? true : me.apply_filter(tl, "company")) { + if (me.is_default('company') ? true : tl.company === me.company) { var posting_date = dateutil.str_to_obj(tl.posting_date); if (posting_date >= from_date && posting_date <= to_date) { var item = me.item_by_name[tl[me.tree_grid.item_key]] || diff --git a/selling/page/sales_analytics/sales_analytics.js b/selling/page/sales_analytics/sales_analytics.js index 7fdc3ac641..8f09197f35 100644 --- a/selling/page/sales_analytics/sales_analytics.js +++ b/selling/page/sales_analytics/sales_analytics.js @@ -123,7 +123,7 @@ erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({ var me = this; this._super(); - this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on"]); + this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on", "company"]); this.show_zero_check() this.setup_plot_check(); @@ -209,7 +209,7 @@ erpnext.SalesAnalytics = wn.views.TreeGridReport.extend({ var is_val = this.value_or_qty == 'Value'; $.each(this.tl[this.based_on], function(i, tl) { - if (me.is_default('company') ? true : me.apply_filter(tl, "company")) { + if (me.is_default('company') ? true : tl.company === me.company) { var posting_date = dateutil.str_to_obj(tl.posting_date); if (posting_date >= from_date && posting_date <= to_date) { var item = me.item_by_name[tl[me.tree_grid.item_key]] ||