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>
This commit is contained in:
parent
6ef879fca2
commit
d743c41b54
@ -22,7 +22,15 @@ frappe.query_reports["Stock Ageing"] = {
|
|||||||
"fieldname":"warehouse",
|
"fieldname":"warehouse",
|
||||||
"label": __("Warehouse"),
|
"label": __("Warehouse"),
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Warehouse"
|
"options": "Warehouse",
|
||||||
|
get_query: () => {
|
||||||
|
const company = frappe.query_report.get_filter_value("company");
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
...company && {company},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"item_code",
|
"fieldname":"item_code",
|
||||||
|
@ -53,13 +53,14 @@ frappe.query_reports["Stock Balance"] = {
|
|||||||
"width": "80",
|
"width": "80",
|
||||||
"options": "Warehouse",
|
"options": "Warehouse",
|
||||||
get_query: () => {
|
get_query: () => {
|
||||||
var warehouse_type = frappe.query_report.get_filter_value('warehouse_type');
|
let warehouse_type = frappe.query_report.get_filter_value("warehouse_type");
|
||||||
if(warehouse_type){
|
let company = frappe.query_report.get_filter_value("company");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
'warehouse_type': warehouse_type
|
...warehouse_type && {warehouse_type},
|
||||||
|
...company && {company}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user