Skip to content

Conversation

@lmb
Copy link
Contributor

@lmb lmb commented Dec 8, 2025

Allow importing multiple accounts from a single XML file by pre-populating Extractor.Item.accountPrimary, portfolioPrimary, etc.

Introduces a heuristic to be able to find reference accounts in different currencies.

See the commit messages for details.

lmb added 2 commits December 8, 2025 20:19
For some reason the IBFlex importer creates a new Client instead
of using the one passed in to the constructor. This leads to it
creating securities that already exist.

Fix this by using the passed in client and adjusting a unit test
which already specifies securities.
Refactor IBFlexStatementExtractorResult to represent the result of
importing a single FlexStatement (i.e., one account) rather than
an entire document.

This prepares for supporting multiple accounts in a single IBFlex
export file.
Use accountId and acctAlias in the XML export to find a matching portfolio.
Use that so set portfolio and account on imported items if possible.
This allows importing multiple IB accounts from a single XML file because
the import wizard will now pre-populate portfolios and accounts.

Allow specifying reference accounts in currencies other than the
base currency by matching the reference account nameagainst the start of
other account names. For example, a reference account named "IB" will match
"IB1", "IB EUR", "IB GBP", etc. deposit accounts.
@lmb lmb force-pushed the ibflex-multi-account branch from 9a593a1 to 18ba029 Compare December 9, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants