From 2f7b112736bf28e376b5b5c7d58c20d225e4be43 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Wed, 19 Jul 2023 12:36:44 +0530 Subject: [PATCH] fix: filter by party in opening row calculation --- erpnext/accounts/report/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index 91a6e7fd9f..5e915869fb 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -375,5 +375,5 @@ def get_opening_row(party_type, party, from_date, company): Sum(gle.credit).as_("credit"), (Sum(gle.debit) - Sum(gle.credit)).as_("balance"), ) - .where((gle.account.isin(party_account)) & (gle.posting_date < from_date)) + .where((gle.account.isin(party_account)) & (gle.party == party) & (gle.posting_date < from_date)) ).run(as_dict=True)