fix: filter by party in opening row calculation

This commit is contained in:
Gursheen Anand 2023-07-19 12:36:44 +05:30
parent a93d7633d4
commit 2f7b112736

View File

@ -375,5 +375,5 @@ def get_opening_row(party_type, party, from_date, company):
Sum(gle.credit).as_("credit"), Sum(gle.credit).as_("credit"),
(Sum(gle.debit) - Sum(gle.credit)).as_("balance"), (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) ).run(as_dict=True)