gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Tue Mar 12 11:15:49 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/27985ee3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b57f6d60 (commit)
	from  https://github.com/Gnucash/gnucash/commit/fc805d61 (commit)



commit 27985ee337b2cc42b5c09dcd2e4a4a2b5fa2084e
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Mar 12 19:05:59 2019 +0800

    i18n: commit was missing GNC-OWNER-JOB
    
    The commit 4ee0c3ef4 was incomplete and was missing GNC-OWNER-JOB
    which would return #unspecified to string-append causing error. This
    commit restores this conditional and also a fallback "" to return to
    string-append.

diff --git a/gnucash/report/business-reports/job-report.scm b/gnucash/report/business-reports/job-report.scm
index f6b015cf0..e8a7ef84e 100644
--- a/gnucash/report/business-reports/job-report.scm
+++ b/gnucash/report/business-reports/job-report.scm
@@ -625,10 +625,13 @@
            (cond
             ((eqv? type GNC-OWNER-CUSTOMER)
              (_ "No valid customer selected."))
+            ((eqv? type GNC-OWNER-JOB)
+             (_ "No valid job selected."))
             ((eqv? type GNC-OWNER-VENDOR)
              (_ "No valid vendor selected."))
             ((eqv? type GNC-OWNER-EMPLOYEE)
-             (_ "No valid employee selected.")))
+             (_ "No valid employee selected."))
+            (else ""))
            " "
            (_ "Click on the \"Options\" button to select a company.")))))
 

commit b57f6d60f5d0a7350442cb42e6ab94403ed35e39
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Mar 12 22:54:14 2019 +0800

    Revert "[report-utilities] fix gnc:strify for value/commodity collectors"
    
    This reverts commit fc805d6155ae7037af82fc0831c6b9e355073b86 which
    causes test failure. I'll find a proper fix when I've found the cause.

diff --git a/gnucash/report/report-system/report-utilities.scm b/gnucash/report/report-system/report-utilities.scm
index 8fb4f9e1b..3bacd3a28 100644
--- a/gnucash/report/report-system/report-utilities.scm
+++ b/gnucash/report/report-system/report-utilities.scm
@@ -1093,14 +1093,17 @@ flawed. see report-utilities.scm. please update reports.")
             (map gnc:strify (coll 'format gnc:make-gnc-monetary #f))))
   (define (value-collector->str coll)
     (format #f "Val-coll<~a>"
-            (gnc:strify (coll 'total gnc:make-gnc-monetary))))
+            (map gnc:strify (coll 'total gnc:make-gnc-monetary))))
+  (define (procedure->str proc)
+    (format #f "Proc<~a>"
+            (or (procedure-name proc) "unk")))
   (define (monetary->string mon)
     (format #f "Mon<~a>"
             (gnc:monetary->string mon)))
   (define (try proc)
     ;; Try proc with d as a parameter, catching 'wrong-type-arg
     ;; exceptions to return #f to the (or) evaluator below.
-    (catch #t
+    (catch 'wrong-type-arg
       (lambda () (proc d))
       (const #f)))
   (or (and (boolean? d) (if d "#t" "#f"))
@@ -1116,6 +1119,7 @@ flawed. see report-utilities.scm. please update reports.")
                              (if (eq? (car d) 'absolute)
                                  (qof-print-date (cdr d))
                                  (gnc:strify (cdr d)))))
+      (try procedure->str)
       (try gnc-commodity-get-mnemonic)
       (try account->str)
       (try split->str)
diff --git a/gnucash/report/report-system/test/test-report-utilities.scm b/gnucash/report/report-system/test/test-report-utilities.scm
index d1f3cdf46..f58878fb1 100644
--- a/gnucash/report/report-system/test/test-report-utilities.scm
+++ b/gnucash/report/report-system/test/test-report-utilities.scm
@@ -129,20 +129,9 @@
   (test-equal "gnc:strify (a . 2)"
     "('a . 2)"
     (gnc:strify (cons 'a 2)))
-  (let ((m (gnc:make-value-collector)))
-    (m 'add 20)
-    (test-equal "value-collector"
-      "Val-coll<20>"
-      (gnc:strify m)))
-  (let* ((m (gnc:make-commodity-collector))
-         (book (gnc-get-current-book))
-         (comm-table (gnc-commodity-table-get-table book))
-         (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD")))
-    (m 'add USD 10)
-    (test-equal "commodity-collector"
-      "Mon-coll<(Mon<$10.00>)>"
-      (gnc:strify m)))
-  (test-end "debugging tools"))
+  (test-equal "gnc:strify cons"
+    "Proc<cons>"
+    (gnc:strify cons)))
 
 (define (test-commodity-collector)
   (test-group-with-cleanup "test-commodity-collector"



Summary of changes:
 gnucash/report/business-reports/job-report.scm          |  5 ++++-
 gnucash/report/report-system/report-utilities.scm       |  8 ++++++--
 .../report/report-system/test/test-report-utilities.scm | 17 +++--------------
 3 files changed, 13 insertions(+), 17 deletions(-)



More information about the gnucash-changes mailing list