Skip to content

Commit f89ca7e

Browse files
authored
Improve BLKB PDF-Importer (#5743)
- Fix DocumentType declaration to use final var - Replace literal umlauts (ü) with . in regex patterns to handle PDF-to-text encoding variations
1 parent be8cd43 commit f89ca7e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ public String getLabel()
3939

4040
private void addBuySellTransaction()
4141
{
42-
DocumentType type = new DocumentType("B.rsenabrechnung \\-( Zeichnung| R.cknahme)? (Kauf|Verkauf)");
42+
final var type = new DocumentType("B.rsenabrechnung \\-( Zeichnung| R.cknahme)? (Kauf|Verkauf)");
4343
this.addDocumentTyp(type);
4444

45-
Transaction<BuySellEntry> pdfTransaction = new Transaction<>();
45+
var pdfTransaction = new Transaction<BuySellEntry>();
4646

47-
Block firstRelevantLine = new Block("^Auftragsnummer.*$");
47+
var firstRelevantLine = new Block("^Auftragsnummer.*$");
4848
type.addBlock(firstRelevantLine);
4949
firstRelevantLine.set(pdfTransaction);
5050

@@ -70,7 +70,7 @@ private void addBuySellTransaction()
7070
// Total Kurswert CHF -105.51
7171
// @formatter:on
7272
.section("name", "nameContinued", "wkn", "isin", "currency") //
73-
.find("Wir haben für Sie am .*") //
73+
.find("Wir haben f.r Sie am .*") //
7474
.match("^[\\.'\\d]+ .*$") //
7575
.match("^(?<name>.*)$") //
7676
.match("^(?<nameContinued>.*)$") //
@@ -95,7 +95,7 @@ private void addBuySellTransaction()
9595
// Wir haben für Sie am 11.01.2024 gezeichnet.
9696
// @formatter:on
9797
.section("date") //
98-
.match("^Wir haben für Sie am (?<date>[\\d]{2}\\.[\\d]{2}\\.[\\d]{4}).*$") //
98+
.match("^Wir haben f.r Sie am (?<date>[\\d]{2}\\.[\\d]{2}\\.[\\d]{4}).*$") //
9999
.assign((t, v) -> t.setDate(asDate(v.get("date"))))
100100

101101
// @formatter:off

0 commit comments

Comments
 (0)