Bug 510448

Summary: When editing a share transaction I cannot change the total amount
Product: [Applications] kmymoney Reporter: Ingo Klöcker <kloecker>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: NEEDSINFO WAITINGFORINFO    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.2.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ingo Klöcker 2025-10-10 09:46:27 UTC
I wanted to fix a typo in the numbers of shares of a Sell shares transaction. Although the price entry for this share is set to "Total for all shares" in the editor I cannot change the total (which is wrong after changing the number of shares because KMyMoney recalculates it based on the wrong price/share).

STEPS TO REPRODUCE
1. Create a share with price entry "Total for all shares"
2. Sell some of those shares (very likely you can also buy some shares)
3. Now try to edit the number of shares you sold/bought without changing the Total price

OBSERVED RESULT
1. The Total changes when I edit the number of shares.
2. I cannot edit the Total (but I can edit the price/share).

EXPECTED RESULT
1. For a share configured with price entry "Total for all shares" when changing the number of shares of an existing transaction then the price/share should be recalculated based on the new number of shares and the (old) Total.
2. For a share configured with price entry "Total for all shares" when editing a buy/sell/etc. for such a share then it should be possible to change the Total and the Price/share should be read-only.
Comment 1 Jack 2025-10-10 23:55:01 UTC
I cannot reproduce this with a recent version compiled from git (either master (self compiled) or 5.2 branch (Appimage)) but I CAN reproduce with an older Appimage from the 5.2 branch.  If you are using a released version of 5.2.1, then I would say to confirm with a version from git (either master or 5.2 branch, Appimage should be fine for testing) as it appears this may have been fixed already.