diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index 55d863928f..fd5241b1ff 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -23,10 +23,10 @@ frappe.query_reports["Accounts Receivable"] = { "options": "Customer Group" }, { - "fieldname":"credit_days_based_on", - "label": __("Credit Days Based On"), - "fieldtype": "Select", - "options": "\nFixed Days\nLast Day of the Next Month" + "fieldname":"payment_terms_template", + "label": __("Payment Terms Template"), + "fieldtype": "Link", + "options": "Payment Terms Template" }, { "fieldtype": "Break", diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 522abe85b4..0732b7dc09 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -283,9 +283,9 @@ class ReceivablePayableReport(object): where exists(select name from `tabCustomer Group` where lft >= {0} and rgt <= {1} and name=tabCustomer.customer_group))""".format(lft, rgt)) - if self.filters.get("credit_days_based_on"): - conditions.append("party in (select name from tabCustomer where credit_days_based_on=%s)") - values.append(self.filters.get("credit_days_based_on")) + if self.filters.get("payment_terms_template"): + conditions.append("party in (select name from tabCustomer where payment_terms=%s)") + values.append(self.filters.get("payment_terms_template")) return " and ".join(conditions), values