use of name.abuchen.portfolio.datatransfer.pdf.PDFParser.Transaction in project portfolio by buchen.
the class UnicreditPDFExtractor method addBuyTransaction.
@SuppressWarnings("nls")
private void addBuyTransaction() {
DocumentType type = new DocumentType("UniCredit");
this.addDocumentTyp(type);
Block block = new Block("W e r t p a p i e r - A b r e c h n u n g K a u f .*");
type.addBlock(block);
block.set(new Transaction<BuySellEntry>().subject(() -> {
BuySellEntry entry = new BuySellEntry();
entry.setType(PortfolioTransaction.Type.BUY);
return entry;
}).section("name", "wkn", "isin").find("Nennbetrag Wertpapierbezeichnung Wertpapierkennnummer/ISIN").match("^(?<name>.*) (?<wkn>[^ ]*)$").match("^.* (?<isin>[A-Z]{2}[A-Z\\d]{9}\\d)$").assign((t, v) -> t.setSecurity(getOrCreateSecurity(v))).section("shares").match("^ST *(?<shares>[\\.\\d]+[,\\d]*)$").assign((t, v) -> t.setShares(asShares(v.get("shares")))).section("amount", "currency").match("^Belastung.* (?<currency>\\w{3}) (?<amount>[\\d.]+,\\d{2})$").assign((t, v) -> {
t.setCurrencyCode(asCurrencyCode(v.get("currency")));
t.setAmount(asAmount(v.get("amount")));
}).section("date").match("^Valuta (?<date>\\d+\\.\\d+\\.\\d{4}) .*").assign((t, v) -> t.setDate(asDate(v.get("date")))).section("fee", "currency").optional().match("^Brokerkommission.* (?<currency>\\w{3}) (?<fee>[\\d.]+,\\d{2})$").assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("fee")))))).section("fee", "currency").optional().match("^Transaktionsentgelt.* (?<currency>\\w{3}) (?<fee>[\\d.]+,\\d{2})$").assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("fee")))))).section("fee", "currency").optional().match("^Provision.* (?<currency>\\w{3}) (?<fee>[\\d.]+,\\d{2})$").assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("fee")))))).wrap(t -> new BuySellEntryItem(t)));
}
use of name.abuchen.portfolio.datatransfer.pdf.PDFParser.Transaction in project portfolio by buchen.
the class BaaderBankPDFExtractor method addDividendTransaction.
@SuppressWarnings("nls")
private void addDividendTransaction() {
DocumentType type1 = new DocumentType("Fondsausschüttung");
DocumentType type2 = new DocumentType("Ertragsthesaurierung");
this.addDocumentTyp(type1);
this.addDocumentTyp(type2);
Block block = new Block("Ex-Tag.*");
type1.addBlock(block);
type2.addBlock(block);
block.set(new Transaction<AccountTransaction>().subject(() -> {
AccountTransaction t = new AccountTransaction();
t.setType(AccountTransaction.Type.DIVIDENDS);
return t;
}).section("isin", "wkn").match("Nominale *ISIN: *(?<isin>[^ ]*) *WKN: *(?<wkn>[^ ]*) .*").assign((t, v) -> t.setSecurity(getOrCreateSecurity(v))).section("shares").match("STK *(?<shares>[\\.\\d]+[,\\d]*) .*").assign((t, v) -> t.setShares(asShares(v.get("shares")))).section("date", "amount", "currency").match("Zu Gunsten Konto \\d+ Valuta: (?<date>\\d+.\\d+.\\d{4}) *(?<currency>\\w{3}) *(?<amount>[\\d.]+,\\d{2})").assign((t, v) -> {
t.setDateTime(asDate(v.get("date")));
t.setCurrencyCode(asCurrencyCode(v.get("currency")));
t.setAmount(asAmount(v.get("amount")));
}).section("tax", "currency").optional().match("Kapitalertragsteuer (?<currency>\\w{3}) (?<tax>[\\d.]+,\\d{2}) -").assign((t, v) -> t.addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("tax")))))).section("tax", "currency").optional().match("Kirchensteuer (?<currency>\\w{3}) (?<tax>[\\d.]+,\\d{2}) -").assign((t, v) -> t.addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("tax")))))).section("tax", "currency").optional().match("Solidaritätszuschlag (?<currency>\\w{3}) (?<tax>[\\d.]+,\\d{2}) -").assign((t, v) -> t.addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("tax")))))).wrap(t -> new TransactionItem(t)));
}
use of name.abuchen.portfolio.datatransfer.pdf.PDFParser.Transaction in project portfolio by buchen.
the class BaaderBankPDFExtractor method addSellTransaction.
@SuppressWarnings("nls")
private void addSellTransaction() {
DocumentType type = new DocumentType("Wertpapierabrechnung: Verkauf");
this.addDocumentTyp(type);
Block block = new Block("Scalable Capital .*");
type.addBlock(block);
block.set(new Transaction<BuySellEntry>().subject(() -> {
BuySellEntry entry = new BuySellEntry();
entry.setType(PortfolioTransaction.Type.SELL);
return entry;
}).section("isin", "wkn").match("Nominale *ISIN: *(?<isin>[^ ]*) *WKN: *(?<wkn>[^ ]*) .*").assign((t, v) -> t.setSecurity(getOrCreateSecurity(v))).section("shares").match("STK *(?<shares>[\\.\\d]+[,\\d]*) .*").assign((t, v) -> t.setShares(asShares(v.get("shares")))).section("date", "amount", "currency").match("Zu Gunsten Konto \\d+ Valuta: \\d+\\.\\d+\\.\\d{4} *(?<currency>\\w{3}) *(?<amount>[\\d.]+,\\d{2})").find("Handelsdatum Handelsuhrzeit").match("^(?<date>\\d+\\.\\d+\\.\\d{4}) \\d{2}:\\d{2}:\\d{2}:\\d{2}$").assign((t, v) -> {
t.setDate(asDate(v.get("date")));
t.setCurrencyCode(asCurrencyCode(v.get("currency")));
t.setAmount(asAmount(v.get("amount")));
}).section("tax", "currency").optional().match("Kapitalertragsteuer (?<currency>\\w{3}) (?<tax>[\\d.]+,\\d{2}) -").assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("tax")))))).section("tax", "currency").optional().match("Kirchensteuer (?<currency>\\w{3}) (?<tax>[\\d.]+,\\d{2}) -").assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("tax")))))).section("tax", "currency").optional().match("Solidaritätszuschlag (?<currency>\\w{3}) (?<tax>[\\d.]+,\\d{2}) -").assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.TAX, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("tax")))))).section("fee", "currency").optional().match(//
"Provision (?<currency>\\w{3}) (?<fee>[\\d.]+,\\d{2}) -").assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE, Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("fee")))))).wrap(t -> new BuySellEntryItem(t)));
}
use of name.abuchen.portfolio.datatransfer.pdf.PDFParser.Transaction in project portfolio by buchen.
the class BaaderBankPDFExtractor method addFeesAssetManagerTransaction.
@SuppressWarnings("nls")
private void addFeesAssetManagerTransaction() {
DocumentType type = new DocumentType("Vergütung des Vermögensverwalters");
this.addDocumentTyp(type);
Block block = new Block("Rechnung für .*");
type.addBlock(block);
block.set(new Transaction<AccountTransaction>().subject(() -> {
AccountTransaction t = new AccountTransaction();
t.setType(AccountTransaction.Type.FEES);
return t;
}).section("currency", "amount").match("Leistungen Beträge \\((?<currency>\\w{3})\\).*").match("Rechnungsbetrag *(?<amount>[\\d.]+,\\d{2}).*").assign((t, v) -> {
t.setCurrencyCode(asCurrencyCode(v.get("currency")));
t.setAmount(asAmount(v.get("amount")));
}).section("date").match("Abbuchungsdatum: (?<date>\\d+.\\d+.\\d{4})").assign((t, v) -> t.setDateTime(asDate(v.get("date")))).wrap(t -> new TransactionItem(t)));
}
use of name.abuchen.portfolio.datatransfer.pdf.PDFParser.Transaction in project portfolio by buchen.
the class BankSLMPDFExtractor method addBuyTransaction.
@SuppressWarnings("nls")
private void addBuyTransaction() {
DocumentType type = new DocumentType("abrechnung - Kauf");
this.addDocumentTyp(type);
Block block = new Block("B.rsenabrechnung - Kauf");
type.addBlock(block);
Transaction<BuySellEntry> extractor = new Transaction<BuySellEntry>().subject(() -> {
BuySellEntry entry = new BuySellEntry();
entry.setType(PortfolioTransaction.Type.BUY);
return entry;
}).section("date", "shares", "name", "wkn", "currency").match(//
"Wir haben f.r Sie am (?<date>\\d+.\\d+.\\d{4}+) gekauft.").match(//
"^(?<shares>[\\d.']+) .*$").match(//
"^(?<name>.*)$").match(//
"^Valor: (?<wkn>[^ ]*)$").match(//
"Total Kurswert (?<currency>\\w{3}+) .*").assign((t, v) -> {
t.setDate(asDate(v.get("date")));
t.setShares(asShares(v.get("shares")));
t.setSecurity(getOrCreateSecurity(v));
}).section("amount", //
"currency").match(//
"Netto (?<currency>\\w{3}+) -(?<amount>[\\d.']+)").assign((t, v) -> {
t.setAmount(asAmount(v.get("amount")));
t.setCurrencyCode(v.get("currency"));
}).wrap(t -> new BuySellEntryItem(t));
addForexGrossValue(extractor);
addFeesSection(extractor);
block.set(extractor);
}
Aggregations