From 49d08f6455d5eebc3938378c7fdf363b4666e8c7 Mon Sep 17 00:00:00 2001 From: Alexander Ott <45203494+Nirus2000@users.noreply.github.com> Date: Tue, 24 Dec 2024 06:09:37 +0100 Subject: [PATCH] Modify Baader Bank PDF-Importer to support new transaction (#4417) https://forum.portfolio-performance.info/t/pdf-import-von-baader-bank-scalable-capital-smartbroker-plus/2057/411 --- .../BaaderBankPDFExtractorTest.java | 31 ++++++++++ .../pdf/baaderbank/Dividende24.txt | 59 +++++++++++++++++++ .../pdf/BaaderBankPDFExtractor.java | 10 ++++ 3 files changed, 100 insertions(+) create mode 100644 name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/baaderbank/Dividende24.txt diff --git a/name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/baaderbank/BaaderBankPDFExtractorTest.java b/name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/baaderbank/BaaderBankPDFExtractorTest.java index 96647a12b8..2b57648f78 100644 --- a/name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/baaderbank/BaaderBankPDFExtractorTest.java +++ b/name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/baaderbank/BaaderBankPDFExtractorTest.java @@ -4246,6 +4246,37 @@ public void testDividende23WithSecurityInEUR() })))); } + @Test + public void testDividende24() + { + BaaderBankPDFExtractor extractor = new BaaderBankPDFExtractor(new Client()); + + List errors = new ArrayList<>(); + + List results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Dividende24.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("NL0011683594"), hasWkn("A2JAHJ"), hasTicker(null), // + hasName("VanEck Mstr.DM Dividend.UC.ETF"), // + hasCurrencyCode("EUR")))); + + // check dividends transaction + assertThat(results, hasItem(dividend( // + hasDate("2023-12-13T00:00"), hasShares(12.371), // + hasSource("Dividende24.txt"), // + hasNote("Transaction No.: 01473347"), // + hasAmount("EUR", 2.94), hasGrossValue("EUR", 3.46), // + hasTaxes("EUR", 0.52), hasFees("EUR", 0.00)))); + } + @Test public void testDividendeStorno01() { diff --git a/name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/baaderbank/Dividende24.txt b/name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/baaderbank/Dividende24.txt new file mode 100644 index 0000000000..c83b2436f6 --- /dev/null +++ b/name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/baaderbank/Dividende24.txt @@ -0,0 +1,59 @@ +PDFBox Version: 1.8.17 +Portfolio Performance Version: 0.72.2 +----------------------------------------- +Baader Bank AG Weihenstephaner Straße 4 85716 Unterschleißheim Scalable Capital GmbH +T 00800 00 586336* F +49 89 5150 2442 service@baaderbank.de Seitzstrasse 8e +80538 Munich +service@scalable.capital +Page 1/2 +Mr. Munich +2023-12-14 +vreozuzRr iFD hpMsYV +czWGONTy 230 isFPzGhCs Cgg DHGNTE +0049 Th JFsdSEid Client ID: 9259468 Portfolio: 1 +Sec. Account No.: 0303777450 +THE NETHERLANDS Transaction No.: 01473347 +Reference No.: 600986768 +Fund Distribution +Ex-Date: 2023-12-06 +Quantity ISIN: NL0011683594 WKN: A2JAHJ Distribution +Units 12.371 VanEck Mstr.DM Dividend.UC.ETF EUR 0.28 p. Unit +Payment Period: 2023-01-01 - 2023-12-31 +Payday: 2023-12-13 +Gross Amount EUR 3.46 +Withholding tax EUR 0.52 - +Amount credited to account 9151651669 Value: 2023-12-13 EUR 2.94 +Please ensure your compliance with the German foreign trade reporting regulations to the German Bundesbank (AWV-Meldung). +Please note that the income from capital assets are fully subject to income tax in Germany. +This document has been generated electronically and will not be signed. +Scalable Capital GmbH • Managing Directors: Erik Podzuweit, Florian Prucker, Martin Krebs, Dirk Urmoneit, Dirk Franzmeyer • HRB 217778, District Court +Munich • VAT No. DE300434774 • www.scalable.capital + +Publisher and responsible for the content is Baader Bank Aktiengesellschaft • Weihenstephaner Strasse 4 • 85716 Unterschleissheim • Germany +Management Board: Nico Baader (CEO), Oliver Riedel (Deputy CEO) • Chairman of the Supervisory Board: Helmut Schreyer • Commercial Register HRB +121537 • Principal Office: Unterschleissheim • TaxNo: 143/107/04009 • VAT ID: DE114123893 • LEI: 529900JFOPPEDUR61H13 • T 00800 00 586336* +service@baaderbank.de DCUP-055.048 + +* Toll-free from (inter-) national landline networks. Charges may apply from other networks. + +Fund Distribution +Continued: Page 2/2 +Basis for Tax Calculation: +Assessment Bases Gross Tax Obligation Net Tax Obligation +Distribution equity fund before tax exemption EUR 3.46 EUR 3.46 +Distribution equity fund after partial tax exemption EUR 2.42 EUR 2.42 +Dividend Withholding Tax +Withholding tax 15.00% EUR 0.52 - EUR 0.52 - +Please ensure your compliance with the German foreign trade reporting regulations to the German Bundesbank (AWV-Meldung). +Please note that the income from capital assets are fully subject to income tax in Germany. +Please note that some German tax specific terms are not translated into English. +This document has been generated electronically and will not be signed. +Scalable Capital GmbH • Managing Directors: Erik Podzuweit, Florian Prucker, Martin Krebs, Dirk Urmoneit, Dirk Franzmeyer • HRB 217778, District Court +Munich • VAT No. DE300434774 • www.scalable.capital + +Publisher and responsible for the content is Baader Bank Aktiengesellschaft • Weihenstephaner Strasse 4 • 85716 Unterschleissheim • Germany +Management Board: Nico Baader (CEO), Oliver Riedel (Deputy CEO) • Chairman of the Supervisory Board: Helmut Schreyer • Commercial Register HRB +121537 • Principal Office: Unterschleissheim • TaxNo: 143/107/04009 • VAT ID: DE114123893 • LEI: 529900JFOPPEDUR61H13 • T 00800 00 586336* +service@baaderbank.de DCUP-055.048 + +* Toll-free from (inter-) national landline networks. Charges may apply from other networks. \ No newline at end of file diff --git a/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/pdf/BaaderBankPDFExtractor.java b/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/pdf/BaaderBankPDFExtractor.java index 4ed5e174e2..4f27e8c30a 100644 --- a/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/pdf/BaaderBankPDFExtractor.java +++ b/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/pdf/BaaderBankPDFExtractor.java @@ -1445,6 +1445,16 @@ private > void addTaxesSectionsTransaction(T transactio // @formatter:on .section("withHoldingTax", "currency").optional() // .match("^US withholding tax (?[\\w]{3}) (?[\\.,\\d]+) \\-$") // + .assign((t, v) -> { + if (!type.getCurrentContext().getBoolean("noTax")) + processWithHoldingTaxEntries(t, v, "withHoldingTax", type); + }) + + // @formatter:off + // Withholding tax EUR 0.52 - + // @formatter:on + .section("withHoldingTax", "currency").optional() // + .match("^Withholding tax (?[\\w]{3}) (?[\\.,\\d]+) \\-$") // .assign((t, v) -> { if (!type.getCurrentContext().getBoolean("noTax")) processWithHoldingTaxEntries(t, v, "withHoldingTax", type);