-- Copyright (C) 2026 Eduard Wisch
-- Table for EÜR Buchungen

CREATE TABLE IF NOT EXISTS llx_steuer_buchung (
    rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
    ref VARCHAR(30) NOT NULL,
    datum DATE NOT NULL,
    belegnummer VARCHAR(50) DEFAULT NULL,
    beschreibung VARCHAR(255) NOT NULL,
    fk_konto INTEGER NOT NULL,
    betrag_netto DOUBLE(24,8) DEFAULT 0,
    betrag_ust DOUBLE(24,8) DEFAULT 0,
    betrag_brutto DOUBLE(24,8) DEFAULT 0,
    ust_satz DOUBLE(5,2) DEFAULT 0,
    typ VARCHAR(20) NOT NULL,
    zahlungsart VARCHAR(30) DEFAULT NULL,
    fk_soc INTEGER DEFAULT NULL,
    fk_facture INTEGER DEFAULT NULL,
    fk_facture_fourn INTEGER DEFAULT NULL,
    note_private TEXT,
    date_creation DATETIME,
    tms TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    fk_user_creat INTEGER,
    fk_user_modif INTEGER,
    status TINYINT(4) DEFAULT 1,
    entity INTEGER DEFAULT 1
) ENGINE=InnoDB;
