Bug 456472 - Interest field dropped on buy transactions for brokerage accounts
Summary: Interest field dropped on buy transactions for brokerage accounts
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.2
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-08 06:25 UTC by Zoltan Puskas
Modified: 2022-08-21 10:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltan Puskas 2022-07-08 06:25:34 UTC
SUMMARY
When entering a buy transaction on a brokerage account, any category selected for "Interest" along with value does not get saved into the ledger, when the activity is "buy shares", as opposed to "Fees" field which still works. It does not seem to matter whether the currency is the base one or a foreign one.


STEPS TO REPRODUCE
1. go to brokerage account
2. new transaction
3. select, activity to be "Buy shares"
4. select security  (in my case a bond type investment)
5. enter dates, amount, price/share
6. select account
7. select "Interest" category and add value to it
8. "Enter"

OBSERVED RESULT
Interest value is not saved for the ledger item. Editing an existing item with an interest field in it will also delete the interest category and amount.

EXPECTED RESULT
Interest value is saved as before.

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux 2.8
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.8-gentoo (64-bit)
Graphics Platform: X11
Comment 1 Jack 2022-07-08 13:43:38 UTC
I don't know if that is an intentional limit of the program or not, but under what conditions would you be receiving interest or dividends as part of a buy shares transaction?  Do you know what version this DID work with, as you say you have such transactions?  Are those also buy or of any other type?
Comment 2 Zoltan Puskas 2022-07-21 02:43:58 UTC
I'm not sure which version it worked with, it was a long time ago (I've been using KMyMoney for 10+ years now).

I use this entry method when buying zero-coupon bonds, where you buy the bond below face value and when it expires you get the actual nominal value. Since this is considered interest income and not capital gains, I use this method to account for it in the interest income category (as I tend to keep them till maturity), since KMyMoney lacks facilities to register this type of investment otherwise.

I'm aware of reports, but they are really suboptimal and hard to create custom ones. Also should I close an investment (i.e. a bond) because they cannot be bought any more, the reports won't show them at all, while in the investments category the ledgers remain and it's easy to look at. This also helps categorize different incomes better.
Comment 3 Bug Janitor Service 2022-08-05 04:35:26 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Jack 2022-08-06 15:22:55 UTC
I still wonder why you would add the interest at buy time instead of at sell time.  If you sell before maturity, I assume you wont get the full interest.  (Even if you always keep the bonds until maturity, KMM should also support any reasonable use case.)
It would certainly be possible to allow interest income on a purchase, but it still makes more sense to me to do either as a separate interest/dividend transaction or as part of the sell transaction.
Comment 5 Bug Janitor Service 2022-08-21 04:35:30 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Zoltan Puskas 2022-08-21 07:28:50 UTC
(In reply to Jack from comment #4)
> I still wonder why you would add the interest at buy time instead of at sell
> time.  If you sell before maturity, I assume you wont get the full interest.
> (Even if you always keep the bonds until maturity, KMM should also support
> any reasonable use case.)
> It would certainly be possible to allow interest income on a purchase, but
> it still makes more sense to me to do either as a separate interest/dividend
> transaction or as part of the sell transaction.

This was the only way I was able to assign earned interest into a category. Using the interest field at sell/redemption time does not work in this case. 

Example of current KMyMoney workflow:
- Buy zero coupon bond on date T for $998 price/share, which is it's discount price, but in reality it has has a face value of $1000. 
- Wait till maturity at T+10, at which point it gets redeemed for $1000 price/share (out of which $2 is my interest).

In this case KMyMoney will treat the bond like it would a stock and the earnings are considered as capital gains (which I can only obtain via "reports" tab). If I add a value into the "Interest" field (say the same $2) then the total amount of the transaction will become $1002, which is incorrect. There is no way for me to signify the amount of interest in this case. Keeping the price/share at $998 is also not correct as it gets redeemed at $1000.

So the reason for me to enter the interest at purchase time was because this way I could reconcile the transaction in earlier versions of KMymoney, like so:
- Buy zero coupon bond on date T for $1000 price/share, which is the face value. However also add an interest of $2, which lowered the amount of the final transaction to $998, making it representing the correct discounted price hitting the brokerage account at the time of the purchase.
- Wait till maturity at T+10, at which point it gets redeemed for $1000 price/share, no additional field needed to be set.

If I had to sell the investment before maturity, I would typically add a "Fee" category which would reduce due to premature redemption (though I think "Interest" field value with a negative value would also work for this).

I hope this clarifies what I'm trying to achieve. The reason I kept doing it like this because interest and capital gains have different tax implications and using the interest category made it easy to track this.

For what it's worth, I'm open to any solutions that allows me to treat income from bonds and stocks differently, however so far I've not found anything better.
Comment 7 Ian Neal 2022-08-21 08:54:06 UTC
Can you not use a negative amount in the Fee field when adding the discounted shares?
Comment 8 Zoltan Puskas 2022-08-21 09:03:47 UTC
No, as the application will only offer expense type categories in the fees field, and does not allow for income type categories.
Comment 9 Ian Neal 2022-08-21 09:20:44 UTC
As you will find only income categories for the Interest field if selling early.
I think I worked around the issue by having the bond in a fake trading currency with the exchange rate usually being 1:1 but changing it for discounted purchases.
Comment 10 Thomas Baumgart 2022-08-21 10:29:38 UTC
Git commit 78f3d513035344ac80de5fc22b8115e35f947fcc by Thomas Baumgart.
Committed on 21/08/2022 at 10:29.
Pushed by tbaumgart into branch 'master'.

Allow entering interest on investment buy transaction

Note: this change cannot simply be cherry-picked onto the 5.1 branch.
One has to backport it manually. Volunteers welcome.

M  +21   -0    kmymoney/views/investactivities.cpp
M  +10   -3    kmymoney/views/investactivities.h

https://invent.kde.org/office/kmymoney/commit/78f3d513035344ac80de5fc22b8115e35f947fcc