mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
TP->T64: gnucash/report/standard-reports/category-barchart.scm
This commit is contained in:
parent
3adec363fa
commit
1adbe4d329
@ -237,14 +237,14 @@ developing over time"))
|
|||||||
(gnc:report-options report-obj) section name)))
|
(gnc:report-options report-obj) section name)))
|
||||||
|
|
||||||
(gnc:report-starting reportname)
|
(gnc:report-starting reportname)
|
||||||
(let* ((to-date-tp (gnc:timepair-end-day-time
|
(let* ((to-date-t64 (gnc:time64-end-day-time
|
||||||
(gnc:date-option-absolute-time
|
|
||||||
(get-option gnc:pagename-general
|
|
||||||
optname-to-date))))
|
|
||||||
(from-date-tp (gnc:timepair-start-day-time
|
|
||||||
(gnc:date-option-absolute-time
|
(gnc:date-option-absolute-time
|
||||||
(get-option gnc:pagename-general
|
(get-option gnc:pagename-general
|
||||||
optname-from-date))))
|
optname-to-date))))
|
||||||
|
(from-date-t64 (gnc:time64-start-day-time
|
||||||
|
(gnc:date-option-absolute-time
|
||||||
|
(get-option gnc:pagename-general
|
||||||
|
optname-from-date))))
|
||||||
(interval (get-option gnc:pagename-general optname-stepsize))
|
(interval (get-option gnc:pagename-general optname-stepsize))
|
||||||
(report-currency (get-option gnc:pagename-general
|
(report-currency (get-option gnc:pagename-general
|
||||||
optname-report-currency))
|
optname-report-currency))
|
||||||
@ -303,14 +303,14 @@ developing over time"))
|
|||||||
(if averaging-fraction-func
|
(if averaging-fraction-func
|
||||||
;; Calculate the divisor of the amounts so that an
|
;; Calculate the divisor of the amounts so that an
|
||||||
;; average is shown. Multiplier factor is a gnc-numeric
|
;; average is shown. Multiplier factor is a gnc-numeric
|
||||||
(let* ((start-frac-avg (averaging-fraction-func (gnc:timepair->secs from-date-tp)))
|
(let* ((start-frac-avg (averaging-fraction-func from-date-t64))
|
||||||
(end-frac-avg (averaging-fraction-func (+ 1 (gnc:timepair->secs to-date-tp))))
|
(end-frac-avg (averaging-fraction-func (+ 1 to-date-t64)))
|
||||||
(diff-avg (- end-frac-avg start-frac-avg))
|
(diff-avg (- end-frac-avg start-frac-avg))
|
||||||
(diff-avg-numeric (/
|
(diff-avg-numeric (/
|
||||||
(inexact->exact (round (* diff-avg 1000000))) ; 6 decimals precision
|
(inexact->exact (round (* diff-avg 1000000))) ; 6 decimals precision
|
||||||
1000000))
|
1000000))
|
||||||
(start-frac-int (interval-fraction-func (gnc:timepair->secs from-date-tp)))
|
(start-frac-int (interval-fraction-func from-date-t64))
|
||||||
(end-frac-int (interval-fraction-func (+ 1 (gnc:timepair->secs to-date-tp))))
|
(end-frac-int (interval-fraction-func (+ 1 to-date-t64)))
|
||||||
(diff-int (- end-frac-int start-frac-int))
|
(diff-int (- end-frac-int start-frac-int))
|
||||||
(diff-int-numeric (/
|
(diff-int-numeric (/
|
||||||
(inexact->exact diff-int) 1))
|
(inexact->exact diff-int) 1))
|
||||||
@ -332,12 +332,12 @@ developing over time"))
|
|||||||
;; This is the list of date intervals to calculate.
|
;; This is the list of date intervals to calculate.
|
||||||
(dates-list (if do-intervals?
|
(dates-list (if do-intervals?
|
||||||
(gnc:make-date-interval-list
|
(gnc:make-date-interval-list
|
||||||
(gnc:timepair-start-day-time from-date-tp)
|
(gnc:time64-start-day-time from-date-t64)
|
||||||
(gnc:timepair-end-day-time to-date-tp)
|
(gnc:time64-end-day-time to-date-t64)
|
||||||
(gnc:deltasym-to-delta interval))
|
(gnc:deltasym-to-delta interval))
|
||||||
(gnc:make-date-list
|
(gnc:make-date-list
|
||||||
(gnc:timepair-end-day-time from-date-tp)
|
(gnc:time64-end-day-time from-date-t64)
|
||||||
(gnc:timepair-end-day-time to-date-tp)
|
(gnc:time64-end-day-time to-date-t64)
|
||||||
(gnc:deltasym-to-delta interval))))
|
(gnc:deltasym-to-delta interval))))
|
||||||
;; Here the date strings for the x-axis labels are
|
;; Here the date strings for the x-axis labels are
|
||||||
;; created.
|
;; created.
|
||||||
@ -349,7 +349,7 @@ developing over time"))
|
|||||||
|
|
||||||
(define (datelist->stringlist dates-list)
|
(define (datelist->stringlist dates-list)
|
||||||
(map (lambda (date-list-item)
|
(map (lambda (date-list-item)
|
||||||
(gnc-print-date
|
(qof-print-date
|
||||||
(if do-intervals?
|
(if do-intervals?
|
||||||
(car date-list-item)
|
(car date-list-item)
|
||||||
date-list-item)))
|
date-list-item)))
|
||||||
@ -361,7 +361,7 @@ developing over time"))
|
|||||||
;; instead of division to avoid division-by-zero issues) in case
|
;; instead of division to avoid division-by-zero issues) in case
|
||||||
;; the user wants to see the amounts averaged over some value.
|
;; the user wants to see the amounts averaged over some value.
|
||||||
(define (collector->monetary c date)
|
(define (collector->monetary c date)
|
||||||
(if (not (gnc:timepair? date))
|
(if (not (number? date))
|
||||||
(throw 'wrong))
|
(throw 'wrong))
|
||||||
(gnc:make-gnc-monetary
|
(gnc:make-gnc-monetary
|
||||||
report-currency
|
report-currency
|
||||||
@ -474,7 +474,7 @@ developing over time"))
|
|||||||
report-currency))
|
report-currency))
|
||||||
(set! exchange-fn (gnc:case-exchange-time-fn
|
(set! exchange-fn (gnc:case-exchange-time-fn
|
||||||
price-source report-currency
|
price-source report-currency
|
||||||
commodity-list to-date-tp
|
commodity-list to-date-t64
|
||||||
5 15))
|
5 15))
|
||||||
|
|
||||||
;; Sort the account list according to the account code field.
|
;; Sort the account list according to the account code field.
|
||||||
@ -530,8 +530,8 @@ developing over time"))
|
|||||||
(if do-intervals?
|
(if do-intervals?
|
||||||
(_ "%s to %s")
|
(_ "%s to %s")
|
||||||
(_ "Balances %s to %s"))
|
(_ "Balances %s to %s"))
|
||||||
(jqplot-escape-string (gnc-print-date from-date-tp))
|
(jqplot-escape-string (qof-print-date from-date-t64))
|
||||||
(jqplot-escape-string (gnc-print-date to-date-tp))))
|
(jqplot-escape-string (qof-print-date to-date-t64))))
|
||||||
|
|
||||||
(gnc:html-barchart-set-width! chart width)
|
(gnc:html-barchart-set-width! chart width)
|
||||||
(gnc:html-barchart-set-height! chart height)
|
(gnc:html-barchart-set-height! chart height)
|
||||||
@ -556,8 +556,8 @@ developing over time"))
|
|||||||
(if do-intervals?
|
(if do-intervals?
|
||||||
(_ "%s to %s")
|
(_ "%s to %s")
|
||||||
(_ "Balances %s to %s"))
|
(_ "Balances %s to %s"))
|
||||||
(jqplot-escape-string (gnc-print-date from-date-tp))
|
(jqplot-escape-string (qof-print-date from-date-t64))
|
||||||
(jqplot-escape-string (gnc-print-date to-date-tp))))
|
(jqplot-escape-string (qof-print-date to-date-t64))))
|
||||||
|
|
||||||
(gnc:html-linechart-set-width! chart width)
|
(gnc:html-linechart-set-width! chart width)
|
||||||
(gnc:html-linechart-set-height! chart height)
|
(gnc:html-linechart-set-height! chart height)
|
||||||
|
Loading…
Reference in New Issue
Block a user