Bug 332924

Summary: Investment view, equity tab, sorts numeric columns by alpha sort instead of numeric
Product: [Applications] kmymoney Reporter: Jack <ostroffjh>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: gh47ghd3, m.nemo, onet.cristian, ralf.habacker
Priority: NOR    
Version: 4.6.4   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 5.1.0
Sentry Crash Report:

Description Jack 2014-04-01 18:41:14 UTC
The value, quantity, and price columns sort alphabetically instead of numerically.

Reproducible: Always

Steps to Reproduce:
1. Display investment view
2. Click column heading of value, quantity, or price
3.
Actual Results:  
column is sorted alphabetically

Expected Results:  
column should be sorted numerically
Comment 1 gh47 2014-05-30 17:45:04 UTC
I confirmed this. "Investments" page, "Equities" tab, "Value" field is sorting alphabetically thus neutering the sort feature.
Comment 2 Cristian Oneț 2014-09-24 18:17:56 UTC
Git commit 4458e573676ee1096cec2a55955299983a63c0fe by Cristian Oneț.
Committed on 24/09/2014 at 18:15.
Pushed by conet into branch 'master'.

Fix the sorting in the equities tab of the investments view.

M  +32   -4    kmymoney/views/kinvestmentview.cpp

http://commits.kde.org/kmymoney/4458e573676ee1096cec2a55955299983a63c0fe
Comment 3 Jack 2020-01-20 21:32:57 UTC
I was about to open a new bug for exactly this reason.  It seems this fix was somehow reverted since 2014.  I'll try to track down which commit did it.
Comment 4 Jack 2020-01-20 21:38:33 UTC
It was reverted by commit e5d6a2594c52949deb90ec3751760316e866336b on 2017-09-11 18:51:48 +0200 by Łukasz Wojniłowicz.  I guess he missed the comment "This class is only needed to implement proper sorting." and just deleted that class, without addressing sorting at all.
Comment 5 Bug Janitor Service 2021-08-09 05:39:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/office/kmymoney/-/merge_requests/113
Comment 6 Thomas Baumgart 2021-08-18 21:34:43 UTC
Git commit 819f260084b7e29713ce6fec1efcd0946c427740 by Thomas Baumgart, on behalf of Wei Qi Ong.
Committed on 18/08/2021 at 19:40.
Pushed by tbaumgart into branch 'master'.

Investment view, Equities: sort by actual value instead of display value
Related: bug 428940

M  +22   -3    kmymoney/models/equitiesmodel.cpp
M  +1    -0    kmymoney/views/kinvestmentview_p.h

https://invent.kde.org/office/kmymoney/commit/819f260084b7e29713ce6fec1efcd0946c427740
Comment 7 Andreas Freimuth 2023-01-07 09:40:29 UTC
Still an issue with v5.1.3
Comment 8 Jack 2023-01-07 21:04:18 UTC
Very odd - it looks like those changes were only made in master and not the 5.1 branch.  Was it actually working in 5.1.2?  The branches differ enough that backporting will not be trivial (for me.)  Hopefully the fix isn't actually too difficult.
Comment 9 Thomas Baumgart 2023-01-08 10:33:29 UTC
Yes, the fix was easy enough, but I don't have any test data. Merge request https://invent.kde.org/office/kmymoney/-/merge_requests/191 has been added. Please verify and confirm it's working as expected.
Comment 10 Bug Janitor Service 2023-01-08 17:18:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/office/kmymoney/-/merge_requests/191
Comment 11 Thomas Baumgart 2023-01-14 05:53:26 UTC
Git commit 68b81627958ee33b26301b674207da47d065f6f8 by Thomas Baumgart.
Committed on 14/01/2023 at 05:53.
Pushed by tbaumgart into branch '5.1'.

Investment view, Equities: sort by actual value instead of display value

Backporting commit 819f2600 to stable 5.1 branch
Related: bug 428940

M  +28   -1    kmymoney/models/equitiesmodel.cpp
M  +2    -1    kmymoney/models/equitiesmodel.h

https://invent.kde.org/office/kmymoney/commit/68b81627958ee33b26301b674207da47d065f6f8