Bug 414246 - Net Worth Report includes share value twice
Summary: Net Worth Report includes share value twice
Status: RESOLVED DUPLICATE of bug 415668
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: 2019-11-17 23:07 UTC by Christoph Roick
Modified: 2020-01-25 14:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Roick 2019-11-17 23:07:10 UTC
The fix for BUG 398982 where the opening balance in the forecast was corrected, results in a regression in the reports.
In the reports the calculated account value already includes the share value and therefore the fix multiplies the share value a second time.

I can obtain the desired behavior by applying this patch:

diff --git a/kmymoney/plugins/views/reports/core/pivottable.cpp b/kmymoney/plugins/views/reports/core/pivottable.cpp
index c0d8517ed..c0f73a10f 100644
--- a/kmymoney/plugins/views/reports/core/pivottable.cpp
+++ b/kmymoney/plugins/views/reports/core/pivottable.cpp
@@ -697,7 +697,7 @@ void PivotTable::calculateOpeningBalances()
         }
       }
 
-      if (account.isInvest()) {
+      if (account.isInvest() and m_config.isIncludingForecast()) {
         // calculate value of shares
         value *= account.deepCurrencyPrice(from.addDays(-1));
       }


but I do not consider it a real fix, since to me it doesn't seem to be a reliable distinction of cases nor did I try to understand how the account value is obtained in the first place.
Comment 1 Thomas Baumgart 2020-01-25 14:47:11 UTC

*** This bug has been marked as a duplicate of bug 415668 ***