Disallow Closing Transactions.

These txns must not be counted in this report.
This commit is contained in:
christopherlam 2017-09-16 14:53:27 +08:00
parent 9d85ee65d8
commit 499c33cb35

View File

@ -1710,13 +1710,14 @@ for taxes paid on expenses, and type LIABILITY for taxes collected on sales.")
; otherwise it will double count where transaction contains 2 splits in same account
(set! splits (splits-filter-unique-transactions splits))
; For each split, we will optionally only keep those which contain useful data
; e.g. show invoices & regular transactions
; For each split, we will only keep those which contain useful data
; e.g. show invoices & regular transactions. We will also disallow closing txns.
(set! splits (filter
(lambda (split)
(let* ((trans (xaccSplitGetParent split))
(txn-type (xaccTransGetTxnType trans)))
(member txn-type (list TXN-TYPE-NONE TXN-TYPE-INVOICE))))
(and (member txn-type (list TXN-TYPE-NONE TXN-TYPE-INVOICE))
(not (xaccTransGetIsClosingTxn trans)))))
splits))
(if (not (null? splits))