After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 587875 - Advanced Portfolio: cash basis blank for particular share
Advanced Portfolio: cash basis blank for particular share
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Reports
2.4.x
Other All
: Normal normal
: ---
Assigned To: gnucash-reports-maint
gnucash-reports-maint
: 603426 612467 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-07-06 11:15 UTC by David Giddy
Modified: 2018-06-29 22:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample demonstrating reported bug (3.80 KB, application/x-gnucash)
2009-07-06 11:17 UTC, David Giddy
Details
Simplest test case that demonstrates the problem (3.07 KB, application/x-gnucash)
2009-08-15 12:21 UTC, David Giddy
Details
Test case (27.51 KB, application/octet-stream)
2012-12-07 09:26 UTC, Erik Grinaker
Details

Description David Giddy 2009-07-06 11:15:24 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:
Comment 1 David Giddy 2009-07-06 11:17:23 UTC
Created attachment 137911 [details]
Sample demonstrating reported bug

This is the sample .gnucash file that demonstrates the reported bug
Comment 2 David Giddy 2009-08-15 12:17:43 UTC
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.
Comment 3 David Giddy 2009-08-15 12:21:21 UTC
Created attachment 140837 [details]
Simplest test case that demonstrates the problem
Comment 4 Erik Grinaker 2012-12-07 09:25:49 UTC
I'm seeing the same problem with 2.4.11, a test case is attached.
Comment 5 Erik Grinaker 2012-12-07 09:26:32 UTC
Created attachment 230956 [details]
Test case
Comment 6 Geert Janssens 2013-12-08 15:38:54 UTC
*** Bug 603426 has been marked as a duplicate of this bug. ***
Comment 7 Geert Janssens 2013-12-08 15:39:30 UTC
*** Bug 612467 has been marked as a duplicate of this bug. ***
Comment 8 zz-bugzilla-9297 2013-12-20 02:31:53 UTC
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.
Comment 9 Alun Champion 2013-12-25 00:40:05 UTC
This didn't seem to help in my case. I have a number of stocks that all exhibit this exact same issue.
Comment 10 Geert Janssens 2013-12-26 15:52:02 UTC
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.
Comment 11 Erik Grinaker 2013-12-30 09:50:12 UTC
The patch fixed the bug for me. Thanks!
Comment 12 Mike Alexander 2014-01-20 05:33:23 UTC
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.
Comment 13 odavy 2014-01-20 10:39:29 UTC
Thank you for the fix. I will wait for the next stable release 2.6.1 to test it.

best regards,

olivier
Comment 14 John Ralls 2017-09-24 22:45:02 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 15 John Ralls 2018-06-29 22:24:07 UTC
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.