From 81ae6800105d8043c4c922eb284dc8ec2a859688 Mon Sep 17 00:00:00 2001 From: Phil Longstaff Date: Sun, 2 Aug 2009 02:42:50 +0000 Subject: [PATCH] Center budget report period dates properly over the columns for that period git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18229 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/report/standard-reports/budget.scm | 71 +++++++++++++++----------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/src/report/standard-reports/budget.scm b/src/report/standard-reports/budget.scm index 4aeaf2cc2b..260ff9d013 100644 --- a/src/report/standard-reports/budget.scm +++ b/src/report/standard-reports/budget.scm @@ -335,38 +335,49 @@ (gnc:html-table-prepend-row! html-table '()) (gnc:html-table-prepend-row! html-table '()) - ;; make the column headers - (while (< period num-periods) - (let* ((date (gnc-budget-get-period-start-date budget period))) - (gnc:html-table-set-cell/tag! - html-table 0 (if show-diff? (+ current-col 1) current-col) "centered-label-cell" - (gnc-print-date date)) - (if show-budget? - (begin - (gnc:html-table-set-cell/tag! - html-table 1 current-col "centered-label-cell" - (_ "Bgt")) ;; Translators: Abbreviation for "Budget" - (set! current-col (+ current-col 1)) - ) - ) - (if show-actual? - (begin - (gnc:html-table-set-cell/tag! - html-table 1 current-col "centered-label-cell" - (_ "Act")) ;; Translators: Abbreviation for "Actual" - (set! current-col (+ current-col 1)) - ) - ) - (if show-diff? - (begin - (gnc:html-table-set-cell/tag! - html-table 1 current-col "centered-label-cell" - (_ "Diff")) ;; Translators: Abbrevation for "Difference" - (set! current-col (+ current-col 1)) - ) - ) + (while (< period num-periods) + (let* ( + (tc #f) + (date (gnc-budget-get-period-start-date budget period)) + ) + (gnc:html-table-set-cell! + html-table 0 (+ current-col period) + (gnc-print-date date)) + (set! tc (gnc:html-table-get-cell html-table 0 (+ current-col period))) + (gnc:html-table-cell-set-colspan! tc (if show-diff? 3 2)) + (gnc:html-table-cell-set-tag! tc "centered-label-cell") (set! period (+ period 1)) + ) + ) + + ;; make the column headers + (set! period 0) + (while (< period num-periods) + (if show-budget? + (begin + (gnc:html-table-set-cell/tag! + html-table 1 current-col "centered-label-cell" + (_ "Bgt")) ;; Translators: Abbreviation for "Budget" + (set! current-col (+ current-col 1)) ) + ) + (if show-actual? + (begin + (gnc:html-table-set-cell/tag! + html-table 1 current-col "centered-label-cell" + (_ "Act")) ;; Translators: Abbreviation for "Actual" + (set! current-col (+ current-col 1)) + ) + ) + (if show-diff? + (begin + (gnc:html-table-set-cell/tag! + html-table 1 current-col "centered-label-cell" + (_ "Diff")) ;; Translators: Abbrevation for "Difference" + (set! current-col (+ current-col 1)) + ) + ) + (set! period (+ period 1)) ) (if show-totalcol? (begin