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 336240 - advanced portfolio - the basis calculation is not working properly in funds
advanced portfolio - the basis calculation is not working properly in funds
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Reports
1.9.x
Other All
: Normal normal
: ---
Assigned To: Chris Lyttle
Chris Lyttle
Depends on:
Blocks: backport
 
 
Reported: 2006-03-27 19:20 UTC by F. Kurz
Modified: 2018-06-29 21:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for advanced portfolio improvements (10.23 KB, patch)
2006-04-14 10:30 UTC, F. Kurz
none Details | Review
Data file to demo Adv Portf issues handling Splits (7.34 KB, application/xml)
2006-05-08 03:17 UTC, dvherman
  Details

Description F. Kurz 2006-03-27 19:20:55 UTC
Please describe the problem:
In funds, the basis calculated dosesn't take intro account transactions with
money coming from an income account ( this is the case for instance in France as
this is a way for companies to give extra money from the benefits, without any
taxes). Thus every ROI is wrong.

Steps to reproduce:
1. create a fund with 10 shares of value 10 (total 100) with the money coming
from  an asset account : the basis is 100
2. use an income account instead : the basis is 0.



Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Bengt Thuree 2006-04-03 07:14:27 UTC
Would it be possible to fill in the "Actual Results" as well as the "Expected Results". 
If you also can describe the correct formula for how to calculate this it would be even better.
Comment 2 F. Kurz 2006-04-04 20:06:43 UTC
In the example above, the correct basis is 100 (total amount of money invested).

I probably wasn't clear enough : the problem is not related to a wrong formula.  there is somewhere in the code (probably in advanced-portfolio.scm around line 333 but my poor knowleldge of scheme prevents me to go further) where transactions with money coming from an income account are not used in the function to calculate the basis, but I think they should.
In gnucash 1.8 the basis was not clearly calculated but the percentages of benefits related to the investments were right : it should be the same in the 1.9 version.
Comment 3 F. Kurz 2006-04-14 10:30:24 UTC
Created attachment 63451 [details] [review]
patch for advanced portfolio improvements

the partfolio now deals with income accounts to compute the basis, and there is now a new ROI.
Comment 4 F. Kurz 2006-04-14 10:33:40 UTC
some other explanations that I did not add with the patch : 

The report is modified that way:
- the basis takes into account money coming from assets or income accounts
- the dividends are now included in a more general notion : external investment 
- two new columns are displayed: the external investment and the global ROI on the other hand.
the idea is to take into account the possibility to have shares or funds paid by someone else ( re-invested dividends or extra salary or whatever) . 

The return formulae are:
personnal return= gain/(personnal money invested)  ;;(external money is thus considered as gain - no change)
global return= (gain-external money)/(money invested (own and other). this  shows more or less the fund/actions performance
Comment 5 dvherman 2006-05-08 03:17:03 UTC
Created attachment 64985 [details]
Data file to demo Adv Portf issues handling Splits

If the patch earlier in this bug report is applied the Basis calculations are much improved.  The attached data file demonstrates an additional problem with Stock Splits.  The entry in the column "Realized Gain" is incorrect.  If that entry is removed from the column "Basis" the report is correct.


This data file is from the updates to the Concept Guide.
Comment 6 Christian Stimming 2006-06-20 12:22:31 UTC
See also bug#343245
Comment 7 Andrew Sackville-West 2007-12-14 18:05:53 UTC
I think this is fixed in r16620. at least the basis portion of it, which is what the original bug report was about. Doing a simple purchase of shares with an income account adjusts the basis properly, though it does show a realized gain as well, which is not right. But that is another issue. ISTM that these types of purchases, from Income accounts, need to be passed through an interim account. We can't tell, at this time, what the purchase was made with -- reinvested dividends, regular income, etc etc. 

Anyway, I'm marking this as blocking the backport bug to that it gets closed when 16220 backports.
Comment 8 Andreas Köhler 2007-12-16 12:32:53 UTC
branches/2.2@r16663.

Please mark the patch as obsolete or committed, whatever fits better.
Comment 9 John Ralls 2018-06-29 21:00:34 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=336240. Please update any external references or bookmarks.