gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Sun Feb 14 20:04:09 EST 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/6efdafb9 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/779c0521 (commit)
	from  https://github.com/Gnucash/gnucash/commit/eb56bf91 (commit)



commit 6efdafb9b44a78f0a95f84e3188bf5b2c7f7ed25
Merge: eb56bf910 779c0521e
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Feb 15 09:01:42 2021 +0800

    Merge branch 'maint-yank-canonically-tabbed-option' into maint #908


commit 779c0521e0e947c47afa39a51f127cc3182ebb03
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Feb 12 17:36:16 2021 +0800

    [options.scm API] yank canonically-tabbed parent-subtotal-mode
    
    'canonically-tabbed option is buggy and has never graduated out of
    experimental for 17 years. Time to put it to rest.
    
    All previous saved reports with this option will be switched to 't
    i.e. parent-subtotal-mode enabled..

diff --git a/gnucash/report/html-acct-table.scm b/gnucash/report/html-acct-table.scm
index 4c83f39b8..02b851b38 100644
--- a/gnucash/report/html-acct-table.scm
+++ b/gnucash/report/html-acct-table.scm
@@ -206,19 +206,14 @@
 ;;          text.  stylesheets, really, should be able to remove
 ;;          link markup.
 ;; 
-;;     parent-account-subtotal-mode: #t #f 'canonically-tabbed
+;;     parent-account-subtotal-mode: #t #f
 ;; 
 ;;          indicates whether or not to add a line, recursively
 ;;          subtotalling an account and its descendents, for any
-;;          account with children (non-leaf account).  if #t or
-;;          #canonically-tabbed, a subtotal row will be created for
-;;          each non-leaf account.  if #f, no non-leaf account
-;;          subtotal rows will be created.  if 'canonically-tabbed,
-;;          account total entry labels will be placed at the position
-;;          specified by accounting texts (indented one column from
-;;          the accounts being totalled, two columns from where
-;;          gnc:html-acct-table would otherwise place them). the
-;;          default is #f.
+;;          account with children (non-leaf account).  if #t, a
+;;          subtotal row will be created for each non-leaf account.
+;;          if #f, no non-leaf account subtotal rows will be
+;;          created. the default is #f.
 ;; 
 ;;     zero-balance-mode: 'show-leaf-acct 'omit-leaf-acct
 ;; 
@@ -349,18 +344,14 @@
 ;;         the number of columns in the group of account columns to
 ;;         which a row was assigned.  also one more than the maximum
 ;;         column depth at which rows were positioned in the
-;;         table. this value may be different from logical-cols when
-;;         parent-account-subtotal-mode is 'canonically-tabbed.
+;;         table.
 ;; 
 ;;     account-cols: integer
 ;; 
 ;;         the number of columns in the group of account columns.  if
 ;;         display-tree-depth is #f, this is the value of label-cols
 ;;         plus any indent.  if display-tree-depth is set, this is the
-;;         value of display-tree-depth, plus indent plus zero, if
-;;         parent-account-subotal-mode is not 'canonically-tabbed, or,
-;;         if parent-account-subtotal-mode is 'canonically-tabbed,
-;;         plus one.  don't you just love english?
+;;         value of display-tree-depth, plus indent.
 ;; 
 ;;     account-colspan: integer
 ;; 
