Skip to content

Commit

Permalink
Modify Trade Republic PDF-Importer to support new transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirus2000 authored and buchen committed Oct 11, 2023
1 parent a45201f commit 7342d13
Show file tree
Hide file tree
Showing 4 changed files with 276 additions and 190 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
PDFBox Version: 1.8.17
Portfolio Performance Version: 0.65.4
-----------------------------------------
TRADE REPUBLIC BANK GMBH KÖPENICKER STRASSE 40C 10179 BERLIN
qbqIykNK XAAxHm TrfTJ PEraGMV PAGINA 1 dal 1
lUW vvIB wxdGLPM 529 DATA 17.07.2023
00009 AlgChRhBR CONTO TITOLI 1810039672
DISTRIBUZIONE
PANORAMICA
Distribuzione con l'ex-tag 17.08.2023.
POSIZIONE QUANTITÀ REDDITO IMPORTO
iSh.ST.Gl.Sel.Div.100 U.ETF DE 23,632607 Pz. 0,704284 EUR 16,64 EUR
Inhaber-Anteile
ISIN: DE001A0F8UH1
TOTALE 16,64 EUR
PRENOTAZIONE
CONTO DI TRANSITO DATA VALUTA IMPORTO
DE09762409007071864502 17.07.2023 16,64 EUR
iSh.ST.Gl.Sel.Div.100 U.ETF DE Inhaber-Anteile in giro collection storage 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
Köpenicker Straße 40c [email protected] AG Charlottenburg HRB 244347 B Andreas Torner
10179 Berlin PARTITA IVA DE307510626 Gernot Mittendorfer
ABRE / 18.07.2023 / 68741871 / d39b-5ebf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
PDFBox Version: 1.8.17
Portfolio Performance Version: 0.65.4
-----------------------------------------
TRADE REPUBLIC BANK GMBH KÖPENICKER STRASSE 40C 10179 BERLIN
Tomas Vančo PAGE 1 from 1
A. JiTLqb 34 DATE 02.10.2023
690 48 KRfwumSc CASH ACCOUNT 9569919482
TAX ID 2669622448
INTEREST INVOICE
as of 30.09.2023
OVERVIEW
ASSET INCOME TYPE INTEREST RATE TOTAL
Cash Interest 2,00% 1,47 EUR
BOOKING
IBAN BOOKING DATE TOTAL
DE27502109007011534672 02.10.2023 1,47 EUR
Trade Republic Bank GmbH www.traderepublic.com Headquarters: Berlin Directors
Köpenicker Straße 40c [email protected] AG Charlottenburg HRB 244347 B Andreas Torner
10179 Berlin VAT-ID DE307510626 Gernot Mittendorfer
Original file line number Diff line number Diff line change
Expand Up @@ -2759,12 +2759,13 @@ public void testDividendo01()
hasName("Enbridge Inc. Registered Shares o.N."), //
hasCurrencyCode("CAD"))));

// check dividende transaction
// check dividends transaction
assertThat(results, hasItem(dividend( //
hasDate("2023-06-01T00:00"), hasShares(20.971565), //
hasSource("Dividendo01.txt"), //
hasNote(null), //
hasAmount("EUR", 9.56), hasGrossValue("EUR", 12.74), hasForexGrossValue("CAD", 18.61), //
hasAmount("EUR", 9.56), hasGrossValue("EUR", 12.74), //
hasForexGrossValue("CAD", 18.61), //
hasTaxes("EUR", (4.65 / 1.46055)), hasFees("EUR", 0.00))));
}

Expand Down Expand Up @@ -2806,6 +2807,37 @@ public void testDividendo01WithSecurityInEUR()
}))));
}

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

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

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

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

// check security
assertThat(results, hasItem(security( //
hasIsin("DE001A0F8UH1"), hasWkn(null), hasTicker(null), //
hasName("iSh.ST.Gl.Sel.Div.100 U.ETF DE Inhaber-Anteile"), //
hasCurrencyCode("EUR"))));

// check dividends transaction
assertThat(results, hasItem(dividend( //
hasDate("2023-07-17T00:00"), hasShares(23.632607), //
hasSource("Dividendo02.txt"), //
hasNote(null), //
hasAmount("EUR", 16.64), hasGrossValue("EUR", 16.64), //
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
}

@Test
public void testKaptialreduktion01()
{
Expand Down Expand Up @@ -3720,4 +3752,26 @@ public void testRescontoInteressiMaturati01()
assertThat(results, hasItem(interest(hasDate("2023-05-31"), hasAmount("EUR", 0.12), //
hasSource("RescontoInteressiMaturati01.txt"), hasNote(null))));
}

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

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

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

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

// assert transaction
assertThat(results, hasItem(interest(hasDate("2023-09-30"), hasAmount("EUR", 1.47), //
hasSource("InterestInvoice01.txt"), hasNote(null))));
}
}
Loading

0 comments on commit 7342d13

Please sign in to comment.