Bug 462862

Summary: Changing default sort order causes balance totals to read incorrectly on ledger page.
Product: [Applications] kmymoney Reporter: Micha Novak <micha>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: micha
Priority: NOR    
Version First Reported In: 5.1.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screenshot showing the broken behavior
Screenshot of the default behavior

Description Micha Novak 2022-12-10 18:04:10 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

STEPS TO REPRODUCE
1. Load up KMyMoney
2. Create an Asset Account
3. Enter a series of transactions and note the balance listed on the most recent transaction
4. Left click in the header of the ledger.
5. Uncheck "Use Default" and change the sort arrow for "Post Date" from down to up.
4. Note that the balance provided after the most recent transaction has now changed.

OBSERVED RESULT

The Balance provided in the ledger appears to be calculated from the top down regardless of the sort direction of the transactions.  This results in an incorrect balance on the most recent transaction

EXPECTED RESULT

The balance after any given transaction should not change, regardless of the sorting order of the ledger.

SOFTWARE/OS VERSIONS
Windows: Not Confirmed
macOS: Not Confirmed
Linux/KDE Plasma:  Fedora 37 KDE Spin
(available in About System)
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Comment 1 Micha Novak 2022-12-10 18:11:18 UTC
Created attachment 154484 [details]
Screenshot showing the broken behavior
Comment 2 Micha Novak 2022-12-10 18:11:39 UTC
Created attachment 154485 [details]
Screenshot of the default behavior
Comment 3 Thomas Baumgart 2025-07-31 06:42:02 UTC
This has been fixed in version 5.2 and above hence I close it as such.