<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>421260</bug_id>
          
          <creation_ts>2020-05-10 05:08:14 +0000</creation_ts>
          <short_desc>Networth &quot;account balances by institution&quot; provides incorrect results</short_desc>
          <delta_ts>2020-06-05 04:06:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmymoney</product>
          <component>reports</component>
          <version>git (master)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Thomas Baumgart">tbaumgart</reporter>
          <assigned_to name="KMyMoney Devel Mailing List">kmymoney-devel</assigned_to>
          <cc>me</cc>
          
          <cf_commitlink>https://commits.kde.org/kmymoney/650d68b395dcd87dfa41294565d86d0fdbfcbab4</cf_commitlink>
          <cf_versionfixedin>5.1.0</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1928595</commentid>
    <comment_count>0</comment_count>
    <who name="Thomas Baumgart">tbaumgart</who>
    <bug_when>2020-05-10 05:08:14 +0000</bug_when>
    <thetext>SUMMARY

When investment accounts assigned to an institution are grouped under an umbrella that does not have an institution assigned, then they will be listed as account with no institution in the networth &quot;account balances by institution&quot; report

1. Create institution B
2. Create investment account I with institution B
3. Create an investment S in I
4. Create plain asset account A with no institution
5. Make A the parent account of I

OBSERVED RESULT
1. The Networth &quot;Account balances by institution&quot; report shows S under &quot;None&quot;
2. The Information &quot;Account information&quot; I is shown under B 

EXPECTED RESULT
The Networth &quot;Account balances by institution&quot; report shows S under B

ADDITIONAL INFORMATION
- With I being a top-level account S is reported correctly under B
- Accounts of type checking, savings, and asset are properly organized/grouped under their respective institutions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928596</commentid>
    <comment_count>1</comment_count>
    <who name="Thomas Baumgart">thb</who>
    <bug_when>2020-05-10 05:57:33 +0000</bug_when>
    <thetext>Git commit 650d68b395dcd87dfa41294565d86d0fdbfcbab4 by Thomas Baumgart.
Committed on 10/05/2020 at 05:57.
Pushed by tbaumgart into branch &apos;5.0&apos;.

Use the correct institution in reports

When an account has no institution assigned the one of the top-level
account was used in some reports. This leads to wrong results in case of
investments which don&apos;t have an institution assigned but should use the
one of the parent investment account.

This worked as long as the investment account itself was the top-level
account. In case the investment account itself was a sub-account to a
top-level account or even further down in the account hierarchy, the
institution was always taken from the top-level account.

This change fixes the problem by walking up the hierarchy and using the
first institution found.
FIXED-IN: 5.0.9

M  +1    -6    kmymoney/plugins/views/reports/core/querytable.cpp
M  +17   -0    kmymoney/plugins/views/reports/core/reportaccount.cpp
M  +7    -0    kmymoney/plugins/views/reports/core/reportaccount.h

https://commits.kde.org/kmymoney/650d68b395dcd87dfa41294565d86d0fdbfcbab4</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>