r18232 - gnucash/trunk/src/report - Fix wrapping problems in budget cells (account labels and negative values)

Phil Longstaff plongstaff at code.gnucash.org
Sun Aug 2 12:51:54 EDT 2009


Author: plongstaff
Date: 2009-08-02 12:51:53 -0400 (Sun, 02 Aug 2009)
New Revision: 18232
Trac: http://svn.gnucash.org/trac/changeset/18232

Modified:
   gnucash/trunk/src/report/report-system/html-acct-table.scm
   gnucash/trunk/src/report/standard-reports/budget.scm
   gnucash/trunk/src/report/stylesheets/stylesheet-css.scm
   gnucash/trunk/src/report/stylesheets/stylesheet-easy.scm
   gnucash/trunk/src/report/stylesheets/stylesheet-fancy.scm
   gnucash/trunk/src/report/stylesheets/stylesheet-plain.scm
Log:
Fix wrapping problems in budget cells (account labels and negative values)


Modified: gnucash/trunk/src/report/report-system/html-acct-table.scm
===================================================================
--- gnucash/trunk/src/report/report-system/html-acct-table.scm	2009-08-02 13:36:29 UTC (rev 18231)
+++ gnucash/trunk/src/report/report-system/html-acct-table.scm	2009-08-02 16:51:53 UTC (rev 18232)
@@ -1291,7 +1291,7 @@
 	      label
               indented-depth
               account-colspan               ;; label-colspan
-              #f                            ;; label-markup
+              "anchor-cell"                 ;; label-markup
 	      amount
 	      (+ account-cols (- 0 1)
 		 (- logical-cols display-depth)

Modified: gnucash/trunk/src/report/standard-reports/budget.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/budget.scm	2009-08-02 13:36:29 UTC (rev 18231)
+++ gnucash/trunk/src/report/standard-reports/budget.scm	2009-08-02 16:51:53 UTC (rev 18232)
@@ -208,6 +208,10 @@
 
   (define (negative-numeric-p x)
     (if (gnc-numeric-p x) (gnc-numeric-negative-p x) #f))
+  (define (number-cell-tag x)
+    (if (negative-numeric-p x) "number-cell-neg" "number-cell"))
+  (define (total-number-cell-tag x)
+    (if (negative-numeric-p x) "total-number-cell-neg" "total-number-cell"))
 
   ;; Adds a line to tbe budget report.
   ;;
@@ -276,14 +280,14 @@
                (if show-actual?
                  (begin
                    (gnc:html-table-set-cell/tag!
-                    html-table rownum current-col (if (negative-numeric-p act-numeric-val) "number-cell-neg" "number-cell") act-val)
+                    html-table rownum current-col (number-cell-tag act-numeric-val) act-val)
                    (set! current-col (+ current-col 1))
                  )
                )
                (if show-diff?
                  (begin
                    (gnc:html-table-set-cell/tag!
-                    html-table rownum current-col (if (negative-numeric-p dif-numeric-val) "number-cell-neg" "number-cell") dif-val)
+                    html-table rownum current-col (number-cell-tag dif-numeric-val) dif-val)
                    (set! current-col (+ current-col 1))
                  )
                )
@@ -306,20 +310,19 @@
                (if show-actual?
                  (begin
                    (gnc:html-table-set-cell/tag!
-                    html-table rownum current-col (if (negative-numeric-p act-total) "total-number-cell" "total-number-cell-neg")
+                    html-table rownum current-col (total-number-cell-tag act-total)
                           (gnc:make-gnc-monetary comm act-total))
                    (set! current-col (+ current-col 1))
                  )
                )
                (if show-diff?
                  (let* ((diff-val 
-                          (gnc:make-gnc-monetary comm
                               (gnc-numeric-sub bgt-total
                                        act-total GNC-DENOM-AUTO
-                                       (+ GNC-DENOM-LCD GNC-RND-NEVER)))))
+                                       (+ GNC-DENOM-LCD GNC-RND-NEVER))))
                    (gnc:html-table-set-cell/tag!
-                    html-table rownum current-col (if (negative-numeric-p diff-val) "total-number-cell-neg" "total-number-cell")
-                    (if bgt-total-unset? "." diff-val)
+                    html-table rownum current-col (total-number-cell-tag diff-val)
+                    (if bgt-total-unset? "." (gnc:make-gnc-monetary comm diff-val))
                    )
                    (set! current-col (+ current-col 1))
                  )
@@ -353,6 +356,16 @@
                (set! period (+ period 1))
              )
       )
