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 344566 - Advance Portfolio has wrong Realized Gain
Advance Portfolio has wrong Realized Gain
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Reports
git-master
Other Linux
: Normal normal
: ---
Assigned To: Chris Lyttle
Chris Lyttle
Depends on:
Blocks: backport
 
 
Reported: 2006-06-11 14:18 UTC by Bengt Thuree
Modified: 2018-06-29 21:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Small test file (4.18 KB, application/x-compressed-tar)
2006-06-11 14:21 UTC, Bengt Thuree
Details

Description Bengt Thuree 2006-06-11 14:18:58 UTC
After purchasing some stocks, I performed a Reverse-Split. The account looks ok, and the Chart of Accounts looks ok, but when I display a Advance Portfolio, I quite suddenly see that I have an realized gain of -$90,000 or so.
This despite the fact that I did not sell anything.

GnuCash version r14352 on 2006-06-11 (1.9.7 serie)

Step to reproduce this.

1) Buy 10000 stocks in AMAZON
2) Record a stock merger, where you will only have 1000 shares after the merger is done. 
3) Check the Advanced Portfolio

If you leave the new price empty in the Stock Split druid, you will get 0 as a unrealized gain. If you set a new price in the Stock Split druid, you will get a n unrealized gain which is equal to the realized gain (but positiv instead of negativ or the other way around). 

From IRC
<warlord> bengt: okay..  I'll see what I can see...  
<warlord> I bet the report is just confused about the 1-split txn
<warlord> Oh, I bet I see the problem.  The PriceDB wasn't adjusted along with the reverse-split..  So the report still thinks the value is $10/share after the reverse-split, but the new value should be $100/share.
<warlord> Once I add the additional pricedb entry the report looks right.
<warlord> bengt: can you file a bug report on this?  Copy and paste this discussion into the report, and then attach that test file?
<andi5> warlord: the stock split druid allows to set a new price (i think that at least), but you can leave it empty
<bengt> but why is it a realized gain? I never sold anything.....
<bengt> warlord: also the druid states it is perfectly ok to leave the price empty.
<warlord> bengt: I'm not seeing a realized gain.  you're using 1.9.x?
<andi5> svn upped to the extreme
<warlord> oh, I take it back, I AM seeing a realized gain.
<warlord> The report just doesn't understand how to handle stock splits... or at least reverse-splits..
<warlord> at least that's my take on it.
<andi5> warlord: for the newb: what is a reverse-split?
<warlord> Even after adding the new price, I still see a realized gain of -90,000 and an unrealized gain of 90,000... which is wrong.
<warlord> a reverse-split is what bengt has been calling a merger.
<andi5> h..... ok
<andi5> ;-)
<bengt> (druid calls it a merger also)
<warlord> it does?   Hmm.
<bengt> :) my comments... then again this was my first reverse-split/stock merger... so I am not certain
<warlord> it certainly looks like the report doesn't handle it properly, so you should file a bug report.
Comment 1 Bengt Thuree 2006-06-11 14:21:04 UTC
Created attachment 67128 [details]
Small test file

A small test file that contains
1) one purchase of 10000 stocks.
2) Reverse-split (-9000) so we only have 1000 stocks left. No new price is set.
3) Check the Advance Portfolio, and you will see a realized gain!
Comment 2 Christian Stimming 2006-07-20 09:06:54 UTC
Potentially related bugs (feel free to close this any one as "duplicate" if they are in fact identical or a direct subset of this bug):
bug#115267 bug#336240 (including patch) bug#342245 (including patch) bug#343245 bug#344566 bug#346062 bug#347975
Comment 3 Thierry Scalais 2006-08-13 21:21:24 UTC
(In reply to comment #1)
After the merger 10 to 1 the stock value should change in the ratio 1 to 10.
If the stock value is not changed by the merger you lost effectively 90% of your investment.
Comment 4 Andrew Sackville-West 2007-12-08 18:13:18 UTC
should be fixed in r 16620.
Comment 5 Andreas Köhler 2007-12-16 12:36:18 UTC
branches/2.2@r16663.

Thanks a lot!
Comment 6 John Ralls 2018-06-29 21:07:55 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=344566. Please update any external references or bookmarks.