Skip to content

Commit

Permalink
adding inbound and outbound Echtzeitüberweisungen. (#4505)
Browse files Browse the repository at this point in the history
  • Loading branch information
christen90 authored Feb 2, 2025
1 parent 5b9b2a1 commit f4dd14c
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
```
PDFBox Version: 3.0.3 != 1.8.17
Portfolio Performance Version: 0.74.0
System: win32 | x86_64 | 21.0.5+11-LTS | Azul Systems, Inc.
-----------------------------------------
VORNAME NACHNAME DATUM 01 Jan. 2025 - 31 Jan. 2025
Straße 1, 12345 IBAN DE00000000000000000000
Ort, DE BIC TRBKDEBBXXX
KONTOÜBERSICHT
PRODUKT ANFANGSSALDO ZAHLUNGSEINGANG ZAHLUNGSAUSGANG ENDSALDO
Cashkonto 81,76 € 500,00 € 393,51 € 188,25 €
UMSATZÜBERSICHT
DATUM TYP BESCHREIBUNG ZAHLUNGSEINGANG ZAHLUNGSAUSGANG SALDO
23
SEPA
Jan. Incoming transfer from Vorname Nachname 500,00 € 581,76 €
Echtzeitüberweisung
2025
24
Jan. Kartentransaktion Lidl sagt Danke 34,14 € 547,62 €
2025
24
SEPA
Jan. Outgoing transfer for Möbel Heidenreich GmbH 359,37 € 188,25 €
Echtzeitüberweisung
2025
Seite 3 von 4
Erstellt am 01 Feb. 2025
Trade Republic Bank GmbH
HAFTUNGSAUSSCHLUSS
Sehr geehrte Kundin, sehr geehrter Kunde
Bitte überprüfe unbedingt deine Buchungen, Berechnungen und den Schlusssaldo auf dem Kontoauszug, der gleichzeitig deinen Rechnungsabschluss
darstellt. Der Rechnungsabschluss gilt als anerkannt, wenn du innerhalb von sechs Wochen nach Zugang keine Einwendungen erhebst. Einwendungen
gegen Kontoauszüge sind schriftlich an uns zu richten. Guthaben sind einlagefähig im Sinne des Einlagensicherungsgesetzes (EinSiG). Weitere
Informationen entnehme bitte dem Merkblatt für den Einleger, das zusammen mit unseren Allgemeinen Geschäftsbedingungen eingesehen werden kann.
Trade Republic Bank GmbH Kontakt Sitz der Gesellschaft: Berlin
Brunnenstraße 19-21 www.traderepublic.com AG Charlottenburg HRB 244347 B
10119 Berlin service@traderepublic.com Umsatzsteuer-ID DE307510626
Seite 4 von 4
Erstellt am 01 Feb. 2025
Trade Republic Bank GmbH

```
Original file line number Diff line number Diff line change
Expand Up @@ -2472,6 +2472,35 @@ public void testKontoauszug24()
hasSource("Kontoauszug24.txt"), hasNote("Lidl sagt Danke"))));
}

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

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

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

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

// assert transaction
assertThat(results, hasItem(deposit(hasDate("2025-01-23"), hasAmount("EUR", 500.00),
hasSource("Kontoauszug25.txt"), hasNote("Vorname Nachname"))));

// assert transaction
assertThat(results, hasItem(removal(hasDate("2025-01-24"), hasAmount("EUR", 34.14),
hasSource("Kontoauszug25.txt"), hasNote("Lidl sagt Danke"))));

// assert transaction
assertThat(results, hasItem(removal(hasDate("2025-01-24"), hasAmount("EUR", 359.37),
hasSource("Kontoauszug25.txt"), hasNote("Möbel Heidenreich GmbH"))));
}

@Test
public void testReleveDeCompte01()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2281,6 +2281,70 @@ private void addAccountStatementTransaction_Format02()
return null;
}));

Block depositRemovalBlock_Format04 = new Block("^[\\d]{2}[\\s]$");
type.addBlock(depositRemovalBlock_Format04);
depositRemovalBlock_Format04.setMaxSize(5);
depositRemovalBlock_Format04.set(new Transaction<AccountTransaction>()

.subject(() -> {
AccountTransaction accountTransaction = new AccountTransaction();
accountTransaction.setType(AccountTransaction.Type.DEPOSIT);
return accountTransaction;
})

.optionalOneOf( //
// @formatter:off
// 24
// SEPA
// Jan. Outgoing transfer for Möbel Heidenreich GmbH 359,37 € 188,25 €
// Echtzeitüberweisung
// 2025
// @formatter:on
section -> section //
.attributes("day", "month", "year", "note", "amount", "currency") //
.match("^(?<day>[\\d]{2})[\\s]$") //
.match("^SEPA[\\s]$") //
.match("^(?<month>[\\p{L}]{3,4}([\\.]{1})?) Outgoing transfer for " //
+ "(?<note>.*) " //
+ "(?<amount>[\\.,\\d]+) (?<currency>\\p{Sc}) ([\\.,\\d]+) (\\p{Sc})$") //
.match("^Echtzeit.berweisung$") //
.match("^(?<year>[\\d]{4})$") //
.assign((t, v) -> {
t.setType(AccountTransaction.Type.REMOVAL);
t.setDateTime(asDate(v.get("day") + " " + v.get("month") + " " + v.get("year")));
t.setAmount(asAmount(v.get("amount")));
t.setCurrencyCode(asCurrencyCode(v.get("currency")));
t.setNote(trim(v.get("note")));
}),
// @formatter:off
// 23
// SEPA
// Jan. Incoming transfer from Vorname Nachname 500,00 € 581,76 €
// Echtzeitüberweisung
// 2025
// @formatter:on
section -> section //
.attributes("day", "month", "year", "note", "amount", "currency") //
.match("^(?<day>[\\d]{2})[\\s]$") //
.match("^SEPA[\\s]$") //
.match("^(?<month>[\\p{L}]{3,4}([\\.]{1})?) " //
+ "(Incoming transfer from)" //
+ "(?<note>.*) " //
+ "(?<amount>[\\.,\\d]+) (?<currency>\\p{Sc}) [\\.,\\d]+ \\p{Sc}$") //
.match("^(?<year>[\\d]{4})$") //
.assign((t, v) -> {
t.setDateTime(asDate(v.get("day") + " " + v.get("month") + " " + v.get("year")));
t.setAmount(asAmount(v.get("amount")));
t.setCurrencyCode(asCurrencyCode(v.get("currency")));
t.setNote(trim(v.get("note")));
}))

.wrap(t -> {
if (t.getCurrencyCode() != null && t.getAmount() != 0)
return new TransactionItem(t);
return null;
}));

// @formatter:off
// 03 Apr.
// 2024 Gebühren Trade Republic Card 5,00 € 49.997,41 €
Expand Down

0 comments on commit f4dd14c

Please sign in to comment.