Bug 434933 - Balance calculation discrepancy in Future payments
Summary: Balance calculation discrepancy in Future payments
Status: RESOLVED NOT A BUG
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-25 14:13 UTC by John Hudson
Modified: 2021-03-27 13:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Home page with balance calculations for Future payments (120.53 KB, image/png)
2021-03-25 14:58 UTC, John Hudson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Hudson 2021-03-25 14:13:53 UTC
SUMMARY
Future payments summary miscalculates the balance on both accounts.


STEPS TO REPRODUCE
1. Happens every time I open KMyMoney
2. 
3. 

OBSERVED RESULT
Balance calculation discrepancy of -£39.06 on one account and -£18.67 on the other.


EXPECTED RESULT
No balance calculation discrepancy

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.18.6
KDE Frameworks Version: 5.71.0
Qt Version: 5.12.7

ADDITIONAL INFORMATION
Comment 1 Jack 2021-03-25 14:42:24 UTC
Please provide a more complete description of what is wrong, or even better, please provide a sample data file which demonstrates the problem, including what you expect the future balance to be.
Thanks.
Comment 2 John Hudson 2021-03-25 14:58:46 UTC
Created attachment 137057 [details]
Home page with balance calculations for Future payments

Screenshot of current display of balances; the balances should be, in order, 39.06, 36.41, 763.62, 683.62, 664.61, 1271.69
Comment 3 Jack 2021-03-25 16:32:44 UTC
First, can you confirm you are using £ for all currencies, so there are no conversions?
Oddly, it looks like only the first future transaction for any date is off.  Subsequent transactions for the two dates shown seem to apply the expected arithmetic.  Is there anything about those two transactions (-20.15 and 727.71) are they split transactions? Does the same pattern apply to future scheduled transacxtions?
Comment 4 John Hudson 2021-03-25 17:57:40 UTC
All the transactions are GBP; there have been no split transactions for at least the past month. The problem appears to be with the first calculation for both accounts. The pattern continues if I open Show more schedules.

I saw a similar bug was listed as fixed in 2010; however, I have been using KMyMoney since 2005 and this bug did not affect me in 2010. So I am assuming it might be different.

The version I have was installed on my system on 7 February but the problem only appeared about a week ago.
Comment 5 Jack 2021-03-25 18:12:19 UTC
Unfortunately, I don't see anything in the numbers that suggests any pattern, and my own file does not exhibit the problem.  It's nothing more than a guess, but I'd start by looking for any pattern in the amount by which that first transaction on a date is wrong - either absolute or related to the transaction amount or the previous balance.  It would really help if you could provide a sample data file which exhibited the problem.  You could try saving your file as an anonymous file, but that alters the amounts of transactions, so confirming that the problem still exists would probably be painful.  I you can't simply create on from scratch, you might export that account as a QIF file, then import it into a brand new data file, altering any personal data.  Also, do you have any scheduled transactions in any other accounts?  If not, you might try creating one or two, just to see if the problem shows up there, or is restricted to the one account.
Comment 6 John Hudson 2021-03-25 21:07:54 UTC
Thanks for the suggestion. It looks as if it is device specific - perhaps corruption of a library on my desktop.
I back the file up weekly and so I updated my latest backup on my backup laptop step by step and the problem did not appear. However, when I copied the file to my desktop, even after reinstalling KMyMoney, the problem persisted. Finally, I copied the file to a notebook running the same release as the desktop and the problem did not appear.
Comment 7 Jack 2021-03-26 00:07:19 UTC
So the same file shows the problem on your desktop but not on your laptop, using the same version of KMM?  Do you have the same Distro and version on both machines?  If so, then it will likely remain a mystery.  If not, you  might try to figure out what other package you upgraded at the time the problem appeared.  Specifically consider any of the packages the openSuse package of KMM depends on.
Comment 8 John Hudson 2021-03-26 11:23:09 UTC
I have Leap 15.2 on the desktop displaying the miscalculations and Leap 15.2 on the notebook displaying correctly; both are identically up-to-date; I have Tumbleweed on the backup laptop displaying correctly. All have KMM 5.1.1 installed.

So I will fsck the partition on the desktop later and see if that makes any difference.
Comment 9 John Hudson 2021-03-27 11:19:57 UTC
Problem solved. I had an update to KDE5 Frameworks and the problem has disappeared; so it appears that it was a library file within KDE5 Frameworks which had become corrupted on the desktop only.
Comment 10 Thomas Baumgart 2021-03-27 13:56:20 UTC
Sorry for entering the arena a bit late. I am not sure if a (corrupted) KDE framework library can influence the balance of an account. More so, as I use the same distro and version as John does. I also doubt it has anything to do with Brexit :)

In fact I saw a similar behavior today on my data file, but that was related to a scheduled transaction that did not (yet) happened because the payee postponed it by more than a month and I had the option turned on to display the schedules on their planned date. Of course, the balance calculation took that into account.

Looking closer at this specific option, this would also explain, why you see different balances for the same data file when switching computers. The options are kept in your ~/.config/kmymoney directory and not in the data file. BTW, this option was introduced with 5.0.3 (dated Jan 2019).