Skip to content

Commit b084604

Browse files
committed
Modify Modena Estonia PDF-Importer to support new transaction
https://forum.portfolio-performance.info/t/pdf-import-von-modena-estonia-ou/32378/12
1 parent ea860fd commit b084604

3 files changed

Lines changed: 53 additions & 3 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
PDFBox Version: 3.0.3
2+
Portfolio Performance Version: 0.76.3
3+
System: win32 | x86_64 | 21.0.5+11-LTS | Azul Systems, Inc.
4+
-----------------------------------------
5+
Income statement
6+
For the period of 2025-04-30 - 2025-05-31 GMT
7+
GuhOgWQh EZwEBgO
8+
Income summary
9+
Amount
10+
Total Vault Net Income €17.03
11+
Total Bond Net Income €0.00
12+
Total €17.03
13+
Vault Income
14+
Date Source Amount
15+
2025-05-01 08:00:10 Vault accrued revenue €0.61
16+
Bond Interest Income
17+
3
18+
Income statement
19+
For the period of 2025-04-30 - 2025-05-31 GMT
20+
GuhOgWQh EZwEBgO
21+
Date Source Amount
22+
There is no income for the selected period
23+
4

name.abuchen.portfolio.tests/src/name/abuchen/portfolio/datatransfer/pdf/modenaestonia/ModenaEstoniaPDFExtractorTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,25 @@ public void testKontoauszug02()
8585
assertThat(results, hasItem(interestCharge(hasDate("2025-04-17T07:00:16"), hasAmount("EUR", 0.63), //
8686
hasSource("Kontoauszug02.txt"), hasNote("Debt claims buyback"))));
8787
}
88+
89+
@Test
90+
public void testKontoauszug03()
91+
{
92+
var extractor = new ModenaEstoniaPDFExtractor(new Client());
93+
94+
List<Exception> errors = new ArrayList<>();
95+
96+
var results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "Kontoauszug03.txt"), errors);
97+
98+
assertThat(errors, empty());
99+
assertThat(countSecurities(results), is(0L));
100+
assertThat(countBuySell(results), is(0L));
101+
assertThat(countAccountTransactions(results), is(1L));
102+
assertThat(results.size(), is(1));
103+
new AssertImportActions().check(results, "EUR");
104+
105+
// assert transaction
106+
assertThat(results, hasItem(deposit(hasDate("2025-05-01T08:00:10"), hasAmount("EUR", 0.61), //
107+
hasSource("Kontoauszug03.txt"), hasNote("Vault accrued revenue"))));
108+
}
88109
}

name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/pdf/ModenaEstoniaPDFExtractor.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,23 @@ private void addAccountStatementTransaction()
5252

5353
.optionalOneOf( //
5454
// @formatter:off
55-
// 2025-03-13 21:39:01 Vault revenue share €12.56
5655
// 2025-03-14 07:00:00 Vault signup bonus €1.42
5756
// 2025-03-21 21:59:09 Vault campaign bonus €50.00
57+
// 2025-05-01 08:00:10 Vault accrued revenue €0.61
5858
// @formatter:on
5959
section -> section //
6060
.attributes("type") //
6161
.match("^[\\d]{4}\\-[\\d]{2}\\-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2} " //
6262
+ "(?<type>(Vault signup bonus" //
63-
+ "|Vault campaign bonus)" //
63+
+ "|Vault campaign bonus" //
64+
+ "|Vault accrued revenue)" //
6465
+ ").*$") //
6566
.assign((t, v) -> {
6667
if ("Vault signup bonus".equals(v.get("type")) //
67-
|| "Vault campaign bonus".equals(v.get("type")))
68+
|| "Vault campaign bonus"
69+
.equals(v.get("type"))
70+
|| "Vault accrued revenue"
71+
.equals(v.get("type")))
6872
t.setType(AccountTransaction.Type.DEPOSIT);
6973
}),
7074
// @formatter:off
@@ -84,12 +88,14 @@ private void addAccountStatementTransaction()
8488
// 2025-03-14 07:00:00 Vault signup bonus €1.42
8589
// 2025-03-21 21:59:09 Vault campaign bonus €50.00
8690
// 2025-04-17 07:00:16 Debt claims buyback €-0.63
91+
// 2025-05-01 08:00:10 Vault accrued revenue €0.61
8792
// @formatter:on
8893
.section("date", "time", "note", "currency", "amount") //
8994
.match("^(?<date>[\\d]{4}\\-[\\d]{2}\\-[\\d]{2}) (?<time>[\\d]{2}:[\\d]{2}:[\\d]{2}) " //
9095
+ "(?<note>(Vault revenue share" //
9196
+ "|Vault signup bonus" //
9297
+ "|Vault campaign bonus" //
98+
+ "|Vault accrued revenue" //
9399
+ "|Debt claims buyback)" //
94100
+ ") " //
95101
+ "(?<currency>\\p{Sc})(\\-)?(?<amount>[\\.,\\d]+)$") //

0 commit comments

Comments
 (0)