[Kmymoney-devel] Strangeness trying to delete a security

Jack ostroffjh at frontier.com
Sun Aug 16 20:59:40 UTC 2015


I just tried to delete a security, but the menu option was disabled,  
although "Close account" was enabled.  I had already deleted all  
transactions related to it (see below however), and I also deleted the  
single price entry.  I have since resolved the issue, but am trying to  
understand what happened, and whether everything is actually working  
correctly or if there might be a subtle bug.

To figure out where the security was still being referenced, I took a  
look into the kmy file.  I found the security's account, and also found  
it referred to in one of two splits in a transaction.

While I admit this is likely a pathologic situation (i.e., not very  
likely to actually occur in reasonable use of KMM) I'm trying to  
understand what happened.  Of course, the original cause of this is the  
strange OFX transactions provided by Merrill Lynch for my investment  
accounts.  From my perspective, the transaction in question should  
simply be an interest payment, which should end up in the brokerage  
account.  However, they have been reporting it as a dividend on an  
equity, which only exists for this purpose, and I suppose got created  
in KMM during one of my OFX imports.  In the investment account, it  
looks like a normal dividend.  When I accept it and then look at it in  
the brokerage account, it shows as an investment account.  However,  
what I had never noticed before (and it seems true for all dividend  
transactions) is that when I edit the transaction, it is a split  
transaction.  One split shows the dividends category and the amount of  
the dividend.  The other split shows the equity itself as the category  
and an amount of 0.  What I had done today was to remove the second  
split from the transaction.  As far as I could initially tell, that had  
the effect of deleting the transaction in the investment account, and  
turned the transaction in the brokerage account into a plain dividend  
transaction.  I then switched dividend to interest.

When I finally started digging into the kmy file, I found there was  
still a reference to the equity account in a split in the transaction,  
which referred to the interest category.  When I then looked at the  
category in KMM in ledger view, the transaction showed as an unaccepted  
match.  I accepted the matche, even though it is not possible to edit a  
transaction in the category ledger.  After that, I was able to delete  
the equity.

Note: I do not remember the exact history of all imports and edits on  
these transactions, although I suspect it will happen again next month  
(or with one of the accounts I have not yet reconciled this month, in  
case there is anything specific I should be watching for.  My question  
is why the transaction from the category view should still refer to the  
equity, even though I had deleted that split from the brokerage account  
view, and the whole transaction had disappeared from the investment  
account view.

So - I think this can be reproduced by:
1 - create an investment account with associated brokerage account.
2 - enter a dividend transaction in the investment account. (create a  
new equity if necessary, you do not need any shared in it.)
3 - edit that transaction in the brokerage account and delete the $0  
split referring to the equity.
4 - confirm the transaction is gone from the investment account
5 - delete all prices for that equity.
6 - confirm you are unable to delete the equity.
7 - go to the category view, double click the dividend category to see  
its ledger view.  See an unmatched transaction, accept the match
8 - you are now able to delete the equity.

Is there a bug somewhere in here?  I know it is a very unlikely  
scenario, so actually doing anything about it is a very low priority,  
but I don't want to open a bug report if this can actually be explained  
as proper behavior.

Thanks for any explanations.

Jack


More information about the KMyMoney-devel mailing list