Bug 457832 - Net worth report displays incorrect account balance
Summary: Net worth report displays incorrect account balance
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: 5.1.2
Platform: Appimage Linux
: NOR major
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-13 10:15 UTC by Ceaus
Modified: 2022-08-14 05:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
KMyMoney data file (8.91 KB, text/xml)
2022-08-13 10:15 UTC, Ceaus
Details
Screenshot of the incorrect balance values (32.54 KB, image/png)
2022-08-13 10:16 UTC, Ceaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ceaus 2022-08-13 10:15:35 UTC
Created attachment 151299 [details]
KMyMoney data file

SUMMARY
A Net-Worth report displays incorrect asset values.
I have an account with outstanding balances set to zero in 2014. Depending on how the date range of the report is set, the report still displays a positive balance for dates > 2014.  This gravely compromises the reporting value. 

STEPS TO REPRODUCE
1. Open the attached data file bug_report_v5.xml.
2. Open the ledger for account A2 and observe the balance is zero on 2014-09-03.
3. Open the ledger for account A3 and observe the balance is zero on 2014-09-03.
4. Open the favorite report R1. 
5. Observe how the balance for A2 is €500 from 2014 onwards (while the balance is in fact zero).
6. Observe how the balance for A3 is €12625.26 from 2014 onwards (while the balance is in fact zero).
7. Configure report R1. Any date change, even if using the same dates, will produce a correct report.

Please be aware that if A2 and A3 are closed (and thus invisible) it is extremely difficult to understand why your current asset values are incorrect.

SOFTWARE/OS VERSIONS
KMyMoney: AppImage 5.1.2-cb0b492
Linux version: openSUSE Leap 15.3
KDE Plasma Version: 5.76.0-bp153.5.2.1
KDE Frameworks Version: 5.51.0
Qt Version: 5.11.3


ADDITIONAL INFORMATION
I've tried to export the data file as an anonymous file, but that created a big mess, so I trimmed down the data file manually to minimum size, and anonymized it manually.
Comment 1 Ceaus 2022-08-13 10:16:29 UTC
Created attachment 151300 [details]
Screenshot of the incorrect balance values
Comment 2 Thomas Baumgart 2022-08-13 13:21:09 UTC
I don't know how you end up with this report configuration. In your description I simply replaced step 7 with

7. Configure report R1. Press Apply w/o any changes

and the report is shown correct. If I save the file and then try to reproduce the problem it is gone. Looking at the raw configuration of the report it has an active filter for category (C1). That is the reason why all your transfer transactions are not taken into account. For a net worth report it does not make sense to filter on categories.

Do you have a category filter setup on your original report? What happens, if you remove it?
Comment 3 Ceaus 2022-08-13 13:59:07 UTC
(In reply to Thomas Baumgart from comment #2)
> I don't know how you end up with this report configuration. 

As simple as point-click-point-click-ENTER

> In your description I simply replaced step 7 with
> 7. Configure report R1. Press Apply w/o any changes and the report is shown correct.

Same here.

> If I save the file and then try to reproduce the problem it is gone.

Same here.

> Looking at the raw configuration of the
> report it has an active filter for category (C1). That is the reason why all
> your transfer transactions are not taken into account. For a net worth
> report it does not make sense to filter on categories.
> Do you have a category filter setup on your original report?

This is for fiscal reasons. I have a (very) small company, and when submitting the balance sheet, I have to exclude taxes from the balance sheet (that's a side effect of Dutch tax laws). So category C1 is in fact the "Paid taxes this year"  category.
I was hoping to be able to run the balance sheet without having to worry about paid taxes during the year. It seems I need to make it a double run: first run the balance sheet (no categories selected) and then manually process the paid taxes.

Would you agree the initial finding (as per the screenshot) is a bug?

> What happens, if you remove it?

Than I get the correct balances. Somehow I've missed the warning for missing the transfer transactions. Which is stupid as I've been using KMM for more than a decade, and I've seen all screens hundreds and hundreds of time. I feel stupid.
Comment 4 Ceaus 2022-08-13 14:08:50 UTC
(In reply to Ceaus from comment #3)
> (In reply to Thomas Baumgart from comment #2)
> > In your description I simply replaced step 7 with
> > 7. Configure report R1. Press Apply w/o any changes and the report is shown correct.
> 
> Same here.

Just to be aware: this is for this debug data file. In my original financial file this doesn't work. If tried changing the reporting start/end dates, change the storage type (kmy/xml/sql), but that trick doesn't work. Still a lagging account balance, while the balance should already be zero. 

> > If I save the file and then try to reproduce the problem it is gone.
> 
> Same here.

See above.

Just to remove all doubt: I'm now trying the  AppImage version kmymoney-5.1-179-linux-64-gcc.AppImage (that's the latest Jenkins successful build from https://binary-factory.kde.org/view/AppImage/job/KMyMoney_Release_appimage-centos7/.
The results and behavior are the same.
Comment 5 lp.allard.1 2022-08-13 20:54:55 UTC
@Ceaus,

please look at bug ticket https://bugs.kde.org/show_bug.cgi?id=450653 and see if its the same issue or not.  I already reported something similar a while ago regarding balances in reports.
Comment 6 Ceaus 2022-08-14 05:11:28 UTC
(In reply to lp.allard.1 from comment #5)
> @Ceaus,
> 
> please look at bug ticket https://bugs.kde.org/show_bug.cgi?id=450653 and
> see if its the same issue or not. 

450653 certainly has similarities. But it's out of my reach to conclude they are the same bug.