From 3efb960daf319f72b6108ca6632f2a42f19591ff Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Tue, 10 Dec 2019 18:23:30 +0800 Subject: [PATCH] Bug 797521 - Receivable Aging (beta): prepayments logic doesn't work, appears to use incorrect absolute value logic Overpayments create at least 2 APAR splits (1 for each invoice, and 1 for the overpayment), they were processed multiple times. Modify query to return unique transactions, thereby ensuring a payment gets processed once only. --- gnucash/report/business-reports/new-aging.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnucash/report/business-reports/new-aging.scm b/gnucash/report/business-reports/new-aging.scm index 5f0f8ba5ab..a9bb0a0452 100644 --- a/gnucash/report/business-reports/new-aging.scm +++ b/gnucash/report/business-reports/new-aging.scm @@ -235,7 +235,7 @@ exist but have no suitable transactions.")) (else (setup-query query accounts report-date) - (let* ((splits (qof-query-run query)) + (let* ((splits (xaccQueryGetSplitsUniqueTrans query)) (accounts (sort-and-delete-duplicates (map xaccSplitGetAccount splits) gnc:account-path-less-p equal?))) (qof-query-destroy query)