Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify WIR PDF-Importer to support new transactions #3552

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,28 @@
PDFBox Version: 1.8.17
Portfolio Performance Version: 0.65.3
-----------------------------------------
Terzo Vorsorgestiftung der WIR Bank
Auberg 1
4002 Basel
E-Mail info@viac.ch
Telefon 0800 80 40 40
www.viac.ch
Vertrag 3.172.491.798
Portfolio 3.172.491.798.01
Herr
Vorname Nachname
Strasse 1
PLZ Ort
Basel, 06.09.2023
Börsenabrechnung - Kauf CSIMF Money Market CHF
Wir haben für Sie folgenden Auftrag ausgeführt:
Order: Kauf
0.001 Anteile CSIMF Money Market CHF
ISIN: CH0031419960
Kurs: CHF 847.52
Betrag CHF 0.44
Verrechneter Betrag: Valuta 06.09.2023 CHF 0.44
S. E. & O.
Freundliche Grüsse
Terzo Vorsorgestiftung
Anzeige ohne Unterschrift
Expand Up @@ -663,12 +663,13 @@ public void testWertpapierKauf08()
hasDate("2023-08-31T00:00"), hasShares(0.025), //
hasSource("Kauf08.txt"), //
hasNote(null), //
hasAmount("CHF", 21.67), hasGrossValue("CHF", 21.67), hasForexGrossValue("EUR", 22.53), //
hasAmount("CHF", 21.67), hasGrossValue("CHF", 21.67), //
hasForexGrossValue("EUR", 22.53), //
hasTaxes("CHF", 0.00), hasFees("CHF", 0.00))));
}

@Test
public void testWertpapierKauf27WithSecurityInCHF()
public void testWertpapierKauf08WithSecurityInCHF()
{
Security security = new Security("CSIF Europe ex CH", "CHF");
security.setIsin("CH0037606552");
Expand Down Expand Up @@ -703,6 +704,37 @@ public void testWertpapierKauf27WithSecurityInCHF()
}))));
}

@Test
public void testWertpapierKauf09()
{
WirBankPDFExtractor extractor = new WirBankPDFExtractor(new Client());

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

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

assertThat(errors, empty());
assertThat(countSecurities(results), is(1L));
assertThat(countBuySell(results), is(1L));
assertThat(countAccountTransactions(results), is(0L));
assertThat(results.size(), is(2));
new AssertImportActions().check(results, "CHF");

// check security
assertThat(results, hasItem(security( //
hasIsin("CH0031419960"), hasWkn(null), hasTicker(null), //
hasName("CSIMF Money Market CHF"), //
hasCurrencyCode("CHF"))));

// check buy sell transaction
assertThat(results, hasItem(purchase( //
hasDate("2023-09-06T00:00"), hasShares(0.001), //
hasSource("Kauf09.txt"), //
hasNote(null), //
hasAmount("CHF", 0.44), hasGrossValue("CHF",0.44), //
hasTaxes("CHF", 0.00), hasFees("CHF", 0.00))));
}

@Test
public void testInterest01()
{
Expand Down