Skip to content

Commit

Permalink
Add argument for varying document archiving account (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonchan51 authored Jul 13, 2024
1 parent a462838 commit 43bddbd
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 43bddbd

Please sign in to comment.