Bug 423783 - Sorting only by "entry order" is overridden by entry date
Summary: Sorting only by "entry order" is overridden by entry date
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.8.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks: 322926
  Show dependency treegraph
 
Reported: 2020-07-02 06:49 UTC by Ralf Habacker
Modified: 2023-12-17 09:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.2


Attachments
test case (25.28 KB, text/xml)
2020-07-02 06:49 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2020-07-02 06:49:45 UTC
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
Comment 1 Jack 2023-12-05 23:44:53 UTC
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.
Comment 2 Thomas Baumgart 2023-12-16 13:21:01 UTC
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.
Comment 3 Thomas Baumgart 2023-12-17 09:02:42 UTC
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