Skip to content

Commit

Permalink
Interactive Brokers statement import: improvement for bond principal …
Browse files Browse the repository at this point in the history
…import
  • Loading branch information
titov-vv committed Apr 9, 2024
1 parent 33a8165 commit 0218cbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions jal/data_import/broker_statements/ibkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ def load_assets(self, assets):
asset['expiry'] = asset['maturity']
if asset['expiry'] == 0:
asset.pop('expiry')
if asset['principal']:
asset['principal'] = int(asset['principal']) * IBKR_Asset.BondPrincipal
if asset['type'] == FOF.ASSET_BOND:
asset['principal'] = int(asset['principal']) * IBKR_Asset.BondPrincipal if asset['principal'] else IBKR_Asset.BondPrincipal
asset.pop('maturity')
asset.pop('exchange')
self.asset_id(asset)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/ibkr_corp_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"assets_data": [
{"id": 1, "asset": 2, "reg_number": "90187E501"},
{"id": 2, "asset": 3, "reg_number": "90187E402"},
{"id": 3, "asset": 4, "expiry": 1706140800, "reg_number": "912796ZY8"}
{"id": 3, "asset": 4, "principal": 1000, "expiry": 1706140800, "reg_number": "912796ZY8"}
],
"asset_payments": [],
"corporate_actions": [
Expand Down

0 comments on commit 0218cbf

Please sign in to comment.