Skip to content

Commit

Permalink
Modify Trade Republic PDF-Importer to support new transaction (#4440)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirus2000 authored Jan 2, 2025
1 parent 4e7e746 commit 5e49a73
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
PDFBox Version: 1.8.17
Portfolio Performance Version: 0.73.0
System: win32 | x86_64 | 21.0.5+11-LTS | Azul Systems, Inc.
-----------------------------------------
TRADE REPUBLIC BANK GMBH BRUNNENSTRASSE 19-21 10119 BERLIN
Matteo Ballan PAGINA 1 dal 1
cpu UTDijb 64 DATA 16.12.2024
34648 rSisfHJVRxqI dzvqiw ESECUZIONE b61b-9U71
PIANO D'INVESTIMENTO d9I1-588y
CONTO TITOLI 2673008477
PIANO D'INVESTIMENTO PER IL REGOLAMENTO DEI TITOLI
PANORAMICA
Esecuzione del piano d'accumulo il 16.12.2024 su Lang und Schwarz Exchange.
La controparte della transazione è Lang & Schwarz TradeCenter AG & Co. KG.
POSIZIONE QUANTITÀ PREZZO MEDIO IMPORTO
Factor MSCI USA Quality ESG EUR Hedged (Acc) 6,236285 Pz. 43,295 EUR 270,00 EUR
ISIN: IE00BWT3KN65
TOTALE 270,00 EUR
PRENOTAZIONE
CONTO DI TRANSITO DATA VALUTA IMPORTO
DE72502109007015593118 2024-12-18 -270,00 EUR
Factor MSCI USA Quality ESG EUR Hedged (Acc) in custodia collettiva in Germania
Questo regolamento viene creato automaticamente e quindi non è firmato.
Se non viene mostrata l'IVA, si tratta di un servizio esente da imposte sulle vendite in conformità con la regolamentazione UStG § 4 n. 8.
Trade Republic Bank GmbH www.traderepublic.com Sede centrale: Berlin Direttore Generale
Brunnenstraße 19-21 [email protected] AG Charlottenburg HRB 244347 B Andreas Torner
10119 Berlin PARTITA IVA DE307510626 Gernot Mittendorfer
Christian Hecker
Thomas Pischke
epDa / 89L0-2W2F
Original file line number Diff line number Diff line change
Expand Up @@ -7686,6 +7686,37 @@ public void testSparplan11()
hasTaxes("EUR", 0.08), hasFees("EUR", 0.00))));
}

@Test
public void testPianoDinvestimento01()
{
TradeRepublicPDFExtractor extractor = new TradeRepublicPDFExtractor(new Client());

List<Exception> errors = new ArrayList<>();

List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "PianoDinvestimento01.txt"), errors);

assertThat(errors, empty());
assertThat(countSecurities(results), is(1L));
assertThat(countBuySell(results), is(1L));
assertThat(countAccountTransactions(results), is(0L));
assertThat(results.size(), is(2));
new AssertImportActions().check(results, CurrencyUnit.EUR);

// check security
assertThat(results, hasItem(security( //
hasIsin("IE00BWT3KN65"), hasWkn(null), hasTicker(null), //
hasName("Factor MSCI USA Quality ESG EUR Hedged (Acc)"), //
hasCurrencyCode("EUR"))));

