Skip to content

Commit

Permalink
Modify WIR PDF-Importer to support new transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirus2000 authored and buchen committed Sep 14, 2023
1 parent 4aee71e commit cbfb24d
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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 [email protected]
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
Original file line number Diff line number Diff line change
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

0 comments on commit cbfb24d

Please sign in to comment.