brotherton-erpnext/erpnext/stock/report/stock_ageing/stock_ageing.js
Ankush Menat d743c41b54
fix(ux): apply proper filtering in stock reports (#27411)
* fix(ux): apply proper filtering in stock reports

Stock Balance: apply company filter to warehouse field
Stock Ageing: apply company filter to warehouse field

* fix: unnecessary parens

Co-authored-by: Alan <2.alan.tom@gmail.com>
2021-09-12 16:38:18 +05:30

76 lines
1.5 KiB
JavaScript

// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.query_reports["Stock Ageing"] = {
"filters": [
{
"fieldname":"company",
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_user_default("Company"),
"reqd": 1
},
{
"fieldname":"to_date",
"label": __("As On Date"),
"fieldtype": "Date",
"default": frappe.datetime.get_today(),
"reqd": 1
},
{
"fieldname":"warehouse",
"label": __("Warehouse"),
"fieldtype": "Link",
"options": "Warehouse",
get_query: () => {
const company = frappe.query_report.get_filter_value("company");
return {
filters: {
...company && {company},
}
};
}
},
{
"fieldname":"item_code",
"label": __("Item"),
"fieldtype": "Link",
"options": "Item"
},
{
"fieldname":"brand",
"label": __("Brand"),
"fieldtype": "Link",
"options": "Brand"
},
{
"fieldname":"range1",
"label": __("Ageing Range 1"),
"fieldtype": "Int",
"default": "30",
"reqd": 1
},
{
"fieldname":"range2",
"label": __("Ageing Range 2"),
"fieldtype": "Int",
"default": "60",
"reqd": 1
},
{
"fieldname":"range3",
"label": __("Ageing Range 3"),
"fieldtype": "Int",
"default": "90",
"reqd": 1
},
{
"fieldname":"show_warehouse_wise_stock",
"label": __("Show Warehouse-wise Stock"),
"fieldtype": "Check",
"default": 0
}
]
}