Bug 350360 - OFX import leaves brokerage account field blank for nested accounts
Summary: OFX import leaves brokerage account field blank for nested accounts
Alias: None
Product: kmymoney
Classification: Unclassified
Component: general (show other bugs)
Version: 4.7.2
Platform: Ubuntu Packages Linux
: NOR minor (vote)
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
Depends on:
Reported: 2015-07-19 01:40 UTC by Jeff Carlson
Modified: 2020-06-05 04:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.0


Note You need to log in before you can comment on or make changes to this bug.
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