New problem (master) stock sell showing up as payment

Jack ostroffjh at users.sourceforge.net
Wed Aug 3 15:19:34 BST 2022


On 8/3/22 02:03, Thomas Baumgart via KMyMoney-devel wrote:
> On Mittwoch, 3. August 2022 01:40:50 CEST Jack via KMyMoney-devel wrote:
>> I just looked at on of my investment account to reconcile the new
>> statement, and the brokerage account has a large negative balance.
>> Without doing a full audit, it appears that two stock sell transactions
>> (for the same security) last month are showing up in the brokerage
>> account as Payments instead of Deposits.  I'm know I did a proper
>> reconciliation last month, but now those numbers don't match.  I have
>> not yet gone through all my saved copies to see when it changed, but
>> that's next on my list.
>>
>> Just in case anyone has any ideas, one of the transactions is below.
>> I've trimmed the memo of lots of excess details Merrill Lynch includes,
>> and I trimmed the bankid.
>>
>>     <TRANSACTION commodity="USD" entrydate="2022-07-02"
>> id="T000000000000025879" memo="Sale: PUTNAM ULTRA SHORT DURATION INCOME
>> FD..." postdate="2022-06-15">
>>      <SPLITS>
>>       <SPLIT account="A000345" action="" bankid="" id="S0001"
>> memo="Sale: PUTNAM ULTRA SHORT DURATION INCOME FD..." number=""
>> payee="" price="1/1" reconciledate="2022-06-30" reconcileflag="2"
>> shares="-55723/50" value="-55723/50"/>
>>       <SPLIT account="A000941" action="Buy" bankid="ID 20220614..."
>> id="S0002" memo="Sale: PUTNAM ULTRA SHORT DURATION INCOME FD..."
>> number="" payee="" price="-10/1" reconciledate="2022-06-30"
>> reconcileflag="2" shares="-55723/500" value="55723/50"/>
>>      </SPLITS>
>>     </TRANSACTION>
>>
>> Account 345 is the brokerage account and 941 is the stock account
>> within the investment account.
> Looks like
>
>    shares="-55723/500" value="55723/50"
>
> is probably the source of the problem. That is simply wrong and may be
> caused by some bug. Somewhere, the split of the brokerage account (S0001)
> is created based on the value part of the security split (S0002) by
> simply inverting the value. Since value in S0001 has the wrong sign
> you see those results. It could well be that this is still a problem
> within the investment transaction editor (which is the new kid on
> the block here).
>
>> One thing which caught my eye is that the split for the security has
>> 'action="Buy"' which worried me more before I noticed that it has that
>> value for lots of transactions other then stock sales.  Might that be
>> an issue, or is it likely a red herring?
> Within the XML file, the action string is always presented as "buy"
> and the sign of the split controls if it is actually a buy or a sell
> operation. The conversions happen in MyMoneySplit::investmentTransactionType
> and MyMoneySplit::setAction. So that is not a problem.
>
>> I'll post more when I have a tighter window on when the problem started.
> Did you enter the transactions manually or did you import them and edited
> them afterwards?

First, on history, I have a backup on 7/2 prior to the creation of that 
transaction.  My next backup was 7/27, which shows the problem.  I had 
hoped to have a backup after the import and before the reconciliation.  
I was going to say I'm sure the problem was introduced after 7/2, but 
the actual earliest possible date would be closer to the beginning of 
June, when I did my prior large import from Merrill Lynch.

I'm pretty sure that was an imported transaction, and I do not remember 
having to edit it, as I do with many other Merrill Lynch transactions.  
However, I am quite sure I was using git master when I did that import.

Also note that the sign is reversed for only two transactions, both 
selling the same security, several days apart.  There are plenty of 
other sell transactions in that same account which are correct.

Would it help for me to test importing that account again for June?  I 
suppose I can download those transactions as OFX, if file import would 
give the same values as direct connect.  That way, I can test several 
times, without repeatedly going back to the server.

Jack



More information about the KMyMoney-devel mailing list