[kmymoney4] [Bug 351874] QIF import of investment buys and sells mishandles commissions

allan via KDE Bugzilla bugzilla_noreply at kde.org
Tue May 17 11:23:56 UTC 2016


https://bugs.kde.org/show_bug.cgi?id=351874

--- Comment #8 from allan <agander93 at gmail.com> ---
(In reply to Jeff from comment #6)
> Hi Ɓukasz,
> 
> There is still a problem with the QIF import with your change.  My test file
> also tested the case where the commission was greater than the proceeds from
> the sale (which can happen when trading options.)  Your fix changed a "sell"
> trade that actually cost money into one that brought in money. The example
> in my test file was the "sell" of the "NFLX Aug 18 2012 110.0 Call". The
> price is 0.02, times 100 shares = 2.00. The commission is 10.77.  So income
> of 2.00, outgo of 10.77 makes the total -8.77 (as shown in the U and T
> values in the QIF file).  The cash account should decrease by 8.77. Your
> change turned that into a positive 8.77, and increased the cash account. 
> This is admittedly a corner case, and I think I am the only KMM user that
> trades options because I have made a bunch of other changes to the KMM code
> to support that.
> 
It would not have surprised me if your problem was caused by the same issue I
reported in https://bugs.kde.org/show_bug.cgi?id=362139 comment #7, with the
negative sign getting dropped.
However, the sign appears to be negative throughout the import process until -
Line 1564 in mymoneyqifreader.cpp()
"else if (action == "sell") {
    d->st.m_listPrices += price;
    tr.m_shares = -quantity;
    tr.m_amount = -amount;
    tr.m_eAction = (MyMoneyStatement::Transaction::eaSell);"

I don't profess to know anything about a sell where the commission is greater
than the proceeds of the sale.  However, I think what happens in general is
that a sell is expected to be input with no sign, and therefore the amount
needs to be set to a negative value.  So, in your case, as you have a negative
sign on input, that sign gets removed.
That seems to imply that the commission needs to negative in your case, and
reversing the signs appears to produce your expected result.
If this is all rubbish, just ignore it.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list