gnucash stable: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Thu Dec 18 23:49:49 EST 2025
Updated via https://github.com/Gnucash/gnucash/commit/55496adc (commit)
via https://github.com/Gnucash/gnucash/commit/c539f50b (commit)
via https://github.com/Gnucash/gnucash/commit/45cccc79 (commit)
from https://github.com/Gnucash/gnucash/commit/4f655492 (commit)
commit 55496adc7ac2ec5ca40d9ad2b289a85a51859390
Merge: 4f655492ce c539f50b6e
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Dec 19 12:46:01 2025 +0800
Merge flywire branch 'Subtotal' into stable
diff --cc gnucash/report/trep-engine.scm
index ac0768d4ab,711e5d48f0..7e2e91c2b1
--- a/gnucash/report/trep-engine.scm
+++ b/gnucash/report/trep-engine.scm
@@@ -1062,6 -1066,17 +1066,17 @@@ be excluded from periodic reporting."
(let* ((work-to-do (length splits))
(table (gnc:make-html-table))
+ (subtotals-only? (option-ref options pagename-sorting optname-show-subtotals-only))
+ (sec-subtotal? (option-ref options pagename-sorting optname-sec-subtotal))
+ (subtotal-label (lambda (str level)
+ (let ((show-prefix? (not (and subtotals-only?
+ (case level
+ ((secondary) sec-subtotal?)
+ ((primary) (not sec-subtotal?))
+ (else #f))))))
- (if show-prefix?
- (string-append (G_ "Total For ") str)
++ (if show-prefix?
++ (string-append (G_ "Total For ") str)
+ str))))
(account-types-to-reverse
(keylist-get-info sign-reverse-list
(report-uses? 'reversed-signs)
@@@ -1613,7 -1628,9 +1628,9 @@@
(gnc:html-make-empty-cells left-indent)
(if (report-uses? 'export-table)
(cons
- (gnc:make-html-table-cell/markup "total-label-cell" data)
- (gnc:make-html-table-cell/markup
- (if (summary-style? level) "total-label-cell" "text-cell")
++ (gnc:make-html-table-cell/markup
++ (if (summary-style? level) "total-label-cell" "text-cell")
+ data)
(gnc:html-make-empty-cells
(+ right-indent width-left-columns -1)))
(list
commit c539f50b6e7aac44ff357f761f9626ed89c693fe
Author: flywire <flywire at gmail.com>
Date: Wed Dec 10 21:55:34 2025 +1100
Use trep-engine lowest shown grouping for detail
diff --git a/gnucash/report/trep-engine.scm b/gnucash/report/trep-engine.scm
index f2cc83c483..711e5d48f0 100644
--- a/gnucash/report/trep-engine.scm
+++ b/gnucash/report/trep-engine.scm
@@ -138,6 +138,10 @@
(define def:primary-subtotal-style "primary-subheading")
(define def:secondary-subtotal-style "secondary-subheading")
+(define (option-ref opts section name)
+ (let ((opt (gnc:lookup-option opts section name)))
+ (and opt (gnc:option-value opt))))
+
(define NO-MATCHING-TRANS-HEADER (G_ "No matching transactions found"))
(define NO-MATCHING-TRANS-TEXT (G_ "No transactions were found that \
match the time interval and account selection specified \
@@ -1062,6 +1066,17 @@ be excluded from periodic reporting.")
(let* ((work-to-do (length splits))
(table (gnc:make-html-table))
+ (subtotals-only? (option-ref options pagename-sorting optname-show-subtotals-only))
+ (sec-subtotal? (option-ref options pagename-sorting optname-sec-subtotal))
+ (subtotal-label (lambda (str level)
+ (let ((show-prefix? (not (and subtotals-only?
+ (case level
+ ((secondary) sec-subtotal?)
+ ((primary) (not sec-subtotal?))
+ (else #f))))))
+ (if show-prefix?
+ (string-append (G_ "Total For ") str)
+ str))))
(account-types-to-reverse
(keylist-get-info sign-reverse-list
(report-uses? 'reversed-signs)
@@ -1613,7 +1628,9 @@ be excluded from periodic reporting.")
(gnc:html-make-empty-cells left-indent)
(if (report-uses? 'export-table)
(cons
- (gnc:make-html-table-cell/markup "total-label-cell" data)
+ (gnc:make-html-table-cell/markup
+ (if (summary-style? level) "total-label-cell" "text-cell")
+ data)
(gnc:html-make-empty-cells
(+ right-indent width-left-columns -1)))
(list
@@ -1660,6 +1677,14 @@ be excluded from periodic reporting.")
(and (pair? calculated-cells)
(assq-ref (car calculated-cells) 'merge-dual-column?)))
+ (define (summary-style? level)
+ (let ((detail-level
+ (cond ((not (report-uses? 'subtotals-only)) 'transactions)
+ ((report-uses? 'secondary-key/renderer-fn) 'secondary)
+ ((report-uses? 'primary-key/renderer-fn) 'primary)
+ (else 'grand))))
+ (not (eq? level detail-level))))
+
(define (add-subtotal-row subtotal-string subtotal-collectors
subtotal-style level row col)
(let* ((left-indent (case level
@@ -1681,14 +1706,17 @@ be excluded from periodic reporting.")
(gnc-commodity-equal commodity (gnc:gnc-monetary-commodity mon)))
list-of-monetary))
- (define (first-column string)
- (if (report-uses? 'export-table)
- (cons
- (gnc:make-html-table-cell/markup "total-label-cell" string)
- (gnc:html-make-empty-cells (+ right-indent width-left-columns -1)))
- (list
- (gnc:make-html-table-cell/size/markup
- 1 (+ right-indent width-left-columns) "total-label-cell" string))))
+ (define (first-column string level)
+ (let ((cell-class (if (summary-style? level)
+ "total-label-cell"
+ "text-cell")))
+ (if (report-uses? 'export-table)
+ (cons
+ (gnc:make-html-table-cell/markup cell-class string)
+ (gnc:html-make-empty-cells (+ right-indent width-left-columns -1)))
+ (list
+ (gnc:make-html-table-cell/size/markup
+ 1 (+ right-indent width-left-columns) cell-class string)))))
(define (data-columns commodity)
(let loop ((merging? #f)
@@ -1716,8 +1744,11 @@ be excluded from periodic reporting.")
(merging?
(let* ((sum (and (or last-column this-column)
(- (or last-column 0) (or this-column 0))))
+ (cell-class (if (summary-style? level)
+ "total-number-cell"
+ "number-cell"))
(sum-table-cell (and sum (gnc:make-html-table-cell/markup
- "total-number-cell"
+ cell-class
(gnc:make-gnc-monetary
commodity (abs sum)))))
(debit-col (and sum (positive? sum) sum-table-cell))
@@ -1735,7 +1766,10 @@ be excluded from periodic reporting.")
(cdr columns)
(cdr merge-list)
(cons (gnc:make-html-table-cell/markup
- "total-number-cell" mon)
+ (if (summary-style? level)
+ "total-number-cell"
+ "number-cell")
+ mon)
result))))))))
(define (get-commodity-grid-amount commodity)
@@ -1758,15 +1792,10 @@ be excluded from periodic reporting.")
table subtotal-style
(append
(gnc:html-make-empty-cells left-indent)
- (first-column first-column-string)
+ (first-column first-column-string level)
(data-columns (car list-of-commodities))))
(loop "" (cdr list-of-commodities))))))
- (define (total-string str)
- (if (opt-val pagename-sorting optname-show-subtotals-only)
- str
- (string-append (G_ "Total For ") str)))
-
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; renderers
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1961,8 +1990,8 @@ be excluded from periodic reporting.")
(not (equal? (primary-subtotal-comparator current)
(primary-subtotal-comparator next)))))
(when secondary-subtotal-comparator
- (add-subtotal-row (total-string
- (render-summary current 'secondary #f))
+ (add-subtotal-row (subtotal-label
+ (render-summary current 'secondary #f) 'secondary)
secondary-subtotal-collectors
def:secondary-subtotal-style
'secondary
@@ -1974,8 +2003,8 @@ be excluded from periodic reporting.")
(lambda (coll)
(coll 'reset #f #f))
secondary-subtotal-collectors))
- (add-subtotal-row (total-string
- (render-summary current 'primary #f))
+ (add-subtotal-row (subtotal-label
+ (render-summary current 'primary #f) 'primary)
primary-subtotal-collectors
def:primary-subtotal-style
'primary
@@ -2003,8 +2032,8 @@ be excluded from periodic reporting.")
(or (not next)
(not (equal? (secondary-subtotal-comparator current)
(secondary-subtotal-comparator next)))))
- (add-subtotal-row (total-string
- (render-summary current 'secondary #f))
+ (add-subtotal-row (subtotal-label
+ (render-summary current 'secondary #f) 'secondary)
secondary-subtotal-collectors
def:secondary-subtotal-style
'secondary
commit 45cccc79f12608aba6bf5b2bb978acc9cf558e18
Author: flywire <flywire0 at gmail.com>
Date: Wed May 3 11:40:29 2023 +1000
Only show Subtotal Prefix with Transactions
If `Show subtotals only (hide transactional data)` is selected then the `Total For` prefix should not be shown.
diff --git a/gnucash/report/trep-engine.scm b/gnucash/report/trep-engine.scm
index ac0768d4ab..f2cc83c483 100644
--- a/gnucash/report/trep-engine.scm
+++ b/gnucash/report/trep-engine.scm
@@ -1762,7 +1762,10 @@ be excluded from periodic reporting.")
(data-columns (car list-of-commodities))))
(loop "" (cdr list-of-commodities))))))
- (define (total-string str) (string-append (G_ "Total For ") str))
+ (define (total-string str)
+ (if (opt-val pagename-sorting optname-show-subtotals-only)
+ str
+ (string-append (G_ "Total For ") str)))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; renderers
Summary of changes:
gnucash/report/trep-engine.scm | 72 ++++++++++++++++++++++++++++++------------
1 file changed, 52 insertions(+), 20 deletions(-)
More information about the gnucash-changes
mailing list