feat: Accounts Payable report based on payment terms (#19672)

This commit is contained in:
Deepesh Garg 2019-11-29 16:56:27 +05:30 committed by Nabin Hait
parent 20c31dd579
commit 06a6fa4cfc
2 changed files with 6 additions and 1 deletions

View File

@ -100,6 +100,11 @@ frappe.query_reports["Accounts Payable"] = {
"fieldtype": "Link",
"options": "Supplier Group"
},
{
"fieldname":"based_on_payment_terms",
"label": __("Based On Payment Terms"),
"fieldtype": "Check",
},
{
"fieldname":"tax_id",
"label": __("Tax Id"),

View File

@ -318,7 +318,7 @@ class ReceivablePayableReport(object):
self.append_payment_term(row, d, term)
def append_payment_term(self, row, d, term):
if self.filters.get("customer") and d.currency == d.party_account_currency:
if (self.filters.get("customer") or self.filters.get("supplier")) and d.currency == d.party_account_currency:
invoiced = d.payment_amount
else:
invoiced = flt(flt(d.payment_amount) * flt(d.conversion_rate), self.currency_precision)