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:
Christopher Lam 2018-03-04 08:10:45 +08:00
parent 580ce72da7
commit 551e98435d
2 changed files with 9 additions and 16 deletions

View File

@ -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

View File

@ -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)