diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 93c1bf1af05..2265d01cb1a 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -2384,7 +2384,7 @@ class QueryPaymentLedger: .where(Criterion.all(self.common_filter)) .where(Criterion.all(self.dimensions_filter)) .where(Criterion.all(self.voucher_posting_date)) - .groupby(ple.voucher_type, ple.voucher_no, ple.party_type, ple.party) + .groupby(ple.account, ple.voucher_type, ple.voucher_no, ple.party_type, ple.party) ) # build query for voucher outstanding @@ -2405,7 +2405,7 @@ class QueryPaymentLedger: .where(ple.delinked == 0) .where(Criterion.all(filter_on_against_voucher_no)) .where(Criterion.all(self.common_filter)) - .groupby(ple.against_voucher_type, ple.against_voucher_no, ple.party_type, ple.party) + .groupby(ple.account, ple.against_voucher_type, ple.against_voucher_no, ple.party_type, ple.party) ) # build CTE for combining voucher amount and outstanding