Merge pull request #18349 from rohitwaghchaure/added_payment_terms_in_accounts_payble_summary

feat: added payment terms filter in the accounts payable summary
This commit is contained in:
Deepesh Garg
2019-07-16 08:39:50 +05:30
committed by GitHub
3 changed files with 16 additions and 0 deletions

View File

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

View File

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

View File

@@ -540,6 +540,10 @@ class ReceivablePayableReport(object):
where supplier_group=%s)""")
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"))
accounts = [d.name for d in frappe.get_all("Account",
filters={"account_type": account_type, "company": self.filters.company})]
conditions.append("account in (%s)" % ','.join(['%s'] *len(accounts)))