gnucash maint: Advanced portfolio should respect report date when looking for other income/expense.

Mike Alexander mta at code.gnucash.org
Tue Jan 20 00:08:36 EST 2015


Updated	 via  https://github.com/Gnucash/gnucash/commit/383d1660 (commit)
	from  https://github.com/Gnucash/gnucash/commit/a615606f (commit)



commit 383d16609c2e03e739a71881660edc0adfe92aa7
Author: Mike Alexander <mta at umich.edu>
Date:   Tue Jan 20 00:48:02 2015 -0500

    Advanced portfolio should respect report date when looking for other income/expense.

diff --git a/src/report/standard-reports/advanced-portfolio.scm b/src/report/standard-reports/advanced-portfolio.scm
index 7f15c03..743b554 100644
--- a/src/report/standard-reports/advanced-portfolio.scm
+++ b/src/report/standard-reports/advanced-portfolio.scm
@@ -824,8 +824,11 @@
 	          (lambda (split)
 	            (let* ((other-split (xaccSplitGetOtherSplit split)) 
 	                   ;; This is safe because xaccSplitGetAccount returns null for a null split
-	                   (other-acct (xaccSplitGetAccount other-split)))
+	                   (other-acct (xaccSplitGetAccount other-split))
+	                   (parent (xaccSplitGetParent split))
+	                   (txn-date (gnc-transaction-get-date-posted parent)))
 	              (if (and (not (null? other-acct))
+	                       (gnc:timepair-le txn-date to-date)
 	                       (string=? (xaccAccountGetName other-acct) account-name)
 	                       (gnc-commodity-is-currency (xaccAccountGetCommodity other-acct)))
 	                ;; This is a two split transaction where the other split is to an 



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



More information about the gnucash-changes mailing list