Bug 513187

Summary: Credit Card Account “Show Balance Chart” “Absolute Limit” Line Value Is At Odds With the Account Balance Line
Product: [Applications] kmymoney Reporter: pc <junk_2010>
Component: reportsAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: ralf.habacker
Priority: NOR    
Version First Reported In: 5.2.1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=479040
Latest Commit: Version Fixed/Implemented In: 5.2.2
Sentry Crash Report:
Attachments: screenshots to show issue
test case
screenshots to show new issue after first program update
screenshots with additional account ledger entries after first program update

Description pc 2025-12-10 18:20:45 UTC
Created attachment 187498 [details]
screenshots to show issue

SUMMARY
When using a credit card account, the ledger view "Show balance chart" plot account balance limit line appears to be at odds with the account balance plot.

I will attach a pdf with some screenshots.

STEPS TO REPRODUCE
1. Create a credit card account
2. Specify a credit limit for the account
3. Create some credit card transactions
4. In the ledger view for the credit card account press "Show balance chart"

OBSERVED RESULT
The account balance (when you have debit) is plotted as a positive number.
The account balance limit is plotted as a negative number. 

EXPECTED RESULT
I was expecting the account balance limit to be plotted as a positive number, and not a negative number.
However, on reflection I guess an alternative view is that the account balance (when you have debit) should be plotted as a negative number.

What seems incorrect is that the account balance and the account balance limit numbers appear to be plotted with different "polarities".

SOFTWARE/OS VERSIONS
Linux: Ubuntu 24.04.3
Gnome desktop
KMyMoney AppImage file used

$ kinfo
Operating System: Ubuntu 24.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.14.0-37-generic (64-bit)
Graphics Platform: offscreen
Processors: 8 × 11th Gen Intel® Core™ i5-1145G7 @ 2.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Xe Graphics

ADDITIONAL INFORMATION
Comment 1 pc 2025-12-10 19:45:03 UTC
Bug 479040 may also be relevant?
Comment 2 Ralf Habacker 2025-12-15 23:09:43 UTC
Created attachment 187690 [details]
test case

With the appended test case is could be shown, the issue can be reproduced.
Comment 3 Thomas Baumgart 2025-12-16 14:54:14 UTC
Git commit a52e0fe31172c746768cafcba27870f727a36ba3 by Thomas Baumgart.
Committed on 16/12/2025 at 14:54.
Pushed by tbaumgart into branch 'master'.

Fix marker line for credit limits
FIXED-IN: 5.2.2

M  +2    -2    kmymoney/plugins/views/reports/kbalancechartdlg.cpp

https://invent.kde.org/office/kmymoney/-/commit/a52e0fe31172c746768cafcba27870f727a36ba3
Comment 4 Thomas Baumgart 2025-12-16 14:54:54 UTC
Git commit 2b4685356f9e26d11a0698a09ae35c1ef0c3fff8 by Thomas Baumgart.
Committed on 16/12/2025 at 14:54.
Pushed by tbaumgart into branch '5.2'.

Fix marker line for credit limits
FIXED-IN: 5.2.2
(cherry picked from commit a52e0fe31172c746768cafcba27870f727a36ba3)

M  +2    -2    kmymoney/plugins/views/reports/kbalancechartdlg.cpp

https://invent.kde.org/office/kmymoney/-/commit/2b4685356f9e26d11a0698a09ae35c1ef0c3fff8
Comment 5 pc 2025-12-16 21:22:33 UTC
Thomas,

Thank-you for looking into this and resolving it so quickly.

Would it be possible to briefly provide details of what the chosen resolution was, and also how it affects bug 479040 please?

This bug is marked as being fixed in 5.2.2. Does this mean that I have to wait until 5.2.2, or will it appear at some point as a later build release of 5.2.1? I ask this another resolved bug 510312 was also marked as resolved in 5.2.2, but the fix has appeared in a build of 5.2.1.
Comment 6 Jack 2025-12-16 22:25:47 UTC
In terms of availability of this fix:  it will be in the 5.2.2 release, which is not yet scheduled.  It is also already available in any version built from either master (development) or 5.2 (stable) branch of git, including appimage and snap or flatpak (if that build succeeds.)  The same goes for the Windows builds.  We do not call them 5.2.1 builds, although I suppose it is just a matter of terminology.  Those builds called "stable" are 5.2.1 plus bugfixes.  The "development" versions also include additional commits for new features or other changes to the code, which are not guaranteed to be stable, although should not include anything known not to work.
Comment 7 pc 2025-12-17 16:20:45 UTC
Thomas,

I have downloaded and run: kmymoney-5.2-5046-linux-gcc-x86_64.AppImage

There is now no negative account limit value on the graph. However the graph is still not correct. There is only a plot of a single value, the final balance in the account. No account limit values, and no account balance changes over time.

I will attach a PDF with screenshots. Please let me know if you require me to file a new bug report, or if there is something specific I can do to try to help with resolving the issue.
Comment 8 pc 2025-12-17 16:22:23 UTC
Created attachment 187743 [details]
screenshots to show new issue after first program update
Comment 9 pc 2025-12-17 16:40:37 UTC
I have now added some additional account ledger entries. With these changes the account balance plot changes over time and the account limit line has been drawn.

I will attach a pdf showing screenshots.
Comment 10 pc 2025-12-17 16:41:42 UTC
Created attachment 187744 [details]
screenshots with additional account ledger entries after first program update