gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Thu Dec 12 09:28:32 EST 2019
Updated via https://github.com/Gnucash/gnucash/commit/b372f288 (commit)
via https://github.com/Gnucash/gnucash/commit/67081145 (commit)
via https://github.com/Gnucash/gnucash/commit/1c605a6b (commit)
from https://github.com/Gnucash/gnucash/commit/cac155a9 (commit)
commit b372f28829f67a3749870a3559374a2929a5af83
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Dec 12 20:20:47 2019 +0800
[test-owner-report] initial tests new-owner-report
mainly tests amounts being displayed are correct
diff --git a/gnucash/report/business-reports/test/test-owner-report.scm b/gnucash/report/business-reports/test/test-owner-report.scm
index df8940bb7..d040fc696 100644
--- a/gnucash/report/business-reports/test/test-owner-report.scm
+++ b/gnucash/report/business-reports/test/test-owner-report.scm
@@ -17,6 +17,7 @@
(list (cons 'employee "08ae9c2e884b4f9787144f47eacd7f44")
(cons 'vendor "d7d1e53505ee4b1b82efad9eacedaea0")
(cons 'customer "c146317be32e4948a561ec7fc89d15c1")
+ (cons 'customer-new "c146317be32e4948a561ec7fc89d15c1-new")
(cons 'job "5518ac227e474f47a34439f2d4d049de")))
(setlocale LC_ALL "C")
@@ -206,13 +207,18 @@
(set-option! options "General"
(case variant
((customer) "Customer")
+ ((customer-new) "Customer")
((job) "Job"))
owner)
(set-option! options "General" "From"
(cons 'absolute (gnc-dmy2time64 1 1 1980)))
(set-option! options "General" "To"
(cons 'absolute (gnc-dmy2time64 1 7 1980)))
- (set-option! options "General" "Account" account)
+ (cond
+ ((eq? variant 'customer-new)
+ (set-option! options "Display Columns" "Links" 'detailed))
+ (else
+ (set-option! options "General" "Account" account)))
options))
;; inv-1 $6, due 18.7.1980 after report-date i.e. "current"
@@ -321,6 +327,42 @@
sxml)))
(test-end "customer-report")
+ (test-begin "new-customer-report")
+ (let* ((options (default-testing-options 'customer-new
+ owner-1 (get-acct "AR-USD")))
+ (sxml (options->sxml 'customer-new options "new-customer-report basic")))
+ (test-equal "inv-descriptions"
+ '("inv >90 $11.50" "inv 60-90 $7.50" "inv 30-60 $8.50"
+ "inv >90 payment" "inv >90 payment" "inv <30days $4.00"
+ "inv $200" "inv $200" "inv current $6.75" "inv $3 CN"
+ "$31.75" "$7.50")
+ ((sxpath `(// (table 3) // tr (td 5) // *text*))
+ sxml))
+ (test-equal "credit-amounts"
+ '("$11.50" "$7.50" "$8.50" "$4.00" "$200.00" "$6.75" "$8.00")
+ ((sxpath `(// (table 3) // tr (td 6) // *text*))
+ sxml))
+ (test-equal "debit-amounts"
+ '("$1.50" "$2.00" "$200.00" "$3.00" "$31.75")
+ ((sxpath `(// (table 3) // tr (td 7) // *text*))
+ sxml))
+ (test-equal "balance-amounts"
+ '("$11.50" "$19.00" "$27.50" "$26.00" "$24.00" "$28.00"
+ "$228.00" "$28.00" "$34.75" "$31.75")
+ ((sxpath `(// (table 3) // tr (td 8) // *text*))
+ sxml))
+ (test-equal "link-amounts"
+ '("$1.50" "$11.50" "$11.50" "$200.00" "$200.00")
+ ((sxpath `(// (table 3) // tr (td 11) // *text*))
+ sxml))
+ ;; from the report, find the 3rd table, last row, find embedded
+ ;; table, retrieve tr contents
+ (test-equal "aging-table"
+ '("$0.00" "$6.75" "$1.00" "$8.50" "$7.50" "$8.00" "$31.75")
+ ((sxpath `(// (table 3) // (tr -1) // table // tbody // tr // *text*))
+ sxml)))
+ (test-end "new-customer-report")
+
(display "job-report tests:\n")
;; inv for job
(let ((inv-2-copy (gncInvoiceCopy inv-2)))
commit 670811455dd24d3b30064dc7d5a1e456c4c1efe4
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Dec 12 21:19:03 2019 +0800
[report-utilities] bugfix: aging-list was incorrect. off-by-1 error.
off-by-1 error in aging-list dates.
diff --git a/gnucash/report/report-system/report-utilities.scm b/gnucash/report/report-system/report-utilities.scm
index 36eacf7c7..5cb4d44e7 100644
--- a/gnucash/report/report-system/report-utilities.scm
+++ b/gnucash/report/report-system/report-utilities.scm
@@ -1136,7 +1136,7 @@ flawed. see report-utilities.scm. please update reports.")
to-date date-type receivable?)
(gnc:msg "processing " (qof-print-date to-date) " date-type " date-type
"receivable? " receivable?)
- (let ((bucket-dates (make-extended-interval-list to-date (- num-buckets 2)))
+ (let ((bucket-dates (make-extended-interval-list to-date (- num-buckets 3)))
(buckets (make-vector num-buckets 0)))
(define (addbucket! idx amt)
(vector-set! buckets idx (+ amt (vector-ref buckets idx))))
commit 1c605a6b10c6203acb3d310dec2f8f4696c90008
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Wed Dec 11 22:14:16 2019 +0800
[report-utilities] bugfix: overpayment works for AP accounts
and fix comment from 5f6b9946d.
diff --git a/gnucash/report/report-system/report-utilities.scm b/gnucash/report/report-system/report-utilities.scm
index 652ab4543..36eacf7c7 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.
Summary of changes:
.../business-reports/test/test-owner-report.scm | 44 +++++++++++++++++++++-
gnucash/report/report-system/report-utilities.scm | 6 +--
2 files changed, 46 insertions(+), 4 deletions(-)
More information about the gnucash-changes
mailing list