@@ -808,9 +799,7 @@
                              (eq? zero-mode 'omit-leaf-acct)))
               (let ((lbl-txt (gnc:make-html-text (G_ "Total") " ")))
                 (apply gnc:html-text-append! lbl-txt (gnc:html-text-body label))
-                (if (eq? subtotal-mode 'canonically-tabbed)
-                    (set! disp-depth (+ disp-depth 1))
-                    (set! disp-depth-reached (max disp-depth-reached disp-depth)))
+                (set! disp-depth-reached (max disp-depth-reached disp-depth))
                 (add-row
                  (cons* (list 'account-label lbl-txt)
                         (list 'row-type 'subtotal-row)
@@ -1085,7 +1074,6 @@
 	      amount
 	      (+ account-cols (- 0 1)
 		 (- logical-cols display-depth)
-		 (if (equal? subtotal-mode 'canonically-tabbed) 1 0)
 		 )                          ;; amount-depth
 	      1                             ;; amount-colspan
               "number-cell"                 ;; amount-markup
diff --git a/gnucash/report/options-utilities.scm b/gnucash/report/options-utilities.scm
index 60f4d5d82..ef3b4a4a3 100644
--- a/gnucash/report/options-utilities.scm
+++ b/gnucash/report/options-utilities.scm
@@ -252,8 +252,4 @@
 		  (N_ "Show subtotals for selected parent accounts which have subaccounts."))
 	  (vector 'f
 		  (N_ "Do not show")
-		  (N_ "Do not show any subtotals for parent accounts."))
-	  (vector 'canonically-tabbed
-		  ;;(N_ "Subtotals indented text book style")
-		  (N_ "Text book style (experimental)")
-		  (N_ "Show parent account subtotals, indented per accounting text book practice (experimental)."))))))
+		  (N_ "Do not show any subtotals for parent accounts."))))))
diff --git a/gnucash/report/reports/standard/account-summary.scm b/gnucash/report/reports/standard/account-summary.scm
index c5b1c1af4..4f1ec68da 100644
--- a/gnucash/report/reports/standard/account-summary.scm
+++ b/gnucash/report/reports/standard/account-summary.scm
@@ -297,7 +297,7 @@
          (show-rates? (get-option pagename-commodities optname-show-rates))
          (parent-mode (get-option gnc:pagename-display optname-parent-balance-mode))
          (parent-total-mode
-          (assq-ref '((t . #t) (f . #f) (canonically-tabbed . canonically-tabbed))
+          (assq-ref '((t . #t) (f . #f))
                     (get-option gnc:pagename-display optname-parent-total-mode)))
          (show-zb-accts? (get-option gnc:pagename-display optname-show-zb-accts))
          (omit-zb-bals? (get-option gnc:pagename-display optname-omit-zb-bals))
diff --git a/gnucash/report/reports/standard/balance-sheet.scm b/gnucash/report/reports/standard/balance-sheet.scm
index 6c1c32d76..208383045 100644
--- a/gnucash/report/reports/standard/balance-sheet.scm
+++ b/gnucash/report/reports/standard/balance-sheet.scm
@@ -26,7 +26,6 @@
 ;;    
 ;;    Line & column alignments still do not conform with
 ;;    textbook accounting practice (they're close though!).
-;;    The 'canonically-tabbed option is currently broken.
 ;;    
 ;;    Progress bar functionality is currently mostly broken.
 ;;    
@@ -309,7 +308,7 @@
          (parent-balance-mode (get-option gnc:pagename-display
                                           optname-parent-balance-mode))
          (parent-total-mode
-          (assq-ref '((t . #t) (f . #f) (canonically-tabbed . canonically-tabbed))
+          (assq-ref '((t . #t) (f . #f))
                     (get-option gnc:pagename-display optname-parent-total-mode)))
          (show-zb-accts? (get-option gnc:pagename-display optname-show-zb-accts))
          (omit-zb-bals? (get-option gnc:pagename-display optname-omit-zb-bals))
diff --git a/gnucash/report/reports/standard/budget-balance-sheet.scm b/gnucash/report/reports/standard/budget-balance-sheet.scm
index 03df94ece..c1dc21b9a 100644
--- a/gnucash/report/reports/standard/budget-balance-sheet.scm
+++ b/gnucash/report/reports/standard/budget-balance-sheet.scm
@@ -308,7 +308,7 @@
          (parent-balance-mode (get-option gnc:pagename-display
                                            optname-parent-balance-mode))
          (parent-total-mode
-	  (assq-ref '((t . #t) (f . #f) (canonically-tabbed . canonically-tabbed))
+	  (assq-ref '((t . #t) (f . #f))
 		    (get-option gnc:pagename-display
 				optname-parent-total-mode)))
          (show-zb-accts? (get-option gnc:pagename-display
diff --git a/gnucash/report/reports/standard/budget-income-statement.scm b/gnucash/report/reports/standard/budget-income-statement.scm
index 4d4c76ced..3b5b1cf68 100644
--- a/gnucash/report/reports/standard/budget-income-statement.scm
+++ b/gnucash/report/reports/standard/budget-income-statement.scm
@@ -13,7 +13,6 @@
 ;;    
 ;;    Line & column alignments may still not conform with
 ;;    textbook accounting practice (they're close though!).
-;;    The 'canonically-tabbed option is currently broken.
 ;;    
 ;;    Progress bar functionality is currently mostly broken.
 ;;    
@@ -361,7 +360,7 @@
          (parent-balance-mode (get-option gnc:pagename-display
                                            optname-parent-balance-mode))
          (parent-total-mode
-	  (assq-ref '((t . #t) (f . #f) (canonically-tabbed . canonically-tabbed))
+	  (assq-ref '((t . #t) (f . #f))
 		    (get-option gnc:pagename-display
 				optname-parent-total-mode)))
          (show-zb-accts? (get-option gnc:pagename-display
diff --git a/gnucash/report/reports/standard/income-statement.scm b/gnucash/report/reports/standard/income-statement.scm
index ec9d8df4e..866eda6bd 100644
--- a/gnucash/report/reports/standard/income-statement.scm
+++ b/gnucash/report/reports/standard/income-statement.scm
@@ -14,7 +14,6 @@
 ;;    
 ;;    Line & column alignments may still not conform with
 ;;    textbook accounting practice (they're close though!).
-;;    The 'canonically-tabbed option is currently broken.
 ;;    
 ;;    Progress bar functionality is currently mostly broken.
 ;;    
@@ -325,7 +324,7 @@
          (parent-balance-mode (get-option gnc:pagename-display
                                            optname-parent-balance-mode))
          (parent-total-mode
-	  (assq-ref '((t . #t) (f . #f) (canonically-tabbed . canonically-tabbed))
+	  (assq-ref '((t . #t) (f . #f))
 		    (get-option gnc:pagename-display
 				optname-parent-total-mode)))
          (show-zb-accts? (get-option gnc:pagename-display
diff --git a/libgnucash/app-utils/options.scm b/libgnucash/app-utils/options.scm
index 5547a87fc..be2d8b65b 100644
--- a/libgnucash/app-utils/options.scm
+++ b/libgnucash/app-utils/options.scm
@@ -1057,12 +1057,18 @@ the option '~a'."))
      section name sort-tag 'multichoice documentation-string
      (lambda () value)
      (lambda (x)
-       (if (multichoice-legal x ok-values)
-           (begin
-             (set! value x)
-             (if (procedure? setter-function-called-cb)
-                 (setter-function-called-cb x)))
-           (rpterror-earlier "multichoice" x default-value)))
+       (cond
+        ((and (equal? section "Display")
+              (equal? name "Parent account subtotals")
+              (equal? x 'canonically-tabbed))
+         (gnc:warn "canonically-tabbed obsolete. switching to 't")
+         (set! value 't))
+        ((not (multichoice-legal x ok-values))
+         (rpterror-earlier "multichoice" x default-value))
+        (else
+         (set! value x)
+         (if (procedure? setter-function-called-cb)
+             (setter-function-called-cb x)))))
      (lambda () default-value)
      (gnc:restore-form-generator value->string)
      (lambda (b p) (qof-book-set-option b (symbol->string value) p))



Summary of changes:
 gnucash/report/html-acct-table.scm                 | 28 +++++++---------------
 gnucash/report/options-utilities.scm               |  6 +----
 .../report/reports/standard/account-summary.scm    |  2 +-
 gnucash/report/reports/standard/balance-sheet.scm  |  3 +--
 .../reports/standard/budget-balance-sheet.scm      |  2 +-
 .../reports/standard/budget-income-statement.scm   |  3 +--
 .../report/reports/standard/income-statement.scm   |  3 +--
 libgnucash/app-utils/options.scm                   | 18 +++++++++-----
 8 files changed, 26 insertions(+), 39 deletions(-)



More information about the gnucash-changes mailing list