Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/buying/page/purchase_analytics/purchase_analytics.js b/buying/page/purchase_analytics/purchase_analytics.js
index 96b88b3..2b869a6 100644
--- a/buying/page/purchase_analytics/purchase_analytics.js
+++ b/buying/page/purchase_analytics/purchase_analytics.js
@@ -121,7 +121,7 @@
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 @@
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 7fdc3ac..8f09197f 100644
--- a/selling/page/sales_analytics/sales_analytics.js
+++ b/selling/page/sales_analytics/sales_analytics.js
@@ -123,7 +123,7 @@
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 @@
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]] ||