mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
remove begindate in qofquery
This was producing a date corresponding to 01-01-1970. make-zdate was being used in aging.scm as a hack to search all splits prior to end-date. fix the date query logic to set begin-date match to #f.
This commit is contained in:
parent
580ce72da7
commit
551e98435d
@ -322,21 +322,15 @@ more than one currency. This report is not designed to cope with this possibilit
|
||||
|
||||
|
||||
;; set up the query to get the splits in the chosen account
|
||||
;; XXX: FIXME: begindate is a hack -- we currently only go back a year
|
||||
(define (setup-query query account date)
|
||||
(let ((begindate (gnc-mktime (make-zdate)))) ;Set begindate to the start of the Epoch
|
||||
; (gnc:debug "Account: " account)
|
||||
(gnc:debug "begindate" begindate)
|
||||
(gnc:debug "date" date)
|
||||
(qof-query-set-book query (gnc-get-current-book))
|
||||
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
|
||||
(xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
|
||||
(xaccQueryAddDateMatchTT query #t begindate #t date QOF-QUERY-AND)
|
||||
(qof-query-set-sort-order query
|
||||
(list SPLIT-TRANS TRANS-DATE-POSTED)
|
||||
'() '())
|
||||
(qof-query-set-sort-increasing query #t #t #t)))
|
||||
|
||||
(qof-query-set-book query (gnc-get-current-book))
|
||||
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
|
||||
(xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
|
||||
(xaccQueryAddDateMatchTT query #f 0 #t date QOF-QUERY-AND)
|
||||
(qof-query-set-sort-order query
|
||||
(list SPLIT-TRANS TRANS-DATE-POSTED)
|
||||
'() '())
|
||||
(qof-query-set-sort-increasing query #t #t #t))
|
||||
|
||||
(define (aging-options-generator options)
|
||||
(let* ((add-option
|
||||
|
@ -221,8 +221,7 @@
|
||||
(export gnc:time64-ge-date)
|
||||
(export gnc:make-date-interval-list)
|
||||
(export gnc:make-date-list)
|
||||
(export make-zdate)
|
||||
(export SecDelta )
|
||||
(export SecDelta)
|
||||
(export DayDelta)
|
||||
(export WeekDelta )
|
||||
(export TwoWeekDelta)
|
||||
|
Loading…
Reference in New Issue
Block a user