From 1c605a6b10c6203acb3d310dec2f8f4696c90008 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Wed, 11 Dec 2019 22:14:16 +0800 Subject: [PATCH] [report-utilities] bugfix: overpayment works for AP accounts and fix comment from 5f6b9946d. --- gnucash/report/report-system/report-utilities.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnucash/report/report-system/report-utilities.scm b/gnucash/report/report-system/report-utilities.scm index 652ab4543d..36eacf7c70 100644 --- a/gnucash/report/report-system/report-utilities.scm +++ b/gnucash/report/report-system/report-utilities.scm @@ -1166,7 +1166,7 @@ flawed. see report-utilities.scm. please update reports.") (lp (cdr splits)))) ;; next split is a payment. analyse its sister APAR splits. any - ;; split whose lot-balance is negative is an overpayment. + ;; split whose lot has no invoice is an overpayment. ((eqv? (xaccTransGetTxnType (xaccSplitGetParent (car splits))) TXN-TYPE-PAYMENT) (let* ((txn (xaccSplitGetParent (car splits))) @@ -1181,7 +1181,7 @@ flawed. see report-utilities.scm. please update reports.") 0 splitlist))) (gnc:msg "next " (gnc:strify (car splits)) " payment " payment " overpayment " overpayment) - (addbucket! (1- num-buckets) (- overpayment)) + (addbucket! (1- num-buckets) (if receivable? (- overpayment) overpayment)) (lp (cdr splits)))) ;; not invoice/prepayment. regular or payment split.