[Kmymoney-devel] Re: Investment Problem?

allan agander93 at gmail.com
Tue Jan 25 00:03:22 CET 2011


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.  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.

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

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




More information about the KMyMoney-devel mailing list