mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[report-utilities] fix overpayments calc
overpayment is lot->balance rather than split->amount.
This commit is contained in:
@@ -1169,15 +1169,14 @@ flawed. see report-utilities.scm. please update reports.")
|
||||
TXN-TYPE-PAYMENT)
|
||||
(let* ((txn (xaccSplitGetParent (car splits)))
|
||||
(splitlist (xaccTransGetAPARAcctSplitList txn #f))
|
||||
(payment (apply + (map xaccSplitGetAmount splitlist)))
|
||||
(overpayment
|
||||
(fold
|
||||
(lambda (a b)
|
||||
(if (null? (gncInvoiceGetInvoiceFromLot (xaccSplitGetLot a)))
|
||||
(- b (xaccSplitGetAmount a))
|
||||
(- b (gnc-lot-get-balance (xaccSplitGetLot a)))
|
||||
b))
|
||||
0 splitlist)))
|
||||
(gnc:msg "next " (gnc:strify (car splits)) " payment " payment
|
||||
(gnc:msg "next " (gnc:strify (car splits))
|
||||
" overpayment " overpayment)
|
||||
(addbucket! (1- num-buckets) (if receivable? (- overpayment) overpayment))
|
||||
(lp (cdr splits))))
|
||||
|
||||
Reference in New Issue
Block a user