Bug 350360

Summary: OFX import leaves brokerage account field blank for nested accounts
Product: [Applications] kmymoney Reporter: Jeff Carlson <jeffmcarlson>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: minor CC: me, ostroffjh
Priority: NOR    
Version: 4.7.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 5.1.0
Sentry Crash Report:

Description Jeff Carlson 2015-07-19 01:40:21 UTC
When importing an OFX file into an investment account, each transaction's account field is blank when the investment account as associated brokerage account are nested under another account.

Reproducible: Didn't try

Steps to Reproduce:
1.Create empty account used for grouping accounts (i.e Investment accounts)
2.Change hierarchy for both investment and associated brokerage accounts to be nested under new empty account
3.Import OFX file


Actual Results:  
Each transaction in the investment account that requires money to be drawn from the brokerage account will have a blank account field. Manual intervention is needed, otherwise the money will appear in both accounts, and will not be drawn down from the brokerage account

Expected Results:  
The associated brokerage account should be populated on transactions. This happens correctly when the accounts are not nested under another account.

Workaround is to not nest investment accounts
Comment 1 Jack 2015-07-19 14:47:10 UTC
I believe that is has nothing to do with the brokerage account being nested.  If I remember from dealing with a similar issue, KMM will only use the  brokerage account automatically if it has exactly the default name, which is the name of the investment account followed by " (Brokerage)".  Bug 329701 is a wishlist for exactly this issue.
Comment 2 Jack 2018-07-16 22:27:37 UTC
Can you confirm if this is still the case?  I know the brokerage account field does start out blank for imported investment transactions, but once you edit the transaction, they are usually filled in automatically.
Comment 3 Thomas Baumgart 2020-05-09 05:08:13 UTC
Git commit fc3926479ed186ae2166e6701d267eb0b3f09a07 by Thomas Baumgart.
Committed on 09/05/2020 at 04:55.
Pushed by tbaumgart into branch '5.0'.

Detect brokerage account based on partial name

The detection of a brokerage account connected to an investment account
did not work if the brokerage account was not a top-level account
(sub-account of Asset or Liability).

This change allows to locate the brokerage account based on its name in
any hierarchical level of the account structure.
FIXED-IN: 5.0.9

M  +3    -0    kmymoney/converter/mymoneystatementreader.cpp

https://commits.kde.org/kmymoney/fc3926479ed186ae2166e6701d267eb0b3f09a07