@fin.cx/chartdata 2.13.0 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_ts/00_commitinfo_data.js +3 -3
- package/dist_ts/chartdata.euer.d.ts +67 -0
- package/dist_ts/chartdata.euer.js +162 -0
- package/dist_ts/chartdata.lookup.d.ts +23 -1
- package/dist_ts/chartdata.lookup.js +32 -1
- package/dist_ts/chartdata.types.d.ts +158 -1
- package/dist_ts/data/skr03.2026.js +770 -1
- package/dist_ts/data/skr04.2026.js +735 -1
- package/dist_ts/index.d.ts +1 -0
- package/dist_ts/index.js +2 -1
- package/package.json +2 -2
- package/readme.md +129 -1
- package/ts/00_commitinfo_data.ts +2 -2
- package/ts/chartdata.euer.ts +219 -0
- package/ts/chartdata.lookup.ts +52 -0
- package/ts/chartdata.types.ts +188 -1
- package/ts/data/skr03.2026.ts +769 -0
- package/ts/data/skr04.2026.ts +734 -0
- package/ts/index.ts +1 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@fin.cx/chartdata',
|
|
6
|
-
version: '2.
|
|
7
|
-
description: 'Year-versioned German SKR03/SKR04 chart-of-accounts datasets with Automatikkonto functions, BU-key rules,
|
|
6
|
+
version: '2.15.0',
|
|
7
|
+
description: 'Year-versioned German SKR03/SKR04 chart-of-accounts datasets with Automatikkonto functions, BU-key rules, UStVA-Kennzahl and Anlage EÜR mappings'
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxtQkFBbUI7SUFDekIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLGtKQUFrSjtDQUNoSyxDQUFBIn0=
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Anlage EÜR (standardised Einnahmenüberschussrechnung, § 60 Abs. 4
|
|
3
|
+
* EStDV) of the form years the datasets serve: the lines an account's
|
|
4
|
+
* movements can go to, with their Kennzahlen, their line numbers per year and
|
|
5
|
+
* the form's wording (amtliches Werk, § 5 UrhG — public domain).
|
|
6
|
+
*
|
|
7
|
+
* Read from the BMF's published forms: "Standardisierte Einnahmenüberschuss-
|
|
8
|
+
* rechnung nach § 60 Absatz 4 EStDV; Anlage EÜR 2025" (BMF-Schreiben of
|
|
9
|
+
* 2025-08-29, IV C 6 - S 2142/00023/010/001) and "… Anlage EÜR 2026"
|
|
10
|
+
* (2026-09-01, IV C 6 - S 2142/00024/010/001), with their Anleitungen. The
|
|
11
|
+
* two years list the same lines under the same Kennzahlen; 2026 inserts
|
|
12
|
+
* Zeile 27 (Bildung Rücklage Tierbewertung, from the Anlage LuF), so the
|
|
13
|
+
* goods are Zeile 27 in 2025 and 29 in 2026, and every later line is one
|
|
14
|
+
* number higher in 2026.
|
|
15
|
+
*
|
|
16
|
+
* The table holds the lines of the Betriebseinnahmen, the Betriebsausgaben
|
|
17
|
+
* and the Entnahmen and Einlagen that carry a Kennzahl of their own. Sums,
|
|
18
|
+
* transfers ("Übertrag") and the transfers from the Anlage LuF (2026
|
|
19
|
+
* Zeilen 25 to 27) are not lines an account's movements go to.
|
|
20
|
+
*/
|
|
21
|
+
import type { IChartAccount, IEuerForm, IEuerFormLine, TEuerAccountLines } from './chartdata.types.js';
|
|
22
|
+
/** The Anlage EÜR of each form year, by year. */
|
|
23
|
+
export declare const ANLAGE_EUER_FORMS: IEuerForm[];
|
|
24
|
+
/**
|
|
25
|
+
* The Kennzahl a Kleinunternehmer (§ 19 Abs. 1 UStG) states every receipt
|
|
26
|
+
* under but those of Zeilen 18 to 22: "Die Zeilen 15 bis 17 sind von
|
|
27
|
+
* Kleinunternehmern in der Regel nicht zu verwenden" (Anleitung, Zeile 12).
|
|
28
|
+
* `euerLinesOf` and `getEuerLines` with `smallBusiness` take the taxable (Kz 112) and the
|
|
29
|
+
* tax-free or non-taxable receipts (Kz 103) there. Zeile 13 (Kz 119), the
|
|
30
|
+
* "davon" of the non-taxable receipts and those under § 19 Abs. 2 Satz 1
|
|
31
|
+
* Nr. 1 und 2 UStG within Zeile 12, is stated "nachrichtlich" (Anleitung,
|
|
32
|
+
* Zeile 13): no account resolves to it, since an account does not tell which
|
|
33
|
+
* of its receipts fall under it, so that amount stays with the caller.
|
|
34
|
+
*/
|
|
35
|
+
export declare const EUER_SMALL_BUSINESS_KENNZAHL = 111;
|
|
36
|
+
/** The form years the table holds, ascending. */
|
|
37
|
+
export declare function listEuerFormYears(): number[];
|
|
38
|
+
/**
|
|
39
|
+
* The Anlage EÜR of a form year. Throws for a year the table does not hold —
|
|
40
|
+
* a form's lines must never fall back to another year's silently.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getEuerForm(year: number): IEuerForm;
|
|
43
|
+
/** A line of a form year by its Kennzahl; throws where the year's table has none. */
|
|
44
|
+
export declare function getEuerFormLine(year: number, kennzahl: number): IEuerFormLine;
|
|
45
|
+
/** Options of `getEuerLines`. */
|
|
46
|
+
export interface IEuerLinesOptions {
|
|
47
|
+
/** the business is a Kleinunternehmer (§ 19 Abs. 1 UStG): its taxable and tax-free receipts go to Kz 111 */
|
|
48
|
+
smallBusiness?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The lines of an account in a form year, resolved from the account's
|
|
52
|
+
* mapping (`IChartAccount.euer`, `euerExclusion`). Throws for an account that
|
|
53
|
+
* has neither, which a dataset of this package never holds.
|
|
54
|
+
*/
|
|
55
|
+
export declare function euerLinesOf(account: IChartAccount, formYear: number, options?: IEuerLinesOptions): TEuerAccountLines;
|
|
56
|
+
/** An amount on a line of the Anlage EÜR, in integer cents. */
|
|
57
|
+
export interface IEuerAmount {
|
|
58
|
+
line: IEuerFormLine;
|
|
59
|
+
cents: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* What an account's movements of a period, its debits and its credits in
|
|
63
|
+
* integer cents, amount to on its lines: a netted line counts its own side
|
|
64
|
+
* less the other (it may come out negative: a credit note's reversal), a split
|
|
65
|
+
* account each side on its line, an excluded one nothing.
|
|
66
|
+
*/
|
|
67
|
+
export declare function euerAmountsOf(lines: TEuerAccountLines, debitCents: number, creditCents: number): IEuerAmount[];
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
const INCOME = 'income';
|
|
2
|
+
const EXPENSE = 'expense';
|
|
3
|
+
/** Every line once, with its line numbers on the 2025 and the 2026 form. */
|
|
4
|
+
const ROWS = [
|
|
5
|
+
// 1. Betriebseinnahmen
|
|
6
|
+
[111, 12, 12, INCOME, 1, 'Betriebseinnahmen als umsatzsteuerlicher Kleinunternehmer (nach § 19 Abs. 1 UStG)'],
|
|
7
|
+
[119, 13, 13, INCOME, 0, 'davon nicht steuerbare Umsätze sowie Umsätze nach § 19 Abs. 2 Satz 1 Nr. 1 und 2 sowie Satz 2 UStG'],
|
|
8
|
+
[104, 14, 14, INCOME, 1, 'Betriebseinnahmen als Land- und Forstwirt, soweit die Durchschnittssatzbesteuerung nach § 24 UStG angewandt wird'],
|
|
9
|
+
[112, 15, 15, INCOME, 1, 'Umsatzsteuerpflichtige Betriebseinnahmen (ohne solche zum ermäßigten Steuersatz von 0 %)'],
|
|
10
|
+
[103, 16, 16, INCOME, 1, 'Betriebseinnahmen, die umsatzsteuerfrei (§ 4 UStG) oder nicht umsatzsteuerbar sind oder nach § 12 Abs. 3 UStG dem ermäßigten Steuersatz von 0 % unterliegen oder für die der Leistungsempfänger die Umsatzsteuer nach § 13b UStG schuldet'],
|
|
11
|
+
[140, 17, 17, INCOME, 1, 'Vereinnahmte Umsatzsteuer sowie Umsatzsteuer auf unentgeltliche Wertabgaben'],
|
|
12
|
+
[141, 18, 18, INCOME, 1, 'Vom Finanzamt erstattete und ggf. verrechnete Umsatzsteuer'],
|
|
13
|
+
[102, 19, 19, INCOME, 1, 'Veräußerung oder Entnahme von Anlagevermögen'],
|
|
14
|
+
[106, 20, 20, INCOME, 1, 'Private Kfz-Nutzung'],
|
|
15
|
+
[108, 21, 21, INCOME, 1, 'Sonstige Sach-, Nutzungs- und Leistungsentnahmen'],
|
|
16
|
+
// 2. Betriebsausgaben
|
|
17
|
+
[195, 24, 24, EXPENSE, 1, 'Betriebsausgabenpauschale für bestimmte Berufsgruppen'],
|
|
18
|
+
[100, 27, 29, EXPENSE, 1, 'Waren, Rohstoffe und Hilfsstoffe einschließlich der Nebenkosten'],
|
|
19
|
+
[110, 29, 30, EXPENSE, 1, 'Bezogene Fremdleistungen'],
|
|
20
|
+
[120, 30, 31, EXPENSE, 1, 'Ausgaben für eigenes Personal (z. B. Gehälter, Löhne und Versicherungsbeiträge)'],
|
|
21
|
+
[136, 31, 32, EXPENSE, 1, 'AfA auf Grundstücke/grundstücksgleiche Rechte'],
|
|
22
|
+
[131, 32, 33, EXPENSE, 1, 'AfA auf immaterielle Wirtschaftsgüter'],
|
|
23
|
+
[130, 33, 34, EXPENSE, 1, 'AfA auf bewegliche Wirtschaftsgüter'],
|
|
24
|
+
[134, 34, 35, EXPENSE, 1, 'Sonderabschreibungen nach § 7b EStG und § 7g Abs. 5 und 6 EStG'],
|
|
25
|
+
[138, 35, 36, EXPENSE, 1, 'Herabsetzungsbeträge nach § 7g Abs. 2 Satz 3 EStG'],
|
|
26
|
+
[132, 36, 37, EXPENSE, 1, 'Aufwendungen für geringwertige Wirtschaftsgüter nach § 6 Abs. 2 EStG'],
|
|
27
|
+
[137, 37, 38, EXPENSE, 1, 'Auflösung Sammelposten nach § 6 Abs. 2a EStG'],
|
|
28
|
+
[135, 38, 39, EXPENSE, 1, 'Restbuchwerte der ausgeschiedenen Anlagegüter'],
|
|
29
|
+
[150, 39, 40, EXPENSE, 1, 'Miete/Pacht für Geschäftsräume und betrieblich genutzte Grundstücke'],
|
|
30
|
+
[152, 40, 41, EXPENSE, 1, 'Aufwendungen für doppelte Haushaltsführung (z. B. Miete)'],
|
|
31
|
+
[151, 41, 42, EXPENSE, 1, 'Sonstige Aufwendungen für betrieblich genutzte Grundstücke (ohne Schuldzinsen und AfA)'],
|
|
32
|
+
[153, 42, 43, EXPENSE, 0, 'davon Erhaltungsaufwendungen'],
|
|
33
|
+
[280, 43, 44, EXPENSE, 1, 'Aufwendungen für Telekommunikation (z. B. Telefon, Internet)'],
|
|
34
|
+
[221, 44, 45, EXPENSE, 1, 'Übernachtungs- und Reisenebenkosten bei Geschäftsreisen des Steuerpflichtigen'],
|
|
35
|
+
[281, 45, 46, EXPENSE, 1, 'Fortbildungskosten (ohne Reisekosten)'],
|
|
36
|
+
[194, 46, 47, EXPENSE, 1, 'Kosten für Rechts- und Steuerberatung, Buchführung'],
|
|
37
|
+
[222, 47, 48, EXPENSE, 1, 'Miete/Leasing für bewegliche Wirtschaftsgüter (ohne Kfz)'],
|
|
38
|
+
[225, 48, 49, EXPENSE, 1, 'Erhaltungsaufwendungen (z. B. Instandhaltung, Wartung, Reparatur; ohne solche für Gebäude und Kfz)'],
|
|
39
|
+
[223, 49, 50, EXPENSE, 1, 'Beiträge, Gebühren, Abgaben und Versicherungen (ohne solche für Gebäude und Kfz)'],
|
|
40
|
+
[228, 50, 51, EXPENSE, 1, 'Laufende EDV-Kosten (z. B. Beratung, Wartung, Reparatur)'],
|
|
41
|
+
[229, 51, 52, EXPENSE, 1, 'Arbeitsmittel (z. B. Bürobedarf, Porto, Fachliteratur)'],
|
|
42
|
+
[226, 52, 53, EXPENSE, 1, 'Kosten für Abfallbeseitigung und Entsorgung'],
|
|
43
|
+
[227, 53, 54, EXPENSE, 1, 'Kosten für Verpackung und Transport'],
|
|
44
|
+
[224, 54, 55, EXPENSE, 1, 'Werbekosten (z. B. Inserate, Werbespots, Plakate)'],
|
|
45
|
+
[232, 55, 56, EXPENSE, 1, 'Schuldzinsen zur Finanzierung von Anschaffungs- und Herstellungskosten von Wirtschaftsgütern des Anlagevermögens (ohne häusliches Arbeitszimmer)'],
|
|
46
|
+
[234, 56, 57, EXPENSE, 1, 'Übrige Schuldzinsen'],
|
|
47
|
+
[185, 57, 58, EXPENSE, 1, 'Gezahlte und nach § 15 UStG abziehbare Vorsteuerbeträge'],
|
|
48
|
+
[186, 58, 59, EXPENSE, 1, 'An das Finanzamt gezahlte und ggf. verrechnete Umsatzsteuer'],
|
|
49
|
+
[183, 60, 61, EXPENSE, 1, 'Übrige unbeschränkt abziehbare Betriebsausgaben'],
|
|
50
|
+
[164, 62, 63, EXPENSE, 0, 'Geschenke (nicht abziehbar)'],
|
|
51
|
+
[174, 62, 63, EXPENSE, 1, 'Geschenke (abziehbar)'],
|
|
52
|
+
[165, 63, 64, EXPENSE, 0, 'Bewirtungsaufwendungen (nicht abziehbar)'],
|
|
53
|
+
[175, 63, 64, EXPENSE, 1, 'Bewirtungsaufwendungen (abziehbar)'],
|
|
54
|
+
[171, 64, 65, EXPENSE, 1, 'Verpflegungsmehraufwendungen'],
|
|
55
|
+
[162, 65, 66, EXPENSE, 0, 'Aufwendungen für ein häusliches Arbeitszimmer (nicht abziehbar)'],
|
|
56
|
+
[172, 65, 66, EXPENSE, 1, 'Aufwendungen für ein häusliches Arbeitszimmer (abziehbar)'],
|
|
57
|
+
[163, 66, 67, EXPENSE, 1, 'Tagespauschale für die Tätigkeit in der häuslichen Wohnung'],
|
|
58
|
+
[168, 67, 68, EXPENSE, 0, 'Sonstige beschränkt abziehbare Betriebsausgaben (nicht abziehbar)'],
|
|
59
|
+
[177, 67, 68, EXPENSE, 1, 'Sonstige beschränkt abziehbare Betriebsausgaben (abziehbar)'],
|
|
60
|
+
[144, 68, 69, EXPENSE, 1, 'Kfz-Kosten und andere Fahrtkosten: Leasingkosten'],
|
|
61
|
+
[145, 69, 70, EXPENSE, 1, 'Kfz-Kosten und andere Fahrtkosten: Steuern, Versicherungen und Maut'],
|
|
62
|
+
[146, 70, 71, EXPENSE, 1, 'Sonstige tatsächliche Fahrtkosten ohne AfA und Zinsen (z. B. Reparaturen, Wartungen, Treibstoff, Kosten für Flugstrecken, Kosten für öffentliche Verkehrsmittel)'],
|
|
63
|
+
[147, 71, 72, EXPENSE, 1, 'Fahrtkosten für nicht zum Betriebsvermögen gehörende Fahrzeuge (Nutzungseinlage)'],
|
|
64
|
+
[142, 72, 73, EXPENSE, -1, 'Fahrtkosten für Wege zwischen Wohnung und erster Betriebsstätte; Familienheimfahrten (pauschaliert oder tatsächlich)'],
|
|
65
|
+
[176, 73, 74, EXPENSE, 1, 'Mindestens abziehbare Fahrtkosten für Wege zwischen Wohnung und erster Betriebsstätte (Entfernungspauschale); Familienheimfahrten'],
|
|
66
|
+
[139, 74, 75, EXPENSE, -1, 'Nicht abziehbare Beträge'],
|
|
67
|
+
// 5. Zusätzliche Angaben bei Einzelunternehmen: Entnahmen und Einlagen i. S. d. § 4 Abs. 4a EStG
|
|
68
|
+
[122, 106, 107, 'private', 0, 'Entnahmen einschließlich Sach-, Leistungs- und Nutzungsentnahmen'],
|
|
69
|
+
[123, 107, 108, 'private', 0, 'Einlagen einschließlich Sach-, Leistungs- und Nutzungseinlagen'],
|
|
70
|
+
];
|
|
71
|
+
/** The side a line counts: receipts and Einlagen credit, expenses and Entnahmen debit. */
|
|
72
|
+
const sideOf = (kennzahlArg, sectionArg) => sectionArg === 'income' || kennzahlArg === 123 ? 'credit' : 'debit';
|
|
73
|
+
const formOf = (yearArg, provenanceArg) => ({
|
|
74
|
+
year: yearArg,
|
|
75
|
+
lines: ROWS.map(([kennzahl, line2025, line2026, section, sign, label]) => ({
|
|
76
|
+
kennzahl,
|
|
77
|
+
line: yearArg === 2025 ? line2025 : line2026,
|
|
78
|
+
label,
|
|
79
|
+
section,
|
|
80
|
+
sign,
|
|
81
|
+
side: sideOf(kennzahl, section),
|
|
82
|
+
})),
|
|
83
|
+
provenance: provenanceArg,
|
|
84
|
+
});
|
|
85
|
+
/** The Anlage EÜR of each form year, by year. */
|
|
86
|
+
export const ANLAGE_EUER_FORMS = [
|
|
87
|
+
formOf(2025, 'BMF-Schreiben 2025-08-29 (IV C 6 - S 2142/00023/010/001), Anlage EÜR 2025 and its Anleitung; lines read 2026-10-07'),
|
|
88
|
+
formOf(2026, 'BMF-Schreiben 2026-09-01 (IV C 6 - S 2142/00024/010/001), Anlage EÜR 2026 and its Anleitung; lines read 2026-10-07'),
|
|
89
|
+
];
|
|
90
|
+
/**
|
|
91
|
+
* The Kennzahl a Kleinunternehmer (§ 19 Abs. 1 UStG) states every receipt
|
|
92
|
+
* under but those of Zeilen 18 to 22: "Die Zeilen 15 bis 17 sind von
|
|
93
|
+
* Kleinunternehmern in der Regel nicht zu verwenden" (Anleitung, Zeile 12).
|
|
94
|
+
* `euerLinesOf` and `getEuerLines` with `smallBusiness` take the taxable (Kz 112) and the
|
|
95
|
+
* tax-free or non-taxable receipts (Kz 103) there. Zeile 13 (Kz 119), the
|
|
96
|
+
* "davon" of the non-taxable receipts and those under § 19 Abs. 2 Satz 1
|
|
97
|
+
* Nr. 1 und 2 UStG within Zeile 12, is stated "nachrichtlich" (Anleitung,
|
|
98
|
+
* Zeile 13): no account resolves to it, since an account does not tell which
|
|
99
|
+
* of its receipts fall under it, so that amount stays with the caller.
|
|
100
|
+
*/
|
|
101
|
+
export const EUER_SMALL_BUSINESS_KENNZAHL = 111;
|
|
102
|
+
/** The form years the table holds, ascending. */
|
|
103
|
+
export function listEuerFormYears() {
|
|
104
|
+
return ANLAGE_EUER_FORMS.map((formArg) => formArg.year);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The Anlage EÜR of a form year. Throws for a year the table does not hold —
|
|
108
|
+
* a form's lines must never fall back to another year's silently.
|
|
109
|
+
*/
|
|
110
|
+
export function getEuerForm(year) {
|
|
111
|
+
const form = ANLAGE_EUER_FORMS.find((candidateArg) => candidateArg.year === year);
|
|
112
|
+
if (!form) {
|
|
113
|
+
throw new Error(`No Anlage EÜR for ${year}. Available: ${listEuerFormYears().join(', ')}`);
|
|
114
|
+
}
|
|
115
|
+
return form;
|
|
116
|
+
}
|
|
117
|
+
/** A line of a form year by its Kennzahl; throws where the year's table has none. */
|
|
118
|
+
export function getEuerFormLine(year, kennzahl) {
|
|
119
|
+
const line = getEuerForm(year).lines.find((candidateArg) => candidateArg.kennzahl === kennzahl);
|
|
120
|
+
if (!line) {
|
|
121
|
+
throw new Error(`The Anlage EÜR ${year} has no line of Kz ${kennzahl}`);
|
|
122
|
+
}
|
|
123
|
+
return line;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The lines of an account in a form year, resolved from the account's
|
|
127
|
+
* mapping (`IChartAccount.euer`, `euerExclusion`). Throws for an account that
|
|
128
|
+
* has neither, which a dataset of this package never holds.
|
|
129
|
+
*/
|
|
130
|
+
export function euerLinesOf(account, formYear, options = {}) {
|
|
131
|
+
const lineOf = (kennzahlArg) => getEuerFormLine(formYear, options.smallBusiness && (kennzahlArg === 112 || kennzahlArg === 103) ? EUER_SMALL_BUSINESS_KENNZAHL : kennzahlArg);
|
|
132
|
+
if (account.euer && 'kennzahl' in account.euer) {
|
|
133
|
+
return { kind: 'netted', line: lineOf(account.euer.kennzahl) };
|
|
134
|
+
}
|
|
135
|
+
if (account.euer) {
|
|
136
|
+
return { kind: 'split', debitLine: lineOf(account.euer.debitKennzahl), creditLine: lineOf(account.euer.creditKennzahl) };
|
|
137
|
+
}
|
|
138
|
+
if (account.euerExclusion) {
|
|
139
|
+
return { kind: 'excluded', exclusion: account.euerExclusion };
|
|
140
|
+
}
|
|
141
|
+
throw new Error(`Account ${account.accountNumber} has neither an Anlage EÜR mapping nor an exclusion`);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* What an account's movements of a period, its debits and its credits in
|
|
145
|
+
* integer cents, amount to on its lines: a netted line counts its own side
|
|
146
|
+
* less the other (it may come out negative: a credit note's reversal), a split
|
|
147
|
+
* account each side on its line, an excluded one nothing.
|
|
148
|
+
*/
|
|
149
|
+
export function euerAmountsOf(lines, debitCents, creditCents) {
|
|
150
|
+
switch (lines.kind) {
|
|
151
|
+
case 'netted':
|
|
152
|
+
return [{ line: lines.line, cents: lines.line.side === 'credit' ? creditCents - debitCents : debitCents - creditCents }];
|
|
153
|
+
case 'split':
|
|
154
|
+
return [
|
|
155
|
+
{ line: lines.debitLine, cents: debitCents },
|
|
156
|
+
{ line: lines.creditLine, cents: creditCents },
|
|
157
|
+
];
|
|
158
|
+
case 'excluded':
|
|
159
|
+
return [];
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhcnRkYXRhLmV1ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9jaGFydGRhdGEuZXVlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUErQkEsTUFBTSxNQUFNLEdBQUcsUUFBUSxDQUFDO0FBQ3hCLE1BQU0sT0FBTyxHQUFHLFNBQVMsQ0FBQztBQUUxQiw0RUFBNEU7QUFDNUUsTUFBTSxJQUFJLEdBQVc7SUFDbkIsdUJBQXVCO0lBQ3ZCLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSxFQUFFLEVBQUUsTUFBTSxFQUFFLENBQUMsRUFBRSxtRkFBbUYsQ0FBQztJQUM3RyxDQUFDLEdBQUcsRUFBRSxFQUFFLEVBQUUsRUFBRSxFQUFFLE1BQU0sRUFBRSxDQUFDLEVBQUUsb0dBQW9HLENBQUM7SUFDOUgsQ0FBQyxHQUFHLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRSxNQUFNLEVBQUUsQ0F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FBRSxDQUFDLENBQUM7UUFDM0gsS0FBSyxPQUFPO1lBQ1YsT0FBTztnQkFDTCxFQUFFLElBQUksRUFBRSxLQUFLLENBQUMsU0FBUyxFQUFFLEtBQUssRUFBRSxVQUFVLEVBQUU7Z0JBQzVDLEVBQUUsSUFBSSxFQUFFLEtBQUssQ0FBQyxVQUFVLEVBQUUsS0FBSyxFQUFFLFdBQVcsRUFBRTthQUMvQyxDQUFDO1FBQ0osS0FBSyxVQUFVO1lBQ2IsT0FBTyxFQUFFLENBQUM7SUFDZCxDQUFDO0FBQ0gsQ0FBQyJ9
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { IChart, IChartAccount, IMappingCoverage, IScenarioKennzahlen, TAccountRole, TChartName, TMappingDimension } from './chartdata.types.js';
|
|
1
|
+
import type { IChart, IChartAccount, IMappingCoverage, IScenarioKennzahlen, TAccountRole, TChartName, TEuerAccountLines, TMappingDimension, TSecuritiesRole, TTaxRule } from './chartdata.types.js';
|
|
2
|
+
import { type IEuerLinesOptions } from './chartdata.euer.js';
|
|
2
3
|
/**
|
|
3
4
|
* UStVA Kennzahlen driven by the tax scenario of a booking (not by a single
|
|
4
5
|
* account). Verified against the stable UStVA layout; ERiC validation in the
|
|
@@ -20,8 +21,29 @@ export declare function getAccount(chart: TChartName, year: number, accountNumbe
|
|
|
20
21
|
* chart's order. Throws for unknown chart/year combinations, as `getChart`.
|
|
21
22
|
*/
|
|
22
23
|
export declare function getAccountsByRole(chart: TChartName, year: number, role: TAccountRole): IChartAccount[];
|
|
24
|
+
/**
|
|
25
|
+
* The accounts of a chart with the securities role (`IChartAccount.securitiesRole`),
|
|
26
|
+
* in the chart's order: one without a tax rule and, where DATEV keeps one apart,
|
|
27
|
+
* one under § 3 Nr. 40 EStG / § 8b KStG. Throws for unknown chart/year
|
|
28
|
+
* combinations, as `getChart`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAccountsBySecuritiesRole(chart: TChartName, year: number, role: TSecuritiesRole): IChartAccount[];
|
|
31
|
+
/**
|
|
32
|
+
* The one account of a chart that books the securities role under the tax rule
|
|
33
|
+
* (`taxRule`; none: the account without one), or `null` where the chart keeps
|
|
34
|
+
* none for it. Throws for unknown chart/year combinations, as `getChart`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getSecuritiesAccount(chart: TChartName, year: number, role: TSecuritiesRole, taxRule?: TTaxRule): IChartAccount | null;
|
|
23
37
|
/**
|
|
24
38
|
* Coverage check for the accounts a ledger actually uses. Callers must treat
|
|
25
39
|
* missing/unknown accounts as a hard error before generating filings.
|
|
26
40
|
*/
|
|
27
41
|
export declare function getMappingCoverage(chart: TChartName, year: number, usedAccounts: string[], dimension: TMappingDimension): IMappingCoverage;
|
|
42
|
+
/**
|
|
43
|
+
* The Anlage EÜR lines of a chart's account in a form year (`euerLinesOf`):
|
|
44
|
+
* where its movements go, or why they are no part of the form. `null` for an
|
|
45
|
+
* account the chart does not hold. Throws for an unknown chart, chart year or
|
|
46
|
+
* form year. The chart year and the form year are apart on purpose: a host
|
|
47
|
+
* that books a year on the nearest chart dataset states it on that year's form.
|
|
48
|
+
*/
|
|
49
|
+
export declare function getEuerLines(chart: TChartName, chartYear: number, accountNumber: string, formYear: number, options?: IEuerLinesOptions): TEuerAccountLines | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { euerLinesOf } from './chartdata.euer.js';
|
|
1
2
|
import { SKR03_2026 } from './data/skr03.2026.js';
|
|
2
3
|
import { SKR04_2026 } from './data/skr04.2026.js';
|
|
3
4
|
const CHARTS = [SKR03_2026, SKR04_2026];
|
|
@@ -49,6 +50,23 @@ export function getAccount(chart, year, accountNumber) {
|
|
|
49
50
|
export function getAccountsByRole(chart, year, role) {
|
|
50
51
|
return getChart(chart, year).accounts.filter((account) => account.accountRole === role);
|
|
51
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The accounts of a chart with the securities role (`IChartAccount.securitiesRole`),
|
|
55
|
+
* in the chart's order: one without a tax rule and, where DATEV keeps one apart,
|
|
56
|
+
* one under § 3 Nr. 40 EStG / § 8b KStG. Throws for unknown chart/year
|
|
57
|
+
* combinations, as `getChart`.
|
|
58
|
+
*/
|
|
59
|
+
export function getAccountsBySecuritiesRole(chart, year, role) {
|
|
60
|
+
return getChart(chart, year).accounts.filter((account) => account.securitiesRole === role);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The one account of a chart that books the securities role under the tax rule
|
|
64
|
+
* (`taxRule`; none: the account without one), or `null` where the chart keeps
|
|
65
|
+
* none for it. Throws for unknown chart/year combinations, as `getChart`.
|
|
66
|
+
*/
|
|
67
|
+
export function getSecuritiesAccount(chart, year, role, taxRule) {
|
|
68
|
+
return getAccountsBySecuritiesRole(chart, year, role).find((account) => account.taxRule === taxRule) ?? null;
|
|
69
|
+
}
|
|
52
70
|
function hasMapping(account, dimension) {
|
|
53
71
|
switch (dimension) {
|
|
54
72
|
case 'ustva':
|
|
@@ -59,6 +77,8 @@ function hasMapping(account, dimension) {
|
|
|
59
77
|
return account.hgb275Position !== undefined;
|
|
60
78
|
case 'ebilanz':
|
|
61
79
|
return account.ebilanzPosition !== undefined;
|
|
80
|
+
case 'euer':
|
|
81
|
+
return account.euer !== undefined || account.euerExclusion !== undefined;
|
|
62
82
|
}
|
|
63
83
|
}
|
|
64
84
|
/**
|
|
@@ -84,4 +104,15 @@ export function getMappingCoverage(chart, year, usedAccounts, dimension) {
|
|
|
84
104
|
}
|
|
85
105
|
return { dimension, requested: usedAccounts.length, covered, missing, unknown };
|
|
86
106
|
}
|
|
87
|
-
|
|
107
|
+
/**
|
|
108
|
+
* The Anlage EÜR lines of a chart's account in a form year (`euerLinesOf`):
|
|
109
|
+
* where its movements go, or why they are no part of the form. `null` for an
|
|
110
|
+
* account the chart does not hold. Throws for an unknown chart, chart year or
|
|
111
|
+
* form year. The chart year and the form year are apart on purpose: a host
|
|
112
|
+
* that books a year on the nearest chart dataset states it on that year's form.
|
|
113
|
+
*/
|
|
114
|
+
export function getEuerLines(chart, chartYear, accountNumber, formYear, options = {}) {
|
|
115
|
+
const account = getAccount(chart, chartYear, accountNumber);
|
|
116
|
+
return account ? euerLinesOf(account, formYear, options) : null;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhcnRkYXRhLmxvb2t1cC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2NoYXJ0ZGF0YS5sb29rdXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBWUEsT0FBTyxFQUFFLFdBQVcsRUFBMEIsTUFBTSxxQkFBcUIsQ0FBQztBQUMxRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDbEQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBRWxELE1BQU0sTUFBTSxHQUFhLENBQUMsVUFBVSxFQUFFLFVBQVUsQ0FBQyxDQUFDO0FBRWxEOzs7O0dBSUc7QUFDSCxNQUFNLENBQUMsTUFBTSx5QkFBeUIsR0FBd0I7SUFDNUQsOEJBQThCLEVBQUUsRUFBRTtJQUNsQyw2QkFBNkIsRUFBRSxFQUFFO0lBQ2pDLDJCQUEyQixFQUFFLEVBQUU7SUFDL0IsMEJBQTBCLEVBQUUsRUFBRTtJQUM5QiwyQkFBMkIsRUFBRSxFQUFFO0lBQy9CLDBCQUEwQixFQUFFLEVBQUU7SUFDOUIsc0JBQXNCLEVBQUUsRUFBRTtJQUMxQixxQkFBcUIsRUFBRSxFQUFFO0lBQ3pCLGlCQUFpQixFQUFFLEVBQUU7SUFDckIsVUFBVSxFQUFFLEVBQUU7SUFDZCxvQkFBb0IsRUFBRSxFQUFFO0lBQ3hCLG1CQUFtQixFQUFFLEVBQUU7SUFDdkIseUJBQXlCLEVBQUUsRUFBRTtJQUM3QixRQUFRLEVBQUUsRUFBRTtJQU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sT0FBTyxHQUFHLFFBQVEsQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDLENBQUM7UUFDNUMsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO1lBQ2IsT0FBTyxDQUFDLElBQUksQ0FBQyxhQUFhLENBQUMsQ0FBQztZQUM1QixTQUFTO1FBQ1gsQ0FBQztRQUNELElBQUksVUFBVSxDQUFDLE9BQU8sRUFBRSxTQUFTLENBQUM7WUFBRSxPQUFPLEVBQUUsQ0FBQzs7WUFDekMsT0FBTyxDQUFDLElBQUksQ0FBQyxhQUFhLENBQUMsQ0FBQztJQUNuQyxDQUFDO0lBQ0QsT0FBTyxFQUFFLFNBQVMsRUFBRSxTQUFTLEVBQUUsWUFBWSxDQUFDLE1BQU0sRUFBRSxPQUFPLEVBQUUsT0FBTyxFQUFFLE9BQU8sRUFBRSxDQUFDO0FBQ2xGLENBQUM7QUFFRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsWUFBWSxDQUMxQixLQUFpQixFQUNqQixTQUFpQixFQUNqQixhQUFxQixFQUNyQixRQUFnQixFQUNoQixVQUE2QixFQUFFO0lBRS9CLE1BQU0sT0FBTyxHQUFHLFVBQVUsQ0FBQyxLQUFLLEVBQUUsU0FBUyxFQUFFLGFBQWEsQ0FBQyxDQUFDO0lBQzVELE9BQU8sT0FBTyxDQUFDLENBQUMsQ0FBQyxXQUFXLENBQUMsT0FBTyxFQUFFLFFBQVEsRUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDO0FBQ2xFLENBQUMifQ==
|
|
@@ -13,6 +13,55 @@ export type TAccountType = 'asset' | 'liability' | 'equity' | 'revenue' | 'expen
|
|
|
13
13
|
* books with ("Anlagenabgänge … (Restbuchwert …)"), an expense account.
|
|
14
14
|
*/
|
|
15
15
|
export type TAccountRole = 'asset_sale_proceeds' | 'disposal_book_value';
|
|
16
|
+
/**
|
|
17
|
+
* What an account books of a business's securities (Wertpapiere): holding
|
|
18
|
+
* them, their income, their sale, their valuation at a closing date and the
|
|
19
|
+
* taxes withheld from their income. A booking of securities finds its
|
|
20
|
+
* account by this role together with the account's `taxRule`: within a
|
|
21
|
+
* chart, no two accounts share both.
|
|
22
|
+
* - holdings, by the balance-sheet item (§ 266 Abs. 2 HGB):
|
|
23
|
+
* 'holding_fixed' (Wertpapiere des Anlagevermögens, A.III.5),
|
|
24
|
+
* 'holding_fixed_shares' (those whose income falls under the
|
|
25
|
+
* Teileinkünfteverfahren, A.III.5), 'holding_fixed_bonds' (fixed-interest
|
|
26
|
+
* ones, A.III.5), 'holding_current' (sonstige Wertpapiere, B.III.2);
|
|
27
|
+
* - their income (dividends, distributions, coupons) by whether the
|
|
28
|
+
* securities are fixed or current assets: 'income_fixed', 'income_current';
|
|
29
|
+
* - the sale of current assets, stated net: 'sale_gain_current',
|
|
30
|
+
* 'sale_loss_current';
|
|
31
|
+
* - the sale of fixed assets, stated gross on the accounts of a fixed asset's
|
|
32
|
+
* disposal (`accountRole`): what it fetched, 'sale_proceeds_fixed_gain' and
|
|
33
|
+
* 'sale_proceeds_fixed_loss', and the book value it leaves the books with,
|
|
34
|
+
* 'book_value_fixed_gain' and 'book_value_fixed_loss', by whether the sale
|
|
35
|
+
* makes a book gain or a book loss;
|
|
36
|
+
* - the costs of a sale DATEV states apart, 'sale_costs_gain' and
|
|
37
|
+
* 'sale_costs_loss' (§ 8b Abs. 2 Satz 2 KStG);
|
|
38
|
+
* - the valuation at a closing date (§ 253 Abs. 3 to 5 HGB): a fixed asset's
|
|
39
|
+
* write-down for a lasting or a temporary decline,
|
|
40
|
+
* 'writedown_fixed_lasting' and 'writedown_fixed_temporary', a current
|
|
41
|
+
* asset's, 'writedown_current', and the write-ups, 'writeup_fixed',
|
|
42
|
+
* 'writeup_current', and 'writeup' where one account takes either;
|
|
43
|
+
* - the taxes withheld from their income: 'capital_gains_tax'
|
|
44
|
+
* (Kapitalertragsteuer) and 'capital_gains_tax_soli' (the Solidaritätszuschlag
|
|
45
|
+
* on it), 'foreign_withholding_tax' (a foreign tax to be credited or
|
|
46
|
+
* deducted), 'foreign_tax_exempt_income' (a foreign tax on income exempt at
|
|
47
|
+
* home), and 'foreign_tax_refund' (a foreign tax to be refunded);
|
|
48
|
+
* - 'margin_interest': the interest on a short-term debt, such as a broker's
|
|
49
|
+
* margin loan.
|
|
50
|
+
*/
|
|
51
|
+
export type TSecuritiesRole = 'holding_fixed' | 'holding_fixed_shares' | 'holding_fixed_bonds' | 'holding_current' | 'income_fixed' | 'income_current' | 'sale_gain_current' | 'sale_loss_current' | 'sale_proceeds_fixed_gain' | 'sale_proceeds_fixed_loss' | 'book_value_fixed_gain' | 'book_value_fixed_loss' | 'sale_costs_gain' | 'sale_costs_loss' | 'writedown_fixed_lasting' | 'writedown_fixed_temporary' | 'writedown_current' | 'writeup_fixed' | 'writeup_current' | 'writeup' | 'capital_gains_tax' | 'capital_gains_tax_soli' | 'foreign_withholding_tax' | 'foreign_tax_exempt_income' | 'foreign_tax_refund' | 'margin_interest';
|
|
52
|
+
/**
|
|
53
|
+
* A rule of the income tax law an income or expense account is kept for, as
|
|
54
|
+
* its DATEV name states it:
|
|
55
|
+
* - 'estg_3_40_kstg_8b': income from shares and the expenses of it under the
|
|
56
|
+
* Teileinkünfteverfahren (§ 3 Nr. 40, § 3c Abs. 2 EStG) or, for a
|
|
57
|
+
* corporation, § 8b KStG — DATEV names these accounts "§ 3 Nr. 40 EStG bzw.
|
|
58
|
+
* § 8b … KStG". DATEV's interface to the corporate income tax treats their
|
|
59
|
+
* income as 100 % tax-free and their expenses as 100 % non-deductible, its
|
|
60
|
+
* interface to the trade tax 40 % each (Kontenrahmen SKR 03 and SKR 04,
|
|
61
|
+
* gültig für 2026, footnote 9); the corrections are made in the return, not
|
|
62
|
+
* in the books.
|
|
63
|
+
*/
|
|
64
|
+
export type TTaxRule = 'estg_3_40_kstg_8b';
|
|
16
65
|
/**
|
|
17
66
|
* Built-in DATEV tax automatism of an account. Lines on automatik accounts
|
|
18
67
|
* must carry no BU key (automatism applies) or key 40 (automatism cancelled).
|
|
@@ -35,6 +84,105 @@ export interface IUstvaMapping {
|
|
|
35
84
|
kennzahl: number;
|
|
36
85
|
role: 'base' | 'tax';
|
|
37
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Where an account's movements go in the Anlage EÜR (the standardised
|
|
89
|
+
* Einnahmenüberschussrechnung, § 60 Abs. 4 EStDV), by the Kennzahl of the
|
|
90
|
+
* form's line (`ANLAGE_EUER_FORMS`; the line number itself changes with the
|
|
91
|
+
* form year, the Kennzahl does not):
|
|
92
|
+
* - `{ kennzahl }`: the movements of both sides, netted toward the line's own
|
|
93
|
+
* side: a line of receipts counts credits less debits (a sales deduction
|
|
94
|
+
* lowers the receipts), a line of expenses debits less credits (a received
|
|
95
|
+
* discount lowers the goods);
|
|
96
|
+
* - `{ debitKennzahl, creditKennzahl }`: each side on a line of its own, not
|
|
97
|
+
* netted: the VAT paid to the tax office (Kz 186) and the VAT it refunded
|
|
98
|
+
* (Kz 141) on one account.
|
|
99
|
+
*/
|
|
100
|
+
export type TEuerMapping = {
|
|
101
|
+
kennzahl: number;
|
|
102
|
+
} | {
|
|
103
|
+
debitKennzahl: number;
|
|
104
|
+
creditKennzahl: number;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Why an account's movements are no part of the Anlage EÜR, which counts
|
|
108
|
+
* receipts and expenses when paid (§ 4 Abs. 3, § 11 EStG):
|
|
109
|
+
* - 'balance_sheet': a payment moves between the business's own money, claims
|
|
110
|
+
* and debts (bank, cash, receivables, payables, loans, provisions, equity);
|
|
111
|
+
* - 'fixed_asset': a fixed asset's cost reaches the form through its
|
|
112
|
+
* depreciation and, at its disposal, its residual book value (AfA, GWG,
|
|
113
|
+
* Restbuchwerte), not through the asset account;
|
|
114
|
+
* - 'inventory': stock and its changes: goods count when paid, and a
|
|
115
|
+
* cash-basis book keeps no inventory;
|
|
116
|
+
* - 'valuation': a value at a closing date, which a cash-basis book does not
|
|
117
|
+
* state (currency revaluation, the valuation of the cash funds);
|
|
118
|
+
* - 'pass_through': durchlaufende Posten, received and spent in another's name
|
|
119
|
+
* and for another's account (§ 4 Abs. 3 Satz 2 EStG);
|
|
120
|
+
* - 'reverse_charge': the tax a recipient owes on an intra-Community
|
|
121
|
+
* acquisition or under § 13b UStG and deducts as input tax in the same
|
|
122
|
+
* return: no receipt and no payment of its own (Anleitung zur Anlage EÜR,
|
|
123
|
+
* Zeile 58); what a return leaves to pay counts as paid VAT (Kz 186);
|
|
124
|
+
* - 'closing': a carry-forward, closing or statistical account, which records
|
|
125
|
+
* no business transaction;
|
|
126
|
+
* - 'deferred_current_asset': a current asset named in § 4 Abs. 3 Satz 4
|
|
127
|
+
* EStG — shares, securities, land and buildings —, whose cost counts only
|
|
128
|
+
* when its sale's proceeds are received or it is withdrawn, as goods
|
|
129
|
+
* (Zeile 29, Kz 100), through the list of such assets in the Anlage AVEÜR
|
|
130
|
+
* (Zeilen 93 bis 96), not when it is paid.
|
|
131
|
+
*/
|
|
132
|
+
export type TEuerExclusion = 'balance_sheet' | 'fixed_asset' | 'inventory' | 'valuation' | 'pass_through' | 'reverse_charge' | 'closing' | 'deferred_current_asset';
|
|
133
|
+
/**
|
|
134
|
+
* The part of the Anlage EÜR a line belongs to: Betriebseinnahmen (Zeilen
|
|
135
|
+
* 12 bis 22), Betriebsausgaben (Zeilen 24 bis 76 of the 2026 form), or the
|
|
136
|
+
* private Entnahmen and Einlagen of a sole proprietor (Zeilen 107 and 108).
|
|
137
|
+
*/
|
|
138
|
+
export type TEuerSection = 'income' | 'expense' | 'private';
|
|
139
|
+
/** One line of the Anlage EÜR of a form year that an account's movements can go to. */
|
|
140
|
+
export interface IEuerFormLine {
|
|
141
|
+
/**
|
|
142
|
+
* The line's Kennzahl on the form. Unique among the lines of a form's
|
|
143
|
+
* table; the form reuses some numbers in its general and closing sections,
|
|
144
|
+
* which the table does not hold.
|
|
145
|
+
*/
|
|
146
|
+
kennzahl: number;
|
|
147
|
+
/** the line ("Zeile") on the year's form */
|
|
148
|
+
line: number;
|
|
149
|
+
/** the line's text on the form; a line of two columns names its column ("nicht abziehbar", "abziehbar") */
|
|
150
|
+
label: string;
|
|
151
|
+
section: TEuerSection;
|
|
152
|
+
/**
|
|
153
|
+
* How the line enters its section's sum (Zeilen 23 and 76): 1 adds, -1
|
|
154
|
+
* subtracts (the travel to the first place of business, Zeile 73, and the
|
|
155
|
+
* non-deductible amounts, Zeile 75), 0 not at all (a "davon" line, the
|
|
156
|
+
* column "nicht abziehbar", the Entnahmen and Einlagen).
|
|
157
|
+
*/
|
|
158
|
+
sign: 1 | -1 | 0;
|
|
159
|
+
/** the side whose movements the line counts, net of the other: receipts and Einlagen credit, expenses and Entnahmen debit */
|
|
160
|
+
side: 'debit' | 'credit';
|
|
161
|
+
}
|
|
162
|
+
/** The lines of the Anlage EÜR of one form year, as the BMF published the form. */
|
|
163
|
+
export interface IEuerForm {
|
|
164
|
+
year: number;
|
|
165
|
+
lines: IEuerFormLine[];
|
|
166
|
+
/** the published form these lines were read from */
|
|
167
|
+
provenance: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* The lines an account's movements go to in a form year:
|
|
171
|
+
* - 'netted': both sides, netted, on one line;
|
|
172
|
+
* - 'split': each side on a line of its own;
|
|
173
|
+
* - 'excluded': none, and why.
|
|
174
|
+
*/
|
|
175
|
+
export type TEuerAccountLines = {
|
|
176
|
+
kind: 'netted';
|
|
177
|
+
line: IEuerFormLine;
|
|
178
|
+
} | {
|
|
179
|
+
kind: 'split';
|
|
180
|
+
debitLine: IEuerFormLine;
|
|
181
|
+
creditLine: IEuerFormLine;
|
|
182
|
+
} | {
|
|
183
|
+
kind: 'excluded';
|
|
184
|
+
exclusion: TEuerExclusion;
|
|
185
|
+
};
|
|
38
186
|
export interface IChartAccount {
|
|
39
187
|
accountNumber: string;
|
|
40
188
|
accountName: string;
|
|
@@ -42,6 +190,10 @@ export interface IChartAccount {
|
|
|
42
190
|
accountType: TAccountType;
|
|
43
191
|
/** what the account is for beyond its type and HGB position; unset = they say it all */
|
|
44
192
|
accountRole?: TAccountRole;
|
|
193
|
+
/** what the account books of a business's securities; unset = nothing of its own */
|
|
194
|
+
securitiesRole?: TSecuritiesRole;
|
|
195
|
+
/** the income tax rule the account is kept for, as its DATEV name states it; unset = none of its own */
|
|
196
|
+
taxRule?: TTaxRule;
|
|
45
197
|
description?: string;
|
|
46
198
|
automatikFunction?: TAutomatikFunction;
|
|
47
199
|
/** BU keys allowed on lines of this account ('' = none). Unset = all. */
|
|
@@ -53,6 +205,10 @@ export interface IChartAccount {
|
|
|
53
205
|
hgb275Position?: string;
|
|
54
206
|
/** E-Bilanz de-gaap-ci taxonomy position (A3 — not yet populated) */
|
|
55
207
|
ebilanzPosition?: string;
|
|
208
|
+
/** the Anlage EÜR line(s) the account's movements go to; every account has this or `euerExclusion` */
|
|
209
|
+
euer?: TEuerMapping;
|
|
210
|
+
/** why the account's movements are no part of the Anlage EÜR */
|
|
211
|
+
euerExclusion?: TEuerExclusion;
|
|
56
212
|
/** where this record's facts come from (source, date) */
|
|
57
213
|
provenance: string;
|
|
58
214
|
/** first year this record is valid for */
|
|
@@ -64,7 +220,8 @@ export interface IChart {
|
|
|
64
220
|
year: number;
|
|
65
221
|
accounts: IChartAccount[];
|
|
66
222
|
}
|
|
67
|
-
|
|
223
|
+
/** 'euer' counts an account covered when it maps to the Anlage EÜR or is excluded from it with a reason. */
|
|
224
|
+
export type TMappingDimension = 'ustva' | 'hgb266' | 'hgb275' | 'ebilanz' | 'euer';
|
|
68
225
|
export interface IMappingCoverage {
|
|
69
226
|
dimension: TMappingDimension;
|
|
70
227
|
requested: number;
|