daily-reports.scm (gnucash-5.0.tar.bz2) | : | daily-reports.scm (gnucash-5.1.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 173 | skipping to change at line 173 | |||
(gnc:debug daily-totals) | (gnc:debug daily-totals) | |||
;; The percentage done numbers here are a hack so that | ;; The percentage done numbers here are a hack so that | |||
;; something gets displayed. On my system the | ;; something gets displayed. On my system the | |||
;; gnc:case-exchange-time-fn takes about 20% of the time | ;; gnc:case-exchange-time-fn takes about 20% of the time | |||
;; building up a list of prices for later use. Either this | ;; building up a list of prices for later use. Either this | |||
;; routine needs to send progress reports, or the price | ;; routine needs to send progress reports, or the price | |||
;; lookup should be distributed and done when actually | ;; lookup should be distributed and done when actually | |||
;; needed so as to amortize the cpu time properly. | ;; needed so as to amortize the cpu time properly. | |||
(gnc:report-percent-done 1) | (gnc:report-percent-done 1) | |||
(set! commodity-list (gnc:accounts-get-commodities | (set! commodity-list (gnc:accounts-get-commodities | |||
(gnc-accounts-and-all-descendants accounts) | (gnc-accounts-and-all-descendants accounts) | |||
report-currency)) | report-currency)) | |||
(gnc:report-percent-done 5) | (gnc:report-percent-done 5) | |||
(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 | commodity-list to-date | |||
5 20)) | 5 20)) | |||
(gnc:report-percent-done 20) | (gnc:report-percent-done 20) | |||
;; initialize the query to find splits in the right | ;; initialize the query to find splits in the right | |||
skipping to change at line 214 | skipping to change at line 214 | |||
(xaccQueryAddDateMatchTT | (xaccQueryAddDateMatchTT | |||
query #t from-date #t to-date QOF-QUERY-AND) | query #t from-date #t to-date QOF-QUERY-AND) | |||
(qof-query-set-sort-order query | (qof-query-set-sort-order query | |||
(list SPLIT-TRANS TRANS-DATE-POSTED) | (list SPLIT-TRANS TRANS-DATE-POSTED) | |||
(list QUERY-DEFAULT-SORT) | (list QUERY-DEFAULT-SORT) | |||
'()) | '()) | |||
;; get the query results | ;; get the query results | |||
(set! splits (qof-query-run query)) | (set! splits (qof-query-run query)) | |||
(qof-query-destroy query) | (qof-query-destroy query) | |||
(gnc:report-percent-done 40) | (gnc:report-percent-done 40) | |||
;; each split is analyzed... the amount is converted to | ;; each split is analyzed... the amount is converted to | |||
;; report-currency, and the date modulo 7 used to find | ;; report-currency, and the date modulo 7 used to find | |||
;; weekday, and the correct daily-totals is updated. | ;; weekday, and the correct daily-totals is updated. | |||
(for-each | (for-each | |||
(lambda (split) | (lambda (split) | |||
(let* ((date (xaccTransGetDate (xaccSplitGetParent split))) | (let* ((date (xaccTransGetDate (xaccSplitGetParent split))) | |||
(weekday (modulo (1- (gnc:time64-get-week-day date)) 7)) | (weekday (modulo (1- (gnc:time64-get-week-day date)) 7)) | |||
(exchanged (monetary->amount | (exchanged (monetary->amount | |||
(gnc:make-gnc-monetary | (gnc:make-gnc-monetary | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |