Bug 274018 - Consistency check fails on stocks: "The investment <> has no price set for the opening date <> Please enter a price on or before the opening date."
Summary: Consistency check fails on stocks: "The investment <> has no price set for th...
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.5.3
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-24 12:05 UTC by Martin Schröder
Modified: 2011-05-30 00:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Schröder 2011-05-24 12:05:03 UTC
Version:           4.5.3 (using KDE 4.6.0) 
OS:                Linux

After updating to KMyMoney4, consistency check complains:
"The investment <> has no price set for the opening date <>
Please enter a price on or before the opening date."
It does so for every stock I have - and I have no idea how to set "a price on or before the opening date."

Reproducible: Always
Comment 1 allan 2011-05-24 14:35:39 UTC
(In reply to comment #0)
> Version:           4.5.3 (using KDE 4.6.0) 
> OS:                Linux
> 
> After updating to KMyMoney4, consistency check complains:
> "The investment <> has no price set for the opening date <>
> Please enter a price on or before the opening date."
> It does so for every stock I have - and I have no idea how to set "a price on
> or before the opening date."
> 
> Reproducible: Always

Have you tried Tools/Prices, then select your stock and click 'New'?
Comment 2 Martin Schröder 2011-05-24 14:50:04 UTC
(In reply to comment #1)
> Have you tried Tools/Prices, then select your stock and click 'New'?

That would be the logical way, but the stocks are not listed there.
Comment 3 Cristian Oneț 2011-05-24 15:10:40 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Have you tried Tools/Prices, then select your stock and click 'New'?
> 
> That would be the logical way, but the stocks are not listed there.

It doesn't need to be listed there *before* clicking 'New'. Just select 'New' and add the price.
Comment 4 Martin Schröder 2011-05-24 15:20:02 UTC
(In reply to comment #3)
> It doesn't need to be listed there *before* clicking 'New'. Just select 'New'
> and add the price.

Thanks, that works.
Comment 5 Jack 2011-05-25 16:24:14 UTC
Out of curiosity, isn't this the same issue (the consistency check message) that was recently fixed by saving manually entered prices (in this case, the purchase price) in addition to on-line price updates?
Comment 6 allan 2011-05-25 18:28:06 UTC
(In reply to comment #5)
> Out of curiosity, isn't this the same issue (the consistency check message)
> that was recently fixed by saving manually entered prices (in this case, the
> purchase price) in addition to on-line price updates?

Hi Jack

The bug that's just been fixed is long-standing.  This manifestation is more recent, but it jogged my mind  and I thought I'd have a go.  I suspect that the fix will or may avoid the condition giving rise to the consistency message, at least in the future.  I suspect though that a number of old files are slumbering, waiting to bite!  That may not be the case, though, with the check being run on saving.  I assume it must scan the whole file.

Allan
Comment 7 Thomas Baumgart 2011-05-27 08:26:20 UTC
Hi Jack,

not really. The fix enters the price information for the post date of the transaction. Here we deal with a missing price information for the opening date of the account. As Allan assumed, it will certainly show up for old files (unless the user entered a price already) and can come up for new files as well. And yes, the consistency check runs over all the data available. Otherwise it does not make sense ;)

Hope that sheds some more light on the issue.
Comment 8 Jack 2011-05-27 15:03:39 UTC
I guess the only time I ran into this the opening date of the account was the first date of security purchase, so they seemed more closely related.
Comment 9 allan 2011-05-29 16:29:16 UTC
On Fri, 27 May 2011 08:26:27 +0200 (CEST)
Thomas Baumgart <ipwizard@users.sourceforge.net> wrote:

> https://bugs.kde.org/show_bug.cgi?id=274018
> 
> 
> 
> 
> 
> --- Comment #7 from Thomas Baumgart <ipwizard users sourceforge net>
> 2011-05-27 08:26:20 --- Hi Jack,
> 
> not really. The fix enters the price information for the post date of
> the transaction. Here we deal with a missing price information for
> the opening date of the account. As Allan assumed, it will certainly
> show up for old files (unless the user entered a price already) and
> can come up for new files as well. And yes, the consistency check
> runs over all the data available. Otherwise it does not make sense ;)
> 
> Hope that sheds some more light on the issue.
> 

On the general topic, I've just noticed that it requires a price even
if the only transaction is 'dividend' and therefore has no price
requirement.

Allan
Comment 10 Jack 2011-05-30 00:06:13 UTC
I don't think it is really the dividend transaction that causes the need for a price.  If it doesn't have a price, it can't calculate the value of the account.  It doesn't make much sense to register a dividend without already owning some number of shares, even if you haven't actually registered the add or buy transaction yet.
Comment 11 allan 2011-05-30 00:46:06 UTC
(In reply to comment #10)
> I don't think it is really the dividend transaction that causes the need for a
> price.  If it doesn't have a price, it can't calculate the value of the
> account.  It doesn't make much sense to register a dividend without already
> owning some number of shares, even if you haven't actually registered the add
> or buy transaction yet.

That's absolutely logical and true.  However, I was reporting an observation while in debug mode.  I saved a file and the consistency message popped up, and there happened to be only that one transaction in the account - not a real-life situation, I agree.

In actual fact, though, the message will come if there are no transactions there.  What I'd done was create a new security, and, to avoid having to go through the process again after the next build, I saved the file.  In the meantime, though, I had manually entered a single dividend transaction to explore the problem.  The message arose because no price had been entered, not because a dividend had been entered which would not have a price!

What I previously said was over-condensed version of the situation, but still true.  However, apologies....