gnucash maint: The cash flow report should ignore splits in trading accounts.

Mike Alexander mta at code.gnucash.org
Tue May 13 22:50:56 EDT 2014


Updated	 via  https://github.com/Gnucash/gnucash/commit/15e9bde7 (commit)
	from  https://github.com/Gnucash/gnucash/commit/dcbeba9e (commit)



commit 15e9bde7c3c190cb5385982343c3c545ab513baf
Author: Mike Alexander <mta at umich.edu>
Date:   Tue May 13 18:04:32 2014 -0400

    The cash flow report should ignore splits in trading accounts.

diff --git a/src/report/standard-reports/cash-flow.scm b/src/report/standard-reports/cash-flow.scm
index 45dad7e..0c1e91e 100644
--- a/src/report/standard-reports/cash-flow.scm
+++ b/src/report/standard-reports/cash-flow.scm
@@ -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))
                               )



Summary of changes:
 src/report/standard-reports/cash-flow.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list