importzugferd/sql/llx_importzugferd_import_line.sql

38 lines
2.7 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_line (
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
fk_import integer NOT NULL, -- Referenz zum Import
line_id varchar(50), -- Position/Zeilen-ID aus ZUGFeRD
supplier_ref varchar(128), -- Lieferanten-Artikelnummer
product_name varchar(255), -- Artikelbezeichnung aus ZUGFeRD
description text, -- Zusätzliche Beschreibung
quantity double(24,8) DEFAULT 1, -- Menge
unit_code varchar(10), -- UN/ECE Einheitencode (C62, MTR, etc.)
unit_price double(24,8) DEFAULT 0, -- Einzelpreis (berechnet)
unit_price_raw double(24,8) DEFAULT 0, -- Original-Einzelpreis
basis_quantity double(24,8) DEFAULT 1, -- Basismenge für Preis
basis_quantity_unit varchar(10), -- Einheit der Basismenge
line_total double(24,8) DEFAULT 0, -- Zeilensumme netto
tax_percent double(24,8) DEFAULT 0, -- MwSt-Satz
ean varchar(20), -- EAN/GTIN falls vorhanden
copper_surcharge double(24,8) DEFAULT NULL, -- Kupferzuschlag pro Einheit
copper_surcharge_basis_qty double(24,8) DEFAULT NULL, -- Basismenge für Kupferzuschlag
fk_product integer, -- Zugeordnetes Dolibarr-Produkt
fk_datanorm integer, -- Zugeordneter Datanorm-Artikel
match_method varchar(50), -- Wie wurde Produkt gefunden
date_creation datetime NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;