// check buy sell transaction
assertThat(results, hasItem(purchase( //
hasDate("2024-12-16T00:00"), hasShares(6.236285), //
hasSource("PianoDinvestimento01.txt"), //
hasNote("Esecuzione: b61b-9U71 | Piano D'Investimenton: d9I1-588y"), //
hasAmount("EUR", 270.00), hasGrossValue("EUR", 270.00), //
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
}

@Test
public void testPlanDeInvestion01()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private void addBuySellTransaction()
{
DocumentType type = new DocumentType("(WERTPAPIERABRECHNUNG" //
+ "|WERTPAPIERABRECHNUNG SPARPLAN" //
+ "|PIANO D.INVESTIMENTO" //
+ "|WERTPAPIERABRECHNUNG ROUND UP" //
+ "|WERTPAPIERABRECHNUNG SAVEBACK" //
+ "|SECURITIES SETTLEMENT SAVINGS PLAN" //
Expand Down Expand Up @@ -327,6 +328,13 @@ private void addBuySellTransaction()
.match("^Ex.cution de l.investissement programm. .* (?<date>[\\d]{2}\\/[\\d]{2}\\/[\\d]{4}) .*$") //
.assign((t, v) -> t.setDate(asDate(v.get("date")))),
// @formatter:off
// Esecuzione del piano d'accumulo il 16.12.2024 su Lang und Schwarz Exchange.
// @formatter:on
section -> section //
.attributes("date") //
.match("^Esecuzione del piano d.accumulo il (?<date>[\\d]{2}\\.[\\d]{2}\\.[\\d]{4}) .*$") //
.assign((t, v) -> t.setDate(asDate(v.get("date")))),
// @formatter:off
// Sparplanausführung am 18.11.2019 an der Lang & Schwarz Exchange.
// Savings plan execution on 16.05.2023 on the Lang & Schwarz Exchange.
// Saveback execution on 02.05.2024 on the Lang & Schwarz Exchange.
Expand Down Expand Up @@ -595,7 +603,14 @@ private void addBuySellTransaction()
section -> section //
.attributes("note") //
.match("^.*ORDINE (?<note>.*\\-.*)$") //
.assign((t, v) -> t.setNote("Ordine: " + trim(v.get("note")))))
.assign((t, v) -> t.setNote("Ordine: " + trim(v.get("note")))),
// @formatter:off
// 34648 rSisfHJVRxqI dzvqiw ESECUZIONE b61b-9U71
// @formatter:on
section -> section //
.attributes("note") //
.match("^.*ESECUZIONE (?<note>.*\\-.*)$") //
.assign((t, v) -> t.setNote("Esecuzione: " + trim(v.get("note")))))

.optionalOneOf( //
// @formatter:off
Expand Down Expand Up @@ -627,6 +642,13 @@ private void addBuySellTransaction()
.match("^PLAN DE INVERSIÓN (?<note>.*\\-.*)$") //
.assign((t, v) -> t.setNote(concatenate(t.getNote(), trim(v.get("note")), " | Plan de Invesión: "))),
// @formatter:off
// PIANO D'INVESTIMENTO d9I1-588y
// @formatter:on
section -> section //
.attributes("note") //
.match("^PIANO D.INVESTIMENTO (?<note>.*\\-.*)$") //
.assign((t, v) -> t.setNote(concatenate(t.getNote(), trim(v.get("note")), " | Piano D'Investimenton: "))),
// @formatter:off
// ROUND UP 42c2-50a7
// @formatter:on
section -> section //
Expand Down Expand Up @@ -3533,6 +3555,13 @@ private void addBuySellTaxReturnBlock(DocumentType type)
.match("^Ex.cution de l.investissement programm. .* (?<date>[\\d]{2}\\/[\\d]{2}\\/[\\d]{4}) .*$") //
.assign((t, v) -> t.setDateTime(asDate(v.get("date")))),
// @formatter:off
// Esecuzione del piano d'accumulo il 16.12.2024 su Lang und Schwarz Exchange.
// @formatter:on
section -> section //
.attributes("date") //
.match("^Esecuzione del piano d.accumulo il (?<date>[\\d]{2}\\.[\\d]{2}\\.[\\d]{4}) .*$") //
.assign((t, v) -> t.setDateTime(asDate(v.get("date")))),
// @formatter:off
// Sparplanausführung am 18.11.2019 an der Lang & Schwarz Exchange.
// Savings plan execution on 16.05.2023 on the Lang & Schwarz Exchange.
// Saveback execution on 02.05.2024 on the Lang & Schwarz Exchange.
Expand Down

0 comments on commit 5e49a73

Please sign in to comment.