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)