Skip to content

Commit b92d2f5

Browse files
author
Ralf Waldukat
committed
added delayed delivery balance adjustment
1 parent b7ba7a9 commit b92d2f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tw-pnl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def check_tcode(tcode, tsubcode, description):
121121
'Fee', 'Withdrawal', 'Dividend', 'Debit Interest', 'Mark to Market'):
122122
raise ValueError(f'Unknown tsubcode for Money Movement: {tsubcode}')
123123
if tsubcode == 'Balance Adjustment' and description != 'Regulatory fee adjustment' \
124-
and not description.startswith('Fee Correction'):
124+
and not (description.startswith('Fee Correction') or description.startswith('Delayed Delivery_')):
125125
raise ValueError(f'Unknown Balance Adjustment: {description}')
126126
elif tcode == 'Trade':
127127
if tsubcode not in ('Sell to Open', 'Buy to Close', 'Buy to Open', 'Sell to Close', 'Buy', 'Sell'):
@@ -822,6 +822,7 @@ def check(all_wk, output_summary, output_csv, output_excel, tax_output, show, ve
822822
quantity = 1
823823
else:
824824
if tcode == 'Receive Deliver' and tsubcode in ('Forward Split', 'Reverse Split', 'Symbol Change'):
825+
tsubcode in ('Forward Split', 'Reverse Split', 'Symbol Change', 'Stock Merger'):
825826
pass # splits might have further data, not quantity
826827
elif int(quantity) != quantity:
827828
# Hardcode AssetType.Crypto here again:

0 commit comments

Comments
 (0)