feat: added payment terms filter in the accounts payable summary

This commit is contained in:
Rohit Waghchaure 2019-07-16 01:52:03 +05:30
parent b395daf76c
commit 4c0dffe687
3 changed files with 16 additions and 0 deletions

View File

@ -88,6 +88,12 @@ frappe.query_reports["Accounts Payable"] = {
} }
} }
}, },
{
"fieldname":"payment_terms_template",
"label": __("Payment Terms Template"),
"fieldtype": "Link",
"options": "Payment Terms Template"
},
{ {
"fieldname":"supplier_group", "fieldname":"supplier_group",
"label": __("Supplier Group"), "label": __("Supplier Group"),

View File

@ -77,6 +77,12 @@ frappe.query_reports["Accounts Payable Summary"] = {
"fieldtype": "Link", "fieldtype": "Link",
"options": "Supplier" "options": "Supplier"
}, },
{
"fieldname":"payment_terms_template",
"label": __("Payment Terms Template"),
"fieldtype": "Link",
"options": "Payment Terms Template"
},
{ {
"fieldname":"supplier_group", "fieldname":"supplier_group",
"label": __("Supplier Group"), "label": __("Supplier Group"),

View File

@ -541,6 +541,10 @@ class ReceivablePayableReport(object):
where supplier_group=%s)""") where supplier_group=%s)""")
values.append(self.filters.get("supplier_group")) values.append(self.filters.get("supplier_group"))
if self.filters.get("payment_terms_template"):
conditions.append("party in (select name from tabSupplier where payment_terms=%s)")
values.append(self.filters.get("payment_terms_template"))
if self.filters.get("cost_center"): if self.filters.get("cost_center"):
lft, rgt = frappe.get_cached_value("Cost Center", lft, rgt = frappe.get_cached_value("Cost Center",
self.filters.get("cost_center"), ['lft', 'rgt']) self.filters.get("cost_center"), ['lft', 'rgt'])