cashflow: use the much faster gnc:account-get-trans-type-splits-interval

This retrieves all the splits we need, and much faster.
This commit is contained in:
Peter Broadbery 2015-11-09 20:42:43 +00:00
parent 8d12338244
commit 526fd82ca8

View File

@ -405,7 +405,8 @@
(money-out-alist '())
(money-out-collector (gnc:make-commodity-collector))
(splits-to-do (gnc:accounts-count-splits accounts))
(all-splits (gnc:account-get-trans-type-splits-interval accounts '() from-date-tp to-date-tp))
(splits-to-do (length all-splits))
(seen-split-list '())
(work-done 0))
@ -499,12 +500,8 @@
)
)
(define (calc-money-in-out-internal accounts-internal)
(if (not (null? accounts-internal))
(let* ((current (car accounts-internal))
(rest (cdr accounts-internal)))
(for-each work-per-split (xaccAccountGetSplitList current))
(calc-money-in-out-internal rest))))
(define (calc-money-in-out-internal accounts)
(for-each work-per-split all-splits))
;; And calculate
(calc-money-in-out-internal accounts)