Bug 507664

Summary: 'Total for all shares' and 'fraction' settings ignored when entering investment buy
Product: [Applications] kmymoney Reporter: Alan Rubin <alan>
Component: importerAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: kloecker
Priority: NOR    
Version First Reported In: 5.2.0   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In: 5.2.1
Sentry Crash Report:

Description Alan Rubin 2025-07-30 11:28:37 UTC
Trying to add investment to transaction. The investment has fraction 1/1000 and price entry 'Total for all shares'. Despite this the 3rd figure after the decimal is ignored and more seriously, total is shown as if price per share entered.

SUMMARY


STEPS TO REPRODUCE
1. Enter buy of investment
2. 
3. 

OBSERVED RESULT
'Price per share' and 'fraction' settings ignored

EXPECTED RESULT


SOFTWARE/OS VERSIONS
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
Operating System: Slackware 15.0
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.116.0
Qt Version: 5.15.17


ADDITIONAL INFORMATION
I don't have this problem with 5.1.2 on same database
Comment 1 Alan Rubin 2025-07-30 11:30:14 UTC
Sorry that should be 'Total for all shares' and 'fraction' settings ignored
Comment 2 Ingo Klöcker 2025-07-30 11:51:32 UTC
How did you enter/select the investment? Did you press Enter after selecting the investment? I think I ran into the same problem and the "trick" was to press Enter after the investment had been auto-completed. The label of the price field didn't change, but the entered amount was treated as "Total for all shares".

I think the problem is that the default values for fraction and price (I really wish those default values would be configurable because I have to change the values for every single investment I add) are different from the values that you configured for the investment and one needs to nudge KMyMoney to use those configured values instead of the default values. In any case, it shouldn't be necessary to press Enter.
Comment 3 Alan Rubin 2025-07-30 12:18:21 UTC
I now see that 'Enter' is greyed out and I can't enter the transaction at all.
Comment 4 Alan Rubin 2025-07-30 12:25:04 UTC
(In reply to Alan Rubin from comment #3)
> I now see that 'Enter' is greyed out and I can't enter the transaction at
> all.

And now suddenly it worked for that transaction but I am getting the same problem for the next buy transaction that I am trying to enter!
Comment 5 Alan Rubin 2025-07-30 12:33:59 UTC
I also notice that all my previously entered buys and sells are now showing the share price in 'transaction amount' with the 'total' in correctly.
They were all entered as Total amount. Is that correct behaviour?
Comment 6 Ingo Klöcker 2025-07-30 12:46:06 UTC
Sorry, I meant press the Enter key on the keyboard after entering the investment not the Enter button.
Comment 7 Alan Rubin 2025-07-30 12:55:25 UTC
(In reply to Ingo Klöcker from comment #6)
> Sorry, I meant press the Enter key on the keyboard after entering the
> investment not the Enter button.

No. If the Enter button is greyed out then the Enter key doesn't work.

There is another odd thing going on in that I get a consistency check problem reported with the new Investments saying that they were created after the date of the transaction. Which is true but it's mad that it shows a consistency problem.
Comment 8 Thomas Baumgart 2025-07-30 14:01:05 UTC
> There is another odd thing going on in that I get a consistency check problem
> reported with the new Investments saying that they were created after the
> date of the transaction. Which is true but it's mad that it shows a consistency problem.

Yes, because there is no UI for the security account to modify the opening date. Therefore, the consistency check also told you that it corrected the problem ;-)
Comment 9 Thomas Baumgart 2025-07-30 14:37:40 UTC
Git commit 9f1c7dd0c1c76bdaa4b98b267c787613e94a1e64 by Thomas Baumgart.
Committed on 30/07/2025 at 14:35.
Pushed by tbaumgart into branch 'master'.

Update label when security changes

When the security widget was left with the TAB key the labels for
certain widgets were not updated according to the settings for the
selected security. This change fixes the problem.
FIXED-IN: 5.2.1

M  +7    -2    kmymoney/views/investactivities.cpp
M  +2    -0    kmymoney/views/investactivities.h
M  +26   -12   kmymoney/views/investtransactioneditor.cpp

https://invent.kde.org/office/kmymoney/-/commit/9f1c7dd0c1c76bdaa4b98b267c787613e94a1e64
Comment 10 Alan Rubin 2025-07-30 16:34:26 UTC
(In reply to Thomas Baumgart from comment #9)
> Git commit 9f1c7dd0c1c76bdaa4b98b267c787613e94a1e64 by Thomas Baumgart.
> Committed on 30/07/2025 at 14:35.
> Pushed by tbaumgart into branch 'master'.
> 
> Update label when security changes
> 
> When the security widget was left with the TAB key the labels for
> certain widgets were not updated according to the settings for the
> selected security. This change fixes the problem.
> FIXED-IN: 5.2.1
> 
Thanks.  Is it possible to pick up an executable that I can just slot in?
Comment 11 Jack 2025-07-30 17:22:47 UTC
5.2.1 should be released this weekend, but no idea how soon Slackware will package it.  It should also be included in the Appimage version within a day or so.
Comment 12 Alan Rubin 2025-07-30 17:26:50 UTC
(In reply to Jack from comment #11)
> 5.2.1 should be released this weekend, but no idea how soon Slackware will
> package it.  It should also be included in the Appimage version within a day
> or so.

Actually I just found kmymoney-master-4575-linux-gcc-x86_64.AppImage	which I can run from the command line and seems to not have the bug.