40 lines
2.8 KiB
SQL
40 lines
2.8 KiB
SQL
-- ============================================================================
|
|
-- Copyright (C) 2026 ZUGFeRD Import Module
|
|
--
|
|
-- 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.
|
|
--
|
|
-- This program is distributed in the hope that it will be useful,
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
-- GNU General Public License for more details.
|
|
-- ============================================================================
|
|
|
|
CREATE TABLE llx_importzugferd_import (
|
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
|
ref varchar(128) NOT NULL, -- Interne Referenz
|
|
invoice_number varchar(128) NOT NULL, -- Rechnungsnummer aus ZUGFeRD
|
|
invoice_date date NOT NULL, -- Rechnungsdatum
|
|
seller_name varchar(255), -- Lieferantenname aus Rechnung
|
|
seller_vat varchar(50), -- USt-ID Lieferant
|
|
buyer_reference varchar(128), -- Kundennummer beim Lieferanten
|
|
total_ht double(24,8) DEFAULT 0, -- Nettobetrag
|
|
total_ttc double(24,8) DEFAULT 0, -- Bruttobetrag
|
|
currency varchar(3) DEFAULT 'EUR', -- Währung
|
|
fk_soc integer, -- Zugeordneter Lieferant
|
|
fk_facture_fourn integer, -- Erstellte Lieferantenrechnung
|
|
xml_content mediumtext, -- Original XML-Inhalt
|
|
pdf_filename varchar(255), -- Original PDF-Dateiname
|
|
file_hash varchar(64), -- SHA256 Hash für Duplikatserkennung
|
|
status integer DEFAULT 0, -- 0=importiert, 1=verarbeitet, 2=fehler
|
|
error_message text, -- Fehlermeldung falls status=2
|
|
date_creation datetime NOT NULL, -- Erstellungsdatum
|
|
date_import datetime, -- Importdatum der Rechnung
|
|
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
fk_user_creat integer, -- Ersteller
|
|
fk_user_modif integer, -- Letzter Bearbeiter
|
|
import_key varchar(14), -- Import-Batch-Key
|
|
entity integer DEFAULT 1 NOT NULL -- Multi-company
|
|
) ENGINE=innodb;
|