@kreiseck/kasseneck-api 1.37.0 → 1.38.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/CHANGELOG.md +21 -0
- package/README.md +16 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +6 -5
- package/dist/cjs/invoice/texte.d.ts +18 -1
- package/dist/cjs/invoice/texte.js +43 -2
- package/dist/cjs/invoice/vertrag.d.ts +1 -1
- package/dist/cjs/invoice/vertrag.js +1 -0
- package/dist/cjs/models/cancellation.d.ts +1 -1
- package/dist/cjs/models/cancellation.js +2 -0
- package/dist/cjs/models/index.d.ts +2 -1
- package/dist/cjs/models/index.js +6 -3
- package/dist/cjs/models/invoice-payment-ref.d.ts +42 -0
- package/dist/cjs/models/invoice-payment-ref.js +38 -0
- package/dist/cjs/models/receipt-item.d.ts +10 -2
- package/dist/cjs/models/receipt-item.js +14 -1
- package/dist/cjs/models/receipt.d.ts +7 -0
- package/dist/cjs/models/receipt.js +6 -0
- package/dist/cjs/pos/schicht-lesen.js +5 -0
- package/dist/cjs/pos/schicht-typen.d.ts +11 -0
- package/dist/cjs/pos/texte.d.ts +13 -2
- package/dist/cjs/pos/texte.js +18 -3
- package/dist/cjs/receipt/index.d.ts +1 -0
- package/dist/cjs/receipt/index.js +4 -2
- package/dist/cjs/receipt/layout.d.ts +2 -2
- package/dist/cjs/receipt/layout.js +106 -117
- package/dist/cjs/receipt/shift-sheet.js +6 -1
- package/dist/cjs/receipt/vermerke.d.ts +80 -0
- package/dist/cjs/receipt/vermerke.js +167 -0
- package/dist/cjs/stored/draht.js +25 -1
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +21 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/invoice/texte.d.ts +18 -1
- package/dist/esm/invoice/texte.js +43 -2
- package/dist/esm/invoice/vertrag.d.ts +1 -1
- package/dist/esm/invoice/vertrag.js +1 -0
- package/dist/esm/models/cancellation.d.ts +1 -1
- package/dist/esm/models/cancellation.js +2 -0
- package/dist/esm/models/index.d.ts +2 -1
- package/dist/esm/models/index.js +2 -1
- package/dist/esm/models/invoice-payment-ref.d.ts +42 -0
- package/dist/esm/models/invoice-payment-ref.js +35 -0
- package/dist/esm/models/receipt-item.d.ts +10 -2
- package/dist/esm/models/receipt-item.js +13 -1
- package/dist/esm/models/receipt.d.ts +7 -0
- package/dist/esm/models/receipt.js +6 -0
- package/dist/esm/pos/schicht-lesen.js +5 -0
- package/dist/esm/pos/schicht-typen.d.ts +11 -0
- package/dist/esm/pos/texte.d.ts +13 -2
- package/dist/esm/pos/texte.js +18 -3
- package/dist/esm/receipt/index.d.ts +1 -0
- package/dist/esm/receipt/index.js +1 -0
- package/dist/esm/receipt/layout.d.ts +2 -2
- package/dist/esm/receipt/layout.js +103 -113
- package/dist/esm/receipt/shift-sheet.js +6 -1
- package/dist/esm/receipt/vermerke.d.ts +80 -0
- package/dist/esm/receipt/vermerke.js +155 -0
- package/dist/esm/stored/draht.js +25 -1
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +21 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/expected/invoice-payment-cancellation.grid32.txt +28 -0
- package/fixtures/expected/invoice-payment-cancellation.grid48.txt +26 -0
- package/fixtures/expected/invoice-payment-cancellation.lines.json +189 -0
- package/fixtures/expected/invoice-payment-cancellation.sheet32.json +194 -0
- package/fixtures/expected/invoice-payment-cancellation.sheet48.json +182 -0
- package/fixtures/expected/invoice-payment-manual-receipt.grid32.txt +30 -0
- package/fixtures/expected/invoice-payment-manual-receipt.grid48.txt +29 -0
- package/fixtures/expected/invoice-payment-manual-receipt.lines.json +199 -0
- package/fixtures/expected/invoice-payment-manual-receipt.sheet32.json +206 -0
- package/fixtures/expected/invoice-payment-manual-receipt.sheet48.json +200 -0
- package/fixtures/expected/invoice-payment-normal.grid32.txt +22 -0
- package/fixtures/expected/invoice-payment-normal.grid48.txt +21 -0
- package/fixtures/expected/invoice-payment-normal.lines.json +192 -0
- package/fixtures/expected/invoice-payment-normal.sheet32.json +158 -0
- package/fixtures/expected/invoice-payment-normal.sheet48.json +152 -0
- package/fixtures/expected/invoice-payment-outage.grid32.txt +23 -0
- package/fixtures/expected/invoice-payment-outage.grid48.txt +21 -0
- package/fixtures/expected/invoice-payment-outage.lines.json +172 -0
- package/fixtures/expected/invoice-payment-outage.sheet32.json +164 -0
- package/fixtures/expected/invoice-payment-outage.sheet48.json +152 -0
- package/fixtures/expected/invoice-payment-partial.grid32.txt +20 -0
- package/fixtures/expected/invoice-payment-partial.grid48.txt +20 -0
- package/fixtures/expected/invoice-payment-partial.lines.json +162 -0
- package/fixtures/expected/invoice-payment-partial.sheet32.json +146 -0
- package/fixtures/expected/invoice-payment-partial.sheet48.json +146 -0
- package/fixtures/expected/invoice-payment-refund.grid32.txt +20 -0
- package/fixtures/expected/invoice-payment-refund.grid48.txt +20 -0
- package/fixtures/expected/invoice-payment-refund.lines.json +162 -0
- package/fixtures/expected/invoice-payment-refund.sheet32.json +146 -0
- package/fixtures/expected/invoice-payment-refund.sheet48.json +146 -0
- package/fixtures/expected/invoice-payment-see-invoice.grid32.txt +22 -0
- package/fixtures/expected/invoice-payment-see-invoice.grid48.txt +21 -0
- package/fixtures/expected/invoice-payment-see-invoice.lines.json +192 -0
- package/fixtures/expected/invoice-payment-see-invoice.sheet32.json +158 -0
- package/fixtures/expected/invoice-payment-see-invoice.sheet48.json +152 -0
- package/fixtures/expected/invoice-payment-training.grid32.txt +30 -0
- package/fixtures/expected/invoice-payment-training.grid48.txt +27 -0
- package/fixtures/expected/invoice-payment-training.lines.json +183 -0
- package/fixtures/expected/invoice-payment-training.sheet32.json +206 -0
- package/fixtures/expected/invoice-payment-training.sheet48.json +188 -0
- package/fixtures/expected/invoice-payment-without-vat.grid32.txt +20 -0
- package/fixtures/expected/invoice-payment-without-vat.grid48.txt +19 -0
- package/fixtures/expected/invoice-payment-without-vat.lines.json +162 -0
- package/fixtures/expected/invoice-payment-without-vat.sheet32.json +146 -0
- package/fixtures/expected/invoice-payment-without-vat.sheet48.json +140 -0
- package/fixtures/expected/invoice-payment-zero-percent.grid32.txt +22 -0
- package/fixtures/expected/invoice-payment-zero-percent.grid48.txt +21 -0
- package/fixtures/expected/invoice-payment-zero-percent.lines.json +192 -0
- package/fixtures/expected/invoice-payment-zero-percent.sheet32.json +158 -0
- package/fixtures/expected/invoice-payment-zero-percent.sheet48.json +152 -0
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +3 -2
- package/fixtures/invoice-texts.json +37 -3
- package/fixtures/manifest.json +80 -0
- package/fixtures/pos-message-cases.json +3 -0
- package/fixtures/pos-texts.json +14 -1
- package/fixtures/receipt-due-generated.json +3 -3
- package/fixtures/receipt-due-voucher-generated.json +5 -5
- package/fixtures/receipts/invoice-payment-cancellation.json +70 -0
- package/fixtures/receipts/invoice-payment-manual-receipt.json +69 -0
- package/fixtures/receipts/invoice-payment-normal.json +65 -0
- package/fixtures/receipts/invoice-payment-outage.json +63 -0
- package/fixtures/receipts/invoice-payment-partial.json +63 -0
- package/fixtures/receipts/invoice-payment-refund.json +63 -0
- package/fixtures/receipts/invoice-payment-see-invoice.json +65 -0
- package/fixtures/receipts/invoice-payment-training.json +63 -0
- package/fixtures/receipts/invoice-payment-without-vat.json +63 -0
- package/fixtures/receipts/invoice-payment-zero-percent.json +65 -0
- package/fixtures/surface.json +3 -2
- package/fixtures/v3/antworten/belege.json +2 -2
- package/fixtures/v3/antworten/belegmail.json +2 -2
- package/fixtures/v3/antworten/berichte.json +2 -2
- package/fixtures/v3/antworten/kasse-belege.json +2 -2
- package/fixtures/v3/antworten/kasse.json +10 -127
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +2 -2
- package/fixtures/v3/antworten/storno.json +2 -2
- package/fixtures/v3/stored/belege.json +2 -2
- package/fixtures/v3/stored/kasse.json +3 -3
- package/fixtures/v3/stored/rechnungen.json +2 -2
- package/fixtures/v3/v3-vokabular.json +172 -18
- package/fixtures/v3/zahlbetrag-faelle.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SIGNATUR_AUSGEFALLEN = exports.TESTSIGNATUR_TEXT = exports.TESTKASSE_TEXT = void 0;
|
|
4
|
+
exports.receiptSignatureFailed = receiptSignatureFailed;
|
|
5
|
+
exports.belegtyp = belegtyp;
|
|
6
|
+
exports.testkasseVermerk = testkasseVermerk;
|
|
7
|
+
exports.testsignaturVermerk = testsignaturVermerk;
|
|
8
|
+
exports.trainingVermerk = trainingVermerk;
|
|
9
|
+
exports.stornoVermerk = stornoVermerk;
|
|
10
|
+
exports.nacherfassungTeile = nacherfassungTeile;
|
|
11
|
+
exports.signaturausfallVermerk = signaturausfallVermerk;
|
|
12
|
+
exports.receiptNotes = receiptNotes;
|
|
13
|
+
const index_js_1 = require("../models/index.js");
|
|
14
|
+
const vienna_time_js_1 = require("../vienna-time.js");
|
|
15
|
+
const errors_js_1 = require("../client/errors.js");
|
|
16
|
+
// ------------------------------------------------------------------- Texte
|
|
17
|
+
exports.TESTKASSE_TEXT = 'TESTKASSE — kein gültiger Beleg';
|
|
18
|
+
exports.TESTSIGNATUR_TEXT = 'TESTSIGNATUR — kein gültiger Beleg';
|
|
19
|
+
/** Text, den das Backend statt einer Signatur ablegt, wenn die Karte ausfaellt. */
|
|
20
|
+
exports.SIGNATUR_AUSGEFALLEN = 'Sicherheitseinrichtung ausgefallen';
|
|
21
|
+
/**
|
|
22
|
+
* Derselbe Text base64url-kodiert -- so steht er als dritter JWS-Teil im Feld
|
|
23
|
+
* `sig` (Zwilling von `RKSVService.isSigSuccess`). Fest hinterlegt statt zur
|
|
24
|
+
* Laufzeit kodiert: `btoa`/`Buffer` sind in Browser und Node verschieden zu
|
|
25
|
+
* haben, und der Wert ist unveraenderlich.
|
|
26
|
+
*/
|
|
27
|
+
const SIGNATUR_AUSGEFALLEN_BASE64URL = 'U2ljaGVyaGVpdHNlaW5yaWNodHVuZyBhdXNnZWZhbGxlbg';
|
|
28
|
+
/** Erklaerung am Trainingsbeleg (Wortlaut mit dem Betreiber abgestimmt). */
|
|
29
|
+
const TRAINING_ERKLAERUNG = [
|
|
30
|
+
'Trainingsbuchung — kein Kauf, keine Zahlung, keine steuerliche Buchung.',
|
|
31
|
+
'Sollten Sie diesen Beleg als Kunde erhalten haben, sagen Sie bitte dem Betrieb Bescheid.',
|
|
32
|
+
];
|
|
33
|
+
/** Grund-Zeile nach einem Ausfall der Kasse; `other` druckt den eigenen Text. */
|
|
34
|
+
const NACHERFASSUNG_GRUND = {
|
|
35
|
+
network_outage: 'Internet', power_outage: 'Strom', device_failure: 'Gerät defekt', system_outage: 'Störung',
|
|
36
|
+
};
|
|
37
|
+
// ------------------------------------------------------------ Hilfsregeln
|
|
38
|
+
/** Wurde der Beleg ohne funktionierende Signatureinheit ausgestellt? */
|
|
39
|
+
function receiptSignatureFailed(receipt) {
|
|
40
|
+
return receipt.sig.split('.')[2] === SIGNATUR_AUSGEFALLEN_BASE64URL;
|
|
41
|
+
}
|
|
42
|
+
/** Belegtyp als Zeichenkette (Enum-Objekt oder roher Serverwert). */
|
|
43
|
+
function belegtyp(receipt) {
|
|
44
|
+
return typeof receipt.receiptType === 'object' ? receipt.receiptType.value : String(receipt.receiptType ?? '');
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Datum des stornierten Originals: „11.08.2026, 09:02 Uhr". Ein unlesbarer
|
|
48
|
+
* Zeitstempel am BEZUG ist kein Grund, den Storno-Bon zu verweigern (der
|
|
49
|
+
* Beleg selbst ist gueltig) -- dann bleibt die Zeile weg.
|
|
50
|
+
*/
|
|
51
|
+
function originalDatum(timeStamp) {
|
|
52
|
+
try {
|
|
53
|
+
const t = (0, vienna_time_js_1.toViennaWallClock)((0, vienna_time_js_1.parseServerTimeStamp)(timeStamp));
|
|
54
|
+
const zwei = (n) => String(n).padStart(2, '0');
|
|
55
|
+
return `${zwei(t.day)}.${zwei(t.month)}.${t.year}, ${zwei(t.hour)}:${zwei(t.minute)} Uhr`;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Grund eines Stornos lesbar -- aus dem EINEN Katalog des Modells
|
|
63
|
+
* (`CANCELLATION_REASONS`, derselbe, den die Kasse anbietet und das Backend
|
|
64
|
+
* annimmt). Unbekannter Code (Fremdclient): sichtbar, aber ohne zu werfen.
|
|
65
|
+
*/
|
|
66
|
+
function stornoGrundText(code) {
|
|
67
|
+
if (!code)
|
|
68
|
+
return null;
|
|
69
|
+
return (0, index_js_1.isCancellationReason)(code) ? index_js_1.CANCELLATION_REASONS[code] : code;
|
|
70
|
+
}
|
|
71
|
+
/** `YYYY-MM-DD` als `TT.MM.JJJJ`; anderes bleibt, wie es kam. */
|
|
72
|
+
function handbelegDatum(tag) {
|
|
73
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(tag);
|
|
74
|
+
return m ? `${m[3]}.${m[2]}.${m[1]}` : tag;
|
|
75
|
+
}
|
|
76
|
+
// ---------------------------------------------------------------- Bausteine
|
|
77
|
+
function testkasseVermerk() {
|
|
78
|
+
return { kind: 'test_cashregister', title: exports.TESTKASSE_TEXT, lines: [] };
|
|
79
|
+
}
|
|
80
|
+
function testsignaturVermerk() {
|
|
81
|
+
return { kind: 'test_signature', title: exports.TESTSIGNATUR_TEXT, lines: [] };
|
|
82
|
+
}
|
|
83
|
+
/** Trainingsbeleg: Titel und Erklaerung; sonst `null`. */
|
|
84
|
+
function trainingVermerk(receipt) {
|
|
85
|
+
return belegtyp(receipt) === 'training' ? { kind: 'training', title: 'TRAININGSBELEG', lines: [...TRAINING_ERKLAERUNG] } : null;
|
|
86
|
+
}
|
|
87
|
+
/** Stornobeleg: Bezug, Datum des Originals (wenn der Bezug es traegt, Backend seit 2026-09-04) und Grund; sonst `null`. */
|
|
88
|
+
function stornoVermerk(receipt) {
|
|
89
|
+
if (belegtyp(receipt) !== 'cancellation')
|
|
90
|
+
return null;
|
|
91
|
+
const zeilen = [receipt.cancellationOf ? `Stornobuchung zu Beleg ${receipt.cancellationOf.receiptId}` : 'Stornobuchung'];
|
|
92
|
+
const datum = receipt.cancellationOf?.timeStamp ? originalDatum(receipt.cancellationOf.timeStamp) : null;
|
|
93
|
+
if (datum)
|
|
94
|
+
zeilen.push(`vom ${datum}`);
|
|
95
|
+
const grund = stornoGrundText(typeof receipt.cancellationReason === 'string' ? receipt.cancellationReason : undefined);
|
|
96
|
+
if (grund)
|
|
97
|
+
zeilen.push(`Grund: ${grund}`);
|
|
98
|
+
return { kind: 'cancellation', title: 'STORNOBELEG', lines: zeilen };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Nacherfassung eines Handbelegs (manualReceipt): Art, Grund, Nummer und Tag
|
|
102
|
+
* des Handbelegs bzw. der Handbelege eines Tagessammelbelegs. Ohne Handbeleg `null`.
|
|
103
|
+
*/
|
|
104
|
+
function nacherfassungTeile(receipt) {
|
|
105
|
+
const m = receipt.manualReceipt;
|
|
106
|
+
if (!m)
|
|
107
|
+
return null;
|
|
108
|
+
const anlass = [m.reason === 'outside_premises' ? 'Leistung außer Haus' : 'nach Ausfall der Kasse'];
|
|
109
|
+
const grund = m.reason === 'other' ? m.note : NACHERFASSUNG_GRUND[m.reason];
|
|
110
|
+
if (grund)
|
|
111
|
+
anlass.push(`Grund: ${grund}`);
|
|
112
|
+
const tag = handbelegDatum(m.date);
|
|
113
|
+
if (m.numberTo) {
|
|
114
|
+
return {
|
|
115
|
+
title: 'NACHERFASSUNG',
|
|
116
|
+
anlass,
|
|
117
|
+
handbeleg: ['Tagessammelbeleg', `Handbelege Nr. ${m.number} bis ${m.numberTo}`, `${m.count ? `${m.count} Belege ` : ''}vom ${tag}`],
|
|
118
|
+
ustHinweis: 'USt: Duplikat der Handbelege',
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
title: 'NACHERFASSUNG',
|
|
123
|
+
anlass,
|
|
124
|
+
handbeleg: [`Handbeleg Nr. ${m.number}`, `vom ${tag}${m.time ? `, ${m.time} Uhr` : ''}`],
|
|
125
|
+
ustHinweis: 'USt: Duplikat des Handbelegs',
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** Signaturausfall (§ 17 Abs. 4 RKSV): der Vermerk ohne Zeilen; sonst `null`. */
|
|
129
|
+
function signaturausfallVermerk(receipt) {
|
|
130
|
+
return receiptSignatureFailed(receipt) ? { kind: 'signature_outage', title: exports.SIGNATUR_AUSGEFALLEN, lines: [] } : null;
|
|
131
|
+
}
|
|
132
|
+
// ------------------------------------------------------------------ Ausgabe
|
|
133
|
+
const OPTIONEN = new Set(['testCashregister', 'testSignature']);
|
|
134
|
+
const OPTIONEN_ALT = { testKasse: 'testCashregister', testSignatur: 'testSignature' };
|
|
135
|
+
/**
|
|
136
|
+
* Die Vermerke eines Belegs in fester Reihenfolge: Testkasse, Testsignatur,
|
|
137
|
+
* Training, Storno, Nacherfassung, Signaturausfall. Ein gewoehnlicher Beleg
|
|
138
|
+
* hat keine (`[]`).
|
|
139
|
+
*
|
|
140
|
+
* Ob Testkasse oder Testsignatur, weiss nur der Aufrufer (er kennt das Konto),
|
|
141
|
+
* wie bei [buildReceiptLayout]. Eine unbekannte Option wirft
|
|
142
|
+
* (`KasseneckValidationError`, `scope: 'request'`): eine alte deutsche
|
|
143
|
+
* (`testKasse`) darf nie still wegfallen, sonst saehe ein Testbeleg gueltig aus.
|
|
144
|
+
*
|
|
145
|
+
* Firmendaten kennt diese Ausgabe nicht; der USt-Hinweis der Nacherfassung
|
|
146
|
+
* („USt: Duplikat …“) gehoert darum nicht zum Vermerk (siehe [NacherfassungTeile]).
|
|
147
|
+
*/
|
|
148
|
+
function receiptNotes(receipt, options = {}) {
|
|
149
|
+
for (const name of Object.keys(options)) {
|
|
150
|
+
if (OPTIONEN.has(name))
|
|
151
|
+
continue;
|
|
152
|
+
const neu = OPTIONEN_ALT[name];
|
|
153
|
+
throw new errors_js_1.KasseneckValidationError('receiptNotes', neu !== undefined ? `Option "${name}" heisst "${neu}"` : `Unbekannte Option "${name}"`, 'request');
|
|
154
|
+
}
|
|
155
|
+
const vermerke = [
|
|
156
|
+
options.testCashregister ? testkasseVermerk() : null,
|
|
157
|
+
options.testSignature ? testsignaturVermerk() : null,
|
|
158
|
+
trainingVermerk(receipt),
|
|
159
|
+
stornoVermerk(receipt),
|
|
160
|
+
(() => {
|
|
161
|
+
const teile = nacherfassungTeile(receipt);
|
|
162
|
+
return teile ? { kind: 'manual_receipt', title: teile.title, lines: [...teile.anlass, ...teile.handbeleg] } : null;
|
|
163
|
+
})(),
|
|
164
|
+
signaturausfallVermerk(receipt),
|
|
165
|
+
];
|
|
166
|
+
return vermerke.filter((v) => v !== null);
|
|
167
|
+
}
|
package/dist/cjs/stored/draht.js
CHANGED
|
@@ -246,6 +246,30 @@ function _storedReceiptInner(doc, functionName) {
|
|
|
246
246
|
function pruefangabenDerHuelle(p) {
|
|
247
247
|
return { karteRegistriertAm: alsIso(p.karteRegistriertAm), kasseRegistriertAm: alsIso(p.kasseRegistriertAm) };
|
|
248
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Steuerhinweis der Zahlung auf Rechnung: innen `steuerhinweis` (`inkl_ust` | `null_prozent` | `siehe_rechnung`),
|
|
251
|
+
* aussen `taxNote` (`incl_vat` | `zero_percent` | `see_invoice`). Der Vertrags-Export kennt die Umbenennung und den
|
|
252
|
+
* Wertekatalog inzwischen; diese Zeile bleibt trotzdem, weil sie bewusst deutsche UND englische Werte annimmt
|
|
253
|
+
* (Huellen kommen innen wie aussen vor). Ein anderer oder fehlender Wert ergibt keinen Hinweis; das alte Feld
|
|
254
|
+
* `includesVat` faellt weg.
|
|
255
|
+
*/
|
|
256
|
+
const STEUERHINWEIS_AUSSEN = {
|
|
257
|
+
inkl_ust: 'incl_vat', null_prozent: 'zero_percent', siehe_rechnung: 'see_invoice',
|
|
258
|
+
incl_vat: 'incl_vat', zero_percent: 'zero_percent', see_invoice: 'see_invoice',
|
|
259
|
+
};
|
|
260
|
+
function rechnungszahlungNachAussen(beleg) {
|
|
261
|
+
if (!Array.isArray(beleg.invoicePayments))
|
|
262
|
+
return beleg;
|
|
263
|
+
const invoicePayments = beleg.invoicePayments.map((e) => {
|
|
264
|
+
if (!(0, exports.istObjekt)(e))
|
|
265
|
+
return e;
|
|
266
|
+
const { steuerhinweis, taxNote, includesVat: _alt, ...rest } = e;
|
|
267
|
+
const roh = steuerhinweis ?? taxNote;
|
|
268
|
+
const aussen = typeof roh === 'string' && (0, exports.hat)(STEUERHINWEIS_AUSSEN, roh) ? STEUERHINWEIS_AUSSEN[roh] : undefined;
|
|
269
|
+
return aussen === undefined ? rest : { ...rest, taxNote: aussen };
|
|
270
|
+
});
|
|
271
|
+
return { ...beleg, invoicePayments };
|
|
272
|
+
}
|
|
249
273
|
/**
|
|
250
274
|
* Eine Beleg-Huelle der inneren Form (`receipt`, Betriebsfelder, `kopfId`,
|
|
251
275
|
* `pruefangaben`, `testKasse` ...) in die Drahtform von `getReceipt` unter
|
|
@@ -254,7 +278,7 @@ function pruefangabenDerHuelle(p) {
|
|
|
254
278
|
function _receiptEnvelopeToWire(huelle) {
|
|
255
279
|
const schema = vokabular_js_1.SCHEMAS.getReceipt;
|
|
256
280
|
const draht = werteNachAussen(schluesselNachAussen(huelle, schema.data), schema.werte);
|
|
257
|
-
return (0, exports.istObjekt)(draht.receipt) ? { ...draht, receipt: belegGutscheineNachAussen(belegRueckgabeNachAussen(draht.receipt)) } : draht;
|
|
281
|
+
return (0, exports.istObjekt)(draht.receipt) ? { ...draht, receipt: rechnungszahlungNachAussen(belegGutscheineNachAussen(belegRueckgabeNachAussen(draht.receipt))) } : draht;
|
|
258
282
|
}
|
|
259
283
|
/**
|
|
260
284
|
* Ein Belegdokument (`users/{uid}/cashregisters/{id}/receipts/{id}`) in der
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
|
|
2
|
-
export declare const VOKABULAR_QUELLE = "
|
|
2
|
+
export declare const VOKABULAR_QUELLE = "7e41f406752cf109d3809bd187db0dfccceafbc3c9d88305edf32c98d57bced3";
|
|
3
3
|
/** Schema-Notation des Vertrags: Blatt 'aussen': 'innen', Objekt { __: 'innen', ... }, Liste [ { __: 'innen', ... } ]. */
|
|
4
4
|
export type SchemaEintrag = string | SchemaObjekt | readonly [SchemaObjekt];
|
|
5
5
|
export interface SchemaObjekt {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.ZUSATZ_KATALOGE = exports.KATALOGE = exports.ARTIKEL_FELDER = exports.SCHEMAS = exports.VOKABULAR_QUELLE = void 0;
|
|
6
6
|
/** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
|
|
7
|
-
exports.VOKABULAR_QUELLE = "
|
|
7
|
+
exports.VOKABULAR_QUELLE = "7e41f406752cf109d3809bd187db0dfccceafbc3c9d88305edf32c98d57bced3";
|
|
8
8
|
/** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
|
|
9
9
|
exports.SCHEMAS = {
|
|
10
10
|
"getReceipt": {
|
|
@@ -45,7 +45,18 @@ exports.SCHEMAS = {
|
|
|
45
45
|
"sharedReturnPoint": {
|
|
46
46
|
"__": "pfandStelle",
|
|
47
47
|
"address": "adresse"
|
|
48
|
-
}
|
|
48
|
+
},
|
|
49
|
+
"invoicePayments": [
|
|
50
|
+
{
|
|
51
|
+
"__": "rechnungszahlung",
|
|
52
|
+
"invoiceNumber": "nummer",
|
|
53
|
+
"customerId": "kundeId",
|
|
54
|
+
"amountCents": "betragCents",
|
|
55
|
+
"partial": "teil",
|
|
56
|
+
"paidOn": "zahlungVom",
|
|
57
|
+
"taxNote": "steuerhinweis"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
49
60
|
},
|
|
50
61
|
"taxNumber": "taxnr",
|
|
51
62
|
"vatId": "uid",
|
|
@@ -115,6 +126,9 @@ exports.SCHEMAS = {
|
|
|
115
126
|
"receipt.items[].depositKind": {
|
|
116
127
|
"$catalog": "PFAND_ART"
|
|
117
128
|
},
|
|
129
|
+
"receipt.invoicePayments[].taxNote": {
|
|
130
|
+
"$catalog": "RECHNUNGSZAHLUNG_STEUERHINWEIS"
|
|
131
|
+
},
|
|
118
132
|
"issuedVouchers[].type": {
|
|
119
133
|
"$catalog": "GUTSCHEIN_ART"
|
|
120
134
|
},
|
|
@@ -856,6 +870,11 @@ exports.KATALOGE = {
|
|
|
856
870
|
"glas": "glass",
|
|
857
871
|
"sonstiges": "other"
|
|
858
872
|
},
|
|
873
|
+
"RECHNUNGSZAHLUNG_STEUERHINWEIS": {
|
|
874
|
+
"inkl_ust": "incl_vat",
|
|
875
|
+
"null_prozent": "zero_percent",
|
|
876
|
+
"siehe_rechnung": "see_invoice"
|
|
877
|
+
},
|
|
859
878
|
"REFERENZ_STUFE": {
|
|
860
879
|
"fragen": "optional",
|
|
861
880
|
"pflicht": "required"
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
|
|
2
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape, type ExternalVoucherNumberCheck, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS, type ReceiptOutputLogKind, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputResult, RECEIPT_OUTPUT_ENTRIES_MAX, type ReceiptOutput, type ReceiptOutputActor, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, type ReceiptOutputEntryErrorCode, RECEIPT_OUTPUT_ERROR_CODES, type ReceiptOutputErrorCode, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, type ReceiptOutputFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, isInvoicePaymentItem, type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape, type ExternalVoucherNumberCheck, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, type Receipt, type RegistrationInfo, type InvoicePaymentRef, type InvoicePaymentTaxNote, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS, type ReceiptOutputLogKind, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputResult, RECEIPT_OUTPUT_ENTRIES_MAX, type ReceiptOutput, type ReceiptOutputActor, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, type ReceiptOutputEntryErrorCode, RECEIPT_OUTPUT_ERROR_CODES, type ReceiptOutputErrorCode, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, type ReceiptOutputFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type TransportCallOptions, type KasseneckTransport, type KasseneckBinaryTransport, type KasseneckPdfOrDataTransport, type PdfOrData, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, createPdfOrDataTransport, createFileOrDataTransport, type FileOrData, type FileOrDataCallOptions, type KasseneckFileOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, type ReceiptOutputEntry, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type RejectedReceiptOutput, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, type CashregisterReportPeriod, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, listedReceiptWithCompany, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, type ListReceiptsErrorCode, type ListReceiptsView, type ListReceiptsOrder, type ListReceiptsOptions, type ListReceiptsWindow, type ListReceiptsGrossByRate, type ListReceiptsSummary, type ListReceiptsDaySummary, type ListReceiptsPage, type ListedReceipt, createDepExport, getDepExport, waitForDepExport, getDepExportFile, createDepHandoverLink, revokeDepHandoverLink, DepExportTimeoutError, DepExportChecksumError, DEP_EXPORT_STATUSES, DEP_EXPORT_FILES, DEP_EXPORT_ERROR_CODES, DEP_EXPORT_FAILURES, DEP_EXPORT_POLL_START_MS, DEP_EXPORT_POLL_FACTOR, DEP_EXPORT_POLL_MAX_MS, DEP_EXPORT_WAIT_TIMEOUT_MS, DEP_EXPORT_DOWNLOAD_TIMEOUT_MS, type DepExportStatus, type DepExportFileKind, type DepExportErrorCode, type DepExportFailure, type CreateDepExportOptions, type CreateDepExportResult, type DepExportGap, type DepExportChainBreak, type DepExportFindings, type DepExportItems, type DepHandoverLinkInfo, type DepExport, type WaitForDepExportOptions, type GetDepExportFileOptions, type DepExportFile, type DepHandoverLink, type RevokedDepHandoverLink, registerTerminalDevice, getTerminalAccess, claimTerminal, requestTerminalCode, getTerminalCode, reportTerminalLogin, reportTerminalReady, TERMINAL_PLATFORMS, TERMINAL_SETUP_STATES, TERMINAL_CODE_STATUSES, TERMINAL_CODE_SOURCES, TERMINAL_ERROR_CODES, TERMINAL_LABEL_MAX, TERMINAL_APP_MAX, TERMINAL_REQUESTED_BY_MAX, type TerminalPlatform, type TerminalSetupState, type TerminalCodeStatus, type TerminalCodeSource, type TerminalErrorCode, type TerminalDeviceCredentials, type RegisterTerminalDeviceOptions, type RegisteredTerminalDevice, type GetTerminalAccessOptions, type ClaimTerminalOptions, type RequestTerminalCodeOptions, type ReportTerminalLoginOptions, type TerminalSetup, type TerminalCodeFormat, type TerminalAccess, type TerminalListEntry, type TerminalAccessUnavailable, type TerminalAccessResult, type TerminalCodeRequest, type TerminalCode, EWP_REASONS, EWP_WARNING_CODES, type EwpReason, type EwpWarningCode, type EwpMasterData, type EwpLineSources, type EwpLine, type EwpWarning, type EwpExtraQuantity, type EwpExtraQuantityInput, type EwpReport, type EwpReportFile, type ListedFullReceipt, type ListReceiptsHeader, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { type ReceiptDueTip, type ReceiptDueTipRecipient, type ReceiptDueOptions, type ReceiptDueBuckets, type ReceiptDueBreakdown, type ReceiptDueErrorReason, receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, type VoucherDueInfo, type VoucherDueArticle, type VoucherDueType, type VoucherRedeemContext, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ReceiptType, VatRate, KeckPaymentMethod, CreditCardProvider, VoucherType, VoucherAction, StripeLinkMode, } from './enums/index.js';
|
|
2
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, fromReceiptPaymentPayload, toReceiptPaymentPayload, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_LOG_KINDS, RECEIPT_OUTPUT_RESULTS, RECEIPT_OUTPUT_ENTRIES_MAX, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, RECEIPT_OUTPUT_ERROR_CODES, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, isInvoicePaymentItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, fromReceiptPaymentPayload, toReceiptPaymentPayload, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_LOG_KINDS, RECEIPT_OUTPUT_RESULTS, RECEIPT_OUTPUT_ENTRIES_MAX, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, RECEIPT_OUTPUT_ERROR_CODES, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, ALL_CALLS, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, createTransport, createBinaryTransport, createPdfOrDataTransport, createFileOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, CLIENT_ERROR_CODES, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, listMyCashregisters, checkVoucherCombinationError, sendReceiptEmail, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2, listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, listedReceiptWithCompany, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, createDepExport, getDepExport, waitForDepExport, getDepExportFile, createDepHandoverLink, revokeDepHandoverLink, DepExportTimeoutError, DepExportChecksumError, DEP_EXPORT_STATUSES, DEP_EXPORT_FILES, DEP_EXPORT_ERROR_CODES, DEP_EXPORT_FAILURES, DEP_EXPORT_POLL_START_MS, DEP_EXPORT_POLL_FACTOR, DEP_EXPORT_POLL_MAX_MS, DEP_EXPORT_WAIT_TIMEOUT_MS, DEP_EXPORT_DOWNLOAD_TIMEOUT_MS, registerTerminalDevice, getTerminalAccess, claimTerminal, requestTerminalCode, getTerminalCode, reportTerminalLogin, reportTerminalReady, TERMINAL_PLATFORMS, TERMINAL_SETUP_STATES, TERMINAL_CODE_STATUSES, TERMINAL_CODE_SOURCES, TERMINAL_ERROR_CODES, TERMINAL_LABEL_MAX, TERMINAL_APP_MAX, TERMINAL_REQUESTED_BY_MAX, EWP_REASONS, EWP_WARNING_CODES, getCashboxStatus, getSignatureStatus, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock } from './vienna-time.js';
|
|
@@ -18,6 +18,8 @@ import type { InvoiceLanguage } from './vertrag.js';
|
|
|
18
18
|
declare const DE: {
|
|
19
19
|
readonly 'pdf.title.invoice': "RECHNUNG";
|
|
20
20
|
readonly 'pdf.title.credit_note': "GUTSCHRIFT";
|
|
21
|
+
readonly 'pdf.title.payment_confirmation': "ZAHLUNGSBESTÄTIGUNG";
|
|
22
|
+
readonly 'pdf.title.refund_confirmation': "RÜCKZAHLUNGSBESTÄTIGUNG";
|
|
21
23
|
readonly 'pdf.badge.paid': "BEZAHLT";
|
|
22
24
|
readonly 'pdf.badge.direct_debit': "SEPA-LASTSCHRIFT";
|
|
23
25
|
readonly 'pdf.meta.number.invoice': "Rechnungsnr.";
|
|
@@ -78,9 +80,24 @@ declare const DE: {
|
|
|
78
80
|
readonly 'pdf.payment.note_until': "Zahlbar ohne Abzug bis {date}. Vielen Dank für Ihren Auftrag.";
|
|
79
81
|
readonly 'pdf.payment.note': "Zahlbar ohne Abzug. Vielen Dank für Ihren Auftrag.";
|
|
80
82
|
readonly 'pdf.payment.qr': "Mit Banking-App scannen & zahlen";
|
|
81
|
-
readonly 'pdf.paid.text': "Diese Rechnung ist beglichen.
|
|
83
|
+
readonly 'pdf.paid.text': "Diese Rechnung ist beglichen.";
|
|
82
84
|
readonly 'pdf.paid.date': "Bezahlt am";
|
|
85
|
+
readonly 'pdf.paid.cash': "Bar bezahlt am {date}.";
|
|
86
|
+
readonly 'pdf.paid.card': "Mit Karte bezahlt am {date}.";
|
|
83
87
|
readonly 'pdf.paid.payment_method': "Zahlungsart";
|
|
88
|
+
readonly 'pdf.cash_register.header': "REGISTRIERKASSE";
|
|
89
|
+
readonly 'pdf.cash_register.receipt_number': "Beleg-Nr.";
|
|
90
|
+
readonly 'pdf.cash_register.date': "Datum";
|
|
91
|
+
readonly 'pdf.cash_register.tax.incl_vat': "inkl. USt";
|
|
92
|
+
readonly 'pdf.cash_register.tax.zero_percent': "0 % USt";
|
|
93
|
+
readonly 'pdf.cash_register.tax.see_invoice': "Steuerangaben siehe Rechnung";
|
|
94
|
+
readonly 'pdf.confirmation.intro': "Wir bestätigen den Erhalt Ihrer Zahlung.";
|
|
95
|
+
readonly 'pdf.confirmation.not_invoice': "Diese Bestätigung ist keine Rechnung.";
|
|
96
|
+
readonly 'pdf.confirmation.table.invoice': "Rechnung";
|
|
97
|
+
readonly 'pdf.confirmation.table.amount': "Betrag";
|
|
98
|
+
readonly 'pdf.confirmation.table.paid_so_far': "Bisher bezahlt";
|
|
99
|
+
readonly 'pdf.confirmation.table.received_today': "Heute erhalten";
|
|
100
|
+
readonly 'pdf.confirmation.table.still_open': "Noch offen";
|
|
84
101
|
readonly 'payment_method.cash': "Bar";
|
|
85
102
|
readonly 'payment_method.transfer': "Überweisung";
|
|
86
103
|
readonly 'payment_method.card': "Karte";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const DE = {
|
|
2
2
|
'pdf.title.invoice': 'RECHNUNG',
|
|
3
3
|
'pdf.title.credit_note': 'GUTSCHRIFT',
|
|
4
|
+
// Zahlung auf Rechnung (1.38.0): eigene Bestaetigung, wenn spaeter bar oder mit Karte bezahlt wird.
|
|
5
|
+
'pdf.title.payment_confirmation': 'ZAHLUNGSBESTÄTIGUNG',
|
|
6
|
+
'pdf.title.refund_confirmation': 'RÜCKZAHLUNGSBESTÄTIGUNG',
|
|
4
7
|
'pdf.badge.paid': 'BEZAHLT',
|
|
5
8
|
'pdf.badge.direct_debit': 'SEPA-LASTSCHRIFT',
|
|
6
9
|
'pdf.meta.number.invoice': 'Rechnungsnr.',
|
|
@@ -69,9 +72,30 @@ const DE = {
|
|
|
69
72
|
'pdf.payment.note_until': 'Zahlbar ohne Abzug bis {date}. Vielen Dank für Ihren Auftrag.',
|
|
70
73
|
'pdf.payment.note': 'Zahlbar ohne Abzug. Vielen Dank für Ihren Auftrag.',
|
|
71
74
|
'pdf.payment.qr': 'Mit Banking-App scannen & zahlen',
|
|
72
|
-
|
|
75
|
+
// Kurz, fuer jede bezahlte Rechnung (auch Ueberweisung); der Satz „Es ist nichts weiter zu tun.“ entfiel mit 1.38.0.
|
|
76
|
+
'pdf.paid.text': 'Diese Rechnung ist beglichen.',
|
|
73
77
|
'pdf.paid.date': 'Bezahlt am',
|
|
78
|
+
// Kurztexte (1.38.0) fuer die Zahlung vor Ort; {date} = Zahltag.
|
|
79
|
+
'pdf.paid.cash': 'Bar bezahlt am {date}.',
|
|
80
|
+
'pdf.paid.card': 'Mit Karte bezahlt am {date}.',
|
|
74
81
|
'pdf.paid.payment_method': 'Zahlungsart',
|
|
82
|
+
// Kassenteil (1.38.0): der Zahlungsbeleg der Kasse unten auf Rechnung und Zahlungsbestaetigung. Kopfzeile
|
|
83
|
+
// mit der Kassen-ID dahinter; Vermerke und Positionstexte bleiben deutsch (Pflichtwoerter, receiptNotes).
|
|
84
|
+
'pdf.cash_register.header': 'REGISTRIERKASSE',
|
|
85
|
+
'pdf.cash_register.receipt_number': 'Beleg-Nr.',
|
|
86
|
+
'pdf.cash_register.date': 'Datum',
|
|
87
|
+
// Steuerhinweis unter der Zahlung (Spec 2026-11-11, Abschnitt 16): Umsatzsteuer ausgewiesen, steuerfrei/nicht steuerbar, Reverse Charge.
|
|
88
|
+
'pdf.cash_register.tax.incl_vat': 'inkl. USt',
|
|
89
|
+
'pdf.cash_register.tax.zero_percent': '0 % USt',
|
|
90
|
+
'pdf.cash_register.tax.see_invoice': 'Steuerangaben siehe Rechnung',
|
|
91
|
+
// Zahlungsbestaetigung (1.38.0): Einleitung, Hinweis und die Spalten der Tabelle je Rechnung.
|
|
92
|
+
'pdf.confirmation.intro': 'Wir bestätigen den Erhalt Ihrer Zahlung.',
|
|
93
|
+
'pdf.confirmation.not_invoice': 'Diese Bestätigung ist keine Rechnung.',
|
|
94
|
+
'pdf.confirmation.table.invoice': 'Rechnung',
|
|
95
|
+
'pdf.confirmation.table.amount': 'Betrag',
|
|
96
|
+
'pdf.confirmation.table.paid_so_far': 'Bisher bezahlt',
|
|
97
|
+
'pdf.confirmation.table.received_today': 'Heute erhalten',
|
|
98
|
+
'pdf.confirmation.table.still_open': 'Noch offen',
|
|
75
99
|
'payment_method.cash': 'Bar',
|
|
76
100
|
'payment_method.transfer': 'Überweisung',
|
|
77
101
|
'payment_method.card': 'Karte',
|
|
@@ -216,6 +240,8 @@ const DE = {
|
|
|
216
240
|
const EN = {
|
|
217
241
|
'pdf.title.invoice': 'INVOICE',
|
|
218
242
|
'pdf.title.credit_note': 'CREDIT NOTE',
|
|
243
|
+
'pdf.title.payment_confirmation': 'PAYMENT CONFIRMATION',
|
|
244
|
+
'pdf.title.refund_confirmation': 'REFUND CONFIRMATION',
|
|
219
245
|
'pdf.badge.paid': 'PAID',
|
|
220
246
|
'pdf.badge.direct_debit': 'SEPA DIRECT DEBIT',
|
|
221
247
|
'pdf.meta.number.invoice': 'Invoice no.',
|
|
@@ -276,9 +302,24 @@ const EN = {
|
|
|
276
302
|
'pdf.payment.note_until': 'Payable without deduction by {date}. Thank you for your business.',
|
|
277
303
|
'pdf.payment.note': 'Payable without deduction. Thank you for your business.',
|
|
278
304
|
'pdf.payment.qr': 'Scan with your banking app to pay',
|
|
279
|
-
'pdf.paid.text': 'This invoice has been paid.
|
|
305
|
+
'pdf.paid.text': 'This invoice has been paid.',
|
|
280
306
|
'pdf.paid.date': 'Paid on',
|
|
307
|
+
'pdf.paid.cash': 'Paid in cash on {date}.',
|
|
308
|
+
'pdf.paid.card': 'Paid by card on {date}.',
|
|
281
309
|
'pdf.paid.payment_method': 'Payment method',
|
|
310
|
+
'pdf.cash_register.header': 'CASH REGISTER',
|
|
311
|
+
'pdf.cash_register.receipt_number': 'Receipt no.',
|
|
312
|
+
'pdf.cash_register.date': 'Date',
|
|
313
|
+
'pdf.cash_register.tax.incl_vat': 'incl. VAT',
|
|
314
|
+
'pdf.cash_register.tax.zero_percent': '0 % VAT',
|
|
315
|
+
'pdf.cash_register.tax.see_invoice': 'Tax details see invoice',
|
|
316
|
+
'pdf.confirmation.intro': 'We confirm receipt of your payment.',
|
|
317
|
+
'pdf.confirmation.not_invoice': 'This confirmation is not an invoice.',
|
|
318
|
+
'pdf.confirmation.table.invoice': 'Invoice',
|
|
319
|
+
'pdf.confirmation.table.amount': 'Amount',
|
|
320
|
+
'pdf.confirmation.table.paid_so_far': 'Paid so far',
|
|
321
|
+
'pdf.confirmation.table.received_today': 'Received today',
|
|
322
|
+
'pdf.confirmation.table.still_open': 'Still open',
|
|
282
323
|
'payment_method.cash': 'Cash',
|
|
283
324
|
'payment_method.transfer': 'Bank transfer',
|
|
284
325
|
'payment_method.card': 'Card',
|
|
@@ -27,7 +27,7 @@ export type InvoiceEndpoint = (typeof INVOICE_ENDPOINTS)[number];
|
|
|
27
27
|
* Stabile Fehlercodes. Das Fremdsystem verzweigt am Code, der Text darf sich
|
|
28
28
|
* aendern. `validation` traegt zusaetzlich `errors: [{ field, message }]`.
|
|
29
29
|
*/
|
|
30
|
-
export declare const INVOICE_ERROR_CODES: readonly ["validation", "idempotency_conflict", "module_inactive", "customer_not_found", "customer_exists", "short_code_taken", "short_code_immutable", "recipient_required", "invoice_requirements_missing", "invoice_not_found", "invoice_ambiguous", "not_cancellable", "partial_credit_exists", "credit_exceeds_invoice", "einvoice_incomplete", "invoice_api_not_enabled", "invoice_setup_incomplete", "language_not_allowed", "brand_not_found", "not_payable", "payment_exceeds_invoice", "tax_scheme_mismatch", "vat_rate_not_in_country", "reverse_charge_reason_required", "reverse_charge_threshold", "mixed_supply_not_allowed", "oss_not_enabled", "einvoice_unavailable", "amount_too_large", "vat_id_invalid", "vat_id_check_pending", "reservation_not_found", "reservation_mismatch", "reservation_not_active", "invoice_number_taken", "deposit_not_enabled", "deposit_type_not_found", "deposit_set_by_server", "invalid_deposit_quantity", "invalid_deposit"];
|
|
30
|
+
export declare const INVOICE_ERROR_CODES: readonly ["validation", "idempotency_conflict", "module_inactive", "customer_not_found", "customer_exists", "short_code_taken", "short_code_immutable", "recipient_required", "invoice_requirements_missing", "invoice_not_found", "invoice_ambiguous", "not_cancellable", "partial_credit_exists", "credit_exceeds_invoice", "einvoice_incomplete", "invoice_api_not_enabled", "invoice_setup_incomplete", "language_not_allowed", "brand_not_found", "not_payable", "payment_exceeds_invoice", "tax_scheme_mismatch", "vat_rate_not_in_country", "reverse_charge_reason_required", "reverse_charge_threshold", "mixed_supply_not_allowed", "oss_not_enabled", "einvoice_unavailable", "amount_too_large", "vat_id_invalid", "vat_id_check_pending", "reservation_not_found", "reservation_mismatch", "reservation_not_active", "invoice_number_taken", "deposit_not_enabled", "deposit_type_not_found", "deposit_set_by_server", "invalid_deposit_quantity", "invalid_deposit", "cash_receipt_pending"];
|
|
31
31
|
export type InvoiceErrorCode = (typeof INVOICE_ERROR_CODES)[number];
|
|
32
32
|
/**
|
|
33
33
|
* Codes, die Anmeldung und Rand auf jedem Rechnungsaufruf erzeugen koennen,
|
|
@@ -85,6 +85,7 @@ export const INVOICE_ERROR_CODES = [
|
|
|
85
85
|
'deposit_set_by_server', // das Pfand zu einer Artikelposition leitet der Server selbst ab
|
|
86
86
|
'invalid_deposit_quantity', // die Pfandmenge passt nicht zur Menge der Position
|
|
87
87
|
'invalid_deposit', // sonstige Pfandangabe unzulaessig, `index` nennt die Position
|
|
88
|
+
'cash_receipt_pending', // Rechnung bar bezahlt, der Kassenbeleg der Zahlung ist noch nicht fertig: PDF spaeter abrufen
|
|
88
89
|
];
|
|
89
90
|
/**
|
|
90
91
|
* Codes, die Anmeldung und Rand auf jedem Rechnungsaufruf erzeugen koennen,
|
|
@@ -54,7 +54,7 @@ export declare function isReturnDisposition(value: unknown): value is ReturnDisp
|
|
|
54
54
|
* [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
|
|
55
55
|
* `KasseneckApiError.code` lesbar.
|
|
56
56
|
*/
|
|
57
|
-
export declare const CANCELLATION_ERROR_CODES: readonly ["receipt_not_found", "receipt_type_not_cancellable", "training_receipt", "already_cancelled", "invalid_line", "quantity_exceeds_remaining", "unknown_reason", "note_too_long", "invalid_items", "cashregister_not_assigned", "not_permitted", "own_receipts_only", "cashregister_incomplete", "cancellation_failed", "cancellation_payments_required", "cancellation_refund_exceeds_payment", "cancellation_refund_reference_required", "cancellation_refund_reference_unknown", "cancellation_outcome_unknown", "invalid_return_disposition", "tip_refund_conflict", "invalid_tip_refund_source", "tip_refund_source_requires_cash", "tip_keep_not_possible_with_voucher", "refund_as_invalid", "refund_as_conflict", "refund_as_voucher_not_available", "refund_as_voucher_reason", "refund_as_voucher_with_voucher", "refund_as_voucher_no_type", "refund_as_voucher_amount", "idempotency_key_required", "account_not_found", "action_confirmation_required", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
|
|
57
|
+
export declare const CANCELLATION_ERROR_CODES: readonly ["receipt_not_found", "receipt_type_not_cancellable", "training_receipt", "already_cancelled", "invalid_line", "quantity_exceeds_remaining", "unknown_reason", "note_too_long", "invalid_items", "cashregister_not_assigned", "not_permitted", "own_receipts_only", "cashregister_incomplete", "cancellation_failed", "cancellation_payments_required", "cancellation_refund_exceeds_payment", "cancellation_refund_reference_required", "cancellation_refund_reference_unknown", "cancellation_outcome_unknown", "invalid_return_disposition", "tip_refund_conflict", "invalid_tip_refund_source", "tip_refund_source_requires_cash", "tip_keep_not_possible_with_voucher", "refund_as_invalid", "refund_as_conflict", "refund_as_voucher_not_available", "refund_as_voucher_reason", "refund_as_voucher_with_voucher", "refund_as_voucher_no_type", "refund_as_voucher_amount", "idempotency_key_required", "invoice_payment_not_cancellable", "account_not_found", "action_confirmation_required", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
|
|
58
58
|
export type CancellationErrorCode = (typeof CANCELLATION_ERROR_CODES)[number];
|
|
59
59
|
export declare function isCancellationErrorCode(value: unknown): value is CancellationErrorCode;
|
|
60
60
|
/** Der Code eines geworfenen Fehlers, wenn er in [CANCELLATION_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -90,6 +90,8 @@ export const CANCELLATION_ERROR_CODES = Object.freeze([
|
|
|
90
90
|
'refund_as_voucher_no_type', // keine passende Rueckgabe-Sorte eingestellt
|
|
91
91
|
'refund_as_voucher_amount', // Betrag ohne Trinkgeld ausserhalb 1,00 bis 10.000,00 Euro
|
|
92
92
|
'idempotency_key_required', // refundAs ohne idempotencyKey
|
|
93
|
+
// Zahlung auf Rechnung (Server 2026-11): ein Zahlungsbeleg wird nur im Kundenbereich bei der Rechnung storniert
|
|
94
|
+
'invoice_payment_not_cancellable', // Original ist ein Zahlungsbeleg (Positionen invoice_payment)
|
|
93
95
|
// Anmeldung und Rand (errorCodes.auth ohne Partner-Zugang, errorCodes.edge)
|
|
94
96
|
'account_not_found',
|
|
95
97
|
'action_confirmation_required',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, } from './receipt-item.js';
|
|
1
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, isInvoicePaymentItem, } from './receipt-item.js';
|
|
2
2
|
export { type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, type ExternalVoucherNumberCheck, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, } from './voucher.js';
|
|
3
3
|
export { type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, readRegistrationInfo, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, } from './receipt.js';
|
|
4
4
|
export { type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, } from './cancellation.js';
|
|
@@ -11,6 +11,7 @@ export { type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayl
|
|
|
11
11
|
export { type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, } from './cashregister.js';
|
|
12
12
|
export { type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind } from './receipt-summary.js';
|
|
13
13
|
export { type ManualReceipt, type ManualReceiptReason, MANUAL_RECEIPT_REASONS, readManualReceipt, type ManualReceiptErrorCode, MANUAL_RECEIPT_ERROR_CODES, isManualReceiptErrorCode, } from './manual-receipt.js';
|
|
14
|
+
export { type InvoicePaymentRef, type InvoicePaymentTaxNote, readInvoicePaymentRefs } from './invoice-payment-ref.js';
|
|
14
15
|
export { type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, } from './report-month.js';
|
|
15
16
|
export { type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, } from './stripe-url-session.js';
|
|
16
17
|
export { type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './hobex-receipt.js';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, } from './receipt-item.js';
|
|
1
|
+
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, isInvoicePaymentItem, } from './receipt-item.js';
|
|
2
2
|
export { toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, } from './voucher.js';
|
|
3
3
|
export { toReceiptPayload, fromReceiptPayload, readRegistrationInfo, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, } from './receipt.js';
|
|
4
4
|
export { RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, } from './cancellation.js';
|
|
@@ -11,6 +11,7 @@ export { fromReceiptCompanyPayload, receiptCompanyTaxInfo, } from './receipt-com
|
|
|
11
11
|
export { fromCashregisterPayload, } from './cashregister.js';
|
|
12
12
|
export { fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind } from './receipt-summary.js';
|
|
13
13
|
export { MANUAL_RECEIPT_REASONS, readManualReceipt, MANUAL_RECEIPT_ERROR_CODES, isManualReceiptErrorCode, } from './manual-receipt.js';
|
|
14
|
+
export { readInvoicePaymentRefs } from './invoice-payment-ref.js';
|
|
14
15
|
export { reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, } from './report-month.js';
|
|
15
16
|
export { toStripeUrlSessionPayload, fromStripeUrlSessionPayload, } from './stripe-url-session.js';
|
|
16
17
|
export { toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './hobex-receipt.js';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zahlung auf Rechnung (`invoicePayments` am Beleg, Backend `rechnungszahlung`):
|
|
3
|
+
* Ein Zahlungsbeleg nimmt in der Kasse Geld fuer eine oder mehrere Rechnungen
|
|
4
|
+
* entgegen (bar oder mit Karte vor Ort) bzw. gibt es zu einer Gutschrift
|
|
5
|
+
* zurueck. Seine Positionen tragen `kind: 'invoice_payment'` und zaehlen im
|
|
6
|
+
* RKSV-Feld „Null“; die Umsatzsteuer steht auf der Rechnung, nicht am Beleg.
|
|
7
|
+
*
|
|
8
|
+
* Je Rechnung ein Bezug, in der Reihenfolge der Positionen (eine Zeile je
|
|
9
|
+
* Rechnung). Der Bezug ist nicht signiert (wie `cancellationOf`), die
|
|
10
|
+
* Rechnungsnummer steht zusaetzlich im Text der Position.
|
|
11
|
+
*
|
|
12
|
+
* Nur der Server legt solche Belege an; dieses Paket liest sie nur.
|
|
13
|
+
*/
|
|
14
|
+
export interface InvoicePaymentRef {
|
|
15
|
+
invoiceId: string;
|
|
16
|
+
/** Nummer der Rechnung bzw. Gutschrift aus ihrem Rechnungskreis (`2026-0042`). */
|
|
17
|
+
invoiceNumber: string;
|
|
18
|
+
/** Kennung des Zahlungseintrags an der Rechnung. */
|
|
19
|
+
paymentId: string;
|
|
20
|
+
customerId: string | null;
|
|
21
|
+
/** Betrag dieser Zeile in Cent; bei einer Rueckzahlung zu einer Gutschrift negativ. */
|
|
22
|
+
amountCents: number;
|
|
23
|
+
/** Teilzahlung: weniger als der Rechnungsbetrag. */
|
|
24
|
+
partial: boolean;
|
|
25
|
+
/** Zahlungstag `YYYY-MM-DD` (Wiener Tag), `null` wenn unbekannt. */
|
|
26
|
+
paidOn: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Steuerhinweis unter der Position: `incl_vat` (die Rechnung weist Umsatzsteuer aus), `zero_percent`
|
|
29
|
+
* (steuerfrei oder nicht steuerbar) oder `see_invoice` (Reverse Charge). Fehlt er, steht kein Hinweis.
|
|
30
|
+
*/
|
|
31
|
+
taxNote?: InvoicePaymentTaxNote;
|
|
32
|
+
}
|
|
33
|
+
/** Werte von [InvoicePaymentRef.taxNote] (gespeichert `inkl_ust` | `null_prozent` | `siehe_rechnung`). */
|
|
34
|
+
export type InvoicePaymentTaxNote = 'incl_vat' | 'zero_percent' | 'see_invoice';
|
|
35
|
+
/**
|
|
36
|
+
* Liest `invoicePayments` vom Draht. Ein Eintrag ohne Rechnungs-ID, Nummer,
|
|
37
|
+
* Zahlungs-ID oder ganzzahligen Betrag faellt weg (lesen tolerant, der Beleg
|
|
38
|
+
* bleibt anzeigbar); ohne brauchbaren Eintrag gibt es keinen Bezug
|
|
39
|
+
* (`undefined`). Ein unbekannter oder fehlender `taxNote` ergibt keinen
|
|
40
|
+
* Hinweis: ein Beleg behauptet nie eine Steuer, die er nicht kennt.
|
|
41
|
+
*/
|
|
42
|
+
export declare function readInvoicePaymentRefs(roh: unknown): InvoicePaymentRef[] | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const STEUERHINWEISE = ['incl_vat', 'zero_percent', 'see_invoice'];
|
|
2
|
+
const istText = (w) => typeof w === 'string' && w !== '';
|
|
3
|
+
/**
|
|
4
|
+
* Liest `invoicePayments` vom Draht. Ein Eintrag ohne Rechnungs-ID, Nummer,
|
|
5
|
+
* Zahlungs-ID oder ganzzahligen Betrag faellt weg (lesen tolerant, der Beleg
|
|
6
|
+
* bleibt anzeigbar); ohne brauchbaren Eintrag gibt es keinen Bezug
|
|
7
|
+
* (`undefined`). Ein unbekannter oder fehlender `taxNote` ergibt keinen
|
|
8
|
+
* Hinweis: ein Beleg behauptet nie eine Steuer, die er nicht kennt.
|
|
9
|
+
*/
|
|
10
|
+
export function readInvoicePaymentRefs(roh) {
|
|
11
|
+
if (!Array.isArray(roh))
|
|
12
|
+
return undefined;
|
|
13
|
+
const raus = [];
|
|
14
|
+
for (const e of roh) {
|
|
15
|
+
if (e === null || typeof e !== 'object' || Array.isArray(e))
|
|
16
|
+
continue;
|
|
17
|
+
const o = e;
|
|
18
|
+
if (!istText(o['invoiceId']) || !istText(o['invoiceNumber']) || !istText(o['paymentId']))
|
|
19
|
+
continue;
|
|
20
|
+
if (!Number.isSafeInteger(o['amountCents']))
|
|
21
|
+
continue;
|
|
22
|
+
const hinweis = o['taxNote'];
|
|
23
|
+
raus.push({
|
|
24
|
+
invoiceId: o['invoiceId'],
|
|
25
|
+
invoiceNumber: o['invoiceNumber'],
|
|
26
|
+
paymentId: o['paymentId'],
|
|
27
|
+
customerId: istText(o['customerId']) ? o['customerId'] : null,
|
|
28
|
+
amountCents: o['amountCents'],
|
|
29
|
+
partial: o['partial'] === true,
|
|
30
|
+
paidOn: istText(o['paidOn']) ? o['paidOn'] : null,
|
|
31
|
+
...(typeof hinweis === 'string' && STEUERHINWEISE.includes(hinweis) ? { taxNote: hinweis } : {}),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return raus.length > 0 ? raus : undefined;
|
|
35
|
+
}
|