GNOME Bugzilla – Bug 587875
Advanced Portfolio: cash basis blank for particular share
Last modified: 2018-06-29 22:24:07 UTC
Please describe the problem: In the advanced portfolio report, the cash basis field is blank for one particular stock. All other stocks appear correctly. A simplified .gnucash file that demonstrates the problem is attached. Steps to reproduce: 1. Load the attached .gnucash file 2. Select Advanced Portfolio Report 3. Cash basis (and derived fields) are blank Actual results: Cash basis field is blank Expected results: Expect to see the cash basis correctly displayed (as all other stocks are) Does this happen every time? Yes Other information:
Created attachment 137911 [details] Sample demonstrating reported bug This is the sample .gnucash file that demonstrates the reported bug
Further testing seems to indicate that the problem is where there are two or more stock splits in the account. Attached is a second file (test02.gnucash) that is as simple as I can make that demonstrates the problem.
Created attachment 140837 [details] Simplest test case that demonstrates the problem
I'm seeing the same problem with 2.4.11, a test case is attached.
Created attachment 230956 [details] Test case
*** Bug 603426 has been marked as a duplicate of this bug. ***
*** Bug 612467 has been marked as a duplicate of this bug. ***
At least some of the problems mentioned in this bug report are caused by an overflow in the function sum-basis in report/standard-reports/advanced-portfolio.scm In 2.4.11, Changing line 199 from: (gnc-numeric-add (gnc-numeric-mul (caar b-list) (cdar b-list) GNC-DENOM-AUTO GNC-RND-ROUND) To: (gnc-numeric-add (gnc-numeric-mul (caar b-list) (cdar b-list) GNC-DENOM-AUTO (logior GNC-DENOM-REDUCE GNC-RND-ROUND)) Seems to resolve the issue.
This didn't seem to help in my case. I have a number of stocks that all exhibit this exact same issue.
I'm not using the Advanced Portfolio report myself, so I don't know how it is supposed to behave. However the patch in comment 8 looks fine to me. In the best case it solves some overflows in the worst case it may slow down report generation a bit. So I have applied it on r23622 (trunk) and r23623 (2.4). I'll leave the report open for futher investigation.
The patch fixed the bug for me. Thanks!
I think that the changes I to the Advanced Portfolio report that I checked in today fixed these problems. You can get the new version at http://svn.gnucash.org/trac/browser/gnucash/trunk/src/report/standard-reports/advanced-portfolio.scm if you want to try it, or wait for the next release. Let me know if you think it is still broken. I tried the test cases attached to the bug report and they seem to work ok.
Thank you for the fix. I will wait for the next stable release 2.6.1 to test it. best regards, olivier
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=587875. Please update any external references or bookmarks.