fix: change filters for AR summary

This commit is contained in:
Gursheen Anand 2023-09-26 15:10:16 +05:30
parent 832d7e7d7b
commit 7d96044d8e
2 changed files with 21 additions and 5 deletions

View File

@ -52,9 +52,7 @@ frappe.query_reports["Accounts Receivable"] = {
}, },
on_change: () => { on_change: () => {
frappe.query_report.set_filter_value('party', ""); frappe.query_report.set_filter_value('party', "");
let party_type = frappe.query_report.get_filter_value('party_type');
frappe.query_report.toggle_filter_display('customer_group', frappe.query_report.get_filter_value('party_type') !== "Customer"); frappe.query_report.toggle_filter_display('customer_group', frappe.query_report.get_filter_value('party_type') !== "Customer");
} }
}, },
{ {

View File

@ -72,10 +72,28 @@ frappe.query_reports["Accounts Receivable Summary"] = {
} }
}, },
{ {
"fieldname":"customer", "fieldname": "party_type",
"label": __("Customer"), "label": __("Party Type"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Customer" "options": "Party Type",
"Default": "Customer",
get_query: () => {
return {
filters: {
'account_type': 'Receivable'
}
};
},
on_change: () => {
frappe.query_report.set_filter_value('party', "");
frappe.query_report.toggle_filter_display('customer_group', frappe.query_report.get_filter_value('party_type') !== "Customer");
}
},
{
"fieldname":"party",
"label": __("Party"),
"fieldtype": "Dynamic Link",
"options": "party_type",
}, },
{ {
"fieldname":"customer_group", "fieldname":"customer_group",