Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add argument for varying document archiving account #4

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/uabean/importers/ibkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
wht_account="Expenses:Investments:IB:WithholdingTax",
fees_account="Expenses:IB:Fees",
pnl_account="Income:Investments:IB:{symbol}:PnL",
document_archiving_account="ib",
use_existing_holdings=True,
**kwargs,
):
Expand All @@ -62,6 +63,7 @@ def __init__(
self.wht_account = wht_account
self.fees_account = fees_account
self.bnl_account = pnl_account
self.document_archiving_account = document_archiving_account
self.use_existing_holdings = use_existing_holdings
self.holdings_map = defaultdict(list)
super().__init__(**kwargs)
Expand Down Expand Up @@ -95,7 +97,7 @@ def get_pnl_account(self, symbol):
return self.get_account_name(self.bnl_account, symbol=symbol)

def account(self, filename):
return "ib"
return self.document_archiving_account

def extract(self, filename, existing_entries=None):
if self.use_existing_holdings and existing_entries is not None:
Expand Down
Loading