gnucash maint: Bug 797591 - multiperiod b/s and PnL reports: add style sheet 'easy'

Christopher Lam clam at code.gnucash.org
Wed Jan 22 08:47:52 EST 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/c29409f4 (commit)
	from  https://github.com/Gnucash/gnucash/commit/24b46b1c (commit)



commit c29409f45a66dcf4fffe5986682f4081b47c4c2a
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Jan 19 19:22:33 2020 +0800

    Bug 797591 - multiperiod b/s and PnL reports: add style sheet 'easy'
    
    Change headers & subtotals row markup to "primary-subheading".

diff --git a/gnucash/report/standard-reports/balsheet-pnl.scm b/gnucash/report/standard-reports/balsheet-pnl.scm
index faa2c0927..bed290824 100644
--- a/gnucash/report/standard-reports/balsheet-pnl.scm
+++ b/gnucash/report/standard-reports/balsheet-pnl.scm
@@ -407,24 +407,28 @@ also show overall period profit & loss."))
   (define (make-narrow-cell)
     (gnc:make-html-table-cell/min-width 1))
 
-  (define (add-indented-row indent label label-markup amount-indent rest)
+  (define (add-indented-row indent label label-markup row-markup amount-indent rest)
     (when (or (not depth-limit) (<= indent depth-limit))
-      (gnc:html-table-append-row!
-       table
-       (append (if disable-account-indent?
-                   '() (make-list-thunk indent make-narrow-cell))
-               (list (if label-markup
-                         (gnc:make-html-table-cell/size/markup
-                          1 (if disable-account-indent? 1 (- maxindent indent))
-                          label-markup label)
-                         (gnc:make-html-table-cell/size
-                          1 (if disable-account-indent? 1 (- maxindent indent))
-                          label)))
-               (gnc:html-make-empty-cells
-                (if amount-indenting? (1- amount-indent) 0))
-               rest
-               (gnc:html-make-empty-cells
-                (if amount-indenting? (- maxindent amount-indent) 0))))))
+      (let* ((account-cell (if label-markup
+                               (gnc:make-html-table-cell/size/markup
+                                1 (if disable-account-indent? 1 (- maxindent indent))
+                                label-markup label)
+                               (gnc:make-html-table-cell/size
+                                1 (if disable-account-indent? 1 (- maxindent indent))
+                                label)))
+             (row (append
+                   (if disable-account-indent?
+                       '()
+                       (make-list-thunk indent make-narrow-cell))
+                   (list account-cell)
+                   (gnc:html-make-empty-cells
+                    (if amount-indenting? (1- amount-indent) 0))
+                   rest
+                   (gnc:html-make-empty-cells
+                    (if amount-indenting? (- maxindent amount-indent) 0)))))
+        (if row-markup
+            (gnc:html-table-append-row/markup! table row-markup row)
+            (gnc:html-table-append-row! table row)))))
 
   (define (monetary+ . monetaries)
     ;; usage: (monetary+ monetary...)
@@ -549,6 +553,7 @@ also show overall period profit & loss."))
                           (if account-style-normal?
                               "text-cell"
                               "total-label-cell")
+                          #f
                           (- maxindent lvl)
                           (map
                            (lambda (col-datum)
@@ -574,6 +579,7 @@ also show overall period profit & loss."))
         (add-indented-row lvl-curr
                           (render-account curr #f)
                           "text-cell"
+                          #f
                           (- maxindent lvl-curr account-indent)
                           (map
                            (lambda (col-datum)
@@ -595,6 +601,7 @@ also show overall period profit & loss."))
       (add-indented-row 0
                         title
                         "total-label-cell"
+                        "primary-subheading"
                         maxindent
                         (if get-col-header-fn
                             (map
@@ -643,6 +650,7 @@ also show overall period profit & loss."))
       (add-indented-row 0
                         (string-append (_ "Total For ") title)
                         "total-label-cell"
+                        "primary-subheading"
                         maxindent
                         (map
                          (lambda (col-datum)



Summary of changes:
 gnucash/report/standard-reports/balsheet-pnl.scm | 42 ++++++++++++++----------
 1 file changed, 25 insertions(+), 17 deletions(-)



More information about the gnucash-changes mailing list