mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
GSTReport: filter out some transactions
This commit restores filtering for closing, link and payment transactions.
This commit is contained in:
@@ -45,7 +45,17 @@ accounts must be of type ASSET for taxes paid on expenses, and type LIABILITY fo
|
|||||||
(define (income-gst-statement-renderer rpt)
|
(define (income-gst-statement-renderer rpt)
|
||||||
(trep-renderer rpt
|
(trep-renderer rpt
|
||||||
#:custom-calculated-cells gst-calculated-cells
|
#:custom-calculated-cells gst-calculated-cells
|
||||||
#:empty-report-message TAX-SETUP-DESC))
|
#:empty-report-message TAX-SETUP-DESC
|
||||||
|
#:custom-split-filter gst-custom-split-filter))
|
||||||
|
|
||||||
|
(define (gst-custom-split-filter split)
|
||||||
|
;; split -> bool
|
||||||
|
;;
|
||||||
|
;; additional split filter - returns #t if split must be included
|
||||||
|
;; we need to exclude Closing, Link and Payment transactions
|
||||||
|
(let ((trans (xaccSplitGetParent split)))
|
||||||
|
(and (member (xaccTransGetTxnType trans) (list TXN-TYPE-NONE TXN-TYPE-INVOICE))
|
||||||
|
(not (xaccTransGetIsClosingTxn trans)))))
|
||||||
|
|
||||||
(define (gst-statement-options-generator)
|
(define (gst-statement-options-generator)
|
||||||
;; Retrieve the list of options specified within the transaction report
|
;; Retrieve the list of options specified within the transaction report
|
||||||
|
|||||||
@@ -1603,7 +1603,7 @@ tags within description, notes or memo. ")
|
|||||||
;; Here comes the renderer function for this report.
|
;; Here comes the renderer function for this report.
|
||||||
|
|
||||||
|
|
||||||
(define* (trep-renderer report-obj #:key custom-calculated-cells empty-report-message)
|
(define* (trep-renderer report-obj #:key custom-calculated-cells empty-report-message custom-split-filter)
|
||||||
(define options (gnc:report-options report-obj))
|
(define options (gnc:report-options report-obj))
|
||||||
(define (opt-val section name) (gnc:option-value (gnc:lookup-option options section name)))
|
(define (opt-val section name) (gnc:option-value (gnc:lookup-option options section name)))
|
||||||
(define BOOK-SPLIT-ACTION (qof-book-use-split-action-for-num-field (gnc-get-current-book)))
|
(define BOOK-SPLIT-ACTION (qof-book-use-split-action-for-num-field (gnc-get-current-book)))
|
||||||
@@ -1793,6 +1793,8 @@ tags within description, notes or memo. ")
|
|||||||
(match? (xaccTransGetDescription trans))
|
(match? (xaccTransGetDescription trans))
|
||||||
(match? (xaccTransGetNotes trans))
|
(match? (xaccTransGetNotes trans))
|
||||||
(match? (xaccSplitGetMemo split)))
|
(match? (xaccSplitGetMemo split)))
|
||||||
|
(or (not custom-split-filter) ; #f = ignore custom-split-filter
|
||||||
|
(custom-split-filter split))
|
||||||
(or (not reconcile-status-filter) ; #f = ignore next filter
|
(or (not reconcile-status-filter) ; #f = ignore next filter
|
||||||
(member (xaccSplitGetReconcile split) reconcile-status-filter)))))
|
(member (xaccSplitGetReconcile split) reconcile-status-filter)))))
|
||||||
splits))
|
splits))
|
||||||
|
|||||||
Reference in New Issue
Block a user