diff --git a/pytr/event.py b/pytr/event.py index 814007d..d06248f 100644 --- a/pytr/event.py +++ b/pytr/event.py @@ -351,6 +351,8 @@ def from_dict(cls, event_dict: Dict[Any, Any]): event_type = title_event_type_mapping.get(title, None) if event_type is None: event_type = subtitle_event_type_mapping.get(subtitle, None) + if event_type == ConditionalEventType.PRIVATE_MARKETS_ORDER and subtitle == "Vorabpauschale": + event_type = PPEventType.TAXES if event_type is None and uebersicht_dict: for item in uebersicht_dict.get("data", []): ititle = item.get("title") @@ -704,10 +706,7 @@ def _parse_shares_value_fees_taxes_note( taxes = cls._parse_float_from_text_value(taxes_dict.get("detail", {}).get("text", ""), dump_dict) # no logging here because events may or may not have taxes - if ( - eventTypeStr in ["private_markets_order_created", "private_markets_trade_executed"] - or title == "Private Equity" - ): + if event_type == ConditionalEventType.PRIVATE_MARKETS_ORDER: if value is None: shares = 0 else: diff --git a/pytr/transactions.py b/pytr/transactions.py index 371e71f..77d665f 100644 --- a/pytr/transactions.py +++ b/pytr/transactions.py @@ -230,6 +230,11 @@ def from_event(self, event: Event) -> Iterable[dict[str, Any]]: kwargs["value"] = self._decimal_format(-event.value) kwargs["isin"] = None kwargs["shares"] = None + elif event.event_type == PPEventType.TAXES: + if event.isin == "LU3176111881": + kwargs["note"] = "EQT" + elif event.isin == "LU3170240538": + kwargs["note"] = "Apollo" elif event.event_type == PPEventType.SWAP: if event.note == "BlackRock Funding": kwargs["isin2"] = "US09290D1019" diff --git a/tests/private_markets_vorabpauschale.json b/tests/private_markets_vorabpauschale.json new file mode 100644 index 0000000..554fd13 --- /dev/null +++ b/tests/private_markets_vorabpauschale.json @@ -0,0 +1,137 @@ + { + "id": "0319ae86-b98e-388d-9dd6-5a64b5373388", + "timestamp": "2026-03-09T07:56:12.429+0000", + "title": "Private Equity", + "icon": "logos/LU3176111881/v2", + "avatar": { + "asset": "logos/LU3176111881/v2", + "badge": null + }, + "badge": null, + "subtitle": "Vorabpauschale", + "amount": { + "currency": "EUR", + "value": -0.07, + "fractionDigits": 2 + }, + "subAmount": null, + "status": "EXECUTED", + "action": { + "type": "timelineDetail", + "payload": "0319ae86-b98e-388d-9dd6-5a64b5373388" + }, + "cashAccountNumber": "123456789", + "hidden": false, + "deleted": false, + "eventType": "SSP_CORPORATE_ACTION_CASH_NON_DIVIDEND", + "source": "timelineTransaction", + "details": { + "id": "0319ae86-b98e-388d-9dd6-5a64b5373388", + "sections": [ + { + "title": "Du hast 0,07 € bezahlt", + "data": { + "icon": { + "asset": "logos/LU3176111881/v2", + "badge": null + }, + "timestamp": "2026-03-09T07:56:12.429Z", + "status": "executed" + }, + "type": "header" + }, + { + "title": "Übersicht", + "data": [ + { + "title": "Status", + "detail": { + "text": "Ausgeführt", + "functionalStyle": "EXECUTED", + "type": "status" + }, + "style": "plain" + }, + { + "title": "Event", + "detail": { + "text": "Vorabpauschale", + "displayValue": { + "text": "Vorabpauschale" + }, + "type": "text" + }, + "style": "plain" + }, + { + "title": "Wertpapier", + "detail": { + "text": "Private Equity", + "displayValue": { + "text": "Private Equity" + }, + "type": "text" + }, + "style": "plain" + } + ], + "type": "table" + }, + { + "title": "Geschäft", + "data": [ + { + "title": "Bruttoertrag", + "detail": { + "text": "0,00 €", + "displayValue": { + "text": "0,00 €" + }, + "type": "text" + }, + "style": "plain" + }, + { + "title": "Steuer", + "detail": { + "text": "-0,07 €", + "displayValue": { + "text": "-0,07 €" + }, + "type": "text" + }, + "style": "plain" + }, + { + "title": "Gesamt", + "detail": { + "text": "-0,07 €", + "displayValue": { + "text": "-0,07 €" + }, + "type": "text" + }, + "style": "plain" + } + ], + "type": "table" + }, + { + "title": "Dokumente", + "data": [ + { + "title": "Vorabpauschale", + "detail": "09.03.2026", + "action": { + "payload": "", + "type": "browserModal" + }, + "id": "a1f523f2-c944-4617-bfe1-316a77226331", + "postboxType": "CA_VOPA_INVOICE" + } + ], + "type": "documents" + } + ] + } +} diff --git a/tests/test_events.py b/tests/test_events.py index 7f0ad41..2cc2771 100644 --- a/tests/test_events.py +++ b/tests/test_events.py @@ -1273,6 +1273,24 @@ def test_events(): { "filename": "private_markets_verkaufs_order_erstellt.json", }, + { + "filename": "private_markets_vorabpauschale.json", + "event_type": PPEventType.TAXES, + "title": "Private Equity", + "isin": "LU3176111881", + "value": -0.07, + "taxes": -0.07, + "transactions": [ + { + "Datum": "2026-03-09T07:56:12", + "Typ": "Steuern", + "Wert": -0.07, + "Notiz": "EQT", + "ISIN": "LU3176111881", + "Steuern": 0.07, + } + ], + }, { "filename": "reverse_split.json", "event_type": PPEventType.SWAP,