mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[reports] QofQuery must be qof_query_destroyed
This commit is contained in:
parent
c2a449356b
commit
1b0bfa5da7
@ -194,11 +194,6 @@ commissions in cumulative average cost and gain/loss after commission")
|
|||||||
(define cap-purch-costs? (opt-val gnc:pagename-general optname-cap-purch-costs))
|
(define cap-purch-costs? (opt-val gnc:pagename-general optname-cap-purch-costs))
|
||||||
(define document (gnc:make-html-document))
|
(define document (gnc:make-html-document))
|
||||||
|
|
||||||
(define (elt->cell split)
|
|
||||||
(gnc:html-markup-anchor
|
|
||||||
(gnc:split-anchor-text split)
|
|
||||||
(amount->monetary (xaccSplitGetAmount split))))
|
|
||||||
|
|
||||||
(define large 10000000)
|
(define large 10000000)
|
||||||
(define (get-fx db from to time)
|
(define (get-fx db from to time)
|
||||||
(/ (gnc-pricedb-convert-balance-nearest-price-t64 db large from to time)
|
(/ (gnc-pricedb-convert-balance-nearest-price-t64 db large from to time)
|
||||||
@ -232,7 +227,9 @@ commissions in cumulative average cost and gain/loss after commission")
|
|||||||
(let ((query (qof-query-create-for-splits)))
|
(let ((query (qof-query-create-for-splits)))
|
||||||
(qof-query-set-book query (gnc-get-current-book))
|
(qof-query-set-book query (gnc-get-current-book))
|
||||||
(xaccQueryAddSingleAccountMatch query stock-acct QOF-QUERY-AND)
|
(xaccQueryAddSingleAccountMatch query stock-acct QOF-QUERY-AND)
|
||||||
(xaccQueryGetSplitsUniqueTrans query))))
|
(let ((result (xaccQueryGetSplitsUniqueTrans query)))
|
||||||
|
(qof-query-destroy query)
|
||||||
|
result))))
|
||||||
|
|
||||||
(define (to-commodity amt)
|
(define (to-commodity amt)
|
||||||
(if format-cells
|
(if format-cells
|
||||||
|
@ -108,7 +108,9 @@
|
|||||||
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
|
query (logand CLEARED-ALL (lognot CLEARED-VOIDED)) QOF-QUERY-AND)
|
||||||
(xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
|
(xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
|
||||||
(xaccQueryAddDateMatchTT query #t from-date #t to-date QOF-QUERY-AND)
|
(xaccQueryAddDateMatchTT query #t from-date #t to-date QOF-QUERY-AND)
|
||||||
(filter desc-filter? (qof-query-run query))))
|
(let ((result (filter desc-filter? (qof-query-run query))))
|
||||||
|
(qof-query-destroy query)
|
||||||
|
result)))
|
||||||
(transactions
|
(transactions
|
||||||
(sort-and-delete-duplicates
|
(sort-and-delete-duplicates
|
||||||
(map xaccSplitGetParent splits)
|
(map xaccSplitGetParent splits)
|
||||||
|
@ -63,7 +63,8 @@
|
|||||||
(qof-query-set-book query (gnc-get-current-book))
|
(qof-query-set-book query (gnc-get-current-book))
|
||||||
(xaccQueryAddAccountMatch query (list bank)
|
(xaccQueryAddAccountMatch query (list bank)
|
||||||
QOF-GUID-MATCH-ANY QOF-QUERY-AND)
|
QOF-GUID-MATCH-ANY QOF-QUERY-AND)
|
||||||
(set-option options "__reg" "query" (gnc-query2scm query)))
|
(set-option options "__reg" "query" (gnc-query2scm query))
|
||||||
|
(qof-query-destroy query))
|
||||||
|
|
||||||
(let ((sxml (options->sxml options "basic")))
|
(let ((sxml (options->sxml options "basic")))
|
||||||
;; this is a simplistic test - counts the number of populated
|
;; this is a simplistic test - counts the number of populated
|
||||||
|
Loading…
Reference in New Issue
Block a user