Bug 414246

Summary: Net Worth Report includes share value twice
Product: [Applications] kmymoney Reporter: Christoph Roick <chrisito>
Component: reportsAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

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 ***