Skip to content

Commit

Permalink
Inline gnc:query-set-match-non-voids-only!
Browse files Browse the repository at this point in the history
Addendum to 683fe2f - completion deprecate old function
  • Loading branch information
christopherlam committed Sep 17, 2020
1 parent 9a948eb commit e0062b6
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion gnucash/report/commodity-utilities.scm
Expand Up @@ -30,7 +30,8 @@
(define (get-all-splits accounts end-date)
(let ((query (qof-query-create-for-splits)))
(qof-query-set-book query (gnc-get-current-book))
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
(xaccQueryAddClearedMatch
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
(xaccQueryAddAccountMatch query accounts QOF-GUID-MATCH-ANY QOF-QUERY-AND)
(xaccQueryAddDateMatchTT query #f 0 (and end-date #t) (or end-date 0) QOF-QUERY-AND)
(let ((splits (qof-query-run query)))
Expand Down
3 changes: 2 additions & 1 deletion gnucash/report/reports/aging.scm
Expand Up @@ -303,7 +303,8 @@ 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
(define (setup-query query account date)
(qof-query-set-book query (gnc-get-current-book))
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
(xaccQueryAddClearedMatch
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
(xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
(xaccQueryAddDateMatchTT query #f 0 #t date QOF-QUERY-AND)
(qof-query-set-sort-order query
Expand Down
3 changes: 2 additions & 1 deletion gnucash/report/reports/example/average-balance.scm
Expand Up @@ -338,7 +338,8 @@

;; for balance purposes, we don't need to do this, but it cleans up
;; the table display.
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
(xaccQueryAddClearedMatch
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
;; add accounts to the query (include subaccounts
;; if requested)
(gnc:report-percent-done 25)
Expand Down
3 changes: 2 additions & 1 deletion gnucash/report/reports/example/daily-reports.scm
Expand Up @@ -217,7 +217,8 @@

;; for balance purposes, we don't need to do this, but it cleans up
;; the table display.
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
(xaccQueryAddClearedMatch
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
;; add accounts to the query (include subaccounts
;; if requested)
(gnc:report-percent-done 25)
Expand Down
3 changes: 2 additions & 1 deletion gnucash/report/reports/standard/general-journal.scm
Expand Up @@ -56,7 +56,8 @@
;; Register Report properly ignores voided transactions, I'll err
;; on the side of safety by excluding them from the query....
(qof-query-set-book query (gnc-get-current-book))
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
(xaccQueryAddClearedMatch
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
(qof-query-set-sort-order query
(list SPLIT-TRANS TRANS-DATE-POSTED)
(list QUERY-DEFAULT-SORT)
Expand Down
3 changes: 2 additions & 1 deletion gnucash/report/reports/standard/lot-viewer.scm
Expand Up @@ -104,7 +104,8 @@
(splits
(let ((query (qof-query-create-for-splits)))
(qof-query-set-book query (gnc-get-current-book))
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
(xaccQueryAddClearedMatch
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
(xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
(xaccQueryAddDateMatchTT query #t from-date #t to-date QOF-QUERY-AND)
(filter desc-filter? (qof-query-run query))))
Expand Down
3 changes: 2 additions & 1 deletion gnucash/report/reports/standard/new-aging.scm
Expand Up @@ -70,7 +70,8 @@ exist but have no suitable transactions."))

(define (setup-query query accounts date)
(qof-query-set-book query (gnc-get-current-book))
(gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
(xaccQueryAddClearedMatch
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
(xaccQueryAddAccountMatch query accounts QOF-GUID-MATCH-ANY QOF-QUERY-AND)
(xaccQueryAddDateMatchTT query #f 0 #t date QOF-QUERY-AND)
(qof-query-set-sort-order query (list SPLIT-TRANS TRANS-DATE-POSTED) '() '())
Expand Down

0 comments on commit e0062b6

Please sign in to comment.