+      (if show-totalcol?
+         (let* (
+            (tc #f))
+           (gnc:html-table-set-cell/tag!
+            html-table 0 (+ current-col num-periods) "centered-label-cell"
+            "Total")
+           (set! tc (gnc:html-table-get-cell html-table 0 (+ current-col num-periods)))
+           (gnc:html-table-cell-set-colspan! tc (if show-diff? 3 2))
+         )
+      )
 
       ;; make the column headers
       (set! period 0)
@@ -385,9 +398,6 @@
              )
 		 (if show-totalcol?
 		    (begin
-               (gnc:html-table-set-cell/tag!
-                html-table 0 (if show-diff? (+ current-col 1) current-col) "centered-label-cell"
-				"Total")
                (if show-budget?
                  (begin
                    (gnc:html-table-set-cell/tag!

Modified: gnucash/trunk/src/report/stylesheets/stylesheet-css.scm
===================================================================
--- gnucash/trunk/src/report/stylesheets/stylesheet-css.scm	2009-08-02 13:36:29 UTC (rev 18231)
+++ gnucash/trunk/src/report/stylesheets/stylesheet-css.scm	2009-08-02 16:51:53 UTC (rev 18232)
@@ -202,14 +202,22 @@
        'attribute (list "cellpadding" padding))
 
     (gnc:html-document-set-style!
+       ssdoc "anchor-cell"
+       'tag "td"
+       'attribute (list "class" "anchor-cell")
+	   'attribute (list "nowrap"))
+
+    (gnc:html-document-set-style!
        ssdoc "number-cell"
        'tag "td"
-       'attribute (list "class" "number-cell"))
+       'attribute (list "class" "number-cell")
+	   'attribute (list "nowrap"))
 
     (gnc:html-document-set-style!
        ssdoc "number-cell-neg"
        'tag "td"
-       'attribute (list "class" "number-cell-neg"))
+       'attribute (list "class" "number-cell-neg")
+	   'attribute (list "nowrap"))
 
     (gnc:html-document-set-style!
        ssdoc "number-header"
@@ -224,12 +232,14 @@
     (gnc:html-document-set-style!
        ssdoc "total-number-cell"
        'tag "td"
-       'attribute (list "class" "total-number-cell"))
+       'attribute (list "class" "total-number-cell")
+	   'attribute (list "nowrap"))
 
     (gnc:html-document-set-style!
        ssdoc "total-number-cell-neg"
        'tag "td"
-       'attribute (list "class" "total-number-cell-neg"))
+       'attribute (list "class" "total-number-cell-neg")
+	   'attribute (list "nowrap"))
 
     (gnc:html-document-set-style!
        ssdoc "total-label-cell"

Modified: gnucash/trunk/src/report/stylesheets/stylesheet-easy.scm
===================================================================
--- gnucash/trunk/src/report/stylesheets/stylesheet-easy.scm	2009-08-02 13:36:29 UTC (rev 18231)
+++ gnucash/trunk/src/report/stylesheets/stylesheet-easy.scm	2009-08-02 16:51:53 UTC (rev 18232)
@@ -232,6 +232,12 @@
 ;;;;
 
     (gnc:html-document-set-style!
+     ssdoc "anchor-cell"
+     'tag "td"
+     'attribute (list "align" "left")
+     'attribute (list "nowrap"))
+
+    (gnc:html-document-set-style!
      ssdoc "number-cell"
      'tag "td"
      'attribute (list "align" "right")

Modified: gnucash/trunk/src/report/stylesheets/stylesheet-fancy.scm
===================================================================
--- gnucash/trunk/src/report/stylesheets/stylesheet-fancy.scm	2009-08-02 13:36:29 UTC (rev 18231)
+++ gnucash/trunk/src/report/stylesheets/stylesheet-fancy.scm	2009-08-02 16:51:53 UTC (rev 18232)
@@ -226,6 +226,12 @@
 ;;;;
 ;;;;
     (gnc:html-document-set-style!
+     ssdoc "anchor-cell"
+     'tag "td"
+     'attribute (list "align" "left")
+     'attribute (list "nowrap"))
+
+    (gnc:html-document-set-style!
      ssdoc "number-cell"
      'tag "td"
      'attribute (list "align" "right")

Modified: gnucash/trunk/src/report/stylesheets/stylesheet-plain.scm
===================================================================
--- gnucash/trunk/src/report/stylesheets/stylesheet-plain.scm	2009-08-02 13:36:29 UTC (rev 18231)
+++ gnucash/trunk/src/report/stylesheets/stylesheet-plain.scm	2009-08-02 16:51:53 UTC (rev 18232)
@@ -103,6 +103,12 @@
      'attribute (list "cellpadding" padding))
 
     (gnc:html-document-set-style!
+     ssdoc "anchor-cell"
+     'tag "td"
+     'attribute (list "align" "left")
+     'attribute (list "nowrap"))
+
+    (gnc:html-document-set-style!
      ssdoc "number-cell"
      'tag "td"
      'attribute (list "align" "right")



More information about the gnucash-changes mailing list