gnucash maint: Bug 681225 - income statement displays blank base currency entries when trading account transactions are present during the report period

Geert Janssens gjanssens at code.gnucash.org
Tue Jun 16 15:38:45 EDT 2015


Updated	 via  https://github.com/Gnucash/gnucash/commit/e67e5125 (commit)
	from  https://github.com/Gnucash/gnucash/commit/8dc91cf7 (commit)



commit e67e5125011d540cf99ca13809e661c2e31eb322
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Tue Jun 16 21:38:14 2015 +0200

    Bug 681225 - income statement displays blank base currency entries when trading account transactions are present during the report period
    
    Skip splits in trading accounts when calculating
    average cost price source.

diff --git a/src/report/report-system/commodity-utilities.scm b/src/report/report-system/commodity-utilities.scm
index 74b3d2f..fbbf3c2 100644
--- a/src/report/report-system/commodity-utilities.scm
+++ b/src/report/report-system/commodity-utilities.scm
@@ -644,8 +644,11 @@
     (if (not (null? curr-accounts))
 	;; Go through all splits and add up all value-amounts
 	;; and share-amounts
+	;; However skip splits in trading accounts as these counterbalance
+	;; the actual value and share amounts back to zero
 	(for-each 
 	 (lambda (a)
+	   (if (not (eq? (xaccAccountGetType (xaccSplitGetAccount a)) ACCT-TYPE-TRADING))
 	   (let* ((transaction-comm (xaccTransGetCurrency
 				     (xaccSplitGetParent a)))
 		  (account-comm (xaccAccountGetCommodity
@@ -697,7 +700,7 @@
 					 (car comm-list) sumlist)))))
 		   ;; And add the balances to the comm-list entry.
 		   ((caadr pair) 'add (cadr foreignlist))
-		   ((cdadr pair) 'add (caddr foreignlist))))))
+		   ((cdadr pair) 'add (caddr foreignlist)))))))
 	 (gnc:get-all-commodity-splits curr-accounts end-date)))
   
     (gnc:resolve-unknown-comm sumlist report-commodity)))



Summary of changes:
 src/report/report-system/commodity-utilities.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list