Skip to content

Commit

Permalink
Modify Trade Republic PDF.Importer to support new transaction (#4573)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirus2000 authored Mar 3, 2025
1 parent c0751ee commit 5e7db84
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PDFBox Version: 3.0.3
Portfolio Performance Version: 0.74.1
System: win32 | x86_64 | 21.0.5+11-LTS | Azul Systems, Inc.
-----------------------------------------
TRADE REPUBLIC BANK GMBH, BRANCH FRANCE 29 RUE DU PONT 92200 NEUILLY-SUR-SEINE
OybxE qUybn PAGE 1 de 1
Rue des Fgev 5 DATE 17.02.2025
30248 OBERHOFFEN-LES-fEGtPuRKmtw EXÉCUTION 7d14-148e
PLAN D'ÉPARGNE 78c5-4592
COMPTE-TITRES 0835658302
CONFIRMATION DE L'INVESTISSEMENT PROGRAMMÉ
RÉCAPITULATIF
Exécution de l'investissement programmé le 17/02/2025 sur Lang und Schwarz Exchange.
La contrepartie de cette opération est Lang & Schwarz TradeCenter AG & Co. KG.
POSITION QUANTITÉ COURS MOYEN MONTANT
Berkshire Hathaway (B) 0,216943 460,95 EUR 100,00 EUR
ISIN : US0846707026
TOTAL 100,00 EUR
RÉGLEMENT
COMPTE-ESPÈCES DATE DE VALEUR MONTANT
FR7631233123450083565831148 2025-02-19 -100,00 EUR
Berkshire Hathaway (B) en conservation collective en Allemagne
Ce document est généré automatiquement et n'est donc pas signé.
Si aucune taxe n'est indiquée, il s'agit d'un service non sujet à la taxe sur le chiffre d'affaires (conformément à la réglementation UStG. § 4 n° 8).
Trade Republic Bank GmbH, Branch France www.traderepublic.fr Siège sociale: Trade Republic Bank GmbH Directeurs Généraux
c/o Connel Speirs, 29 Rue du Pont [email protected] Brunnenstrasse 19-21, 10119 Berlin, Allemagne Andreas Torner
92200 Neuilly-sur-Seine TVA DE307510626 Registre du commerce du tribunal local de Gernot Mittendorfer
900 796 855 R.C.S. Nanterre Charlottenburg, HRB 244347 B, Allemagne Christian Hecker
Thomas Pischke
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PDFBox Version: 3.0.3
Portfolio Performance Version: 0.74.1
System: win32 | x86_64 | 21.0.5+11-LTS | Azul Systems, Inc.
-----------------------------------------
TRADE REPUBLIC BANK GMBH, BRANCH FRANCE 29 RUE DU PONT 92200 NEUILLY-SUR-SEINE
jPHcT Zwgke PAGE 1 de 1
Rue des mfxQ 5 DATE 17.02.2025
27902 OBERHOFFEN-LES-okkBkcuAlVZ EXÉCUTION c847-5f66
PLAN D'ÉPARGNE 685f-452d
COMPTE-TITRES 0835658302
CONFIRMATION DE L'INVESTISSEMENT PROGRAMMÉ
RÉCAPITULATIF
Exécution de l'investissement programmé le 17/02/2025 sur Lang und Schwarz Exchange.
La contrepartie de cette opération est Lang & Schwarz TradeCenter AG & Co. KG.
POSITION QUANTITÉ COURS MOYEN MONTANT
Nemetschek 0,487012 123,20 EUR 60,00 EUR
ISIN : DE0006452907
TOTAL 60,00 EUR
RÉGLEMENT
COMPTE-ESPÈCES DATE DE VALEUR MONTANT
FR7631233123450083565831148 2025-02-19 -60,00 EUR
Nemetschek en conservation collective en Allemagne
Ce document est généré automatiquement et n'est donc pas signé.
Si aucune taxe n'est indiquée, il s'agit d'un service non sujet à la taxe sur le chiffre d'affaires (conformément à la réglementation UStG. § 4 n° 8).
Trade Republic Bank GmbH, Branch France www.traderepublic.fr Siège sociale: Trade Republic Bank GmbH Directeurs Généraux
c/o Connel Speirs, 29 Rue du Pont [email protected] Brunnenstrasse 19-21, 10119 Berlin, Allemagne Andreas Torner
92200 Neuilly-sur-Seine TVA DE307510626 Registre du commerce du tribunal local de Gernot Mittendorfer
900 796 855 R.C.S. Nanterre Charlottenburg, HRB 244347 B, Allemagne Christian Hecker
Thomas Pischke
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,68 @@ public void testAchat04()
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
}

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

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

List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Achat05.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("US0846707026"), hasWkn(null), hasTicker(null), //
hasName("Berkshire Hathaway (B)"), //
hasCurrencyCode("EUR"))));

// check buy sell transaction
assertThat(results, hasItem(purchase( //
hasDate("2025-02-17T00:00"), hasShares(0.216943), //
hasSource("Achat05.txt"), //
hasNote("Exécution : 7d14-148e | Plan de D'épargne: 78c5-4592"), //
hasAmount("EUR", 100.00), hasGrossValue("EUR", 100.00), //
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
}

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

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

List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Achat06.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("DE0006452907"), hasWkn(null), hasTicker(null), //
hasName("Nemetschek"), //
hasCurrencyCode("EUR"))));

// check buy sell transaction
assertThat(results, hasItem(purchase( //
hasDate("2025-02-17T00:00"), hasShares(0.487012), //
hasSource("Achat06.txt"), //
hasNote("Exécution : c847-5f66 | Plan de D'épargne: 685f-452d"), //
hasAmount("EUR", 60.00), hasGrossValue("EUR", 60.00), //
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
}

@Test
public void testKontoauszug01()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,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
// PLAN D'ÉPARGNE 78c5-4592
// @formatter:on
section -> section //
.attributes("note") //
.match("^PLAN D..PARGNE (?<note>.*\\-.*)$") //
.assign((t, v) -> t.setNote(concatenate(t.getNote(), trim(v.get("note")), " | Plan de D'épargne: "))),
// @formatter:off
// PIANO D'INVESTIMENTO d9I1-588y
// @formatter:on
section -> section //
Expand Down

0 comments on commit 5e7db84

Please sign in to comment.