KMM 5.2.0 ledger balance mismatch

Upgraded to 5.2.0-aac0449 on a Win11 box from 5.1.3.

I’m using a normal (checking) ledger and am seeing oddities with the balances when I show/hide reconciled transactions (from Settings/Configure KMyMoney/General/Filter.) If I uncheck (show) reconciled transactions and look at my ledger, it is the correct running balance. I’m ignoring the Balance at the bottom of the ledger as this shows future balance, and I have future dated transactions.)

When I change settings to hide reconciled transactions, the running balance appears to be ignoring a single transaction and showing a negative amount (all from just hiding transactions):

I’m not fully versed on how to submit a bug (if this is a bug.)

Second question: are the data files backward compatible? Can I use KMM5.1.3 on a .kmy data file after I’ve used KMM5.2.0?

Sorry nobody replied to this yet. I’m not certain, but I think the problem might be due to the unmarked $500 transaction prior to the most recent reconciliation. When all transactions are shown, the balance really is the running balance from all transactions. I’m not certain how this changes when you hide reconciled transactions. To test, try moving that $500 transaction to immediately after the latest reconciliation and see if the numbers look better. If so, we will have a better idea where to look in the code. For now, filing a bug is not necessary - the same people who see the new bugs also read these posts.

I believe that 5.2.0 and 5.2.1 have not introduced any changes to the data file that would cause problems going back to 5.1.3, but always make a backup before trying it just to be sure. At some point, such changes may be introduced, but they should be announced very clearly as part of any release notes.

It would help if you can produce a small data file which demonstrates the problem.

I think I was able to replicate using the following steps. I’ve also upgraded to 5.2.0-cb50551 prior to starting.

Create a checking account
(5 days ago) Add a deposit transaction: $100
(4 days ago) Reconcile, beginning balance $0, ending balance $1. Interest $1 ($100 is not cleared)
(3 days ago) Add a deposit transaction: $150

If I don’t hide the reconciled transactions, the running balance is correct.

If I hide the reconciled transactions, the running balance is off by the interest. It’s like the interest is no longer a transaction.

But then, if I manually mark the $100 transaction as reconciled, the running balance is correct with reconciled transactions hidden. If I mark it as unreconciled, the incorrect running balance shows up again.

I confirm the problem in the latest git master as well as a 5.2.0 appimage, but not in a 5.1 appimage. At some point, it seems the running balance was changed to not add the value of transactions not being displayed, but there was a similar bug fixed in 5.2 which just might be relevant.

Bug filed: 508033 – hiding reconciled transactions alters (incorrectly) running balance in ledger

What do you expect the balance column to show? It can either be what is shown in the screenshot above or 251,00 and 101,00. I have to admit, I don’t remember what 5.1.3 showed.

A 5.1 appimage shows the same balance on each transaction whether or not the reconciled ones are shown. I will also try a similar test, but with some earlier months with various transactions fully reconciled.

I suppose there could be a legitimate debate, but given that reconciled transactions are likely to be at the older end of the ledger, I would say most users would expect showing or hiding reconciled transations to not change the displayed running balance for any transactions. I had started to say that this case was due to there being an unmarked/cleared transaction prior to the most recent reconciliation, but I’m no longer sure of that. Do note that if I add another reconciled transaction prior to the unmarked on (and redo the reconciliation to include it) the balance shown on the unmarked transaction is “correct” (including the the opening balance and the two prior deposits) but then the reconciled interest amount is NOT included in the running balance. Is it possible some flag gets switched when the process hits the first non-reconciled transaction, so later reconciled ones are not added to the running balance?

Did anyone try the latest changes on the master branch for that issue?

Sorry - I’m also troubleshooting email problems, which is delaying everything I do.

Yes - I confirm the fix works as desired.