gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Sat Dec 12 18:13:11 EST 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/cf5db5cf (commit)
	 via  https://github.com/Gnucash/gnucash/commit/200d4d8e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/20a19532 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9b417336 (commit)
	from  https://github.com/Gnucash/gnucash/commit/bd75b08f (commit)



commit cf5db5cff54fd5245ab64231f83e67c546dbc87e
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Dec 13 07:12:17 2020 +0800

    [test-balsheet-pnl] tests reverse-chrono option

diff --git a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
index 68c10d834..452b85438 100644
--- a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
@@ -541,6 +541,15 @@
           "1 FUNDS $350.0000")
         (sxml->table-row-col sxml 1 #f 4)))
 
+    (set-option! multi-bs-options "General" "Period order is most recent first" #t)
+    (let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
+                               "multicol-balsheet-halfyear")))
+      (test-equal "bal-1/1/70-reverse-chrono"
+        '("Date" "01/01/72" "01/01/71" "01/01/70")
+        (sxml->table-row-col sxml 1 1 #f)))
+
+    (set-option! multi-bs-options "General" "Period order is most recent first" #f)
+
     ;; the following includes non-zero retained earnings of $1,270
     (set-option! multi-bs-options "General" "End Date"
                  (cons 'absolute (gnc-dmy2time64 1 3 1980)))
@@ -599,4 +608,11 @@
       (test-equal "pnl-3/80"
         '("03/01/80" " to 03/31/80" "$0.00" "$0.00" "$0.00" "#0.00 "
           "$0.00" "#1.00 $1.7000")
-        (sxml->table-row-col sxml 1 #f 4)))))
+        (sxml->table-row-col sxml 1 #f 4)))
+
+    (set-option! multi-bs-options "General" "Period order is most recent first" #t)
+    (let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
+                               "testing period reverse chrono order pnl")))
+      (test-equal "pnl-reverse chrono"
+        '("Date" "03/31/80" "03/01/80" "02/01/80" "01/01/80")
+        (sxml->table-row-col sxml 1 1 #f)))))

commit 200d4d8e2ee66a875980b509fca80ec7bad72dd5
Merge: 20a19532a 9b4173362
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Dec 13 06:47:17 2020 +0800

    Merge branch 'maint-balsheet-pnl-reverse-chrono' into maint #834


commit 20a19532accd13f853d8174f9a40f8e43ebd45e1
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Dec 13 06:46:36 2020 +0800

    [trep-engine] move currency options into their own section, ter
    
    Another option moved from General to Currency section

diff --git a/gnucash/report/reports/standard/balsheet-pnl.scm b/gnucash/report/reports/standard/balsheet-pnl.scm
index 7b357e218..50e4aa63f 100644
--- a/gnucash/report/reports/standard/balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/balsheet-pnl.scm
@@ -1183,7 +1183,7 @@ also show overall period profit & loss."))
                     (list "General" "End Date" (cons 'absolute (cdr datepair)))
                     (list "Currency" "Show original currency amount" show-orig?)
                     (list "Currency" "Common Currency" common-currency)
-                    (list "General" "Report's currency" curr)
+                    (list "Currency" "Report's currency" curr)
                     (list "Display" "Amount" 'double)
                     (list "Accounts" "Accounts" accts))))))
 

commit 9b4173362233d25e512583a7ebabe19bcab19171
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Dec 9 23:14:25 2020 +0800

    [balsheet-pnl] show most recent period first by default

diff --git a/gnucash/report/reports/standard/balsheet-pnl.scm b/gnucash/report/reports/standard/balsheet-pnl.scm
index 7b357e218..a3e1ce75a 100644
--- a/gnucash/report/reports/standard/balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/balsheet-pnl.scm
@@ -62,6 +62,9 @@ https://bugs.gnucash.org/")))
 (define optname-period (N_ "Period duration"))
 (define opthelp-period (N_ "Duration between time periods"))
 
+(define optname-reverse-chrono (N_ "Period order is most recent first"))
+(define opthelp-reverse-chrono (N_ "Period order is most recent first"))
+
 (define optname-dual-columns (N_ "Enable dual columns"))
 (define opthelp-dual-columns (N_ "Selecting this option will enable double-column \
 reporting."))
@@ -202,6 +205,8 @@ also show overall period profit & loss."))
            options
            gnc:pagename-general optname-dual-columns
            (not x))
+          (gnc-option-db-set-option-selectable-by-name
+           options gnc:pagename-general optname-reverse-chrono x)
           (case report-type
             ((balsheet)
              (gnc-option-db-set-option-selectable-by-name
@@ -229,6 +234,11 @@ also show overall period profit & loss."))
       gnc:pagename-general optname-dual-columns
       "c4" opthelp-dual-columns #t))
 
+    (add-option
+     (gnc:make-simple-boolean-option
+      gnc:pagename-general optname-reverse-chrono
+      "c5" opthelp-reverse-chrono #t))
+
     (add-option
      (gnc:make-multichoice-option
       gnc:pagename-general optname-options-summary
@@ -350,6 +360,7 @@ also show overall period profit & loss."))
 
 (define* (add-multicolumn-acct-table
           table title accountlist maxindent get-cell-monetary-fn cols-data #:key
+          (reverse-cols? #f)
           (omit-zb-bals? #f)
           (show-zb-accts? #t)
           (disable-account-indent? #f)
@@ -427,7 +438,7 @@ also show overall period profit & loss."))
                    (list account-cell)
                    (gnc:html-make-empty-cells
                     (if amount-indenting? (1- amount-indent) 0))
-                   rest
+                   (if reverse-cols? (reverse rest) rest)
                    (gnc:html-make-empty-cells
                     (if amount-indenting? (- maxindent amount-indent) 0)))))
         (if row-markup
@@ -749,6 +760,8 @@ also show overall period profit & loss."))
            ((eq? report-type 'pnl) (list startdate enddate))
            (else (list enddate))))
 
+         (reverse-chrono? (get-option gnc:pagename-general optname-reverse-chrono))
+
          (report-dates-vec (list->vector report-dates))
          (num-report-dates (vector-length report-dates-vec))
 
@@ -1057,6 +1070,7 @@ also show overall period profit & loss."))
                               table title accounts
                               maxindent get-cell-monetary-fn
                               (iota num-report-dates)
+                              #:reverse-cols? reverse-chrono?
                               #:omit-zb-bals? omit-zb-bals?
                               #:show-zb-accts? show-zb-accts?
                               #:disable-account-indent? disable-account-indent?
@@ -1231,6 +1245,7 @@ also show overall period profit & loss."))
                                         (> num-report-dates 2))
                                    '(overall-period)
                                    '()))
+                              #:reverse-cols? reverse-chrono?
                               #:omit-zb-bals? omit-zb-bals?
                               #:show-zb-accts? show-zb-accts?
                               #:disable-account-indent? disable-account-indent?
diff --git a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
index 2d0d89979..68c10d834 100644
--- a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
@@ -475,6 +475,7 @@
 (define (multicol-balsheet-tests)
   (define (default-testing-options)
     (let ((options (gnc:make-report-options multicol-balsheet-uuid)))
+      (set-option! options "General" "Period order is most recent first" #f)
       (set-option! options "General" "Start Date"
                    (cons 'absolute (gnc-dmy2time64 1 1 1970)))
       (set-option! options "General" "End Date"
@@ -557,6 +558,7 @@
 (define (multicol-pnl-tests)
   (define (default-testing-options)
     (let ((options (gnc:make-report-options multicol-pnl-uuid)))
+      (set-option! options "General" "Period order is most recent first" #f)
       (set-option! options "General" "Start Date"
                    (cons 'absolute (gnc-dmy2time64 1 1 1980)))
       (set-option! options "General" "End Date"



Summary of changes:
 gnucash/report/reports/standard/balsheet-pnl.scm     | 19 +++++++++++++++++--
 .../reports/standard/test/test-balsheet-pnl.scm      | 20 +++++++++++++++++++-
 2 files changed, 36 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list