[category-barchart] acct->name

This commit is contained in:
Christopher Lam 2022-02-22 21:42:24 +08:00
parent 5f06fc99fd
commit 136ddc9a57

View File

@ -340,6 +340,9 @@ developing over time"))
c report-currency c report-currency
(lambda (a b) (exchange-fn a b date)))))) (lambda (a b) (exchange-fn a b date))))))
(define acct->name
(if show-fullname? gnc-account-get-full-name xaccAccountGetName))
(define (all-zeros data) (define (all-zeros data)
(cond (cond
((number? data) (zero? data)) ((number? data) (zero? data))
@ -465,11 +468,8 @@ developing over time"))
(case sort-method (case sort-method
((alphabetical) ((alphabetical)
(lambda (a b) (lambda (a b)
(if show-fullname? (gnc:string-locale<? (acct->name (car a))
(gnc:string-locale<? (gnc-account-get-full-name (car a)) (acct->name (car b)))))
(gnc-account-get-full-name (car b)))
(gnc:string-locale<? (xaccAccountGetName (car a))
(xaccAccountGetName (car b))))))
((acct-code) ((acct-code)
(lambda (a b) (lambda (a b)
(gnc:string-locale<? (xaccAccountGetCode (car a)) (gnc:string-locale<? (xaccAccountGetCode (car a))
@ -546,8 +546,7 @@ developing over time"))
(let* ((acct (car series)) (let* ((acct (car series))
(label (cond (label (cond
((string? acct) (car series)) ((string? acct) (car series))
(show-fullname? (gnc-account-get-full-name acct)) (else (acct->name acct))))
(else (xaccAccountGetName acct))))
(amounts (cadr series)) (amounts (cadr series))
(stack (if stacked? "default" (number->string stack))) (stack (if stacked? "default" (number->string stack)))
(fill (eq? chart-type 'barchart)) (fill (eq? chart-type 'barchart))
@ -571,9 +570,7 @@ developing over time"))
(1+ tree-depth)) (1+ tree-depth))
(list gnc:pagename-general (list gnc:pagename-general
gnc:optname-reportname gnc:optname-reportname
(if show-fullname? (acct->name acct))))))))
(gnc-account-get-full-name acct)
(xaccAccountGetName acct)))))))))
(gnc:html-chart-add-data-series! (gnc:html-chart-add-data-series!
chart label amounts color chart label amounts color
'stack stack 'fill fill 'urls urls))) 'stack stack 'fill fill 'urls urls)))
@ -621,8 +618,7 @@ developing over time"))
(lambda (col) (lambda (col)
(cond (cond
((string? col) col) ((string? col) col)
(show-fullname? (gnc-account-get-full-name col)) (else (acct->name col))))
(else (xaccAccountGetName col))))
(map car all-data)) (map car all-data))
(if cols>1? (if cols>1?
(list (G_ "Grand Total")) (list (G_ "Grand Total"))
@ -642,8 +638,7 @@ developing over time"))
(lambda (col) (lambda (col)
(cond (cond
((string? col) col) ((string? col) col)
(show-fullname? (gnc-account-get-full-name col)) (else (acct->name col))))
(else (xaccAccountGetName col))))
(map car all-data)) (map car all-data))
(if (pair? (cdr all-data)) (if (pair? (cdr all-data))
(list (G_ "Grand Total")) (list (G_ "Grand Total"))