Skip to content

Commit

Permalink
add trading212 adjustment support (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmartinv authored Dec 24, 2024
1 parent 5ad2d52 commit 3f19a29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cgt_calc/parsers/trading212.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def action_from_str(label: str, filename: str) -> ActionType:
if label == "Stock Split":
return ActionType.STOCK_SPLIT

if label in ["Result adjustment"]:
return ActionType.ADJUSTMENT

raise ParsingError(filename, f"Unknown action: {label}")


Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/trading212_2024/transactions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Action,Time,ISIN,Ticker,Name,No. of shares,Price / share,Currency (Price / share
Deposit,2024-01-01 00:15:20.149,,,,,,,,,,3000.00,"GBP",,,,"Transaction ID: xxxxxxxxxxxx05",xxxxxxxxxxxx05,,,
Market buy,2024-01-01 16:10:05.175,US00000003,FOO,"Foo Company",24.0000000000,124.01,USD,1.25229,,"GBP",2381.35,"GBP",,,,,EOF999999099,4.71,"GBP",
Interest on cash,2024-01-01 11:05:03.126,,,,,,,,,,0.04,"GBP",,,,"Interest on cash",ffffffff-ffff-ffff-ffff-ffffffffffff,,,
Deposit,2024-01-03 10:00:00.100,,,,,,,,,,0.75,"GBP",,,,"Withholding tax refund - interest on cash Q4 2023.",ffffffff-ffff-ffff-ffff-ffffffffff7f,,,
Result adjustment,2024-01-04 13:12:49.174,,,,,,,,,,0.75,"GBP",,,,"Withholding tax refund - interest on cash Q4 2023.",090f8f76-e24f-4507-b6c9-adc02a969b7f,,,
Dividend (Dividend),2024-03-23 18:35:26,US00000003,FOO,"Foo Company",24.0000000000,0.03,USD,Not available,,,0.11,"GBP",0.02,USD,,,,,,
Limit sell,2024-04-29 13:20:03.075,US00000003,FOO,"Foo Company",24.0000000000,164.01,USD,1.25229,-75.67,"GBP",3138.50,"GBP",,,,,EOF999999099,4.71,"GBP",
Withdrawal,2024-05-26 16:18:16.235,,,,,,,,,,-2000.00,"GBP",,,,"Sent to Bank Account 99-99-99 / 9999999",ffffffff-ffff-ffff-ffff-ffffffffff99,,,

0 comments on commit 3f19a29

Please sign in to comment.