gnucash maint: Bug 722140: Add option to control inclusion of trading accounts in cash flow report.

Mike Alexander mta at code.gnucash.org
Thu Aug 14 17:22:55 EDT 2014


Updated	 via  https://github.com/Gnucash/gnucash/commit/5db0cb98 (commit)
	from  https://github.com/Gnucash/gnucash/commit/e4d97f6d (commit)



commit 5db0cb98d42df0d348aba6c5b3ae301d62b0b5b7
Author: Mike Alexander <mta at umich.edu>
Date:   Thu Aug 14 16:29:59 2014 -0400

    Bug 722140: Add option to control inclusion of trading accounts in cash flow report.

diff --git a/src/report/standard-reports/cash-flow.scm b/src/report/standard-reports/cash-flow.scm
index 2e7c500..764d270 100644
--- a/src/report/standard-reports/cash-flow.scm
+++ b/src/report/standard-reports/cash-flow.scm
@@ -51,6 +51,7 @@
 (define optname-price-source (N_ "Price Source"))
 (define optname-show-rates (N_ "Show Exchange Rates"))
 (define optname-show-full-names (N_ "Show Full Account Names"))
+(define optname-include-trading-accounts (N_ "Include Trading Accounts in report"))
 
 ;; options generator
 (define (cash-flow-options-generator)
@@ -93,6 +94,13 @@
               ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL)
         (gnc-account-get-descendants-sorted (gnc-get-current-root-account))))
      #f)
+     
+     ;; Trading accounts?
+     (gnc:register-option
+      options
+      (gnc:make-simple-boolean-option
+       gnc:pagename-accounts optname-include-trading-accounts
+       "b" (N_ "Include transfers to and from Trading Accounts in the report.")  #f))
     
     ;; Set the general page as default option tab
     (gnc:options-set-default-section options gnc:pagename-general)      
@@ -119,6 +127,8 @@
                                      optname-show-subaccounts))
          (accounts (get-option gnc:pagename-accounts
                                optname-accounts))
+         (include-trading-accounts (get-option gnc:pagename-accounts
+                               optname-include-trading-accounts))
          (row-num 0)
 	 (work-done 0)
 	 (work-to-do 0)
@@ -261,6 +271,7 @@
                             (for-each
                               (lambda (s)
                                 (let* ((s-account (xaccSplitGetAccount s))
+                                       (s-account-type (xaccAccountGetType s-account)) 
                                        (s-amount (xaccSplitGetAmount s))
                                        (s-value (xaccSplitGetValue s))
                                        (s-commodity (xaccAccountGetCommodity s-account)))
@@ -275,6 +286,7 @@
                                   ;(gnc:debug (xaccAccountGetName s-account))
                                   (if (and	 ;; make sure we don't have
 				       (not (null? s-account)) ;;  any dangling splits
+				       (or include-trading-accounts (not (eq? s-account-type ACCT-TYPE-TRADING)))
 				       (not (account-in-list? s-account accounts)))
 				      (if (not (split-in-list? s seen-split-list))
 					  (begin  



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



More information about the gnucash-changes mailing list