stock ageing: apply zero filters
diff --git a/stock/page/stock_ageing/stock_ageing.js b/stock/page/stock_ageing/stock_ageing.js
index 57e69cd..fb60771 100644
--- a/stock/page/stock_ageing/stock_ageing.js
+++ b/stock/page/stock_ageing/stock_ageing.js
@@ -64,10 +64,7 @@
},
filters: [
{fieldtype:"Select", label: "Warehouse", link:"Warehouse",
- default_value: "Select Warehouse...",
- filter: function(val, item, opts, me) {
- return me.apply_zero_filter(val, item, opts, me);
- }},
+ default_value: "Select Warehouse..."},
{fieldtype:"Select", label: "Brand", link:"Brand",
default_value: "Select Brand...", filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val;
@@ -108,6 +105,11 @@
this.data = $.map(this.data, function(d) {
return me.apply_filter(d, "brand") ? d : null;
});
+
+ // filter out rows with zero values
+ this.data = $.map(this.data, function(d) {
+ return me.apply_zero_filter(null, d, null, me) ? d : null;
+ });
},
prepare_balances: function() {
var me = this;