gnucash unstable: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Thu Mar 1 07:51:41 EST 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/dd0553af (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8fef1adc (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7054cc83 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/872aa6b7 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/90fb712c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/840e1f8b (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d8d552ee (commit)
	from  https://github.com/Gnucash/gnucash/commit/93f89207 (commit)



commit dd0553af6a8213bf2c645a5a625a8a917c06fc76
Merge: 93f8920 8fef1ad
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Mar 1 13:01:29 2018 +0100

    Merge branch 'scheme-progress-1' of https://github.com/christopherlam/gnucash into unstable


commit 8fef1adcc415bd3dfd5d943740802067e91c79f0
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Feb 28 22:10:38 2018 +0800

    date-utilities: bugfix weekly render
    
    This was introduced by 48bdab3.

diff --git a/libgnucash/app-utils/date-utilities.scm b/libgnucash/app-utils/date-utilities.scm
index ffad895..1729d08 100644
--- a/libgnucash/app-utils/date-utilities.scm
+++ b/libgnucash/app-utils/date-utilities.scm
@@ -91,19 +91,7 @@
                           604800))
          (begin-string (qof-print-date (+ beginweekt64 345600)))
          (end-string (qof-print-date (+ beginweekt64 864000))))
-    (format #f (_ "~s to ~s") begin-string end-string)))
-    
-;  (let ((begin-string (qof-print-date
-;                       (+ (* (gnc:date-get-week
-;                              (gnc:time64-start-day-time
-;                               (gnc-mktime datevec)))
-;                             604800) 345600)))
-;        (end-string (qof-print-date
-;                     (+ (* (gnc:date-get-week
-;                            (gnc:time64-start-day-time
-;                             (gnc-mktime datevec)))
-;                           604800) 864000))))
-;    (format #f (_ "~s to ~s") begin-string end-string)))
+    (format #f (_ "~a to ~a") begin-string end-string)))
 
 ;; is leap year?
 (define (gnc:leap-year? year)

commit 7054cc83bc0aae8ad14b3cfaa193935988489bda
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Feb 28 06:11:30 2018 +0800

    Bug 793898 - 2.7.4: Incorrect copyright statement in gnucash/report/standard-reports/sx-summary.scm
    
    no copyright claim was intended

diff --git a/gnucash/report/standard-reports/daily-reports.scm b/gnucash/report/standard-reports/daily-reports.scm
index c87eccf..5339ff2 100644
--- a/gnucash/report/standard-reports/daily-reports.scm
+++ b/gnucash/report/standard-reports/daily-reports.scm
@@ -2,7 +2,6 @@
 ;; daily-reports.scm: reports based on the day of the week
 ;;
 ;; Copyright (C) 2003, Andy Wingo <wingo at pobox dot com>
-;; Christopher Lam upgrade to time64 (2017)
 ;;
 ;; based on account-piecharts.scm by Robert Merkel (rgmerk at mira.net)
 ;; and Christian Stimming <stimming at tu-harburg.de> with
diff --git a/gnucash/report/standard-reports/sx-summary.scm b/gnucash/report/standard-reports/sx-summary.scm
index 550ae99..2891ad7 100644
--- a/gnucash/report/standard-reports/sx-summary.scm
+++ b/gnucash/report/standard-reports/sx-summary.scm
@@ -5,7 +5,6 @@
 ;; Copyright 2004 David Montenegro <sunrise2000 at comcast.net>
 ;; Copyright 2001 Christian Stimming <stimming at tu-harburg.de>
 ;; Copyright 2000-2001 Bill Gribble <grib at gnumatic.com>
-;; Copyright 2017 Christopher Lam upgrade to time64
 ;;    
 ;; This program is free software; you can redistribute it and/or    
 ;; modify it under the terms of the GNU General Public License as   

commit 872aa6b74023aecdc04ca766d09666ad4321a651
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Feb 24 20:31:42 2018 +0800

    TR: change multichoice values from list to symbols
    
    Context: https://wiki.gnucash.org/logs/2018/02/24.html#T05:43:50
    
    Summary: I had formerly set some multichoice values to be a list.
    However I think options.scm cannot handle list values. They must be
    scheme symbols. It wasn't clear to me during TR refactoring and
    development.
    
    The root cause is in options.scm multichoice handling, whereby it's
    trying to compare the option value with (eq?); in scheme (eq? (list
    "A") (list "A")) is always #f.
    
    https://github.com/Gnucash/gnucash/blob/06ad55cae981111e8858238229e2605f4c05b0d2/libgnucash/app-utils/options.scm#L911
    is the relevant old code.

diff --git a/gnucash/report/standard-reports/transaction.scm b/gnucash/report/standard-reports/transaction.scm
index b08f4cb..249b01c 100644
--- a/gnucash/report/standard-reports/transaction.scm
+++ b/gnucash/report/standard-reports/transaction.scm
@@ -318,25 +318,30 @@ in the Options panel."))
                 (cons 'tip (_ "Show both (and include void transactions in totals)."))))))
 
 (define reconcile-status-list
-  ;; value will be either #f to disable reconciled-status filter
-  ;; or a list of xaccSplitGetReconcile values. e.g. value can
-  ;; be '(#\c #\y) to retrieve list of cleared and reconciled splits.
   (list
-   (cons  #f (list
-              (cons 'text (_ "All"))
-              (cons 'tip (_ "Show All Transactions"))))
+   (cons 'all
+         (list
+          (cons 'text (_ "All"))
+          (cons 'tip (_ "Show All Transactions"))
+          (cons 'filter-types #f)))
 
-   (cons '(#\n) (list
-                 (cons 'text (_ "Unreconciled"))
-                 (cons 'tip (_ "Unreconciled only"))))
+   (cons 'unreconciled
+         (list
+          (cons 'text (_ "Unreconciled"))
+          (cons 'tip (_ "Unreconciled only"))
+          (cons 'filter-types (list #\n))))
 
-   (cons '(#\c) (list
-                 (cons 'text (_ "Cleared"))
-                 (cons 'tip (_ "Cleared only"))))
+   (cons 'cleared
+         (list
+          (cons 'text (_ "Cleared"))
+          (cons 'tip (_ "Cleared only"))
+          (cons 'filter-types (list #\c))))
 
-   (cons '(#\y) (list
-                 (cons 'text (_ "Reconciled"))
-                 (cons 'tip (_ "Reconciled only"))))))
+   (cons 'reconciled
+         (list
+          (cons 'text (_ "Reconciled"))
+          (cons 'tip (_ "Reconciled only"))
+          (cons 'filter-types (list #\y))))))
 
 
 (define ascending-list
@@ -460,17 +465,17 @@ Credit Card, and Income accounts."))
    (gnc:make-multichoice-option
     gnc:pagename-general optname-infobox-display
     "h" (_ "Add summary of options.")
-    '(no-match)
+    'no-match
     ;; This is an alist of conditions for displaying the infobox
     ;; 'no-match for empty-report
     ;; 'match for generated report
-    (list (vector '(no-match)
+    (list (vector 'no-match
                   (_ "If no transactions matched")
                   (_ "Display summary if no transactions were matched."))
-          (vector '(no-match match)
+          (vector 'always
                   (_ "Always")
                   (_ "Always display summary."))
-          (vector '()
+          (vector 'never
                   (_ "Never")
                   (_ "Disable report summary.")))))
 
@@ -515,7 +520,7 @@ tags within description, notes or memo. ")
    (gnc:make-multichoice-option
     pagename-filter optname-reconcile-status
     "j1" (_ "Filter by reconcile status.")
-    #f
+    'all
     (keylist->vectorlist reconcile-status-list)))
 
   (gnc:register-trep-option
@@ -1669,7 +1674,9 @@ tags within description, notes or memo. ")
          (transaction-matcher (opt-val pagename-filter optname-transaction-matcher))
          (transaction-matcher-regexp (and (opt-val pagename-filter optname-transaction-matcher-regex)
                                           (make-regexp transaction-matcher)))
-         (reconcile-status-filter (opt-val pagename-filter optname-reconcile-status))
+         (reconcile-status-filter (keylist-get-info reconcile-status-list
+                                                    (opt-val pagename-filter optname-reconcile-status)
+                                                    'filter-types))
          (report-title (opt-val gnc:pagename-general gnc:optname-reportname))
          (primary-key (opt-val pagename-sorting optname-prime-sortkey))
          (primary-order (opt-val pagename-sorting optname-prime-sortorder))
@@ -1756,7 +1763,7 @@ tags within description, notes or memo. ")
                document
                empty-report-message))
 
-          (if (member 'no-match infobox-display)
+          (if (memq infobox-display '(always no-match))
               (gnc:html-document-add-object!
                document
                (gnc:render-options-changed options))))
@@ -1815,8 +1822,9 @@ tags within description, notes or memo. ")
                                      (match? (xaccSplitGetMemo split)))
                                  (or (not custom-split-filter)     ; #f = ignore custom-split-filter
                                      (custom-split-filter split))
-                                 (or (not reconcile-status-filter) ; #f = ignore next filter
-                                     (member (xaccSplitGetReconcile split) reconcile-status-filter)))))
+                                 (or (not reconcile-status-filter) ; #f = ignore reconcile-status-filter
+                                     (memv (xaccSplitGetReconcile split)
+                                           reconcile-status-filter)))))
                         splits))
 
           (if (null? splits)
@@ -1830,7 +1838,7 @@ tags within description, notes or memo. ")
                   report-title (gnc:report-id report-obj)
                   NO-MATCHING-TRANS-HEADER NO-MATCHING-TRANS-TEXT))
 
-                (if (member 'no-match infobox-display)
+                (if (memq infobox-display '(always no-match))
                     (gnc:html-document-add-object!
                      document
                      (gnc:render-options-changed options))))
@@ -1848,7 +1856,7 @@ tags within description, notes or memo. ")
                             (qof-print-date begindate)
                             (qof-print-date enddate)))))
 
-                (if (member 'match infobox-display)
+                (if (eq? infobox-display 'always)
                     (gnc:html-document-add-object!
                      document
                      (gnc:render-options-changed options)))

commit 90fb712c7f0e7b8a2e68350faee80c6cf041fbd4
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Feb 28 06:47:08 2018 +0800

    TR: make no-report-data message consistent with initial no-account

diff --git a/gnucash/report/standard-reports/transaction.scm b/gnucash/report/standard-reports/transaction.scm
index aa636c8..b08f4cb 100644
--- a/gnucash/report/standard-reports/transaction.scm
+++ b/gnucash/report/standard-reports/transaction.scm
@@ -1823,11 +1823,12 @@ tags within description, notes or memo. ")
 
               ;; error condition: no splits found
               (begin
+
                 (gnc:html-document-add-object!
                  document
-                 (gnc:make-html-text
-                  (gnc:html-markup-h2 NO-MATCHING-TRANS-HEADER)
-                  (gnc:html-markup-p NO-MATCHING-TRANS-TEXT)))
+                 (gnc:html-make-generic-warning
+                  report-title (gnc:report-id report-obj)
+                  NO-MATCHING-TRANS-HEADER NO-MATCHING-TRANS-TEXT))
 
                 (if (member 'no-match infobox-display)
                     (gnc:html-document-add-object!

commit 840e1f8b02578308da8c5ca6dd807686d97da8a9
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Feb 28 06:22:54 2018 +0800

    TR: simplify no-account-after-filtering stage

diff --git a/gnucash/report/standard-reports/transaction.scm b/gnucash/report/standard-reports/transaction.scm
index 9227cb7..aa636c8 100644
--- a/gnucash/report/standard-reports/transaction.scm
+++ b/gnucash/report/standard-reports/transaction.scm
@@ -1744,19 +1744,17 @@ tags within description, notes or memo. ")
         ;; error condition: no accounts specified or obtained after filtering
         (begin
 
-            ;; error condition: no accounts specified
-            (begin
-
+          (gnc:html-document-add-object!
+           document
+           (gnc:html-make-no-account-warning
+            report-title (gnc:report-id report-obj)))
+
+          ;; if an empty-report-message is passed by a derived report to
+          ;; the renderer, display it here.
+          (if empty-report-message
               (gnc:html-document-add-object!
                document
-               (gnc:html-make-no-account-warning report-title (gnc:report-id report-obj)))
-
-              ;; if an empty-report-message is passed by a derived report to
-              ;; the renderer, display it here.
-              (if empty-report-message
-                  (gnc:html-document-add-object!
-                   document
-                   empty-report-message)))
+               empty-report-message))
 
           (if (member 'no-match infobox-display)
               (gnc:html-document-add-object!

commit d8d552ee8a1cf9c1237b36ac953b7873ba14c91f
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Feb 24 20:54:50 2018 +0800

    options.scm: tidy (gnc:render-options-changed)
    
    This small change introduces \n into the HTML render.

diff --git a/libgnucash/app-utils/options.scm b/libgnucash/app-utils/options.scm
index 9d8f109..fd82e21 100644
--- a/libgnucash/app-utils/options.scm
+++ b/libgnucash/app-utils/options.scm
@@ -2056,8 +2056,8 @@
             (set! row-contents (cons return-string row-contents)))))
     (gnc:options-for-each disp-option-if-changed options)
     (string-append (string-join (reverse row-contents)
-                                (if plaintext? "\n" "<br />"))
-                   (if plaintext? "\n\n" "<br /><br />"))))
+                                (if plaintext? "\n" "<br />\n"))
+                   (if plaintext? "\n\n" "<br />\n<br />\n"))))
 
 (define (gnc:send-options db_handle options)
   (gnc:options-for-each



Summary of changes:
 gnucash/report/standard-reports/daily-reports.scm |  1 -
 gnucash/report/standard-reports/sx-summary.scm    |  1 -
 gnucash/report/standard-reports/transaction.scm   | 85 ++++++++++++-----------
 libgnucash/app-utils/date-utilities.scm           | 14 +---
 libgnucash/app-utils/options.scm                  |  4 +-
 5 files changed, 49 insertions(+), 56 deletions(-)



More information about the gnucash-changes mailing list