Bug 256930

Summary: Investment and Net Worth reports values mutual funds with 1 instead of price
Product: [Applications] kmymoney Reporter: Volker Paul <volker.paul>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: wishlist CC: asoliverez, jan_cecile, lukasz.wojnilowicz, onet.cristian, volker.paul
Priority: NOR    
Version: 4.5   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Volker Paul 2010-11-14 21:33:02 UTC
Version:           4.5 (using KDE 4.5.1) 
OS:                Linux

Investment reports such as Investment Performance by Account
list mutual funds (and probably stocks etc.) with a price of 1.
It would be better to use the purchase price/share from the Buy transaction.
Once a new price is entered with Tools - Update Stock and Currency Prices,
that price is taken, but from purchase till then, only the number of shares
shows up in the report (resp. multiplied by 1).

First found in KMyMoney 1.0.4;
also checked version 4.5.0, the bug is still there.

A workaround may be to (manually) enter a price in the Update Prices tool
at the same time the Buy transaction is entered. 
But I think that should be done automatically.


Reproducible: Always

Steps to Reproduce:
Enter investment transaction (Buy), but no price in the price tool.
For example: 200 shares, price 50 (in transaction, not price tool).
Enter a price for a later date (say, two months after purchase), 
e.g. new price=55.
Then open a report.

Actual Results:  
Investment shows up with 200 from date of purchase till 
two months later, when new price is there.
From then, it shows up with 11000 = 200*55

Expected Results:  
Investment should show up with 10000 = 200*50 from date of purchase till 
two months later, when new price is there.
From then, it should show up as it does with 11000 = 200*55.
Comment 1 Alvaro Soliverez 2010-11-15 02:47:37 UTC
Go to Prices, verify you have an actual price entered.
Comment 2 Volker Paul 2010-11-15 07:22:14 UTC
(In reply to comment #1)
> Go to Prices, verify you have an actual price entered.

Yes, you are right. I can enter a price explicitly, 
additionally, in the price tool.
But what I want to say is: I already entered that price.

I entered an investment transaction:
Activity: Buy shares
Security: test
Shares: 200
Price/share: 50
Total: 10000

And normally I would expect that price of 50 to be used in reports
as the value of that stock until I enter a (new) price. Instead, 
the Investment Performance by Account report shows:

Account  Starting Balance  Buys         ... Return On Investment   Amount
test            0.00       10,000.00            -98.00%            200.00

Imagine the shock a casual user gets when he sees 
that he lost almost everything,
only to find out after a lot of research 
that he had to enter the same price twice at different places, 
once in the transaction and once in the price tool.
Ok, he can do that, but computing is all about doing things automatically.
So my question is: why not take the purchase price/share 
automatically into the stored prices list?
Comment 3 Volker Paul 2010-11-15 18:34:33 UTC
I can't agree with this being "not a bug" (INVALID). 
It may be minor ("minor loss of function, or other problem where easy workaround is present"). Entering data twice is a workaround at best.
And the example shows that the principle of least surprise (POLS)
is violated. (From Wikipedia:)
"It states that, when two elements of an interface conflict, or are ambiguous, the behaviour should be that which will least surprise the user; in particular a programmer should try to think of the behavior that will least surprise someone who uses the program, rather than that behavior that is natural from knowing the inner workings of the program."

Now when you buy a stock, in reality it first approximately holds its value
and the user is surprised if in KMyMoney's reports it suddenly
has a completely different value.

So this is surely not an ideal situation and requires a workaround.
While I can understand that you are too busy to implement it now,
I do think this is something a user normally wants to have,
so it's at least a wish, a "nice-to-have" feature, as it saves the user
extra work.

And it's easy to implement. Just open a dialog box 
asking the user: "Should this price for this security be entered
into prices at this date for later reference in reports?" and
if the user agrees, insert the price in the list.

What do the others think?
Comment 4 Alvaro Soliverez 2010-11-15 18:40:11 UTC
Have you checked the "Enter prices on entry" setting?
Comment 5 Volker Paul 2010-11-15 19:23:30 UTC
(In reply to comment #4)
> Have you checked the "Enter prices on entry" setting?

No, and I can't find such a setting. Where is it?
Comment 6 Thomas Baumgart 2010-12-12 18:47:39 UTC
I sort of remember that we had such a feature. It probably got lost somewhere.
Comment 7 Volker Paul 2010-12-12 22:04:36 UTC
On Sunday, December 12, 2010 18:47:40 Thomas Baumgart wrote:
> https://bugs.kde.org/show_bug.cgi?id=256930
> 
> 
> 
> 
> 
> --- Comment #6 from Thomas Baumgart <ipwizard users sourceforge net> 
> 2010-12-12 18:47:39 --- I sort of remember that we had such a feature. It
> probably got lost somewhere.
Thanks for this answer. I already startet to think I'm blind.
So I have to enter the price manually.

Volker
Comment 8 Alvaro Soliverez 2010-12-13 00:40:42 UTC
The problem seems to be that the share price is not entered into a price automatically.
There is such an option when you deal with foreign currency accounts, but not in the case of investments.
Comment 9 Jack 2010-12-13 00:56:09 UTC
I've also seen this - the first time I save after adding an investment, the consistency check says I don't have a price on or before the opening day of the investment.  Funny thing is, I don't manually enter one, and it stops complaining.  Has it entered one for me automatically, or does it just issue that particular complaint once per investment?
Comment 10 Alvaro Soliverez 2010-12-13 00:59:25 UTC
That consistency check is performed every time you save, so it is either entered automatically or via online update.
Comment 11 Jack 2010-12-13 01:34:36 UTC
That's why I think something is odd.  An online update would get a price for the date of the update, not for an earlier date, and I generally enter new investments at the end of the month when I'm getting ready to reconcile.  If it's automatic, why doesn't it do it as soon as you create the investment (assuming you do so as part of the process of purchasing shares, where you do provide a price) ?

Anyway - should we create a wish-list to automatically enter share prices whenever they are entered in a buy/sell transaction?
Comment 12 Alvaro Soliverez 2012-04-27 14:27:45 UTC
This should be closed and a wishlist should be entered to have a dialog come up to enter share price, like it's done for foreign currency.
Comment 13 Jan 2015-03-15 16:04:52 UTC
I think the value of 1 was chosen, rather arbitrarily, to avoid zero divides.  I agree with the request:  It is better to have no result (error) than a wrong one.
Comment 14 wojnilowicz 2017-05-01 05:39:39 UTC
I cannot reproduce it anymore in master branch of KMM.