Skip to content

Commit e296a08

Browse files
Nirus2000hporten
authored andcommitted
1 parent c9b463e commit e296a08

File tree

4 files changed

+424
-9
lines changed

4 files changed

+424
-9
lines changed

name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/comdirect/ComdirectPDFExtractorTest.java

Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6417,6 +6417,251 @@ public void testDividende36MitSteuerbehandlungVonDividende36WithSecurityInEUR_So
64176417
hasTaxes("EUR", 2.03), hasFees("EUR", 0.00))));
64186418
}
64196419

6420+
@Test
6421+
public void testDividende37()
6422+
{
6423+
var extractor = new ComdirectPDFExtractor(new Client());
6424+
6425+
List<Exception> errors = new ArrayList<>();
6426+
6427+
var results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Dividende37.txt"), errors);
6428+
6429+
assertThat(errors, empty());
6430+
assertThat(countSecurities(results), is(1L));
6431+
assertThat(countBuySell(results), is(0L));
6432+
assertThat(countAccountTransactions(results), is(1L));
6433+
assertThat(countAccountTransfers(results), is(0L));
6434+
assertThat(countItemsWithFailureMessage(results), is(0L));
6435+
assertThat(results.size(), is(2));
6436+
new AssertImportActions().check(results, "EUR");
6437+
6438+
// check security
6439+
assertThat(results, hasItem(security( //
6440+
hasIsin("US94106L1098"), hasWkn("893579"), hasTicker(null), //
6441+
hasName("W a s t e M a n a g e m e n t I n c . R e g i s t e r e d S h a r e s D L - , 0 1"), //
6442+
hasCurrencyCode("USD"))));
6443+
6444+
// check dividends transaction
6445+
assertThat(results, hasItem(dividend( //
6446+
hasDate("2025-09-30T00:00"), hasShares(4.564), //
6447+
hasSource("Dividende37.txt"), //
6448+
hasNote("Ref.-Nr.: 2SIMFYBBRBI005MQ | Quartalsdividende"), //
6449+
hasAmount("EUR", 3.23), hasGrossValue("EUR", 3.23), //
6450+
hasForexGrossValue("USD", 3.77), //
6451+
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
6452+
}
6453+
6454+
@Test
6455+
public void testDividende37WithSecurityInEUR()
6456+
{
6457+
var security = new Security("W a s t e M a n a g e m e n t I n c . R e g i s t e r e d S h a r e s D L - , 0 1", "EUR");
6458+
security.setIsin("US94106L1098");
6459+
security.setWkn("893579");
6460+
6461+
var client = new Client();
6462+
client.addSecurity(security);
6463+
6464+
var extractor = new ComdirectPDFExtractor(client);
6465+
6466+
List<Exception> errors = new ArrayList<>();
6467+
6468+
var results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Dividende37.txt"), errors);
6469+
6470+
assertThat(errors, empty());
6471+
assertThat(countSecurities(results), is(0L));
6472+
assertThat(countBuySell(results), is(0L));
6473+
assertThat(countAccountTransactions(results), is(1L));
6474+
assertThat(countAccountTransfers(results), is(0L));
6475+
assertThat(countItemsWithFailureMessage(results), is(0L));
6476+
assertThat(results.size(), is(1));
6477+
new AssertImportActions().check(results, "EUR");
6478+
6479+
// check dividends transaction
6480+
assertThat(results, hasItem(dividend( //
6481+
hasDate("2025-09-30T00:00"), hasShares(4.564), //
6482+
hasSource("Dividende37.txt"), //
6483+
hasNote("Ref.-Nr.: 2SIMFYBBRBI005MQ | Quartalsdividende"), //
6484+
hasAmount("EUR", 3.23), hasGrossValue("EUR", 3.23), //
6485+
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
6486+
}
6487+
6488+
@Test
6489+
public void testSteuerbehandlungVonDividende37()
6490+
{
6491+
var extractor = new ComdirectPDFExtractor(new Client());
6492+
6493+
List<Exception> errors = new ArrayList<>();
6494+
6495+
var results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "SteuerbehandlungVonDividende37.txt"),
6496+
errors);
6497+
6498+
assertThat(errors, empty());
6499+
assertThat(countSecurities(results), is(1L));
6500+
assertThat(countBuySell(results), is(0L));
6501+
assertThat(countAccountTransactions(results), is(1L));
6502+
assertThat(countAccountTransfers(results), is(0L));
6503+
assertThat(countItemsWithFailureMessage(results), is(0L));
6504+
assertThat(results.size(), is(2));
6505+
new AssertImportActions().check(results, "EUR");
6506+
6507+
// check security
6508+
assertThat(results, hasItem(security( //
6509+
hasIsin("US94106L1098"), hasWkn("893579"), hasTicker(null), //
6510+
hasName("WASTE MANAGEMENT"), //
6511+
hasCurrencyCode("EUR"))));
6512+
6513+
// check tax refund transaction
6514+
assertThat(results, hasItem(taxes( //
6515+
hasDate("2025-09-30T00:00"), hasShares(4.564), //
6516+
hasSource("SteuerbehandlungVonDividende37.txt"), //
6517+
hasNote(null), //
6518+
hasAmount("EUR", 0.48), hasGrossValue("EUR", 0.48), //
6519+
hasTaxes("EUR", 0.00), hasFees("EUR", 0.00))));
6520+
}
6521+
6522+
@Test
6523+
public void testDividende37MitSteuerbehandlungVonDividende37()
6524+
{
6525+
var extractor = new ComdirectPDFExtractor(new Client());
6526+
6527+
List<Exception> errors = new ArrayList<>();
6528+
6529+
var results = extractor.extract(
6530+
PDFInputFile.loadTestCase(getClass(), "Dividende37.txt", "SteuerbehandlungVonDividende37.txt"),
6531+
errors);
6532+
6533+
assertThat(errors, empty());
6534+
assertThat(countSecurities(results), is(1L));
6535+
assertThat(countBuySell(results), is(0L));
6536+
assertThat(countAccountTransactions(results), is(1L));
6537+
assertThat(countAccountTransfers(results), is(0L));
6538+
assertThat(countItemsWithFailureMessage(results), is(0L));
6539+
assertThat(results.size(), is(2));
6540+
new AssertImportActions().check(results, "EUR");
6541+
6542+
// check security
6543+
assertThat(results, hasItem(security( //
6544+
hasIsin("US94106L1098"), hasWkn("893579"), hasTicker(null), //
6545+
hasName("W a s t e M a n a g e m e n t I n c . R e g i s t e r e d S h a r e s D L - , 0 1"), //
6546+
hasCurrencyCode("USD"))));
6547+
6548+
// check dividends transaction
6549+
assertThat(results, hasItem(dividend( //
6550+
hasDate("2025-09-30T00:00"), hasShares(4.564), //
6551+
hasSource("Dividende37.txt; SteuerbehandlungVonDividende37.txt"), //
6552+
hasNote("Ref.-Nr.: 2SIMFYBBRBI005MQ | Quartalsdividende"), //
6553+
hasAmount("EUR", 2.74), hasGrossValue("EUR", 3.22), //
6554+
hasForexGrossValue("USD", 3.77), //
6555+
hasTaxes("EUR", 0.48), hasFees("EUR", 0.00))));
6556+
}
6557+
6558+
@Test
6559+
public void testDividende37MitSteuerbehandlungVonDividende37WithSecurityInEUR()
6560+
{
6561+
var security = new Security("W a s t e M a n a g e m e n t I n c . R e g i s t e r e d S h a r e s D L - , 0 1", "EUR");
6562+
security.setIsin("US94106L1098");
6563+
security.setWkn("893579");
6564+
6565+
var client = new Client();
6566+
client.addSecurity(security);
6567+
6568+
var extractor = new ComdirectPDFExtractor(client);
6569+
6570+
List<Exception> errors = new ArrayList<>();
6571+
6572+
var results = extractor.extract(
6573+
PDFInputFile.loadTestCase(getClass(), "Dividende37.txt", "SteuerbehandlungVonDividende37.txt"),
6574+
errors);
6575+
6576+
assertThat(errors, empty());
6577+
assertThat(countSecurities(results), is(0L));
6578+
assertThat(countBuySell(results), is(0L));
6579+
assertThat(countAccountTransactions(results), is(1L));
6580+
assertThat(countAccountTransfers(results), is(0L));
6581+
assertThat(countItemsWithFailureMessage(results), is(0L));
6582+
assertThat(results.size(), is(1));
6583+
new AssertImportActions().check(results, "EUR");
6584+
6585+
// check dividends transaction
6586+
assertThat(results, hasItem(dividend( //
6587+
hasDate("2025-09-30T00:00"), hasShares(4.564), //
6588+
hasSource("Dividende37.txt; SteuerbehandlungVonDividende37.txt"), //
6589+
hasNote("Ref.-Nr.: 2SIMFYBBRBI005MQ | Quartalsdividende"), //
6590+
hasAmount("EUR", 2.74), hasGrossValue("EUR", 3.22), //
6591+
hasTaxes("EUR", 0.48), hasFees("EUR", 0.00))));
6592+
}
6593+
6594+
@Test
6595+
public void testDividende37MitSteuerbehandlungVonDividende37_SourceFilesReversed()
6596+
{
6597+
var extractor = new ComdirectPDFExtractor(new Client());
6598+
6599+
List<Exception> errors = new ArrayList<>();
6600+
6601+
var results = extractor.extract(
6602+
PDFInputFile.loadTestCase(getClass(), "SteuerbehandlungVonDividende37.txt", "Dividende37.txt"),
6603+
errors);
6604+
6605+
assertThat(errors, empty());
6606+
assertThat(countSecurities(results), is(1L));
6607+
assertThat(countBuySell(results), is(0L));
6608+
assertThat(countAccountTransactions(results), is(1L));
6609+
assertThat(countAccountTransfers(results), is(0L));
6610+
assertThat(countItemsWithFailureMessage(results), is(0L));
6611+
assertThat(results.size(), is(2));
6612+
new AssertImportActions().check(results, "EUR");
6613+
6614+
// check security
6615+
assertThat(results, hasItem(security( //
6616+
hasIsin("US94106L1098"), hasWkn("893579"), hasTicker(null), //
6617+
hasName("WASTE MANAGEMENT"), //
6618+
hasCurrencyCode("EUR"))));
6619+
6620+
// check dividends transaction
6621+
assertThat(results, hasItem(dividend( //
6622+
hasDate("2025-09-30T00:00"), hasShares(4.564), //
6623+
hasSource("Dividende37.txt; SteuerbehandlungVonDividende37.txt"), //
6624+
hasNote("Ref.-Nr.: 2SIMFYBBRBI005MQ | Quartalsdividende"), //
6625+
hasAmount("EUR", 2.74), hasGrossValue("EUR", 3.22), //
6626+
hasTaxes("EUR", 0.48), hasFees("EUR", 0.00))));
6627+
}
6628+
6629+
@Test
6630+
public void testDividende37MitSteuerbehandlungVonDividende37WithSecurityInEUR_SourceFilesReversed()
6631+
{
6632+
var security = new Security("WASTE MANAGEMENT", "EUR");
6633+
security.setIsin("US94106L1098");
6634+
security.setWkn("893579");
6635+
6636+
var client = new Client();
6637+
client.addSecurity(security);
6638+
6639+
var extractor = new ComdirectPDFExtractor(client);
6640+
6641+
List<Exception> errors = new ArrayList<>();
6642+
6643+
var results = extractor.extract(
6644+
PDFInputFile.loadTestCase(getClass(), "SteuerbehandlungVonDividende37.txt", "Dividende37.txt"),
6645+
errors);
6646+
6647+
assertThat(errors, empty());
6648+
assertThat(countSecurities(results), is(0L));
6649+
assertThat(countBuySell(results), is(0L));
6650+
assertThat(countAccountTransactions(results), is(1L));
6651+
assertThat(countAccountTransfers(results), is(0L));
6652+
assertThat(countItemsWithFailureMessage(results), is(0L));
6653+
assertThat(results.size(), is(1));
6654+
new AssertImportActions().check(results, "EUR");
6655+
6656+
// check dividends transaction
6657+
assertThat(results, hasItem(dividend( //
6658+
hasDate("2025-09-30T00:00"), hasShares(4.564), //
6659+
hasSource("Dividende37.txt; SteuerbehandlungVonDividende37.txt"), //
6660+
hasNote("Ref.-Nr.: 2SIMFYBBRBI005MQ | Quartalsdividende"), //
6661+
hasAmount("EUR", 2.74), hasGrossValue("EUR", 3.22), //
6662+
hasTaxes("EUR", 0.48), hasFees("EUR", 0.00))));
6663+
}
6664+
64206665
@Test
64216666
public void testSteuerbehandlungVonEinloesung01()
64226667
{
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
```
2+
PDFBox Version: 3.0.5
3+
Portfolio Performance Version: 0.80.4
4+
System: win32 | x86_64 | 21.0.5+11-LTS | Azul Systems, Inc.
5+
-----------------------------------------
6+
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7+
25449 Quickborn
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
Depotnr.: 124678906
18+
14567 891 BLZ: 512 345 72
19+
Herrn
20+
Marc Billi
21+
22+
Berliner Allee 20
23+
24+
74198 Stuttgart
25+
26.09.2025
26+
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
27+
Dividendengutschrift
28+
Depotbestand Wertpapier-Bezeichnung WKN/ISIN
29+
per 11.09.2025 W a s t e M a n a g e m e n t I n c . 893579
30+
STK 4,564 R e g i s t e r e d S h a r e s D L - , 0 1 US94106L1098
31+
Emissionsland: VEREINIGTE STAATEN
32+
USD 0,825 Dividende pro Stück für Geschäftsjahr 01.01.25 bis 31.12.25
33+
zahlbar ab 26.09.2025 Quartalsdividende
34+
Abrechnung Dividendengutschrift
35+
Bruttobetrag: USD 3,77
36+
15,000 % Quellensteuer USD 0,57 -
37+
Ausmachender Betrag USD 3,20
38+
zum Devisenkurs: EUR/USD 1,169300 EUR 2,74
39+
Verrechnung über Konto (IBAN) Valuta Zu Ihren Gunsten vor Steuern
40+
DE50 1246 1245 8822 1759 51 EUR 30.09.2025 EUR 2,74
41+
Information zur steuerlichen Behandlung dieses Geschäftsvorganges und den auf
42+
Ihrem Konto gebuchten Endbetrag finden Sie auf der separaten Steuermitteilung
43+
(Referenz-Nr. 2SIMFYBBRBI005MQ).
44+
Ihre comdirect
45+
46+
*Diese Abrechnung wird von der Bank nicht unterschrieben
47+
DD762/11/09
48+
49+
```

0 commit comments

Comments
 (0)