dolibarr.steuer/sql/dolibarr_allversions.sql

105 lines
3.9 KiB
SQL
Executable file

--
-- Script run when an upgrade of Dolibarr is done. Whatever is the Dolibarr version.
-- EÜR Modul für Deutschland 2025
--
-- ============================================================================
-- Kontenrahmen (SKR03 basiert für EÜR)
-- ============================================================================
CREATE TABLE IF NOT EXISTS llx_steuer_konto (
rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
kontonummer VARCHAR(10) NOT NULL,
bezeichnung VARCHAR(255) NOT NULL,
kategorie VARCHAR(50) NOT NULL,
euer_zeile INTEGER DEFAULT NULL,
ust_kennzeichen VARCHAR(10) DEFAULT NULL,
aktiv TINYINT(1) DEFAULT 1,
entity INTEGER DEFAULT 1,
UNIQUE KEY uk_konto_nummer (kontonummer, entity)
) ENGINE=InnoDB;
-- ============================================================================
-- 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 DECIMAL(24,8) DEFAULT 0,
betrag_ust DECIMAL(24,8) DEFAULT 0,
betrag_brutto DECIMAL(24,8) DEFAULT 0,
ust_satz DECIMAL(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,
INDEX idx_buchung_datum (datum),
INDEX idx_buchung_konto (fk_konto),
INDEX idx_buchung_typ (typ),
INDEX idx_buchung_ref (ref)
) ENGINE=InnoDB;
-- ============================================================================
-- 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 DECIMAL(24,8) DEFAULT 0,
kz86 DECIMAL(24,8) DEFAULT 0,
kz35 DECIMAL(24,8) DEFAULT 0,
kz36 DECIMAL(24,8) DEFAULT 0,
kz41 DECIMAL(24,8) DEFAULT 0,
kz44 DECIMAL(24,8) DEFAULT 0,
kz66 DECIMAL(24,8) DEFAULT 0,
kz61 DECIMAL(24,8) DEFAULT 0,
kz67 DECIMAL(24,8) DEFAULT 0,
ust_summe DECIMAL(24,8) DEFAULT 0,
vst_summe DECIMAL(24,8) DEFAULT 0,
zahllast DECIMAL(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;
-- ============================================================================
-- Gewerbesteuer
-- ============================================================================
CREATE TABLE IF NOT EXISTS llx_steuer_gewerbe (
rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
jahr INTEGER NOT NULL,
gewinn_euer DECIMAL(24,8) DEFAULT 0,
hinzurechnungen DECIMAL(24,8) DEFAULT 0,
kuerzungen DECIMAL(24,8) DEFAULT 0,
gewerbeertrag DECIMAL(24,8) DEFAULT 0,
freibetrag DECIMAL(24,8) DEFAULT 24500,
hebesatz DECIMAL(5,2) DEFAULT 400,
steuermessbetrag DECIMAL(24,8) DEFAULT 0,
gewerbesteuer DECIMAL(24,8) DEFAULT 0,
anrechnung_est DECIMAL(24,8) DEFAULT 0,
status TINYINT(4) DEFAULT 0,
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_jahr (jahr, entity)
) ENGINE=InnoDB;