show analytics value based valuation method defined in item master
diff --git a/public/js/stock_analytics.js b/public/js/stock_analytics.js
index 53641ce..53be93c 100644
--- a/public/js/stock_analytics.js
+++ b/public/js/stock_analytics.js
@@ -62,8 +62,7 @@
this.columns = std_columns.concat(this.columns);
},
filters: [
- {fieldtype:"Select", label: "Value or Qty", options:["Value (Weighted Average)",
- "Value (FIFO)", "Quantity"],
+ {fieldtype:"Select", label: "Value or Qty", options:["Value", "Quantity"],
filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);
}},
@@ -145,7 +144,7 @@
if(me.value_or_qty!="Quantity") {
var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
- var is_fifo = this.value_or_qty== "Value (FIFO)";
+ var is_fifo = item.valuation_method == "FIFO";
var diff = me.get_value_diff(wh, sl, is_fifo);
} else {
var diff = sl.qty;