Bug 498080

Summary: Reconciliation Wizard: Starting balance is not the ending balance from the previous reconciliation
Product: [Applications] kmymoney Reporter: Paul Worrall <p.r.worrall>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 5.1.90   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.2
Sentry Crash Report:
Attachments: Screenshots of 5.1.3 and 5.1.90

Description Paul Worrall 2024-12-31 10:04:09 UTC
Created attachment 176988 [details]
Screenshots of 5.1.3 and 5.1.90

STEPS TO REPRODUCE
(I'm using kmymoney-master-3791-linux-gcc-x86_64.AppImage):

1. Open the ledger of an account that has previously been reconciled
2. Click on the "Reconcile" button
3. Click "Next" if necessary to get to the page with the Starting & Ending balances

OBSERVED RESULT
The "Starting balance" is not the ending balance from the previous reconciliation and is not greyed-out

EXPECTED RESULT
The "Starting balance" is the ending balance from the previous reconciliation and is greyed-out (as it was in v5.1.3)

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.9.0
Qt Version: 6.9.0
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Regression from 5.1.3
The "Ending balance" is the ending balance from the previous reconciliation and is not greyed-out, as expected.
I have no transactions marked Cleared or Reconciled since the previous reconciliation
The dates for "Oldest unmarked transaction" and "Last reconciled statement" are correct
Comment 1 Thomas Baumgart 2024-12-31 14:43:42 UTC
Git commit 9c3896258f720fd7bb71d6521c9b93088c5d780d by Thomas Baumgart.
Committed on 31/12/2024 at 14:43.
Pushed by tbaumgart into branch 'master'.

Keep track of enabled/disabled state of the widget

M  +13   -2    kmymoney/widgets/amountedit.cpp
M  +5    -0    kmymoney/widgets/amountedit.h

https://invent.kde.org/office/kmymoney/-/commit/9c3896258f720fd7bb71d6521c9b93088c5d780d
Comment 2 Thomas Baumgart 2024-12-31 15:16:55 UTC
Are there any transactions shown with a post date prior to the start date of the statement in the ledger when you set the ledger filter to "Not reconciled"?
Comment 3 Paul Worrall 2024-12-31 15:50:46 UTC
(In reply to Thomas Baumgart from comment #2)
No, the first (earliest) transaction is on the start date of the statement
Comment 4 Thomas Baumgart 2025-01-01 15:17:32 UTC
Git commit 95add404e09b399a58a5276209b86f58d879eb5a by Thomas Baumgart.
Committed on 01/01/2025 at 15:06.
Pushed by tbaumgart into branch 'master'.

Fix calculation of starting balance during reconciliation

When reconciling an account, the starting balance is calculated by
subtracting the amount of all transactions with a posting date later
than the date of the last reconciliation. Unfortunately, transactions on
that very day were also subtracted which lead to a wrong starting
balance. This change fixes the calculation to include them.
FIXED-IN: 5.2

M  +1    -1    kmymoney/wizards/endingbalancedlg/kendingbalancedlg.cpp

https://invent.kde.org/office/kmymoney/-/commit/95add404e09b399a58a5276209b86f58d879eb5a