Skip to content

Commit

Permalink
Add test case to ComDirect PDF-Importer (#4391)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirus2000 authored Dec 8, 2024
1 parent 9221a9b commit 966a1ab
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5344,6 +5344,77 @@ public void testDividende31WithSecurityInEUR()
}))));
}

@Test
public void testDividende32()
{
ComdirectPDFExtractor extractor = new ComdirectPDFExtractor(new Client());

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

List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Dividende32.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("US02079K3059"), hasWkn("A14Y6F"), hasTicker(null), //
hasName("A l p h a b et I n c . R e g . Sh s Cl . A D L -, 0 0 1"), //
hasCurrencyCode("USD"))));

// check dividends transaction
assertThat(results, hasItem(dividend( //
hasDate("2024-06-19T00:00"), hasShares(80.000), //
hasSource("Dividende32.txt"), //
hasNote("Ref.-Nr.: 22IKZEBV1DJ004G8 | Quartalsdividende"), //
hasAmount("EUR", 14.90), hasGrossValue("EUR", 14.90), //
hasForexGrossValue("USD", 16.00), //
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
}

@Test
public void testDividende32WithSecurityInEUR()
{
Security security = new Security("A l p h a b et I n c . R e g . Sh s Cl . A D L -, 0 0 1", CurrencyUnit.EUR);
security.setIsin("US02079K3059");
security.setWkn("A14Y6F");

Client client = new Client();
client.addSecurity(security);

ComdirectPDFExtractor extractor = new ComdirectPDFExtractor(client);

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

List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Dividende32.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);

// check dividends transaction
assertThat(results, hasItem(dividend( //
hasDate("2024-06-19T00:00"), hasShares(80.000), //
hasSource("Dividende32.txt"), //
hasNote("Ref.-Nr.: 22IKZEBV1DJ004G8 | Quartalsdividende"), //
hasAmount("EUR", 14.90), hasGrossValue("EUR", 14.90), //
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00), //
check(tx -> {
CheckCurrenciesAction c = new CheckCurrenciesAction();
Account account = new Account();
account.setCurrencyCode(CurrencyUnit.EUR);
Status s = c.process((AccountTransaction) tx, account);
assertThat(s, is(Status.OK_STATUS));
}))));
}

@Test
public void testSteuerbehandlungVonEinloesung01()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
PDFBox Version: 1.8.17
Portfolio Performance Version: 0.69.1
-----------------------------------------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
25449 Quickborn









Depotnr.: 136442118
83457 431 BLZ: 051 658 95
Herrn

OeRNc kJMRkw hlHGYa



quAQCn iKaCQtEiK 56

05476 fGNmhqeFn
17.06.2024
USt-ID-Nr.: bZ511936771
Rechnungsnummer: 645742171996DD52
G u t s c h ri f t fä ll ig e r W e r t p a p i e r -E r tr ä g e
Dividendengutschrift
Depotbestand Wertpapier-Bezeichnung WKN/ISIN
pe r 07 . 0 6. 20 2 4 A l p h a b et I n c . A1 4 Y6 F
S TK 80 , 0 00 R e g . Sh s Cl . A D L -, 0 0 1 U S 0 20 7 9K 3 0 5 9
Emissionsland: VEREINIGTE STAATEN
USD 0,20 Dividende pro Stück für Geschäftsjahr 01.01.24 bis 31.12.24
zahlbar ab 17.06.2024 Quartalsdividende
Abrechnung Dividendengutschrift
Bruttobetrag: USD 16,00
30,000 % Quellensteuer USD 4,80 -
Ausmachender Betrag USD 11,20
zum Devisenkurs: EUR/USD 1,074100 EUR 10,43
Verrechnung über Konto (IBAN) Valuta Zu Ihren Gunsten vor Steuern
DE92 2004 1133 0552 4095 00 EUR 19.06.2024 EUR 10,43
Information zur steuerlichen Behandlung dieses Geschäftsvorganges und den auf
Ihrem Konto gebuchten Endbetrag finden Sie auf der separaten Steuermitteilung
(Referenz-Nr. 22IKZEBV1DJ004G8).
Ihre comdirect

*Diese Abrechnung wird von der Bank nicht unterschrieben
DD762/11/09

0 comments on commit 966a1ab

Please sign in to comment.