/** * Fiscal years (Geschäftsjahr, Wirtschaftsjahr): calendar years, deviating * years and short years (Rumpfwirtschaftsjahre), built from the dated * regimes of the month the years start in. Pure functions over days as * `YYYY-MM-DD` (UTC). * * The rules, as the law states them: * - "Die Dauer des Geschäftsjahrs darf zwölf Monate nicht überschreiten" * (§ 240 Abs. 2 Satz 2 HGB); "Das Wirtschaftsjahr umfasst einen Zeitraum von * zwölf Monaten" (§ 8b Satz 1 EStDV). * - It may be shorter "wenn 1. ein Betrieb eröffnet, erworben, aufgegeben oder * veräußert wird oder 2. ein Steuerpflichtiger von regelmäßigen Abschlüssen * auf einen bestimmten Tag zu regelmäßigen Abschlüssen auf einen anderen * bestimmten Tag übergeht" (§ 8b Satz 2 EStDV). * - A change from the calendar year to a deviating year, or from one deviating * year to another, counts only "wenn die Umstellung im Einvernehmen mit dem * Finanzamt vorgenommen wird" (§ 8b Satz 3 EStDV; § 4a Abs. 1 Nr. 2 Satz 2 * EStG). A change back to the calendar year needs no consent. * * Who may have a deviating year at all is tax law about the business (§ 4a * Abs. 1 EStG: a trader registered in the Handelsregister; other traders the * calendar year, Land- und Forstwirte 1 July to 30 June), and whether the * consent was given is a fact of the business; the caller decides both. This * module builds the calendar and says where a consent is needed. */ /** * From `from` on, fiscal years start on day `startDay` (1 when absent) of * `startMonth`; `from` is such a day. A regular year is twelve months, and * nothing in § 240 Abs. 2 HGB, § 8b EStDV or § 4a EStG ties it to the first * of a month. */ export interface IFiscalYearRegime { from: string; /** 1 (the calendar year) to 12 */ startMonth: number; /** * 1 when absent; at most the last day the month has in every year: 28 for * February, 30 for April, June, September and November, else 31 */ startDay?: number; } export interface IFiscalYearsInput { /** the regimes, in any order, each `from` at most once; the one in force on a day is the one with the latest `from` up to it */ regimes: readonly IFiscalYearRegime[]; /** the first day of the books: the opening of the business, or the first day of the first year kept here */ firstDay: string; /** the last day of the business, when it was closed or sold */ lastDay?: string; /** every year up to the one that contains this day */ through: string; } /** Why a fiscal year is shorter than twelve months (§ 8b Satz 2 EStDV). */ export type TShortYearReason = /** the books begin on a day that is no start of a year: the business opened or was acquired (Nr. 1) */ 'opening' /** the business closed or was sold (Nr. 1) */ | 'closing' /** both within the one year */ | 'opening_and_closing' /** the closing day changed at its end (Nr. 2) */ | 'change'; export interface IFiscalYearSpan { /** the first and the last day, both included */ start: string; end: string; /** * the fewest months after `start` that reach past `end` (a month begun * counts whole): 2026-03-15..2026-12-31 is 10, 2026-03-15..2027-03-14 is 12. * Months are counted as § 188 Abs. 2, 3 BGB counts them (§ 108 Abs. 1 AO): * 2026-01-31..2026-02-28 is 1, 2026-08-31..2027-02-28 is 6. */ months: number; /** * a Rumpfwirtschaftsjahr: the day after `end` is not twelve months after * `start` (§ 188 Abs. 2, 3 BGB: 2028-02-29..2029-02-28 is twelve months), or * the year opens the books on a day that is no start of a year */ short: boolean; shortReason?: TShortYearReason; /** * The short year of a change to a closing day other than 31 December: * valid for tax only in agreement with the Finanzamt (§ 8b Satz 3 EStDV, * § 4a Abs. 1 Nr. 2 Satz 2 EStG). */ consentRequired: boolean; /** `2026`, or `2025/26` for a year that crosses the calendar year */ label: string; /** * The calendar year the fiscal year ends in: the year a trader's profit of * it counts in (§ 4a Abs. 2 Nr. 2 EStG). A Land- und Forstwirt's profit is * split between both calendar years instead (Nr. 1). */ taxYear: number; } /** * The fiscal years from the first day of the books through the year that * contains `through` (or to the business's last day). A year starts on the * first day of the books, on every `startDay` of the start month of the * regime in force, and on every regime's `from`; it ends the day before the * next start, or on the last day. Refuses a regime whose `from` is not day * `startDay` of its start month, a start month outside 1 to 12, a `startDay` * outside 1 to the month's every-year last day, a `from` given twice, a first * day before every regime, and `through` or the last day before the first day. */ export declare function fiscalYearsOf(input: IFiscalYearsInput): IFiscalYearSpan[]; /** The fiscal year among `spans` that contains the day, or undefined. */ export declare function fiscalYearOfDay(spans: readonly IFiscalYearSpan[], day: string): IFiscalYearSpan | undefined;