/** * The DATEV revenue account of a tax-free sale, by the group of § 4 UStG * exemptions it falls under. `domestic_tax_free` keeps requiring an explicit * `revenueAccount` — the recipe cannot know the exemption — and this is where * the caller that knows it finds the account. * * Numbers from the DATEV Kontenrahmen SKR 03 (Art.-Nr. 11174) and SKR 04 * (Art.-Nr. 11175), "Gültig für 2026" (read 2026-09-25), all marked "U AM" * there (Automatikkonten): * - § 4 Nr. 2 bis 7 UStG: 8150 / 4150 "Sonstige steuerfreie Umsätze (z. B. * § 4 Nr. 2 bis 7 UStG)" — UStVA Kz 43, "weitere steuerfreie Umsätze mit * Vorsteuerabzug" (ELSTER Anleitung zur UStVA 2026). * - § 4 Nr. 8 bis 29 UStG: 8100 / 4100 "Steuerfreie Umsätze § 4 Nr. 8 ff. * UStG" — Kz 48, "Steuerfreie Umsätze ohne Vorsteuerabzug". * - § 4 Nr. 12 UStG (letting and leasing of land) on its own account: 8105 / * 4105 "Steuerfreie Umsätze nach § 4 Nr. 12 UStG (Vermietung und * Verpachtung)" — Kz 48. * - § 19 Abs. 1 UStG (a Kleinunternehmer's supply, tax-exempt since 2025): * 8192 / 4184 "Steuerfreie Erlöse Kleinunternehmer nach § 19 Abs. 1 UStG" * (SKR 03 p. 26, SKR 04 p. 14; "AM", tax-free) — on no UStVA field: a * Kleinunternehmer files no advance return (§ 19 Abs. 1 Satz 2 UStG). The * numbers before 2025, 8195 and 4185, are reserved in the 2026 charts. * An export (§ 4 Nr. 1a) and an intra-Community supply (§ 4 Nr. 1b) have * their own scenarios (`export_third_country`, `intra_eu_supply`). A * Kleinunternehmer's supplies, every one of § 1 Abs. 1 Nr. 1 UStG, are exempt * under § 19 Abs. 1 Satz 1, and Satz 2 sets aside the exemption of an * intra-Community supply (§ 4 Nr. 1 Buchst. b, § 6a): they are `section_19`. */ import type { TSKRType } from './core.types.js'; import { assertSkrType } from './core.chart.js'; export type TTaxFreeExemption = 'section_4_2_to_7' | 'section_4_8_to_29' | 'section_4_12' | 'section_19'; export const TAX_FREE_EXEMPTIONS: readonly TTaxFreeExemption[] = ['section_4_2_to_7', 'section_4_8_to_29', 'section_4_12', 'section_19']; export const TAX_FREE_REVENUE_ACCOUNTS: Readonly>>> = { SKR03: { section_4_2_to_7: '8150', section_4_8_to_29: '8100', section_4_12: '8105', section_19: '8192' }, SKR04: { section_4_2_to_7: '4150', section_4_8_to_29: '4100', section_4_12: '4105', section_19: '4184' }, }; export function taxFreeRevenueAccountFor(exemptionArg: TTaxFreeExemption, skrTypeArg: TSKRType): string { assertSkrType(skrTypeArg); const account = TAX_FREE_REVENUE_ACCOUNTS[skrTypeArg]?.[exemptionArg]; if (!account) { throw new Error(`no tax-free revenue account for exemption '${String(exemptionArg)}' in ${String(skrTypeArg)}`); } return account; }