/** * DATEV BU-Schlüssel (Steuerschlüssel) — single source of truth. * * Provenance (2026-07-09): cross-checked against multiple independent German * bookkeeping sources. Key semantics that v1 (skr.postingkeys.ts) and the * finance.plus reference implementation got wrong are corrected here: * - 18/19 are steuerpflichtiger innergemeinschaftlicher Erwerb (§1a UStG) * at 7%/19% — NOT generic "Vorsteuer ig Lieferungen". * - 91/94 are Leistungsempfänger schuldet die Steuer (§13b UStG) at 7%/19%. * The official DATEV Steuerschlüssel-Tabelle (Hilfe-Center Dokument 0904313) * is portal-gated; verification against it plus one manual DATEV import per * release candidate is the final gate (see readme.plan.md, M0 Phase 0). */ import type { TBuKey, TTaxScenario } from './core.types.js'; export interface IBuKeyRule { key: TBuKey; description: string; taxType: 'none' | 'ust' | 'vst' | 'vst_ust' | 'automatik_aufhebung'; ratePercent: number | null; scenarios: TTaxScenario[]; } export declare const BU_KEY_RULES: Record, IBuKeyRule>; export declare function isKnownBuKey(value: string): value is TBuKey; /** * Whether a BU key is one of § 13b UStG, by which DATEV books the tax the * recipient owes and deducts on the base (91, 94): the only keys a line's * `reverseChargeParagraph` may stand beside. Key 40, which every scenario * takes, is none. */ export declare function isReverseChargeBuKey(key: string): boolean; export declare function getBuKeyRule(key: TBuKey): IBuKeyRule | null; /** * Suggest the BU key for the expense/revenue line of a booking. * * targetIsAutomatik: Automatikkonten compute tax themselves on DATEV import. * When the entry carries explicit VAT lines, the automatism must be cancelled * with key 40; a plain automatik line without explicit VAT gets no key. * * vatAsStated: the entry books a tax as its document states it, which is not * what DATEV would compute from the base at the rate (SKR-VAT1). No key may * then have DATEV compute it: none, or 40 on an Automatikkonto, so the tax * line stays a booking of its own. */ export declare function suggestBuKey(params: { direction: 'inbound' | 'outbound'; scenario: TTaxScenario; ratePercent: number; targetIsAutomatik: boolean; hasExplicitVatLines: boolean; vatAsStated?: boolean; }): TBuKey;