Bug 383165 - Networth report shows wrong values
Summary: Networth report shows wrong values
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: git (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-05 11:45 UTC by Thomas Baumgart
Modified: 2019-08-29 00:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.1,5.0.0
Sentry Crash Report:


Attachments
Report output (15.56 KB, image/png)
2017-08-05 13:18 UTC, Thomas Baumgart
Details
Demo file with two customized networth reports (5.18 KB, application/x-kmymoney)
2017-08-05 15:10 UTC, Thomas Baumgart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Baumgart 2017-08-05 11:45:48 UTC
Some recent changes to the report sub-system must have broken something. The networth report shows wrong values. Use demo file stored in bug 382378 https://bugs.kde.org/attachment.cgi?id=106679 and open "Report/Networth today" and compare the value with the one provided on the home view.

Looks like the equity accounts are taken into account here. This is wrong.
Comment 1 Ralf Habacker 2017-08-05 12:06:19 UTC
The commits which fixes bug 382378 has been recently merged into master and should  fix that in master too. Can you retest ?
Comment 2 Thomas Baumgart 2017-08-05 13:18:55 UTC
Created attachment 107088 [details]
Report output

No, it is still broken (at least in master). The equity accounts are completely wrong here. They don't have to be used in this calculation.
Comment 3 Thomas Baumgart 2017-08-05 15:10:52 UTC
Created attachment 107091 [details]
Demo file with two customized networth reports

And not only the equity accounts: also income and expense accounts are used. That certainly is absolutely false. The attached file shows the problem (at least in master). It contains two customized reports (correct and false). The false one is a copy of the default networth report just the name has been adjusted. I tweaked the configuration so that the correct one shows how the graph must appear.

Ralf, can you check if the default (false) one also shows false values in 4.8 so that we know about the status of 4.8. 

Also, I noticed that the account tab of the report configuration now shows all five account groups when only two (or maybe three with equities) are allowed. To have income and expenses here is *wrong*. I have no idea where this comes from.

Again, let's check if this is in 4.8 as well as master or only master.
Comment 4 Thomas Baumgart 2017-08-05 15:26:29 UTC
this seems to cause the problem

commit bda676a62ecca82de350d15a5086619a02420af0
Author: Ralf Habacker <ralf.habacker@freenet.de>
Date:   Sun Oct 2 17:50:11 2016 +0200

    Show more accounts in account tab of report settings dialog.

Simply reverting is not enough. Once reverted you can load the test file and the false report is still false whereas the default report now shows correct results. One needs to file it once to fix the file so we need a fix to solve this issue in code also.  Arrrgh.
Comment 5 Ralf Habacker 2017-08-07 10:29:15 UTC
(In reply to Thomas Baumgart from comment #3)

> It contains two customized reports (correct and false).
> The false one is a copy of the default networth report just the name has
> been adjusted. I tweaked the configuration so that the correct one shows how
> the graph must appear.
Ah, you added id="A000004" to the correct report to limit the used accounts.

  <REPORT ... >
+   <ACCOUNT id="A000004"/>
  </REPORT>

In the wrong report there is 
  <REPORT ... >
+   <ACCOUNTGROUP group="equity"></ACCOUNTGROUP>
  </REPORT>

> Ralf, can you check if the default (false) one also shows false values in
> 4.8 so that we know about the status of 4.8. 
it is the same
Comment 6 Ralf Habacker 2017-08-07 10:32:17 UTC
(In reply to Thomas Baumgart from comment #4)
> One needs to file it once to fix the file so we need a fix to solve
> this issue in code also.
I fixed that by open report configure dialog and press okay.
Comment 7 Ralf Habacker 2017-08-07 11:14:42 UTC
(In reply to Ralf Habacker from comment #6)
> (In reply to Thomas Baumgart from comment #4)
> > One needs to file it once to fix the file so we need a fix to solve
> > this issue in code also.
> I fixed that by open report configure dialog and press okay.

I think that this issue indicates a generic problem in case the reporting engine may be extended/updated in the future and how to make sure that present reports are still working. 

This issue relates also to the usage of the expert mode, to which new stuff may be bound but on the other side may not work together with other features people depends on.
An example is that the display of equity accounts is bound to expert mode in several locations and it might be a good idea to bound the usage of equity account in reports to bound to this flag too and let people disable expert mode to not have equity accounts in reports. But this does not work for people depending on equity accounts been enabled (see for example https://bugs.kde.org/show_bug.cgi?id=382378#c6) 

On the other side people may want to have a report about net worth change in this year not including opening balance, which is what the "Net worth graph (false)" report shows. 

If I'm incorrect about my assumptions in this statement please let me know.
Comment 8 Ralf Habacker 2017-08-08 06:59:42 UTC
Git commit 552879068c24d6e8c5183da77256c41d78ab3de3 by Ralf Habacker.
Committed on 08/08/2017 at 06:59.
Pushed by habacker into branch '4.8'.

Fix broken reports

Do not show income and expense categories in the account tab
of the report configuration dialog which adds them unconditional
to reports.

M  +0    -2    kmymoney/dialogs/kfindtransactiondlg.cpp

https://commits.kde.org/kmymoney/552879068c24d6e8c5183da77256c41d78ab3de3
Comment 9 Ralf Habacker 2017-08-08 17:05:48 UTC
(In reply to Thomas Baumgart from comment #4)
> One needs to file it once to fix the file so we need a fix to solve
> this issue in code also. 
This is a good change to make kmymoney in this area more robust because you cannot expect that the report engine is set in stone forever.
I will take a look into that issue.
Comment 10 Ralf Habacker 2017-08-09 22:06:25 UTC
Git commit 83d5e5cb1c2a5c10c107a3a7ef005a3a7628d5ca by Ralf Habacker.
Committed on 09/08/2017 at 21:59.
Pushed by habacker into branch '4.8'.

Do not show empty equity sums in html asset and liabilites reports

To have equity sums in html reports there is another rowType required.

M  +0    -1    kmymoney/reports/pivottable.cpp

https://commits.kde.org/kmymoney/83d5e5cb1c2a5c10c107a3a7ef005a3a7628d5ca
Comment 11 Ralf Habacker 2017-08-09 22:06:26 UTC
Git commit 4f9cfd0d7bb2acc7c94aaefdd0c25df5c956ff0f by Ralf Habacker.
Committed on 09/08/2017 at 22:06.
Pushed by habacker into branch '4.8'.

Do not add equity accounts to net worth reports

Equity accounts are disabled by default in find transaction
dialog for now until there is a way to add them to the reports
for which they are useful to add.

M  +2    -2    kmymoney/dialogs/kfindtransactiondlg.h

https://commits.kde.org/kmymoney/4f9cfd0d7bb2acc7c94aaefdd0c25df5c956ff0f
Comment 12 Thomas Baumgart 2017-08-12 11:43:38 UTC
Git commit 9d4bb42f3b77ea74baee55dc7d48d6485180472f by Thomas Baumgart.
Committed on 12/08/2017 at 11:41.
Pushed by tbaumgart into branch 'master'.

Fix networth reports

This should be the last bit to make the networth reports to work as they
used to.
FIXED-IN: 5.0

M  +0    -1    kmymoney/reports/pivottable.cpp

https://commits.kde.org/kmymoney/9d4bb42f3b77ea74baee55dc7d48d6485180472f