Bug 382378 - Net Worth Graph broken by 4.8.1 commit
Summary: Net Worth Graph broken by 4.8.1 commit
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.8.0
Platform: Compiled Sources Linux
: NOR major
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-15 14:03 UTC by David Houlden
Modified: 2017-07-18 15:57 UTC (History)
1 user (show)

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


Attachments
Anon file graph before bad commit (51.25 KB, image/jpeg)
2017-07-15 14:28 UTC, David Houlden
Details
Anon file graph after bad commit with opening balance account selected for graph (44.27 KB, image/jpeg)
2017-07-15 14:30 UTC, David Houlden
Details
Anon file graph after bad commit with opening balance account deselected for graph (48.65 KB, image/jpeg)
2017-07-15 14:35 UTC, David Houlden
Details
KMymoney test file (5.09 KB, application/x-kmymoney)
2017-07-17 11:07 UTC, Ralf Habacker
Details
Anonymous KMyMoney file (439.70 KB, application/x-gzip)
2017-07-17 13:03 UTC, David Houlden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Houlden 2017-07-15 14:03:43 UTC
Commit 67d5ee7055dd3b0277423cd07ae92ea205f4b6af to the 4.8 branch on 18th May 2017 has broken the Net Worth Graph.

Prior to this commit my 12 month net worth history chart was correct and matched Net Worth shown on the home page assets and liability summary. After this commit it seems that the amount of the Opening Balances equity account is being subtracted from each net worth value shown on the graph.

Applying later commits to the 4.8 branch allows me to deselect equity accounts in the report settings but this produces an even stranger graph where the current net worth shown on the graph is correct but going back in time over the 12 months shown on the graph, the net worth becomes less and less than it should be.
Comment 1 David Houlden 2017-07-15 14:28:41 UTC
Created attachment 106647 [details]
Anon file graph before bad commit
Comment 2 David Houlden 2017-07-15 14:30:02 UTC
Created attachment 106648 [details]
Anon file graph after bad commit with opening balance account selected for graph
Comment 3 David Houlden 2017-07-15 14:35:51 UTC
Created attachment 106649 [details]
Anon file graph after bad commit with opening balance account deselected for graph
Comment 4 Ralf Habacker 2017-07-17 11:07:01 UTC
Created attachment 106679 [details]
KMymoney test file

I've tried to reproduce this issue with the appended test file. 

With this test case I can confirm that with recent code from 4.8 branch the net worth graph is similar to attachment 106647 [details] when unselecting the opening balance account in the account tab of the report configuration and like attachment 106648 [details] when selecting opening balance account 

I cannot confirm that changing show/hide equity accounts in kmymoney settings creates a graph like shown in attachment 106649 [details]. Because the test file may not fit exactly into your use case, feel free to update it according to your related transactions to be able to get
Comment 5 Ralf Habacker 2017-07-17 11:43:24 UTC
Git commit e29021419e09583f8995ab9b27c9a802ab584826 by Ralf Habacker.
Committed on 17/07/2017 at 11:42.
Pushed by habacker into branch '4.8'.

Only add equity accounts to reports if expert mode is enabled

This restores Net Worth Graph behaviour in non export mode.

Thanks to David Houlden for pointing out.
FIXED-IN:4.8.1

M  +2    -1    kmymoney/dialogs/kfindtransactiondlg.cpp
M  +7    -4    kmymoney/mymoney/mymoneyreport.cpp

https://commits.kde.org/kmymoney/e29021419e09583f8995ab9b27c9a802ab584826
Comment 6 David Houlden 2017-07-17 12:48:04 UTC
Ralf, your latest fix does not correct the graph for me. I have always had "show equity accounts" selected in KMyMoney settings since it became available (probably years ago) but the Net Worth graph changed after commit 67d5ee7055dd3b0277423cd07ae92ea205f4b6af.

I cannot see why the amount in an opening balance account should be subtracted from the total Net Worth on the graph as I described. The Net worth shown elsewhere is correct.

The anonymous file I created the images above from is my own KMYMoney file with many years of history in it. I will post the anon file to this bug so you can investigate with that file.
Comment 7 David Houlden 2017-07-17 13:03:30 UTC
Created attachment 106680 [details]
Anonymous KMyMoney file
Comment 8 David Houlden 2017-07-17 13:05:17 UTC
Anonymous file now uploaded to this bug. Ralf, you really need to compile a KMyMoney from git prior to the offending commit in order to see what I reported.
Comment 9 Ralf Habacker 2017-07-17 13:55:00 UTC
(In reply to David Houlden from comment #8)
> Anonymous file now uploaded to this bug. 
Thanks

> Ralf, you really need to compile a KMyMoney from git prior to the offending commit in order to see what I
> reported.
I'm aware of that equity accounts are not included in the net worth report before this commit. Unfortunally there is a reason why this commit has been added - to include all accounts into the "Transactions by account" and other reports which is required to support small companies. Now we need to find a way to support both. I guess that the problem is that different report types uses the same set of initialization which inferences here.
Comment 10 Ralf Habacker 2017-07-18 04:50:00 UTC
Git commit 3761846aa319733dbe763b4e5a0cce92c7048d7f by Ralf Habacker.
Committed on 18/07/2017 at 04:46.
Pushed by habacker into branch '4.8'.

Fixup for commit e2902141

Make net worth graph and report configuration account filter
to be independent from expert mode. Expert mode seems to be
used already to much to be able to switch off.
Instead enable equity accounts in account filter if report
is of type eAccount.

M  +4    -4    kmymoney/dialogs/kfindtransactiondlg.cpp
M  +4    -2    kmymoney/dialogs/kfindtransactiondlg.h
M  +1    -1    kmymoney/dialogs/kreportconfigurationfilterdlg.cpp
M  +0    -4    kmymoney/mymoney/mymoneyreport.cpp

https://commits.kde.org/kmymoney/3761846aa319733dbe763b4e5a0cce92c7048d7f
Comment 11 Ralf Habacker 2017-07-18 04:50:01 UTC
Git commit 2365b64e44350592fff8b307c2a98486834fa59b by Ralf Habacker.
Committed on 17/07/2017 at 20:23.
Pushed by habacker into branch '4.8'.

Add code to dump report configuration

M  +52   -0    kmymoney/mymoney/mymoneyreport.cpp
M  +16   -0    kmymoney/mymoney/mymoneyreport.h

https://commits.kde.org/kmymoney/2365b64e44350592fff8b307c2a98486834fa59b