gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Tue Dec 8 11:24:18 EST 2020
Updated via https://github.com/Gnucash/gnucash/commit/299b9027 (commit)
via https://github.com/Gnucash/gnucash/commit/0630c214 (commit)
via https://github.com/Gnucash/gnucash/commit/d8f3107e (commit)
via https://github.com/Gnucash/gnucash/commit/48d24add (commit)
from https://github.com/Gnucash/gnucash/commit/de63a795 (commit)
commit 299b9027e32f851e759187aa84a23456e0d6030e
Merge: 0630c214f d8f3107ed
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Wed Dec 9 00:23:55 2020 +0800
Merge branch 'maint-improve-test-report-utilities' into maint
commit 0630c214f024b46f87fd4897c0fa8dc11860e11c
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Dec 8 22:45:02 2020 +0800
[options.scm] move gnc:options-fancy-date to business-options.scm
it needs gnc:fancy-date-info which is defined in business-options
diff --git a/libgnucash/app-utils/business-options.scm b/libgnucash/app-utils/business-options.scm
index 11ad03f42..792ec8c35 100644
--- a/libgnucash/app-utils/business-options.scm
+++ b/libgnucash/app-utils/business-options.scm
@@ -27,6 +27,12 @@
(use-modules (gnucash engine))
(use-modules (gnucash utilities))
+(define (gnc:options-fancy-date book)
+ (let ((date-format (gnc:fancy-date-info book gnc:*fancy-date-format*)))
+ (if (boolean? date-format) ;; date-format does not exist
+ (qof-date-format-get-string (qof-date-format-get))
+ date-format)))
+
(define (gnc:make-invoice-option
section
name
diff --git a/libgnucash/app-utils/options.scm b/libgnucash/app-utils/options.scm
index d9a0b73d0..01b621537 100644
--- a/libgnucash/app-utils/options.scm
+++ b/libgnucash/app-utils/options.scm
@@ -1944,12 +1944,6 @@ the option '~a'."))
(define (gnc:generate-restore-forms options options-string)
((options 'generate-restore-forms) options-string))
-(define (gnc:options-fancy-date book)
- (let ((date-format (gnc:fancy-date-info book gnc:*fancy-date-format*)))
- (if (boolean? date-format) ;; date-format does not exist
- (qof-date-format-get-string (qof-date-format-get))
- date-format)))
-
(define (gnc:options-scm->kvp options book clear-option?)
(if clear-option?
(qof-book-options-delete book '()))
commit d8f3107ed3d05552b5e85de435f64c00ae99428a
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Dec 8 20:21:10 2020 +0800
[test-report-utilities] add 4th txn to bank1 as originally written
diff --git a/gnucash/report/test/test-report-utilities.scm b/gnucash/report/test/test-report-utilities.scm
index 4a8ed1cb8..647540b2d 100644
--- a/gnucash/report/test/test-report-utilities.scm
+++ b/gnucash/report/test/test-report-utilities.scm
@@ -634,7 +634,7 @@
(env-transfer env 15 01 1970 income bank1 10)
(env-transfer env 15 02 1970 income bank1 20)
-; (env-transfer env 15 03 1970 income bank1 40)
+ (env-transfer env 15 03 1970 income bank1 40)
(let ((clos (env-transfer env 18 03 1970 income bank1 80)))
(xaccTransSetIsClosingTxn clos #t))
@@ -648,11 +648,11 @@
(env-transfer env 15 01 1970 income bank4 18)
(test-equal "1 txn in each slot"
- '(("USD" . 0) ("USD" . 10) ("USD" . 30) ("USD" . 110))
+ '(("USD" . 0) ("USD" . 10) ("USD" . 30) ("USD" . 150))
(map monetary->pair (gnc:account-get-balances-at-dates bank1 dates)))
(test-equal "1 txn in each slot, tests #:split->amount to ignore closing"
- '(("USD" . 0) ("USD" . 10) ("USD" . 30) ("USD" . 30))
+ '(("USD" . 0) ("USD" . 10) ("USD" . 30) ("USD" . 70))
(map monetary->pair
(gnc:account-get-balances-at-dates
bank1 dates #:split->amount
@@ -673,7 +673,7 @@
(map monetary->pair (gnc:account-get-balances-at-dates bank4 dates)))
(test-equal "1 txn in each slot"
- '(#f 10 30 110)
+ '(#f 10 30 150)
(gnc:account-accumulate-at-dates bank1 dates))
(test-equal "2 txn before start, 1 in middle"
commit 48d24addbb6200a83af66bc8013f3d0bc816b498
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Dec 7 06:51:26 2020 +0800
[test-report-utilities] modify test to use unique amounts
diff --git a/gnucash/report/test/test-report-utilities.scm b/gnucash/report/test/test-report-utilities.scm
index 2d1437a13..4a8ed1cb8 100644
--- a/gnucash/report/test/test-report-utilities.scm
+++ b/gnucash/report/test/test-report-utilities.scm
@@ -633,25 +633,26 @@
(gnc:account-accumulate-at-dates bank1 dates))
(env-transfer env 15 01 1970 income bank1 10)
- (env-transfer env 15 02 1970 income bank1 10)
- (env-transfer env 15 03 1970 income bank1 10)
- (let ((clos (env-transfer env 18 03 1970 income bank1 10)))
+ (env-transfer env 15 02 1970 income bank1 20)
+; (env-transfer env 15 03 1970 income bank1 40)
+
+ (let ((clos (env-transfer env 18 03 1970 income bank1 80)))
(xaccTransSetIsClosingTxn clos #t))
- (env-transfer env 15 12 1969 income bank2 10)
- (env-transfer env 17 12 1969 income bank2 10)
- (env-transfer env 15 02 1970 income bank2 10)
+ (env-transfer env 15 12 1969 income bank2 11)
+ (env-transfer env 17 12 1969 income bank2 21)
+ (env-transfer env 15 02 1970 income bank2 41)
- (env-transfer env 15 03 1970 income bank3 10)
+ (env-transfer env 15 03 1970 income bank3 14)
- (env-transfer env 15 01 1970 income bank4 10)
+ (env-transfer env 15 01 1970 income bank4 18)
(test-equal "1 txn in each slot"
- '(("USD" . 0) ("USD" . 10) ("USD" . 20) ("USD" . 40))
+ '(("USD" . 0) ("USD" . 10) ("USD" . 30) ("USD" . 110))
(map monetary->pair (gnc:account-get-balances-at-dates bank1 dates)))
(test-equal "1 txn in each slot, tests #:split->amount to ignore closing"
- '(("USD" . 0) ("USD" . 10) ("USD" . 20) ("USD" . 30))
+ '(("USD" . 0) ("USD" . 10) ("USD" . 30) ("USD" . 30))
(map monetary->pair
(gnc:account-get-balances-at-dates
bank1 dates #:split->amount
@@ -660,31 +661,31 @@
(xaccSplitGetAmount s))))))
(test-equal "2 txn before start, 1 in middle"
- '(("USD" . 20) ("USD" . 20) ("USD" . 30) ("USD" . 30))
+ '(("USD" . 32) ("USD" . 32) ("USD" . 73) ("USD" . 73))
(map monetary->pair (gnc:account-get-balances-at-dates bank2 dates)))
(test-equal "1 txn in late slot"
- '(("USD" . 0) ("USD" . 0) ("USD" . 0) ("USD" . 10))
+ '(("USD" . 0) ("USD" . 0) ("USD" . 0) ("USD" . 14))
(map monetary->pair (gnc:account-get-balances-at-dates bank3 dates)))
(test-equal "1 txn in early slot"
- '(("USD" . 0) ("USD" . 10) ("USD" . 10) ("USD" . 10))
+ '(("USD" . 0) ("USD" . 18) ("USD" . 18) ("USD" . 18))
(map monetary->pair (gnc:account-get-balances-at-dates bank4 dates)))
(test-equal "1 txn in each slot"
- '(#f 10 20 40)
+ '(#f 10 30 110)
(gnc:account-accumulate-at-dates bank1 dates))
(test-equal "2 txn before start, 1 in middle"
- '(20 20 30 30)
+ '(32 32 73 73)
(gnc:account-accumulate-at-dates bank2 dates))
(test-equal "1 txn in late slot"
- '(#f #f #f 10)
+ '(#f #f #f 14)
(gnc:account-accumulate-at-dates bank3 dates))
(test-equal "1 txn in late slot, tests #:nosplit->elt"
- '(x x x 10)
+ '(x x x 14)
(gnc:account-accumulate-at-dates bank3 dates #:nosplit->elt 'x))
(test-equal "1 txn in late slot, tests #:split->elt"
@@ -692,7 +693,7 @@
(gnc:account-accumulate-at-dates bank3 dates #:split->elt (const 'y)))
(test-equal "1 txn in early slot"
- '(#f 10 10 10)
+ '(#f 18 18 18)
(gnc:account-accumulate-at-dates bank4 dates))
;; Tests split->date sorting. note the 3 txns created below are
Summary of changes:
gnucash/report/test/test-report-utilities.scm | 37 ++++++++++++++-------------
libgnucash/app-utils/business-options.scm | 6 +++++
libgnucash/app-utils/options.scm | 6 -----
3 files changed, 25 insertions(+), 24 deletions(-)
More information about the gnucash-changes
mailing list