From ed53fd31498b7ca0063f7a46c73244eedca7a962 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 --- .../report/customer_activity_statement.py | 2 +- .../report/customer_outstanding_statement.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/customer_activity_statement/report/customer_activity_statement.py b/customer_activity_statement/report/customer_activity_statement.py index ee5dafe6..ca226f73 100644 --- a/customer_activity_statement/report/customer_activity_statement.py +++ b/customer_activity_statement/report/customer_activity_statement.py @@ -190,7 +190,7 @@ class CustomerActivityStatement(models.AbstractModel): ) AND l.date <= '%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 """ % (self._get_reconcile_date(), date_end, self._get_reconcile_date(), date_end, partners, date_end, date_end, date_end) diff --git a/customer_outstanding_statement/report/customer_outstanding_statement.py b/customer_outstanding_statement/report/customer_outstanding_statement.py index 4fb3ab26..b0b905df 100644 --- a/customer_outstanding_statement/report/customer_outstanding_statement.py +++ b/customer_outstanding_statement/report/customer_outstanding_statement.py @@ -186,7 +186,7 @@ class CustomerOutstandingStatement(models.AbstractModel): ) AND l.date <= '%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 """ % (self._get_reconcile_date(), date_end, self._get_reconcile_date(), date_end, partners, date_end, date_end, date_end)