[Kmymoney-devel] Re: Investment Problem?

Thomas Baumgart thb at net-bembel.de
Tue Jan 25 08:03:18 CET 2011


Hi,

on Tuesday 25 January 2011 03:15:10 allan wrote:

I know I jump in late in the game, but I was on a road trip yesterday.

> On 25/01/11 00:25, Alvaro Soliverez wrote:
> > This may be related to the performance improvement fixes.
> > I guess you have everything up-to-date on you SVN, correct?
> >
> > On Mon, Jan 24, 2011 at 8:03 PM, allan<agander93 at gmail.com>  wrote:
> >> On 24/01/11 21:56, Jack Ostroff (D8 TC) wrote:
> >>> (sorry for the top post - new response back at the bottom)  Good idea!
> >>>
> >>> On 2011.01.24 15:12, allan wrote:
> >>>> On 24/01/11 19:22, Jack wrote:
> >>>>> What was the balance before the import?
> >>>>
> >>>> Hi Jack
> >>>>
> >>>> When I'm testing, I use an empty-ish test file (just has accounts set
> >>>> up, but empty) and just import into an empty account, so the prior
> >>>> balance was zero.
> >>>>
> >>>> It isn't just with imports. The same happens when I manually enter
> >>>> transactions.  The first I enter shows with zero balance, a second
> >>>> one added then gets zero balance, and the previous one gets a balance
> >>>> just of the quantity from the second one.  Strangely, though, if I
> >>>> use my production file, I can import as normal into existing
> >>>> accounts.  However, if I set up a new file there, and enter
> >>>> transactions, it fails.
> >>>>
> >>>> I'm going to have to clear the sandbox and start from scratch. It
> >>>> just doesn't make sense.
> >>>>
> >>>> Allan
> >>>>
> >>>>> On 2011.01.24 11:36, allan wrote:
> >>>>>> I hope this isn't me, but it is a bit weird.
> >>>>>>
> >>>>>> I'd been importing some investment statements via the csv plugin
> >>>>>> and noticed that a balance figure was incorrect, but the next and
> >>>>>> following lines were OK.  As it coincided with an entry practically
> >>>>>> identical to the one above, I just deleted it and all seemed OK.
> >>>>>>
> >>>>>> Today, with a different file, I'm consistently getting incorrect
> >>>>>> balances on imported investments.  Thinking I'd corrupted the
> >>>>>> plugin code, I used it to make a qif file, examined it, and
> >>>>>> imported that, still with the errors.  I tried an old qif file and
> >>>>>> that too gave errors.
> >>>>>>
> >>>>>> I've now updated from svn - same, and cleared build but still the
> >>>>>> same.
> >>>>>>
> >>>>>> There are three items.  The first is an add of 1545.61 shares,
> >>>>>> against which the balance shows -52.53.  Then there is a reinv of
> >>>>>> 29.31, with the balance now -23.22,  then  another of 23.22 shares
> >>>>>> and the balance now at 0.00.
> >>>>>>
> >>>>>>       Qty                  Balance
> >>>>>> 1545.61          -52.53
> >>>>>>       29.31          -23.22
> >>>>>>       23.22             0.00
> >>>>>>
> >>>>>> So starting at the bottom, the 23.22 reinvested produce the balance
> >>>>>> for the line above, the the previous reinv of 29.31 added, gives
> >>>>>> the balance on the first line.  So, it looks like the balance is
> >>>>>> calculated from the bottomor newest item, instead of from the top.
> >>>
> >>> Definitely odd.  However, as balances (from my understanding) are
> >>> calculated as the register is displayed (effectively - given caching
> >>> for performance) might there be something funny with the display
> >>> order.  Try changing the sort order of the register display in various
> >>> ways to see if anything makes any more sense in a different order.
> >>> Also - you could try changing the dates of the three transactions so
> >>> they come in different orders.  Don't know if it will help, but it
> >>> might provide some additional hint.
> >>
> >> There is something very sick here!
> >>
> >> I've created a new sandbox and when I opened the test file, it had the
> >> saved three items now displaying correctly.  Good, I thought, then added
> >> a new item, and things went wrong again.

That's a clear indication to some caching problem.

> >> I saved the file, reopened it
> >> and they were in correct order again.  Repeat, wrong -save/reload and
> >> OK. Then I deleted the four items, but the foot of the ledger value
> >> still shows £1530, although home shows zero amount.  So home view is
> >> correct, but ledger isn't.  I delete all entries, save and reload and
> >> ledger still shows 1530.

Despite all the caching going on, you need to know that the numbers between 
the homepage and the ledger footer can vary. The home view always uses today's 
balance whereas the ledger footer shows the balance of all entered 
transactions (including those entered with a date in the future but excluding 
any scheduled transactions). Ah, we're in investments and there is no 
scheduling (yet).

> >> Now, slowly...
> >>
> >> QTY            RESULT->           QTY            Balance            
> >> Value £ 1530
> >>
> >> +10                                           10               1530
> >>              1530
> >>
> >> +20 10               1510                  1510
> >> 20               1530                  1530
> >>
> >> +30 10 14801530
> >> 20               1500 1530
> >>                                                   30               1530
> >>                   1530


I assume, you are using a variable-width font. Therefore, I cannot read your 
tables easily being on a fixed-width font in text only mode (I hate HTML 
mails)  :)


> >> Home view shows the expected balance of £60.
> >>
> >> Save, close, reload, and all is as it should be with ledger balance
> >> correct at £60, until I touch it again.
> >> Then buy another  40, and 40 gets deducted from the balance on each line
> >> except the last, and the ledger balance doesn't get changed at all.
> >> Save, close, reload, and all is as it should be with ledger balance
> >> correct at £100.....etc., etc.
> >>
> >> So, the problem is with the display and updating of the balance column,
> >> but only ledger view, with Home OK.
> >>
> >> Is there any chance you could do a quick experiment, with just a couple
> >> of items?
> >>
> >> Allan
> 
> I've since downloaded and installed an openSuse rpm and that works OK. 
>  Now, I've cleared the build folder, reloaded from svn and that still shows
>  the problem.
> 
> If I clear all entries from the investment folder, the previous investment
>  value still shows in ledger view, whereas home view shows the expected
>  value.If I now add one transaction, say qty 10, the balance shows 300,
>  which was the last balance before the original items were deleted.  If I
>  now add qty 20, the current balance stays at 300, but that of the top
>  entry has had the 20 deducted.

I clearly need to look into that.

> As a secondary issue, all the svn builds I've made show Version
> 4.5.90-svn1213267,rather than the expected version,
> although that may indicate I have a build system problem.  If so, I
> don't know what I'm now doing incorrectly.

The number after svn is only updated if you run 'cmake' after an svn update. 
Sometimes, running cmake is triggered because of a change in the build system. 
On regular file content changes the cmake run is *not* triggered so the number 
stays the same - even though it changed in SVN.

-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
Embedded Linux: because you can't do control-alt-delete on a pacemaker.
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 225 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20110125/a26e9dac/attachment-0001.sig 


More information about the KMyMoney-devel mailing list