Bug 797852 - Error in Accounts Payable Aging re cut off dates

Finally the proper fix in aging-report.

The aging-report must consider only activity in the report period
specified. If an invoice is paid after the report period, it is
considered unpaid.
This commit is contained in:
Christopher Lam 2020-08-18 22:27:03 +08:00
parent 5bf57260ae
commit 2fd2b7bb64

View File

@ -908,7 +908,13 @@
(let* ((invoice (gncInvoiceGetInvoiceFromTxn
(xaccSplitGetParent (car splits))))
(lot (gncInvoiceGetPostedLot invoice))
(bal (gnc-lot-get-balance lot))
(lot-splits (gnc-lot-get-split-list lot))
(bal (fold
(lambda (a b)
(if (<= (xaccTransGetDate (xaccSplitGetParent a)) to-date)
(+ (xaccSplitGetAmount a) b)
b))
0 lot-splits))
(bal (if receivable? bal (- bal)))
(date (if (eq? date-type 'postdate)
(gncInvoiceGetDatePosted invoice)