Skip to content

Commit

Permalink
Modify JustTrade PDF-Importer to support new transaction
Browse files Browse the repository at this point in the history
https://forum.portfolio-performance.info/t/pdf-import-von-justtrade/10853/45

Update regulare expressions
Format source to standard eclipse format
  • Loading branch information
Nirus2000 committed Jan 16, 2024
1 parent ef62d3a commit 09cca0e
Show file tree
Hide file tree
Showing 3 changed files with 928 additions and 808 deletions.
@@ -1,14 +1,5 @@
package name.abuchen.portfolio.datatransfer.pdf.justtrade;

import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countAccountTransactions;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countBuySell;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countSecurities;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsEmptyCollection.empty;
import static org.junit.Assert.assertNull;

import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasAmount;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasCurrencyCode;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.hasDate;
Expand All @@ -27,6 +18,15 @@
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.purchase;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.sale;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.security;
import static name.abuchen.portfolio.datatransfer.ExtractorMatchers.taxes;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countAccountTransactions;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countBuySell;
import static name.abuchen.portfolio.datatransfer.ExtractorTestUtilities.countSecurities;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsEmptyCollection.empty;
import static org.junit.Assert.assertNull;

import java.io.IOException;
import java.time.LocalDateTime;
Expand Down Expand Up @@ -793,6 +793,37 @@ public void testDividende05()
is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(0.00))));
}

@Test
public void testVorabpauschale01()
{
JustTradePDFExtractor extractor = new JustTradePDFExtractor(new Client());

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

List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Vorabpauschale01.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("IE00B4L5Y983"), hasWkn(null), hasTicker(null), //
hasName("iShares MSCI World (Acc)"), //
hasCurrencyCode("EUR"))));

// check dividends transaction
assertThat(results, hasItem(taxes( //
hasDate("2024-01-02T00:00"), hasShares(150), //
hasSource("Vorabpauschale01.txt"), //
hasNote(null), //
hasAmount("EUR", 34.25), hasGrossValue("EUR", 34.25), //
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
}

@Test
public void testDepotauszug01()
{
Expand Down
@@ -0,0 +1,36 @@
PDFBox Version: 1.8.17
Portfolio Performance Version: 0.67.1
-----------------------------------------
justTRADE
Ein Service der Sutor Bank GmbH
JT Technologies GmbH
Herr Hamburger Allee 14
Mein Name 60486 Frankfurt am Main
MeineStraße 1 E-Mail: service@justtrade.com
01234 Mein Ort Web: www.justtrade.com
13 Januar 2024
Abrechnung Vorabpauschale für Mein Name
Kalenderjahr 2023
Depotnummer 123456789
Aufgrund nachstehender Abrechnung buchen wir zu Ihren Lasten €34,25
Tag des Zuflusses 02 Januar 2024
Name iShares MSCI World (Acc)
ISIN IE00B4L5Y983
Monat Anzahl Stücke Vorabpauschale in EUR Vorabpauschale in EUR
Bemessungsgrundlage* gemäß §18 InvStg pro gesamt
Stück
Jahresnettobestand 150,0000 1,24 185,55
*Die Anzahl Stücke Jahresnettobestand reflektiert den Jahresanfangsbestand abzüglich unterjähriger
Veräußerungen. Die Anzahl Stücke Januar bis Dezember reflektiert den unterjährigen Kaufüberhang an
Fondsanteilen gemäß FiFo-Staffel.
Vorabpauschale €185,55
Teilfreistellung (30,00%) ./. €-55,67
Zu versteuernder Betrag nach Teilfreistellung €129,88
Kapitalertragssteuer (25,00%) ./. €32,47
Solidaritätszuschlag (5,50%) ./. €1,78
1 von 1
SUTOR BANK GmbH TELEFON 040-8090685-0 GESCHÄFTSFÜHRUNG FINANZAMT HAMBURG AMTSGERICHT HAMBURG
HERMANNSTRASSE 46 TELEFAX 040-8090685-810 ROBERT FREITAG STNR: 222721000896 HRB 178357
20095 HAMBURG THOMAS MEIER UST-IDNR: DE155617009
POSTFACH 11 33 37 INFO@SUTORBANK.DE BANKLEITZAHL 202 308 00
20433 HAMBURG WWW.SUTORBANK.DE BIC CODE: MHSBDEHBXXX

0 comments on commit 09cca0e

Please sign in to comment.