From 999b30f2e26f98d20a936d97eb0dcaa149f2b2e7 Mon Sep 17 00:00:00 2001 From: Graeme Gellatly Date: Sun, 2 Jun 2019 23:17:35 +1200 Subject: [PATCH] [FIX] Aging Buckets In certain scenarios involving mutliple payments for multiple invoices, where the reconciliation happens together and the debit move is the smaller item the aging duplicates its value, making the balance greater than it should be. This fix works by preventing moves where different lines are both partial reconciled being grouped together by adding the lines id to the group by clause of _show_buckets_sql_q1 --- partner_statement/report/report_statement_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_statement/report/report_statement_common.py b/partner_statement/report/report_statement_common.py index d1b0564e..e65a9b52 100644 --- a/partner_statement/report/report_statement_common.py +++ b/partner_statement/report/report_statement_common.py @@ -74,7 +74,7 @@ class ReportStatementCommon(models.AbstractModel): ) AND l.date <= %(date_end)s AND not l.blocked GROUP BY l.partner_id, l.currency_id, l.date, l.date_maturity, l.amount_currency, l.balance, l.move_id, - l.company_id + l.company_id, l.id """, locals()), "utf-8") def _show_buckets_sql_q2(self, date_end, minus_30, minus_60, minus_90,