Bug 397020 - Opening dates in "all dates" plot
Summary: Opening dates in "all dates" plot
Status: REOPENED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: 5.0.1
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
: 392407 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-07-31 20:29 UTC by antoine
Modified: 2021-05-27 16:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.2


Attachments
opening date graph (191.52 KB, image/png)
2018-07-31 20:29 UTC, antoine
Details
demo file (2.42 MB, text/xml)
2020-03-23 17:53 UTC, antoine
Details

Note You need to log in before you can comment on or make changes to this bug.
Description antoine 2018-07-31 20:29:31 UTC
Created attachment 114236 [details]
opening date graph

Hi,

I am running kmy 5.0.1 on xubuntu 18.04 and I think I found a small bug in kmy.

When I plot graph with the on "all date" interval, it works but there is the opening balance plotted at the beginning and in my opinion, it is not the right behavior. (see attachment)

To reproduce the bug :
1> open a file with kmy
2> in the report view, choose a report and plot it on a "all date" interval

antoine@Frankenstein:~$ apt show kmymoney
Package: kmymoney
Version: 5.0.1-2
Priority: optional
Section: universe/kde
Comment 1 Thomas Baumgart 2018-08-05 14:24:02 UTC
Git commit d5210daac1f89d84cbf56d23860e064ad90cbabf by Thomas Baumgart.
Committed on 05/08/2018 at 14:24.
Pushed by tbaumgart into branch 'master'.

Fix y-offset of graph for all dates

Summary:
The left most value in a networth graph (called the opening balance) is
calculated based on the closing balance of the date prior to the
selected start date. This is perfectly OK but leads to the logical
consequence that if the user selects "all dates" as the date range this
value will be zero.

Since the opening balance is the first transaction it would make sense
to use the opening balance if the above is the case. This way, the graph
starts out at the level of the sum of included opening balances and not
zero, which avoids an initial edge to be displayed.

This change does exactly that and solves the problem.

Test Plan: Use the same data used to generate  [[ https://bugsfiles.kde.org/attachment.cgi?id=114236 | the graph attached to the bug ]] and verify that the edge on the left is not painted anymore.

Reviewers: antoine

Reviewed By: antoine

Differential Revision: https://phabricator.kde.org/D14624

M  +13   -0    kmymoney/plugins/views/reports/core/pivottable.cpp

https://commits.kde.org/kmymoney/d5210daac1f89d84cbf56d23860e064ad90cbabf
Comment 2 Thomas Baumgart 2018-09-08 12:17:56 UTC
*** Bug 392407 has been marked as a duplicate of this bug. ***
Comment 3 antoine 2020-03-22 18:05:14 UTC
Are you sure this has been solved ?

I have the same behavior with KMyMoney-5.0.8-029de47-x86_64.AppImage ...
Comment 4 antoine 2020-03-23 17:53:32 UTC
Created attachment 126975 [details]
demo file

Here is a demo file, look at report R000007
Comment 5 antoine 2020-07-13 17:05:15 UTC
Hi,

This bug is also in the latest version of Kmymoney
KMyMoney-5.1.0-74a8f0d-x86_64.AppImage (under Xubuntu 20.04)
Comment 6 Thomas Baumgart 2021-05-23 14:53:21 UTC
Git commit 53b7b2bba26dbd0e0e657646c173ab8f8c430472 by Thomas Baumgart.
Committed on 23/05/2021 at 14:50.
Pushed by tbaumgart into branch 'master'.

Add more options to find a corresponding opening balances account

M  +22   -4    kmymoney/mymoney/mymoneyfile.cpp

https://invent.kde.org/office/kmymoney/commit/53b7b2bba26dbd0e0e657646c173ab8f8c430472
Comment 7 Thomas Baumgart 2021-05-23 15:00:20 UTC
Git commit ab7ccb10b3a8830f23bcbef88bfb8231ece5035f by Thomas Baumgart.
Committed on 23/05/2021 at 14:59.
Pushed by tbaumgart into branch '5.1'.

Add more options to find a corresponding opening balances account
FIXED-IN: 5.1.2

(cherry picked from commit 53b7b2bba26dbd0e0e657646c173ab8f8c430472)

M  +22   -4    kmymoney/mymoney/mymoneyfile.cpp

https://invent.kde.org/office/kmymoney/commit/ab7ccb10b3a8830f23bcbef88bfb8231ece5035f
Comment 8 Thomas Baumgart 2021-05-23 15:06:46 UTC
A few problems come together on this one which cause the failure on your end. The main problem is, that KMyMoney is unable to detect the opening balance transaction of your accounts. To catch another case I updated the logic with the recent commits (which are needed for this to work with anonymized data files).

Another problem is in your data file. To get things working properly I needed to remove two accounts from your file (they are unused, so no problem). Remove the extraneous equity accounts A000007 and A000123 and the result is what you are looking for.
Comment 9 antoine 2021-05-24 15:45:56 UTC
Thank you for your work,
I have just download the latest appimage and erased accounts A000007 and A000123 and it works :)
Comment 10 antoine 2021-05-24 17:36:54 UTC
I think that the value of the opening balance is not correct, some accounts are not taken into account (cash and security accounts)
Comment 11 Thomas Baumgart 2021-05-27 15:55:28 UTC
Looking at the demo file, the opening balances for A000103, A000108, A000109, A000111, A000112 and A000113 are not taken into account, because these are investment (or better security) accounts. KMyMoney currently does not support the concept of an opening balance transaction for security accounts.

Entering a 'Buy' transaction and charge it against the opening balances does not solve the problem because we need a transaction against an opening balances account denominated in the investments security. Not an easy fix because it needs additional UI components and maybe more which I am currently not aware of.
Comment 12 antoine 2021-05-27 16:11:31 UTC
thank you for your feedback
I just wanted to make sure that it was not a new bug