Bug 498401 - Incorrect price output in "Show transaction details" dialog for "add/remove shares" investment transactions
Summary: Incorrect price output in "Show transaction details" dialog for "add/remove s...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.90
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-08 22:33 UTC by Ralf Habacker
Modified: 2025-01-21 21:06 UTC (History)
0 users

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


Attachments
Screenshot showing the issue (61.02 KB, image/png)
2025-01-08 22:33 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2025-01-08 22:33:00 UTC
Created attachment 177213 [details]
Screenshot showing the issue

The attached test file shows an error in the output of prices for investment transactions of the type ‘Add/Remove shares’.

STEPS TO REPRODUCE
1. open the attached file, with a snapshot of kmymoney
2. configure a keyboard shortcut for the function ‘Show transaction details’ e.g. CTRL-SHIFT-D
2. open the general ledger of the account Assets->shares->BHP
3. select the transaction ‘Add shares’ and press CTRL-SHIFT-D

OBSERVED RESULT
The attribute ‘Price’ in the displayed transactions shows ‘1/1’

EXPECTED RESULT
The price attribute for the named transaction in the file should be ‘0/1’. 

SOFTWARE/OS VERSIONS
Operating system: openSUSE Leap 15.6
KDE Plasma Version: 5.27.11
KDE frameworks version: 5.115.0
Qt Version: 5.15.12
Comment 1 Jack 2025-01-09 00:08:47 UTC
From what I understand, this is not a display issue, as that (1/1) is the value actually stored in the transaction.  Is the answer to explicitly test for this type of transaction and display 0 or to change what is stored in such transactions.
Comment 2 Ralf Habacker 2025-01-21 18:57:12 UTC
(In reply to Jack from comment #1)
> From what I understand, this is not a display issue, as that (1/1) is the
> value actually stored in the transaction.  

yes 

> to change what is stored in such transactions.

This solution has been requested at https://invent.kde.org/office/kmymoney/-/merge_requests/252#note_1102237 and will be fixed with https://invent.kde.org/office/kmymoney/-/merge_requests/256.
Comment 3 Ralf Habacker 2025-01-21 21:06:53 UTC
Git commit 402d639624ddc7231f06e66a639651ff1fde93fd by Ralf Habacker.
Committed on 21/01/2025 at 19:02.
Pushed by habacker into branch 'master'.

Fix loading of incorrect split prices for present "add/remove shares" transactions
Related: bug 498356
FIXED-IN:5.2

M  +32   -1    kmymoney/kmymoney.cpp
M  +1    -1    kmymoney/mymoney/mymoneyfile.h

https://invent.kde.org/office/kmymoney/-/commit/402d639624ddc7231f06e66a639651ff1fde93fd