Bug 507477 - When manually entering an Investment transaction price is not updating
Summary: When manually entering an Investment transaction price is not updating
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (other bugs)
Version First Reported In: 5.2.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-25 11:31 UTC by Michael Carpino
Modified: 2025-07-27 08:20 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Carpino 2025-07-25 11:31:09 UTC
Using KMyMoney  Version 5.2.0-1cf050c  -  kmymoney-5.2-4526-linux-gcc-x86_64.AppImage

SUMMARY
When entering a manual investment transaction (ie Buy) in the Ledger and putting in the number shares, transaction amount, security and account the app calculates the price per share but doesn't record the price.  The price for this transaction doesn't show up in the Investment tab price for the security and also doesn't appear when you open "Price Editor " at Tools > Prices. 

STEPS TO REPRODUCE
1.  Enter a Buy Investment transaction and note the date and price for the transaction
2.  Go to the Investment Tab and review the price and last price update date for security
3.  Go to the Price Editor and review the price and date for the security

OBSERVED RESULT
Pricing with manually entering an Investment transaction is not updating

EXPECTED RESULT
When you manually enter a transaction in an Investment account the price and date of the security should update.

SOFTWARE/OS VERSIONS

Linux: Fedora 42
Comment 1 Thomas Baumgart 2025-07-26 07:35:45 UTC
Git commit 5acb6c6e0d1fc70189dc3fd777917af8761e8694 by Thomas Baumgart.
Committed on 26/07/2025 at 07:34.
Pushed by tbaumgart into branch 'master'.

Add price when entereing a buy or reinvest transaction

This function was missed when rewriting the transaction editors.
FIXED-IN: 5.2.1

M  +15   -0    kmymoney/views/investtransactioneditor.cpp

https://invent.kde.org/office/kmymoney/-/commit/5acb6c6e0d1fc70189dc3fd777917af8761e8694
Comment 2 Michael Carpino 2025-07-26 11:34:26 UTC
I wasn't explicate enough in my description of this issue and I discovered it based your commit of the fix that I didn't include all the ways needed to update pricing.  And I haven't been able to test this fix.  KMyMoney should update security prices for Buy, Reinvest and Sell transactions.  I noticed my mistake of not including all the scenarios.  Sorry, my mistake.  I reviewed the code and didn't see "Sell" transactions but I'm not a coder so I don't know if that is included or not.
Comment 3 Thomas Baumgart 2025-07-26 11:57:09 UTC
You need to know that at this point sales are treated as purchases with a negative amount, so sales are also covered with the current implementation.
Comment 4 Thomas Baumgart 2025-07-27 08:20:14 UTC
Git commit cc8d258501d96143aa35e8ff69ad15202b390668 by Thomas Baumgart.
Committed on 27/07/2025 at 08:17.
Pushed by tbaumgart into branch '5.2'.

Add price when entereing a buy or reinvest transaction

This function was missed when rewriting the transaction editors.
FIXED-IN: 5.2.1
(cherry picked from commit 5acb6c6e0d1fc70189dc3fd777917af8761e8694)

M  +15   -0    kmymoney/views/investtransactioneditor.cpp

https://invent.kde.org/office/kmymoney/-/commit/cc8d258501d96143aa35e8ff69ad15202b390668