From f23810749ddde39a3657ebe828ae5f1bd58c0d53 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 13 Mar 2022 18:13:12 +0530 Subject: [PATCH] fix: Do not consider cancelled entries (cherry picked from commit 6308e1be91fef76023d17c232519d51069ce31a1) --- .../report/trial_balance_for_party/trial_balance_for_party.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.py b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.py index d843dfd3ce3..70effce5684 100644 --- a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.py +++ b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.py @@ -107,6 +107,7 @@ def get_opening_balances(filters): select party, sum(debit) as opening_debit, sum(credit) as opening_credit from `tabGL Entry` where company=%(company)s + and is_cancelled=0 and ifnull(party_type, '') = %(party_type)s and ifnull(party, '') != '' and (posting_date < %(from_date)s or ifnull(is_opening, 'No') = 'Yes') {account_filter} @@ -133,6 +134,7 @@ def get_balances_within_period(filters): select party, sum(debit) as debit, sum(credit) as credit from `tabGL Entry` where company=%(company)s + and is_cancelled = 0 and ifnull(party_type, '') = %(party_type)s and ifnull(party, '') != '' and posting_date >= %(from_date)s and posting_date <= %(to_date)s and ifnull(is_opening, 'No') = 'No'