The cash flow report should ignore splits in trading accounts.

This commit is contained in:
Mike Alexander 2014-05-13 18:04:32 -04:00
parent dcbeba9ec3
commit 15e9bde7c3

View File

@ -218,8 +218,10 @@
(lambda (parent-split)
(let* (
(psv (xaccSplitGetValue parent-split))
(acct-type (xaccAccountGetType(xaccSplitGetAccount parent-split)))
)
(if (gnc-numeric-positive-p psv) ;; meaning: if (psv>0)
(if (and (gnc-numeric-positive-p psv) ;; meaning: if (psv>0)
(not (eq? acct-type ACCT-TYPE-TRADING))) ;; not trading account split
(set! transaction-value
(gnc-numeric-add transaction-value psv GNC-DENOM-AUTO GNC-DENOM-LCD)
)
@ -253,6 +255,7 @@
(if (and ;; make sure we don't have
(not (null? s-account)) ;; any dangling splits
(not (account-in-list? s-account accounts))
(not (eq? (xaccAccountGetType s-account) ACCT-TYPE-TRADING)) ;; not trading account
;; only consider splits of opposite sign
(gnc-numeric-negative-p (gnc-numeric-mul s-value split-value GNC-DENOM-AUTO GNC-DENOM-REDUCE))
)