Index: src/report/standard-reports/budget.scm
===================================================================
--- src/report/standard-reports/budget.scm	(Revision 17160)
+++ src/report/standard-reports/budget.scm	(Arbeitskopie)
@@ -49,12 +49,16 @@
 (define optname-price-source (N_ "Price Source"))
 (define optname-show-rates (N_ "Show Exchange Rates"))
 (define optname-show-full-names (N_ "Show Full Account Names"))
+(define optname-select-columns (N_ "Select Columns"))
 
 (define optname-budget (N_ "Budget"))
 
 ;; options generator
 (define (budget-report-options-generator)
-  (let ((options (gnc:new-options)))
+  (let* ((options (gnc:new-options)) 
+    (add-option 
+     (lambda (new-option)
+       (gnc:register-option options new-option))))
 
     (gnc:register-option
      options
@@ -62,6 +66,22 @@
       gnc:pagename-general optname-budget
       "a" (N_ "Budget")))
 
+    (add-option
+     (gnc:make-multichoice-option
+      gnc:pagename-general optname-select-columns
+      "f" (N_ "Select the columns of the budget report") 
+      'opt-all
+      (list (vector 'opt-all
+                    (N_ "All")
+                    (N_ "Display all colums"))
+            (vector 'opt-budget 
+                    (N_ "Budget")
+                    (N_ "Display only the budget values"))
+            (vector 'opt-actual
+                    (N_ "Actual")
+                    (N_ "Display only the actual values"))
+            )))
+
     ;; date interval
     ;;(gnc:options-add-date-interval!
     ;; options gnc:pagename-general
@@ -102,18 +122,23 @@
 
 (define (gnc:html-table-add-budget-values!
          html-table acct-table budget params)
-
+  (let* ((get-val (lambda (alist key)
+                    (let ((lst (assoc-ref alist key)))
+                      (if lst (car lst) lst))))
+         (select-columns (get-val params 'selected-columns))
+         (show-actual? (or (eq? select-columns 'opt-all) (eq? select-columns 'opt-actual)))
+         (show-budget? (or (eq? select-columns 'opt-all) (eq? select-columns 'opt-budget)))
+        )
+  
   (define (gnc:html-table-add-budget-line!
            html-table rownum colnum
            budget acct exchange-fn)
     (let* ((num-periods (gnc-budget-get-num-periods budget))
            (period 0)
+           (current-col 1)
            )
       (while (< period num-periods)
-             (let* ((bgt-col (+ (* period 2) colnum 1))
-                    (act-col (+ 1 bgt-col))
-
-                    (comm (xaccAccountGetCommodity acct))
+             (let* ((comm (xaccAccountGetCommodity acct))
                     (bgt-unset? (not (gnc-budget-is-account-period-value-set 
                                       budget acct period)))
                     (numeric-val (gnc-budget-get-account-period-value
@@ -130,24 +155,30 @@
                (cond (reverse-balance? (set! act-val
                                        (gnc:monetary-neg act-val))))
 
-
-               (gnc:html-table-set-cell!
-                html-table
-                rownum bgt-col bgt-val)
-
-               (gnc:html-table-set-cell!
-                html-table
-                rownum act-col act-val)
-
+               (if show-budget?
+                 (begin
+                   (gnc:html-table-set-cell!
+                    html-table rownum current-col bgt-val)
+                   (set! current-col (+ current-col 1))
+                 )
+               )
+               (if show-actual?
+                 (begin
+                   (gnc:html-table-set-cell!
+                    html-table rownum current-col act-val)
+                   (set! current-col (+ current-col 1))
+                 )
+               )
                (set! period (+ period 1))
-               )
              )
+        )
       )
     )
   (define (gnc:html-table-add-budget-headers!
            html-table colnum budget)
     (let* ((num-periods (gnc-budget-get-num-periods budget))
            (period 0)
+           (current-col 1)
            )
 
       ;; prepend 2 empty rows
@@ -156,21 +187,25 @@
 
       ;; make the column headers
       (while (< period num-periods)
-             (let* ((bgt-col (+ (* period 2) colnum 1))
-                    (act-col (+ 1 bgt-col))
-                    (date (gnc-budget-get-period-start-date budget period))
-                    )
+             (let* ((date (gnc-budget-get-period-start-date budget period)))
                (gnc:html-table-set-cell!
-                html-table 0 bgt-col (gnc-print-date date))
-
-               (gnc:html-table-set-cell!
-                html-table
-                1 bgt-col (_ "Bgt")) ;; Translators: Abbreviation for "Budget"
-
-               (gnc:html-table-set-cell!
-                html-table
-                1 act-col (_ "Act")) ;; Translators: Abbreviation for "Actual"
-
+                html-table 0 current-col (gnc-print-date date))
+               (if show-budget?
+                 (begin
+                   (gnc:html-table-set-cell!
+                    html-table 1
+                    current-col (_ "Bgt")) ;; Translators: Abbreviation for "Budget"
+                   (set! current-col (+ current-col 1))
+                 )
+               )
+               (if show-actual?
+                 (begin 
+                   (gnc:html-table-set-cell!
+                    html-table 1
+                    current-col (_ "Act")) ;; Translators: Abbreviation for "Actual"
+                   (set! current-col (+ current-col 1))
+                 )
+               )
                (set! period (+ period 1))
                )
              )
@@ -178,22 +213,16 @@
     )
 
   (let* ((num-rows (gnc:html-acct-table-num-rows acct-table))
-	 (rownum 0)
+         (rownum 0)
          (numcolumns (gnc:html-table-num-columns html-table))
 	 ;;(html-table (or html-table (gnc:make-html-table)))
-	 (get-val (lambda (alist key)
-		    (let ((lst (assoc-ref alist key)))
-		      (if lst (car lst) lst))))
          ;; WARNING: we implicitly depend here on the details of
          ;; gnc:html-table-add-account-balances.  Specifically, we
          ;; assume that it makes twice as many columns as it uses for
-          ;; account labels.  For now, that seems to be a valid
+         ;; account labels.  For now, that seems to be a valid
          ;; assumption.
-         (colnum (quotient numcolumns 2))
-
 	 )
 
-    ''(display (list "colnum: " colnum  "numcolumns: " numcolumns))
     ;; call gnc:html-table-add-budget-line! for each account
     (while (< rownum num-rows)
            (let* ((env (append
@@ -203,16 +232,16 @@
                   (exchange-fn (get-val env 'exchange-fn))
                   )
              (gnc:html-table-add-budget-line!
-              html-table rownum colnum
+              html-table rownum numcolumns
               budget acct exchange-fn)
              (set! rownum (+ rownum 1)) ;; increment rownum
              )
            ) ;; end of while
 
     ;; column headers
-    (gnc:html-table-add-budget-headers! html-table colnum budget)
-
+    (gnc:html-table-add-budget-headers! html-table numcolumns budget)
     )
+    )
   ) ;; end of define
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -243,6 +272,8 @@
          ;;                             optname-report-currency))
          (show-full-names? (get-option gnc:pagename-general
                                        optname-show-full-names))
+         (select-columns (get-option gnc:pagename-general
+                                       optname-select-columns))
          (doc (gnc:make-html-document))
          ;;(table (gnc:make-html-table))
          ;;(txt (gnc:make-html-text))
@@ -315,7 +346,10 @@
                           ))
                (acct-table #f)
                (html-table (gnc:make-html-table))
-               (params '())
+               (params (list
+                        (list 'selected-columns select-columns)
+                        )
+                       )
                (report-name (get-option gnc:pagename-general
                                         gnc:optname-reportname))
                )
