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

This commit is contained in:
Christopher Lam 2021-02-15 09:01:42 +08:00
commit 6efdafb9b4
8 changed files with 26 additions and 39 deletions

View File

@ -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

View File

@ -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."))))))

View File

@ -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))

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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))