Created attachment 129839 [details] test case STEPS TO REPRODUCE 1. start kmymoney 2. open appended file 3. open ledger 4. right click on the table header and only select "entry order" and ascending sort order OBSERVED RESULT The entries are sorted by entry date, not by transaction id EXPECTED RESULT The entries should be sorted only by transaction id SOFTWARE/OS VERSIONS Linux: openSUSE Leap 15.1
First, the description needs to be clarified, as 'only select "entry order" and ascending sort order' doesn't make sense. However, if the intent were "entry order ascending, then post date ascending" then there is probably a different issue now than when this was posted. Currently "entry order" uses the entry date, not the transaction ID, so the sorting is correct. Perhaps the available sort fields need to be modified to (re?)include transaction id.
I found a few interesting comments in the source code which have been carried over from the SVN age and may therefore be way older than 14 years (see below for more on this). One is: // Never add EntryDateSort when the list of items is build and the other // if we look at the EntryOrderSort option, we have to make // sure, that the EntryDateSort is prepended when setting up the sort order. That definitely explains the behavior. Since I was curious, I looked at the (meanwhile read-only) CVS repo on SourceForge (https://kmymoney2.cvs.sourceforge.net/) and found them too. Last modification date of the file is Jan. 5th, 2007. So this one comes a long way. The version info for KMyMoney on head of the repo is 0.9.3 With the new sorting mechanism available in master, this can certainly be removed and made available for selection to the user.
Git commit 8d13ee7ba65f95d5ecc71288ee67c15e8c8ad75f by Thomas Baumgart. Committed on 17/12/2023 at 10:02. Pushed by tbaumgart into branch 'master'. Separate sorting of entry date and entry order FIXED-IN: 5.2 M +1 -0 kmymoney/models/specialledgeritemfilter.cpp M +1 -24 kmymoney/widgets/transactionsortoption.cpp https://invent.kde.org/office/kmymoney/-/commit/8d13ee7ba65f95d5ecc71288ee67c15e8c8ad75f