From b481e2ea7b0e27e6b14b712dca9381e6b34e5305 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Mon, 30 Sep 2019 15:20:55 +0800 Subject: [PATCH] [budget-balance-sheet] remove dead code indent and tabbing are constant, refactor them out --- .../standard-reports/budget-balance-sheet.scm | 35 ++++--------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/gnucash/report/standard-reports/budget-balance-sheet.scm b/gnucash/report/standard-reports/budget-balance-sheet.scm index 276e7903fc..b5edc5e1f6 100644 --- a/gnucash/report/standard-reports/budget-balance-sheet.scm +++ b/gnucash/report/standard-reports/budget-balance-sheet.scm @@ -48,7 +48,6 @@ (define optname-report-form (N_ "Single column Balance Sheet")) (define opthelp-report-form (N_ "Print liability/equity section in the same column under the assets section as opposed to a second column right of the assets section.")) -;; FIXME this needs an indent option (define optname-accounts (N_ "Accounts")) (define opthelp-accounts @@ -333,8 +332,6 @@ optname-account-links)) (use-rules? (get-option gnc:pagename-display optname-use-rules)) - (indent 0) - (tabbing #f) ;; decompose the account list (split-up-accounts (gnc:decompose-accountlist accounts)) @@ -359,42 +356,24 @@ (gnc:case-exchange-fn price-source report-commodity date-t64)) ) - ;; Wrapper to call gnc:html-table-add-labeled-amount-line! - ;; with the proper arguments. (define (add-subtotal-line table pos-label neg-label signed-balance) - (define allow-same-column-totals #t) - (let* ((neg? (and signed-balance - neg-label - (gnc-numeric-negative-p + (let* ((neg? (and signed-balance neg-label + (negative? (gnc:gnc-monetary-amount (gnc:sum-collector-commodity signed-balance report-commodity exchange-fn))))) (label (if neg? (or neg-label pos-label) pos-label)) - (balance (if neg? - (gnc:collector- signed-balance) - signed-balance)) - ) + (balance (if neg? (gnc:collector- signed-balance) signed-balance))) (gnc:html-table-add-labeled-amount-line! - table - (+ indent (* tree-depth 2) - (if (equal? tabbing 'canonically-tabbed) 1 0)) - "primary-subheading" - (and (not allow-same-column-totals) balance use-rules?) - label indent 1 "total-label-cell" + table (* tree-depth 2) "primary-subheading" #f label 0 1 "total-label-cell" (gnc:sum-collector-commodity balance report-commodity exchange-fn) - (+ indent (* tree-depth 2) (- 0 1) - (if (equal? tabbing 'canonically-tabbed) 1 0)) - 1 "total-number-cell") - ) - ) - + (1- (* tree-depth 2)) 1 "total-number-cell"))) + ;; Wrapper around gnc:html-table-append-ruler! since we call it so ;; often. (define (add-rule table) (gnc:html-table-append-ruler! - table - (+ (* 2 tree-depth) - (if (equal? tabbing 'canonically-tabbed) 1 0)))) + table (* 2 tree-depth))) (cond ((null? accounts)