feat: add party type filter
This commit is contained in:
@@ -12,10 +12,28 @@ frappe.query_reports["TDS Payable Monthly"] = {
|
|||||||
"default": frappe.defaults.get_default('company')
|
"default": frappe.defaults.get_default('company')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"supplier",
|
"fieldname":"party_type",
|
||||||
"label": __("Supplier"),
|
"label": __("Party Type"),
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Select",
|
||||||
"options": "Supplier",
|
"options": ["Supplier", "Customer"],
|
||||||
|
"reqd": 1,
|
||||||
|
"default": "Supplier",
|
||||||
|
"on_change": function(){
|
||||||
|
frappe.query_report.set_filter_value("party", "");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"party",
|
||||||
|
"label": __("Party"),
|
||||||
|
"fieldtype": "Dynamic Link",
|
||||||
|
"get_options": function() {
|
||||||
|
var party_type = frappe.query_report.get_filter_value('party_type');
|
||||||
|
var party = frappe.query_report.get_filter_value('party');
|
||||||
|
if(party && !party_type) {
|
||||||
|
frappe.throw(__("Please select Party Type first"));
|
||||||
|
}
|
||||||
|
return party_type;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"from_date",
|
"fieldname":"from_date",
|
||||||
|
|||||||
Reference in New Issue
Block a user