dolibarr.bankimport/sql/llx_bankimport_statement_line.sql
data be8a02e88e Version 1.3: PDF-Parsing, Kontoauszugsabgleich, Rechnungsnummer-Matching
- Neue Tabelle llx_bankimport_statement_line für geparste PDF-Buchungszeilen
- parsePdfTransactions(): Extrahiert Einzelbuchungen aus VR-Bank PDF-Auszügen
- reconcileBankEntries(): 3-stufiger Abgleich (Betrag+Datum, Datumstoleranz, Rechnungsnummern)
- reconcileByInvoiceNumbers(): Matching über /INV/, /ADV/ und Beleg-Nr. im Verwendungszweck
- 5-EUR-Schwelle: Betragsabweichungen >5 EUR erfordern manuelle Bestätigung
- Pending-Review-Anzeige mit Bestätigungsbutton auf der PDF-Kontoauszüge-Seite
- match_status Spalte für Approval-Workflow (reconciled/pending_review)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:02:01 +01:00

34 lines
1.7 KiB
SQL

-- Copyright (C) 2026 Eduard Wisch <data@data-it-solution.de>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
-- Table for individual transaction lines parsed from PDF bank statements
CREATE TABLE llx_bankimport_statement_line (
rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
fk_statement INTEGER NOT NULL, -- Link to llx_bankimport_statement
entity INTEGER DEFAULT 1 NOT NULL,
line_number INTEGER DEFAULT 0, -- Position within statement (1, 2, 3...)
-- Transaction data from PDF
date_booking DATE NOT NULL, -- Buchungstag (Bu-Tag)
date_value DATE, -- Wertstellungstag (Wert)
transaction_type VARCHAR(100), -- Vorgangsart (e.g. Überweisungsgutschr., Basislastschrift)
amount DOUBLE(24,8) NOT NULL, -- Amount (positive = credit, negative = debit)
currency VARCHAR(3) DEFAULT 'EUR',
-- Counterparty and description
name VARCHAR(255), -- Counterparty name (first detail line)
description TEXT, -- Full description (all detail lines)
-- Matching
fk_bank INTEGER, -- Link to llx_bank when reconciled
match_status VARCHAR(20) DEFAULT NULL, -- NULL=unmatched, reconciled=auto, pending_review=needs approval
-- Timestamps
datec DATETIME,
tms TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB;