Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pytr/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions pytr/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
137 changes: 137 additions & 0 deletions tests/private_markets_vorabpauschale.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
18 changes: 18 additions & 0 deletions tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down