-- Copyright (C) 2026 Eduard Wisch
-- Table for USt-Voranmeldung Perioden

CREATE TABLE IF NOT EXISTS llx_steuer_ustva (
    rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
    jahr INTEGER NOT NULL,
    periode VARCHAR(10) NOT NULL,
    periode_typ VARCHAR(10) NOT NULL,
    kz81 DOUBLE(24,8) DEFAULT 0,
    kz86 DOUBLE(24,8) DEFAULT 0,
    kz35 DOUBLE(24,8) DEFAULT 0,
    kz36 DOUBLE(24,8) DEFAULT 0,
    kz41 DOUBLE(24,8) DEFAULT 0,
    kz44 DOUBLE(24,8) DEFAULT 0,
    kz66 DOUBLE(24,8) DEFAULT 0,
    kz61 DOUBLE(24,8) DEFAULT 0,
    kz67 DOUBLE(24,8) DEFAULT 0,
    ust_summe DOUBLE(24,8) DEFAULT 0,
    vst_summe DOUBLE(24,8) DEFAULT 0,
    zahllast DOUBLE(24,8) DEFAULT 0,
    status TINYINT(4) DEFAULT 0,
    uebermittelt_am DATE DEFAULT NULL,
    note_private TEXT,
    date_creation DATETIME,
    tms TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    fk_user_creat INTEGER,
    entity INTEGER DEFAULT 1,
    UNIQUE KEY uk_periode (jahr, periode, entity)
) ENGINE=InnoDB;
