GNOME Bugzilla – Bug 603426
Advanced Portfolio report - has blank columns for some stocks
Last modified: 2018-06-29 22:31:26 UTC
Created attachment 148797 [details] simple test database showing Advanced Portfolio issue For a stock which has been bought, sold, and bought again, the Advanced Portfolio report shows only a dollar sign (no digits) in the following columns: Basis, Realized Gain, Unrealized Gain, Total Gain This happens only with "Basis Calculation Method" set to "Average" (the default) in report options. The attached database "test" shows this... the report columns are blank for stock account "TGT". There is another stock account "RHT" which has only a single purchase, so does not show the problem.
I have encountered the same bug in 2.4.0.
Created attachment 242659 [details] GnuCash file with updates in stock selling transaction for TGT When I work on the GnuCash file as attached by Jonathan I get the same effect. But looking at the selling transaction for the TGT stock account it does not look like I expect it after reading the concept and tutorial guide. I add an attachment where I changed the selling transaction according to my understanding how it should be done (involving a new checking account). With this file, the Advanced Portfolio Report does not show empty fields anymore. Would be good if Jonathan could check. Right now, I would not confirm this bug.
Sorry, forgot to menation: Tried with GnuCash 2.4.10 and 2.5.0 on Ubuntu 12.04.
It looks like the problem is caused by using the "Scrub Account" feature which sets up lot allocation. In Carsten's example file (with Gnucash 2.4.13), if I open the TGT account, choose menu "Actions / View Lots", then push the "Scrub Account" button: Now the Advanced Portfolio report will show the unexpected blank fields. (In this case the Scrub Account button also produces an incorrect result, because it adds a Realized Gain transaction, which is wrong since Carsten already entered the realized gain as part of the stock sale.) So I think the Scrub Account feature behaves inconsistently with section 8.7 of the Tutorials and Concepts guide, and with the Advanced Portfolio report. I am not sure what to suggest, but maybe Scrub Account should go away?
Did you read http://wiki.gnucash.org/wiki/Concept_of_Lots ? I did, but I did not really get the idea out of it :-( (As I am neither from the US nor a native English speaker, neither do I have any accounting background, this chapter is really hard to read for me). I just noticed, if you press the Scrub Account button you will see this problem if the basis calculation method is set to "Average". It still gives you a result for FIFO or LIFO. Does that make sense with the context what is described on the Wiki page? Could that mean, there is no problem with the Scrub Account as such, but with the calculation method set to Average?
You are right, there must be a bug in the Average cost basis calculation. The problem only occurs with Average. If there is a problem with Scrub Account, it is a separate issue. I think ideally, Advanced Portfolio would use lots (if they exist) to find the cost basis. (Not FIFO or LIFO or Average method.) However, maybe this is not necessary, since the Lots feature seems incomplete. (For example, having only FIFO allocation, not handling stock splits correctly, and being inconsistent with the documentation of how to handle realized gains, as I said above.) Thanks, please email me if I can explain anything better.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 587875 ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=603426. Please update any external references or bookmarks.