From 38ccf8260435bbb4becef05cdfad9d7f275f6c07 Mon Sep 17 00:00:00 2001 From: aakvatech <35020381+aakvatech@users.noreply.github.com> Date: Sat, 3 Oct 2020 19:41:38 +0300 Subject: [PATCH] fix: get_outstanding_invoices not ignoring the cancelled transactions Added is_cancelled=0 in 2 places for get_outstanding_invoices --- erpnext/accounts/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 51ac7cfbfa..008f6e8236 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -683,6 +683,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None, filters where party_type = %(party_type)s and party = %(party)s and account = %(account)s and {dr_or_cr} > 0 + and is_cancelled=0 {condition} and ((voucher_type = 'Journal Entry' and (against_voucher = '' or against_voucher is null)) @@ -705,6 +706,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None, filters and account = %(account)s and {payment_dr_or_cr} > 0 and against_voucher is not null and against_voucher != '' + and is_cancelled=0 group by against_voucher_type, against_voucher """.format(payment_dr_or_cr=payment_dr_or_cr), { "party_type": party_type,