r18272 - gnucash/trunk/src/report/standard-reports - Fix bug 592021: Budget Report: Options to show actual, budgeted, and difference columns

Phil Longstaff plongstaff at code.gnucash.org
Sat Aug 22 17:10:43 EDT 2009


Author: plongstaff
Date: 2009-08-22 17:10:42 -0400 (Sat, 22 Aug 2009)
New Revision: 18272
Trac: http://svn.gnucash.org/trac/changeset/18272

Modified:
   gnucash/trunk/src/report/standard-reports/budget.scm
Log:
Fix bug 592021: Budget Report: Options to show actual, budgeted, and difference columns
doesn't work correctly.

Patch by Luke Duncan


Modified: gnucash/trunk/src/report/standard-reports/budget.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/budget.scm	2009-08-22 20:17:37 UTC (rev 18271)
+++ gnucash/trunk/src/report/standard-reports/budget.scm	2009-08-22 21:10:42 UTC (rev 18272)
@@ -311,7 +311,7 @@
 		          (style-tag (if total? "total-number-cell" "number-cell"))
 				  (style-tag-neg (string-append style-tag "-neg"))
 		         )
-             (if bgt-numeric-val
+             (if show-budget?
                (begin
                  (set! bgt-val (if (gnc-numeric-zero-p bgt-numeric-val) "."
                            (gnc:make-gnc-monetary comm bgt-numeric-val)))
@@ -320,7 +320,7 @@
                  (set! current-col (+ current-col 1))
                )
              )
-             (if act-numeric-val
+             (if show-actual?
                (begin
                  (set! act-val (gnc:make-gnc-monetary comm act-numeric-val))
                  (gnc:html-table-set-cell/tag!
@@ -330,7 +330,7 @@
                  (set! current-col (+ current-col 1))
                )
              )
-             (if dif-numeric-val
+             (if show-diff?
                (begin
                  (set! dif-val
                    (if (and (gnc-numeric-zero-p bgt-numeric-val) (gnc-numeric-zero-p act-numeric-val))
@@ -434,8 +434,14 @@
            (period 0)
            (current-col (+ colnum 1))
            (col-list column-list)
+	   (col-span 0)
            )
 
+	(if show-budget? (set! col-span (+ col-span 1)))
+	(if show-actual? (set! col-span (+ col-span 1)))
+	(if show-diff? (set! col-span (+ col-span 1)))
+	(if (eqv? col-span 0) (set! col-span 1))
+
       ;; prepend 2 empty rows
       (gnc:html-table-prepend-row! html-table '())
       (gnc:html-table-prepend-row! html-table '())
@@ -462,7 +468,7 @@
             )
           )
           (set! tc (gnc:html-table-get-cell html-table 0 current-col))
-          (gnc:html-table-cell-set-colspan! tc (if show-diff? 3 2))
+          (gnc:html-table-cell-set-colspan! tc col-span)
           (gnc:html-table-cell-set-tag! tc "centered-label-cell")
           (set! current-col (+ current-col 1))
           (set! col-list (cdr col-list))



More information about the gnucash-changes mailing list