Bug 498031 - Different sort order in the report on investment transactions
Summary: Different sort order in the report on investment transactions
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: 5.1.90
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-29 17:43 UTC by Ralf Habacker
Modified: 2024-12-30 13:15 UTC (History)
0 users

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


Attachments
test file (11.64 KB, text/xml)
2024-12-29 17:43 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2024-12-29 17:43:40 UTC
Created attachment 176956 [details]
test file

STEPS TO REPRODUCE
1. inspect https://invent.kde.org/office/kmymoney/-/jobs/2415311#L2695

OBSERVED RESULT
On a Windows build, the csv export of the ‘Investment transactions (user-defined)’ report shows a different sort order for the ‘Interest income’ transaction, which is:

1 May 2022 [Split Transaction] BHP  IntIncome  0.00    100.00
           Transfer to Shares: BHP             0.00    0.00
           Interest                            0.00  100.00

while on Linux hosts the order is

1 May 2022 [Split Transaction] BHP  IntIncome  0.00    100.00
           Interest                            0.00  100.00
           Transfer to Shares: BHP             0.00    0.00

EXPECTED RESULT
For Windows builds, the order of the above lines should be the same as under Linux.

SOFTWARE/OS VERSIONS
detected on KDE CI
Comment 1 Thomas Baumgart 2024-12-30 13:15:32 UTC
Git commit fe70386176015e909db92971eea453a07f3adb22 by Thomas Baumgart.
Committed on 30/12/2024 at 13:14.
Pushed by tbaumgart into branch 'master'.

Fix sorting order

Apparently the result of std::sort() differs under Windows and Linux if
all sort criteria are identical. Adding the split ID as the last
criterion solves the problem.
FIXED-IN: 5.2

M  +1    -0    kmymoney/plugins/views/reports/core/listtable.h
M  +4    -1    kmymoney/plugins/views/reports/core/querytable.cpp

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