mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[budget-balance-sheet] remove dead code
indent and tabbing are constant, refactor them out
This commit is contained in:
parent
e579f6af56
commit
b481e2ea7b
@ -48,7 +48,6 @@
|
|||||||
(define optname-report-form (N_ "Single column Balance Sheet"))
|
(define optname-report-form (N_ "Single column Balance Sheet"))
|
||||||
(define opthelp-report-form
|
(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."))
|
(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 optname-accounts (N_ "Accounts"))
|
||||||
(define opthelp-accounts
|
(define opthelp-accounts
|
||||||
@ -333,8 +332,6 @@
|
|||||||
optname-account-links))
|
optname-account-links))
|
||||||
(use-rules? (get-option gnc:pagename-display
|
(use-rules? (get-option gnc:pagename-display
|
||||||
optname-use-rules))
|
optname-use-rules))
|
||||||
(indent 0)
|
|
||||||
(tabbing #f)
|
|
||||||
|
|
||||||
;; decompose the account list
|
;; decompose the account list
|
||||||
(split-up-accounts (gnc:decompose-accountlist accounts))
|
(split-up-accounts (gnc:decompose-accountlist accounts))
|
||||||
@ -359,42 +356,24 @@
|
|||||||
(gnc:case-exchange-fn price-source report-commodity date-t64))
|
(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 (add-subtotal-line table pos-label neg-label signed-balance)
|
||||||
(define allow-same-column-totals #t)
|
(let* ((neg? (and signed-balance neg-label
|
||||||
(let* ((neg? (and signed-balance
|
(negative?
|
||||||
neg-label
|
|
||||||
(gnc-numeric-negative-p
|
|
||||||
(gnc:gnc-monetary-amount
|
(gnc:gnc-monetary-amount
|
||||||
(gnc:sum-collector-commodity
|
(gnc:sum-collector-commodity
|
||||||
signed-balance report-commodity exchange-fn)))))
|
signed-balance report-commodity exchange-fn)))))
|
||||||
(label (if neg? (or neg-label pos-label) pos-label))
|
(label (if neg? (or neg-label pos-label) pos-label))
|
||||||
(balance (if neg?
|
(balance (if neg? (gnc:collector- signed-balance) signed-balance)))
|
||||||
(gnc:collector- signed-balance)
|
|
||||||
signed-balance))
|
|
||||||
)
|
|
||||||
(gnc:html-table-add-labeled-amount-line!
|
(gnc:html-table-add-labeled-amount-line!
|
||||||
table
|
table (* tree-depth 2) "primary-subheading" #f label 0 1 "total-label-cell"
|
||||||
(+ 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"
|
|
||||||
(gnc:sum-collector-commodity balance report-commodity exchange-fn)
|
(gnc:sum-collector-commodity balance report-commodity exchange-fn)
|
||||||
(+ indent (* tree-depth 2) (- 0 1)
|
(1- (* tree-depth 2)) 1 "total-number-cell")))
|
||||||
(if (equal? tabbing 'canonically-tabbed) 1 0))
|
|
||||||
1 "total-number-cell")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Wrapper around gnc:html-table-append-ruler! since we call it so
|
;; Wrapper around gnc:html-table-append-ruler! since we call it so
|
||||||
;; often.
|
;; often.
|
||||||
(define (add-rule table)
|
(define (add-rule table)
|
||||||
(gnc:html-table-append-ruler!
|
(gnc:html-table-append-ruler!
|
||||||
table
|
table (* 2 tree-depth)))
|
||||||
(+ (* 2 tree-depth)
|
|
||||||
(if (equal? tabbing 'canonically-tabbed) 1 0))))
|
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
((null? accounts)
|
((null? accounts)
|
||||||
|
Loading…
Reference in New Issue
Block a user