// Package l10n_de provides German chart of accounts seed data.
package l10n_de

// SKR03Account defines a single account in the SKR03 chart.
type SKR03Account struct {
	Code        string
	Name        string
	AccountType string
	Reconcile   bool
}

// SKR03Accounts returns the core SKR03 chart of accounts.
// Mirrors: odoo/addons/l10n_de/data/template/account.account-de_skr03.csv
// This is a subset of the most commonly used accounts.
var SKR03Accounts = []SKR03Account{
	// 0xxx — Anlagevermögen (Fixed Assets)
	{"0027", "EDV-Software", "asset_non_current", false},
	{"0200", "Grundstücke und Bauten", "asset_fixed", false},
	{"0320", "Maschinen", "asset_fixed", false},
	{"0400", "Technische Anlagen", "asset_fixed", false},
	{"0420", "Büroeinrichtung", "asset_fixed", false},
	{"0440", "Werkzeuge", "asset_fixed", false},
	{"0480", "Geringwertige Wirtschaftsgüter", "asset_fixed", false},
	{"0520", "Fuhrpark", "asset_fixed", false},
	{"0540", "Geschäftsbauten", "asset_fixed", false},

	// 1xxx — Finanz- und Privatkonten
	{"1000", "Kasse", "asset_cash", false},
	{"1200", "Bank", "asset_cash", false},
	{"1210", "Postbank", "asset_cash", false},
	{"1400", "Forderungen aus Lieferungen und Leistungen", "asset_receivable", true},
	{"1410", "Forderungen aus L+L (Debitor)", "asset_receivable", true},
	{"1450", "Forderungen nach §11 EStG", "asset_receivable", true},
	{"1500", "Sonstige Vermögensgegenstände", "asset_current", false},
	{"1518", "Forderungen gegenüber Gesellschaftern", "asset_current", false},
	{"1548", "Vorsteuer laufendes Jahr", "asset_current", false},
	{"1570", "Vorsteuer 7%", "asset_current", false},
	{"1576", "Vorsteuer 19%", "asset_current", false},
	{"1580", "Vorsteuer aus innergemeinschaftlichem Erwerb", "asset_current", false},
	{"1588", "Vorsteuer im Folgejahr abziehbar", "asset_current", false},
	{"1590", "Durchlaufende Posten", "asset_current", false},
	{"1600", "Verbindlichkeiten aus Lieferungen und Leistungen", "liability_payable", true},
	{"1610", "Verbindlichkeiten aus L+L (Kreditor)", "liability_payable", true},
	{"1700", "Sonstige Verbindlichkeiten", "liability_current", false},
	{"1710", "Erhaltene Anzahlungen", "liability_current", false},
	{"1740", "Verbindlichkeiten aus Lohn und Gehalt", "liability_current", false},
	{"1741", "Verbindlichkeiten Sozialversicherung", "liability_current", false},
	{"1750", "Verbindlichkeiten Lohnsteuer", "liability_current", false},
	{"1770", "Umsatzsteuer 7%", "liability_current", false},
	{"1776", "Umsatzsteuer 19%", "liability_current", false},
	{"1780", "Umsatzsteuer-Vorauszahlungen", "liability_current", false},
	{"1790", "Umsatzsteuer laufendes Jahr", "liability_current", false},
	{"1791", "Umsatzsteuer Vorjahr", "liability_current", false},

	// 2xxx — Abgrenzungskonten
	{"2000", "Aufwendungen für Roh-, Hilfs- und Betriebsstoffe", "expense_direct_cost", false},

	// 3xxx — Wareneingang (Purchasing)
	{"3000", "Roh-, Hilfs- und Betriebsstoffe", "expense_direct_cost", false},
	{"3100", "Fremdleistungen", "expense_direct_cost", false},
	{"3200", "Wareneingang", "expense_direct_cost", false},
	{"3300", "Wareneingang 7% Vorsteuer", "expense_direct_cost", false},
	{"3400", "Wareneingang 19% Vorsteuer", "expense_direct_cost", false},
	{"3736", "Erhaltene Skonti 19% VSt", "expense_direct_cost", false},

	// 4xxx — Betriebliche Aufwendungen (Operating Expenses)
	{"4000", "Personalkosten", "expense", false},
	{"4100", "Löhne", "expense", false},
	{"4110", "Löhne Produktion", "expense", false},
	{"4120", "Gehälter", "expense", false},
	{"4130", "Geschäftsführergehälter", "expense", false},
	{"4140", "Freiwillige soziale Aufwendungen", "expense", false},
	{"4170", "Vermögenswirksame Leistungen", "expense", false},
	{"4180", "Arbeitgeberanteile Sozialversicherung", "expense", false},
	{"4190", "Berufsgenossenschaft", "expense", false},
	{"4200", "Raumkosten", "expense", false},
	{"4210", "Miete", "expense", false},
	{"4220", "Heizung", "expense", false},
	{"4230", "Gas, Strom, Wasser", "expense", false},
	{"4240", "Reinigung", "expense", false},
	{"4260", "Instandhaltung Betriebsräume", "expense", false},
	{"4300", "Versicherungen", "expense", false},
	{"4360", "Kfz-Versicherungen", "expense", false},
	{"4380", "Beiträge", "expense", false},
	{"4400", "Bürobedarf", "expense", false},
	{"4500", "Fahrzeugkosten", "expense", false},
	{"4510", "Kfz-Steuer", "expense", false},
	{"4520", "Kfz-Reparaturen", "expense", false},
	{"4530", "Laufende Kfz-Betriebskosten", "expense", false},
	{"4540", "Kfz-Leasing", "expense", false},
	{"4580", "Sonstige Kfz-Kosten", "expense", false},
	{"4600", "Werbekosten", "expense", false},
	{"4630", "Geschenke an Geschäftsfreunde", "expense", false},
	{"4650", "Bewirtungskosten", "expense", false},
	{"4654", "Bewirtungskosten nicht abzugsfähig", "expense", false},
	{"4660", "Reisekosten Arbeitnehmer", "expense", false},
	{"4663", "Reisekosten Unternehmer", "expense", false},
	{"4670", "Kilometergeld", "expense", false},
	{"4700", "Kosten der Warenabgabe", "expense", false},
	{"4800", "Reparaturen und Instandhaltung", "expense", false},
	{"4830", "Abschreibungen Sachanlagen", "expense_depreciation", false},
	{"4840", "Abschreibungen auf GWG", "expense_depreciation", false},
	{"4900", "Sonstige betriebliche Aufwendungen", "expense", false},
	{"4910", "Porto", "expense", false},
	{"4920", "Telefon", "expense", false},
	{"4930", "Büromaterial", "expense", false},
	{"4940", "Zeitschriften, Bücher", "expense", false},
	{"4950", "Rechts- und Beratungskosten", "expense", false},
	{"4955", "Buchführungskosten", "expense", false},
	{"4960", "Nebenkosten des Geldverkehrs", "expense", false},
	{"4970", "Abschluss- und Prüfungskosten", "expense", false},

	// 8xxx — Erlöse (Revenue)
	{"8000", "Erlöse", "income", false},
	{"8100", "Steuerfreie Umsätze §4 Nr. 1a UStG", "income", false},
	{"8120", "Steuerfreie Umsätze §4 Nr. 1b UStG", "income", false},
	{"8125", "Steuerfreie innergem. Lieferungen §4 Nr. 1b", "income", false},
	{"8200", "Erlöse 7% USt", "income", false},
	{"8300", "Erlöse 19% USt", "income", false},
	{"8400", "Erlöse 19% USt (allgemein)", "income", false},
	{"8500", "Provisionserlöse", "income", false},
	{"8600", "Erlöse aus Vermietung", "income_other", false},
	{"8700", "Erlösschmälerungen", "income", false},
	{"8736", "Gewährte Skonti 19% USt", "income", false},
	{"8800", "Erlöse aus Anlagenverkäufen", "income_other", false},
	{"8900", "Privatentnahmen", "equity", false},
	{"8920", "Unentgeltliche Wertabgaben", "income_other", false},

	// 9xxx — Vortrags- und Abschlusskonten
	{"9000", "Saldenvorträge Sachkonten", "equity_unaffected", false},
	{"9008", "Saldenvorträge Debitoren", "equity_unaffected", false},
	{"9009", "Saldenvorträge Kreditoren", "equity_unaffected", false},

	// Eigenkapital
	{"0800", "Gezeichnetes Kapital", "equity", false},
	{"0840", "Kapitalrücklage", "equity", false},
	{"0860", "Gewinnrücklage", "equity", false},
	{"0868", "Gewinnvortrag", "equity", false},
	{"0869", "Verlustvortrag", "equity", false},
	{"0880", "Nicht durch Eigenkapital gedeckter Fehlbetrag", "equity_unaffected", false},
}

// SKR03Taxes returns the standard German tax definitions.
type TaxDef struct {
	Name     string
	Amount   float64
	TypeUse  string // sale / purchase
	Account  string // account code for tax
}

var SKR03Taxes = []TaxDef{
	// USt (Umsatzsteuer) — Sales Tax
	{"USt 19%", 19.0, "sale", "1776"},
	{"USt 7%", 7.0, "sale", "1770"},
	{"USt 0% steuerfreie Umsätze", 0.0, "sale", ""},

	// VSt (Vorsteuer) — Input Tax / Purchase Tax
	{"VSt 19%", 19.0, "purchase", "1576"},
	{"VSt 7%", 7.0, "purchase", "1570"},

	// Innergemeinschaftliche Erwerbe
	{"USt 19% innergem. Erwerb", 19.0, "purchase", "1580"},
	{"USt 19% Reverse Charge", 19.0, "purchase", "1787"},
}
