@kreiseck/kasseneck-api 1.29.0 → 1.30.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 +16 -0
- package/README.md +27 -0
- package/dist/cjs/client/list-receipts.d.ts +5 -0
- package/dist/cjs/client/list-receipts.js +5 -1
- package/dist/cjs/client/receipts.d.ts +6 -0
- package/dist/cjs/client/receipts.js +1 -0
- package/dist/cjs/enums/voucher-type.d.ts +5 -1
- package/dist/cjs/enums/voucher-type.js +5 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +13 -5
- package/dist/cjs/inventory/index.d.ts +2 -2
- package/dist/cjs/inventory/index.js +3 -2
- package/dist/cjs/inventory/typen.d.ts +39 -1
- package/dist/cjs/inventory/vertrag.d.ts +13 -2
- package/dist/cjs/inventory/vertrag.js +16 -1
- package/dist/cjs/inventory/webhook.d.ts +3 -0
- package/dist/cjs/inventory/webhook.js +39 -0
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/index.js +10 -2
- package/dist/cjs/models/voucher.d.ts +78 -2
- package/dist/cjs/models/voucher.js +127 -5
- package/dist/cjs/pos/gutschein.d.ts +13 -0
- package/dist/cjs/pos/gutschein.js +5 -1
- package/dist/cjs/pos/index.d.ts +1 -1
- package/dist/cjs/pos/index.js +3 -2
- package/dist/cjs/pos/texte.d.ts +20 -0
- package/dist/cjs/pos/texte.js +11 -0
- package/dist/cjs/receipt/due.d.ts +8 -1
- package/dist/cjs/receipt/due.js +1 -0
- package/dist/cjs/receipt/gutschein-plan.d.ts +11 -1
- package/dist/cjs/receipt/gutschein-plan.js +116 -1
- package/dist/cjs/receipt/layout.js +39 -6
- package/dist/cjs/stored/draht.js +5 -0
- package/dist/cjs/stored/vokabular.d.ts +3 -1
- package/dist/cjs/stored/vokabular.js +15 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/list-receipts.d.ts +5 -0
- package/dist/esm/client/list-receipts.js +5 -2
- package/dist/esm/client/receipts.d.ts +6 -0
- package/dist/esm/client/receipts.js +1 -0
- package/dist/esm/enums/voucher-type.d.ts +5 -1
- package/dist/esm/enums/voucher-type.js +5 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/inventory/index.d.ts +2 -2
- package/dist/esm/inventory/index.js +1 -1
- package/dist/esm/inventory/typen.d.ts +39 -1
- package/dist/esm/inventory/vertrag.d.ts +13 -2
- package/dist/esm/inventory/vertrag.js +15 -0
- package/dist/esm/inventory/webhook.d.ts +3 -0
- package/dist/esm/inventory/webhook.js +39 -0
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/esm/models/voucher.d.ts +78 -2
- package/dist/esm/models/voucher.js +122 -4
- package/dist/esm/pos/gutschein.d.ts +13 -0
- package/dist/esm/pos/gutschein.js +4 -0
- package/dist/esm/pos/index.d.ts +1 -1
- package/dist/esm/pos/index.js +1 -1
- package/dist/esm/pos/texte.d.ts +20 -0
- package/dist/esm/pos/texte.js +11 -0
- package/dist/esm/receipt/due.d.ts +8 -1
- package/dist/esm/receipt/due.js +1 -0
- package/dist/esm/receipt/gutschein-plan.d.ts +11 -1
- package/dist/esm/receipt/gutschein-plan.js +117 -2
- package/dist/esm/receipt/layout.js +40 -7
- package/dist/esm/stored/draht.js +6 -1
- package/dist/esm/stored/vokabular.d.ts +3 -1
- package/dist/esm/stored/vokabular.js +14 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/expected/voucher-external-redeem.grid32.txt +30 -0
- package/fixtures/expected/voucher-external-redeem.grid48.txt +27 -0
- package/fixtures/expected/voucher-external-redeem.lines.json +280 -0
- package/fixtures/expected/voucher-external-redeem.sheet32.json +206 -0
- package/fixtures/expected/voucher-external-redeem.sheet48.json +188 -0
- package/fixtures/expected/voucher-external-sale.grid32.txt +27 -0
- package/fixtures/expected/voucher-external-sale.grid48.txt +26 -0
- package/fixtures/expected/voucher-external-sale.lines.json +256 -0
- package/fixtures/expected/voucher-external-sale.sheet32.json +188 -0
- package/fixtures/expected/voucher-external-sale.sheet48.json +182 -0
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +1 -1
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/manifest.json +16 -0
- package/fixtures/pos-texts.json +22 -2
- package/fixtures/receipt-due-voucher-generated.json +2 -2
- package/fixtures/receipts/voucher-external-redeem.json +85 -0
- package/fixtures/receipts/voucher-external-sale.json +80 -0
- package/fixtures/stored/voucher-cases.json +2800 -0
- package/fixtures/surface.json +14 -2
- package/fixtures/v3/antworten/belege.json +4 -3
- package/fixtures/v3/antworten/belegmail.json +2 -2
- package/fixtures/v3/antworten/berichte.json +2 -2
- package/fixtures/v3/antworten/kasse-belege.json +4 -3
- package/fixtures/v3/antworten/kasse.json +16 -10
- package/fixtures/v3/antworten/lager.json +6 -3
- 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 +169 -8
- package/fixtures/v3/zahlbetrag-faelle.json +2 -2
- package/package.json +1 -1
|
@@ -130,6 +130,63 @@ function kuTeile(kunde, betragCents) {
|
|
|
130
130
|
nachRest[k].s.cents += 1;
|
|
131
131
|
return saetze.filter((s) => s.cents > 0).map((s) => ({ satzBp: s.satzBp, cents: s.cents }));
|
|
132
132
|
}
|
|
133
|
+
/** Steuer- und Formatzeichen (`gutschein-core.STEUERZEICHEN`). */
|
|
134
|
+
const STEUERZEICHEN = /[\p{Cc}\p{Cf}]/u;
|
|
135
|
+
/**
|
|
136
|
+
* Form eines Fremdgutschein-Wunschs in der Reihenfolge von `gutschein-beleg.pruefeFremd`: Freigabe, Aktion, Art,
|
|
137
|
+
* Freigabe der Art, Felder eigener Gutscheine, eigener Code, Nummer, Dublette, Betrag, Satz, Vermerk, Grund.
|
|
138
|
+
* `freigabe` undefined: die Freigabe prueft nur der Server.
|
|
139
|
+
*/
|
|
140
|
+
function pruefeFremd(v, i, freigabe, gesehen) {
|
|
141
|
+
const nein = (fehler, text) => ({ fehler, text });
|
|
142
|
+
const falsch = (feld) => nein('voucher_invalid', `Gutschein ${i + 1}: ${feld} passt nicht zum Fremdgutschein.`);
|
|
143
|
+
if (freigabe === 'off')
|
|
144
|
+
return nein('external_voucher_not_enabled', `Gutschein ${i + 1}: Fremdgutscheine sind nicht freigegeben.`);
|
|
145
|
+
if (v.action !== 'sell' && v.action !== 'redeem' && v.action !== 'payout')
|
|
146
|
+
return falsch('action');
|
|
147
|
+
if (v.type !== 'multi_purpose' && v.type !== 'single_purpose')
|
|
148
|
+
return falsch('type');
|
|
149
|
+
if (v.type === 'single_purpose' && freigabe !== undefined && freigabe !== 'all') {
|
|
150
|
+
return nein('external_voucher_type_not_enabled', `Gutschein ${i + 1}: fremde Einzweckgutscheine sind nicht freigegeben.`);
|
|
151
|
+
}
|
|
152
|
+
const r = v;
|
|
153
|
+
for (const feld of ['code', 'typeId', 'articleId', 'article', 'quantity', 'positions']) {
|
|
154
|
+
if (r[feld] !== undefined)
|
|
155
|
+
return falsch(feld);
|
|
156
|
+
}
|
|
157
|
+
if (v.valueCents != null)
|
|
158
|
+
return falsch('valueCents');
|
|
159
|
+
const nummer = (0, voucher_js_1.checkExternalVoucherNumber)(v.number);
|
|
160
|
+
if (!nummer.ok)
|
|
161
|
+
return nein(nummer.code, `Gutschein ${i + 1}: die Nummer ist ${nummer.code === 'external_voucher_number_is_own_code' ? 'ein eigener Gutscheincode' : 'ungueltig'}.`);
|
|
162
|
+
if (gesehen.has(nummer.number))
|
|
163
|
+
return nein('external_voucher_duplicate', `Gutschein ${i + 1}: dieselbe Nummer steht zweimal am Beleg.`);
|
|
164
|
+
gesehen.add(nummer.number);
|
|
165
|
+
const c = v.amountCents;
|
|
166
|
+
if (!(typeof c === 'number' && Number.isInteger(c) && c >= 1 && c <= 1_000_000))
|
|
167
|
+
return falsch('amountCents');
|
|
168
|
+
if (v.type === 'single_purpose') {
|
|
169
|
+
if (!(typeof v.vatRateBp === 'number' && voucher_js_1.EXTERNAL_VOUCHER_VAT_RATES_BP.includes(v.vatRateBp)))
|
|
170
|
+
return falsch('vatRateBp');
|
|
171
|
+
}
|
|
172
|
+
else if (v.vatRateBp != null) {
|
|
173
|
+
return falsch('vatRateBp');
|
|
174
|
+
}
|
|
175
|
+
if (v.taxedWith != null) {
|
|
176
|
+
if (v.type !== 'single_purpose' || v.action === 'sell')
|
|
177
|
+
return falsch('taxedWith');
|
|
178
|
+
const t = typeof v.taxedWith === 'string' ? v.taxedWith.trim() : '';
|
|
179
|
+
if (t.length < 1 || t.length > voucher_js_1.EXTERNAL_VOUCHER_TAXED_WITH_MAX || STEUERZEICHEN.test(t))
|
|
180
|
+
return falsch('taxedWith');
|
|
181
|
+
}
|
|
182
|
+
if (v.action === 'payout') {
|
|
183
|
+
const g = typeof v.reason === 'string' ? v.reason.trim() : '';
|
|
184
|
+
if (g.length < 1 || g.length > 200)
|
|
185
|
+
return falsch('reason');
|
|
186
|
+
}
|
|
187
|
+
// Uebrige Serverfelder am Wunsch: wie bei eigenen Gutscheinen nie sendbar.
|
|
188
|
+
return (0, voucher_js_1.voucherIsValid)(v) ? null : falsch('Angaben');
|
|
189
|
+
}
|
|
133
190
|
/**
|
|
134
191
|
* Wuensche und gelesene Eintraege in Positionen und Belegeintraege, wie
|
|
135
192
|
* `plane` sie baut. `kunde` sind Ware und Trinkgeld in innerer Form.
|
|
@@ -175,11 +232,19 @@ function planeGutscheine(kunde, vouchers, art, o) {
|
|
|
175
232
|
return nein('voucher_invalid', 'Gutscheine der neuen Form gibt es nicht auf Schulungsbelegen.');
|
|
176
233
|
if (kunde.some(istGutscheinZeile))
|
|
177
234
|
return nein('voucher_invalid', 'Gutschein-Positionen setzt nur der Server.');
|
|
235
|
+
const freigabe = o.externalVouchers ?? o.voucherSettings?.externalVouchers;
|
|
236
|
+
const nummern = new Set();
|
|
178
237
|
for (const [i, v] of vouchers.entries()) {
|
|
179
238
|
if (istGelesen(v))
|
|
180
239
|
return nein('voucher_invalid', `Gutschein ${i + 1}: Serverfelder an einem Wunsch.`);
|
|
181
240
|
if (!(0, voucher_js_1.isNewFormVoucher)(v))
|
|
182
241
|
continue;
|
|
242
|
+
if ((0, voucher_js_1.isExternalVoucher)(v)) {
|
|
243
|
+
const f = pruefeFremd(v, i, freigabe, nummern);
|
|
244
|
+
if (f)
|
|
245
|
+
return f;
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
183
248
|
if ((0, voucher_js_1.istWertVerkauf)(v) && v.typeId == null) {
|
|
184
249
|
// Wie gutschein-beleg.pruefeWuensche: ein Wert-Verkauf ohne Sorte ist voucher_type_required.
|
|
185
250
|
// Nur eine alte Gutschein-Einstellung MIT Art (Aufrufer bis 1.16) rechnet wie bisher; ein Server ab
|
|
@@ -206,7 +271,8 @@ function planeGutscheine(kunde, vouchers, art, o) {
|
|
|
206
271
|
if (wuensche.some((v) => v.action === 'payout') && vouchers.some((v) => !(0, voucher_js_1.isNewFormVoucher)(v) && v.type === 'promo')) {
|
|
207
272
|
return nein('voucher_invalid', 'Rabatt und Auszahlung gehen nicht am selben Beleg.');
|
|
208
273
|
}
|
|
209
|
-
|
|
274
|
+
// Die Nummer eines Fremdgutscheins prueft pruefeFremd (external_voucher_duplicate).
|
|
275
|
+
const codes = wuensche.filter((v) => v.action !== 'sell' && !(0, voucher_js_1.isExternalVoucher)(v)).map((v) => normalerCode(v.code));
|
|
210
276
|
if (codes.some((c) => c == null))
|
|
211
277
|
return nein('voucher_invalid', 'Ein Gutscheincode ist ungueltig.');
|
|
212
278
|
if (new Set(codes).size !== codes.length)
|
|
@@ -252,6 +318,55 @@ function planeGutscheine(kunde, vouchers, art, o) {
|
|
|
252
318
|
gutscheine.push(g);
|
|
253
319
|
continue;
|
|
254
320
|
}
|
|
321
|
+
if ((0, voucher_js_1.isExternalVoucher)(v)) {
|
|
322
|
+
// gutschein-beleg.plane mit sichtExtern: kein Dokument, kein Saldo, keine Statuspruefung.
|
|
323
|
+
const c = v.amountCents;
|
|
324
|
+
const satz = v.type === 'single_purpose' ? v.vatRateBp : 0;
|
|
325
|
+
if (v.action === 'sell') {
|
|
326
|
+
if (v.type === 'multi_purpose') {
|
|
327
|
+
if (nulltopf) {
|
|
328
|
+
zusatz.push(position(0, c, 'voucher_float'));
|
|
329
|
+
gutscheine.push({ action: 'sell', type: 'value', value: c / 100, imNullTopf: true });
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
gutscheine.push({ action: 'sell', type: 'value', value: c / 100 });
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
// Kleinunternehmer verkauft befreit: Satz 0, egal was gesendet wird.
|
|
337
|
+
zusatz.push(position(ku ? 0 : satz, c, 'voucher'));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
else if (v.action === 'payout') {
|
|
341
|
+
if (v.type === 'multi_purpose') {
|
|
342
|
+
zusatz.push(position(0, -c, 'voucher_float'));
|
|
343
|
+
gutscheine.push({ action: 'payout', type: 'value', value: c / 100, imNullTopf: true });
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
// Ohne Dokument berichtigt ein Kleinunternehmer-Konto im 0-%-Topf (nie USt, die es nie geschuldet hat).
|
|
347
|
+
zusatz.push(position(ku ? 0 : satz, -c, 'voucher'));
|
|
348
|
+
}
|
|
349
|
+
auszahlungCents += c;
|
|
350
|
+
}
|
|
351
|
+
else if (v.type === 'multi_purpose') {
|
|
352
|
+
gutscheine.push({ action: 'redeem', type: 'value', value: c / 100 });
|
|
353
|
+
}
|
|
354
|
+
else if (satz === 0 || ku) {
|
|
355
|
+
// Befreit verkauft (Satz 0) oder Kleinunternehmer-Konto: anteilig auf alle Toepfe des Korbs.
|
|
356
|
+
const teile = kuTeile(kunde, c);
|
|
357
|
+
if (!teile)
|
|
358
|
+
return nein('voucher_rate_mismatch', `Gutschein ${i + 1}: der Korb deckt den Betrag nicht.`);
|
|
359
|
+
for (const t of teile) {
|
|
360
|
+
zusatz.push(position(t.satzBp, -t.cents, 'voucher'));
|
|
361
|
+
minus(t.satzBp, t.cents);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
zusatz.push(position(satz, -c, 'voucher'));
|
|
366
|
+
minus(satz, c);
|
|
367
|
+
}
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
255
370
|
if ((0, voucher_js_1.istWertVerkauf)(v) && v.typeId != null) {
|
|
256
371
|
// Verkauf ueber eine Sorte (gutschein-beleg.plane): unbekannt, andere Art, falscher Fixbetrag. Eine andere Art
|
|
257
372
|
// heisst: die Kasse hat eine alte Sicht (Sorte umgestellt) – wie ein anderer Fixbetrag voucher_amount_mismatch,
|
|
@@ -583,6 +583,10 @@ function nettoAusBrutto(bruttoCents, rate) {
|
|
|
583
583
|
* nennt, allein stehen bleibt.
|
|
584
584
|
*/
|
|
585
585
|
function gutscheinText(voucher) {
|
|
586
|
+
// Fremdgutschein: die Nummer des fremden Systems voll, ohne Gutscheinart (die steht beim Verkauf in der Position).
|
|
587
|
+
const fremd = fremdZeile(voucher);
|
|
588
|
+
if (fremd != null)
|
|
589
|
+
return fremd;
|
|
586
590
|
let text = '';
|
|
587
591
|
if (voucher.type === index_js_1.VoucherType.value) {
|
|
588
592
|
text += 'Wertgutschein';
|
|
@@ -628,6 +632,15 @@ function gutscheinText(voucher) {
|
|
|
628
632
|
* Text „ Grund: <Grund>“
|
|
629
633
|
* Aktion Rabattzeile wie bisher (Aktionsgutschein)
|
|
630
634
|
*
|
|
635
|
+
* Fremdgutschein wie der eigene, nur mit „Gutschein Nr. <Nummer>“ statt der
|
|
636
|
+
* (`source: 'external'`) Maske: Verkauf „Gutschein Nr. W-77 (Mehrzweckgutschein)“ bzw.
|
|
637
|
+
* „(Einzweckgutschein 20 %)“ (Name der Position vom Server),
|
|
638
|
+
* Einloesung Einzweck 8:4 „Gutschein Nr. FG-1234“ | „-20,00 A“ und
|
|
639
|
+
* Text „ Einzweck, versteuert mit FG-1234-V“ (nur mit
|
|
640
|
+
* `taxedWith`), Mehrzweck nach „Zwischensumme“ „Gutschein Nr.
|
|
641
|
+
* W-77“ | „-3,00 €“, Auszahlung „Auszahlung Gutschein Nr. …“;
|
|
642
|
+
* nie „Rest am Gutschein“ (den Saldo kennt nur das fremde System)
|
|
643
|
+
*
|
|
631
644
|
* Vermerke sind Textzeilen mit zwei fuehrenden Leerzeichen; das Raster bricht
|
|
632
645
|
* sie mit demselben Einzug um (grid.ts, haengender Einzug), auf 58 mm etwa
|
|
633
646
|
* „ Einzweck, versteuert mit“ / „ Beleg K1-ID-4711“.
|
|
@@ -670,6 +683,16 @@ function gutscheinEndung(voucher) {
|
|
|
670
683
|
return typeof voucher.code === 'string' && voucher.code.length >= 4 && voucher.code !== 'no-code' ? voucher.code.slice(-4) : null;
|
|
671
684
|
}
|
|
672
685
|
const MEHRZWECK_UST_TEXT = ' USt bei Einlösung';
|
|
686
|
+
/** Zeile eines Fremdgutscheins `Gutschein Nr. <Nummer>`; null bei einem eigenen Gutschein oder ohne Nummer. */
|
|
687
|
+
function fremdZeile(voucher) {
|
|
688
|
+
return (0, index_js_2.isExternalVoucher)(voucher) && typeof voucher.number === 'string' && voucher.number !== '' ? `Gutschein Nr. ${voucher.number}` : null;
|
|
689
|
+
}
|
|
690
|
+
/** Ein gelesener Eintrag mit Wert: beim Fremdgutschein ganze positive Cent, sonst wie [voucherIsValid]. */
|
|
691
|
+
function eintragGueltig(voucher) {
|
|
692
|
+
if (!(0, index_js_2.isExternalVoucher)(voucher))
|
|
693
|
+
return (0, index_js_2.voucherIsValid)(voucher);
|
|
694
|
+
return Number.isSafeInteger(voucher.valueCents) && voucher.valueCents > 0;
|
|
695
|
+
}
|
|
673
696
|
/**
|
|
674
697
|
* Welche Gutscheinposition (`voucher`/`voucher_float`) gehoert zu welchem
|
|
675
698
|
* Eintrag? Jede Position hoechstens einem Eintrag, Eintraege in ihrer
|
|
@@ -698,10 +721,11 @@ function gutscheinPositionen(receipt) {
|
|
|
698
721
|
zuordnung.set(i, { voucher, letzte: true });
|
|
699
722
|
continue;
|
|
700
723
|
}
|
|
724
|
+
const fremd = fremdZeile(voucher);
|
|
701
725
|
const endung = gutscheinEndung(voucher);
|
|
702
|
-
if (endung == null || (voucher.action !== index_js_1.VoucherAction.redeem && voucher.action !== index_js_1.VoucherAction.payout))
|
|
726
|
+
if ((fremd == null && endung == null) || (voucher.action !== index_js_1.VoucherAction.redeem && voucher.action !== index_js_1.VoucherAction.payout))
|
|
703
727
|
continue;
|
|
704
|
-
const name = `${voucher.action === index_js_1.VoucherAction.payout ? 'Auszahlung ' : ''}Gutschein ····-${endung}`;
|
|
728
|
+
const name = `${voucher.action === index_js_1.VoucherAction.payout ? 'Auszahlung ' : ''}${fremd ?? `Gutschein ····-${endung}`}`;
|
|
705
729
|
const ziel = Number.isInteger(voucher.amountCents) ? Math.abs(voucher.amountCents) : Math.abs(voucher.valueCents ?? 0);
|
|
706
730
|
const genommen = [];
|
|
707
731
|
let summe = 0;
|
|
@@ -747,6 +771,12 @@ function gutscheinPositionsZeilen(item, satz, zu) {
|
|
|
747
771
|
return zeilen;
|
|
748
772
|
}
|
|
749
773
|
const art = v.type === index_js_1.VoucherType.service ? 'Leistung' : 'Einzweck';
|
|
774
|
+
if ((0, index_js_2.isExternalVoucher)(v)) {
|
|
775
|
+
// Fremdgutschein: Vermerk nur mit `taxedWith` (Beleg im fremden System, wie gesendet), kein Rest.
|
|
776
|
+
if (typeof v.taxedWith === 'string' && v.taxedWith !== '')
|
|
777
|
+
zeilen.push(textZeile(` ${art}, versteuert mit ${v.taxedWith}`));
|
|
778
|
+
return zeilen;
|
|
779
|
+
}
|
|
750
780
|
if (typeof v.taxedWith === 'string' && v.taxedWith !== '') {
|
|
751
781
|
zeilen.push(textZeile(` ${art}, versteuert mit Beleg ${v.taxedWith}`));
|
|
752
782
|
}
|
|
@@ -1225,17 +1255,18 @@ function buildReceiptLayout(receipt, company, options = {}) {
|
|
|
1225
1255
|
continue;
|
|
1226
1256
|
const wert = voucher.valueCents ?? 0;
|
|
1227
1257
|
const vz = voucher.type === index_js_1.VoucherType.value ? wgVz : 1;
|
|
1228
|
-
if ((
|
|
1258
|
+
if (eintragGueltig(voucher) && voucher.action === index_js_1.VoucherAction.sell) {
|
|
1229
1259
|
gruppeVon(steuersatz(index_js_1.VatRate.vat0)).bruttoCents += vz * wert;
|
|
1230
1260
|
}
|
|
1231
1261
|
if (voucher.action === index_js_1.VoucherAction.sell && voucher.type === index_js_1.VoucherType.value) {
|
|
1232
1262
|
// Mehrzweck mit Code (vor dem Stichtag nur als Eintrag): wie die Position im 0-%-Topf.
|
|
1233
1263
|
const mehrzweck = istMehrzweckMitCode(voucher);
|
|
1234
1264
|
const code = gutscheinCodeZusatz(voucher);
|
|
1265
|
+
const fremd = fremdZeile(voucher);
|
|
1235
1266
|
lines.push({
|
|
1236
1267
|
kind: 'columns',
|
|
1237
1268
|
columns: [
|
|
1238
|
-
{ text: `1 x ${mehrzweck ? `Mehrzweckgutschein${code}` : gutscheinText(voucher)}`, width: 7, align: 'left' },
|
|
1269
|
+
{ text: `1 x ${fremd != null ? `${fremd} (Mehrzweckgutschein)` : mehrzweck ? `Mehrzweckgutschein${code}` : gutscheinText(voucher)}`, width: 7, align: 'left' },
|
|
1239
1270
|
{ text: `${formatCents(vz * wert)} ${index_js_1.VatRate.vat0.category}`, width: 5, align: 'right' },
|
|
1240
1271
|
],
|
|
1241
1272
|
});
|
|
@@ -1315,8 +1346,10 @@ function buildReceiptLayout(receipt, company, options = {}) {
|
|
|
1315
1346
|
// (Zahlungszeile laut Spec); eine Auszahlung ohne `zeroRateBucket`
|
|
1316
1347
|
// (schreibt der Server nicht) zaehlt wie in receiptSumCents.
|
|
1317
1348
|
const wert = voucher.valueCents ?? 0;
|
|
1318
|
-
|
|
1319
|
-
const
|
|
1349
|
+
// Fremdgutschein: „Gutschein Nr. <Nummer>“, nie ein Rest (den Saldo kennt nur das fremde System).
|
|
1350
|
+
const fremd = fremdZeile(voucher);
|
|
1351
|
+
const endung = fremd == null && istMehrzweckMitCode(voucher) ? gutscheinEndung(voucher) : null;
|
|
1352
|
+
const text = fremd ?? (endung != null ? `Gutschein ····-${endung}` : gutscheinText(voucher));
|
|
1320
1353
|
lines.push(paarZeile(voucher.action === index_js_1.VoucherAction.payout ? `Auszahlung ${text}` : text, wgVz === 1 ? `-${formatCents(wert)} €` : `${formatCents(wert)} €`, 8, 4));
|
|
1321
1354
|
if (endung != null && wgVz === 1 && Number.isInteger(voucher.balanceAfterCents)) {
|
|
1322
1355
|
lines.push(paarZeile(' Rest am Gutschein', `${formatCents(voucher.balanceAfterCents)} €`, 8, 4));
|
package/dist/cjs/stored/draht.js
CHANGED
|
@@ -161,6 +161,8 @@ const BELEG_GUTSCHEIN = {
|
|
|
161
161
|
article: 'artikel', articleId: 'artikelId', quantity: 'stueck', positions: 'positionen',
|
|
162
162
|
balanceAfterCents: 'saldoNachCents', remainingQuantityAfter: 'stueckOffenNach', taxedWith: 'versteuertMit', exempt: 'befreit',
|
|
163
163
|
reason: 'grund', zeroRateBucket: 'imNullTopf', typeId: 'sorteId', typeName: 'sorteName', payout: 'auszahlung',
|
|
164
|
+
// Fremdgutschein: source external (GUTSCHEIN_QUELLE) und die Nummer des fremden Systems.
|
|
165
|
+
source: 'quelle', number: 'nummer',
|
|
164
166
|
};
|
|
165
167
|
const BELEG_GUTSCHEIN_AUSSEN = Object.fromEntries(Object.entries(BELEG_GUTSCHEIN).map(([aussen, innen]) => [innen, aussen]));
|
|
166
168
|
const GUTSCHEIN_ARTIKEL_AUSSEN = { satzBp: 'vatRateBp', preisCents: 'priceCents' };
|
|
@@ -173,6 +175,7 @@ function gutscheinEintragNachAussen(v) {
|
|
|
173
175
|
return v;
|
|
174
176
|
const art = vokabular_js_1.KATALOGE.GUTSCHEIN_ART ?? {};
|
|
175
177
|
const auszahlung = vokabular_js_1.KATALOGE.GUTSCHEIN_AUSZAHLUNG ?? {};
|
|
178
|
+
const quelle = vokabular_js_1.ZUSATZ_KATALOGE.GUTSCHEIN_QUELLE ?? {};
|
|
176
179
|
const typNeu = typeof v.type === 'string' && (0, exports.hat)(art, v.type);
|
|
177
180
|
if (!typNeu && !Object.keys(v).some((k) => (0, exports.hat)(BELEG_GUTSCHEIN_AUSSEN, k)))
|
|
178
181
|
return v;
|
|
@@ -184,6 +187,8 @@ function gutscheinEintragNachAussen(v) {
|
|
|
184
187
|
raus.voucherType = typeof w === 'string' && (0, exports.hat)(art, w) ? art[w] : w;
|
|
185
188
|
else if (k === 'artikel')
|
|
186
189
|
raus.article = (0, exports.istObjekt)(w) ? umbenannt(w, GUTSCHEIN_ARTIKEL_AUSSEN) : w;
|
|
190
|
+
else if (k === 'quelle')
|
|
191
|
+
raus.source = typeof w === 'string' && (0, exports.hat)(quelle, w) ? quelle[w] : w;
|
|
187
192
|
else if (k === 'auszahlung')
|
|
188
193
|
raus.payout = typeof w === 'string' && (0, exports.hat)(auszahlung, w) ? auszahlung[w] : w;
|
|
189
194
|
else
|
|
@@ -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 = "3c729299a204cf522158317aa38dcad5bb8ef797c44e9369faecc94be4717d78";
|
|
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 {
|
|
@@ -18,3 +18,5 @@ export declare const SCHEMAS: Readonly<Record<'getReceipt' | 'getKasseSettings'
|
|
|
18
18
|
export declare const ARTIKEL_FELDER: readonly string[];
|
|
19
19
|
/** Wertkataloge innen (deutsch) -> aussen (englisch). */
|
|
20
20
|
export declare const KATALOGE: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
21
|
+
/** Kataloge der Gutschein-Eintraege am Beleg ohne Schemaverweis (`quelle` eines Fremdgutscheins), innen -> aussen. */
|
|
22
|
+
export declare const ZUSATZ_KATALOGE: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Erzeugt von scripts/stored-vokabular.mjs aus fixtures/v3/v3-vokabular.json.
|
|
3
3
|
// Nicht von Hand aendern: test/stored.test.ts vergleicht mit dem Vertrag.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.KATALOGE = exports.ARTIKEL_FELDER = exports.SCHEMAS = exports.VOKABULAR_QUELLE = void 0;
|
|
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 = "3c729299a204cf522158317aa38dcad5bb8ef797c44e9369faecc94be4717d78";
|
|
8
8
|
/** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
|
|
9
9
|
exports.SCHEMAS = {
|
|
10
10
|
"getReceipt": {
|
|
@@ -47,6 +47,7 @@ exports.SCHEMAS = {
|
|
|
47
47
|
},
|
|
48
48
|
"testCashregister": "testKasse",
|
|
49
49
|
"testSignature": "testSignatur",
|
|
50
|
+
"deprecation": "deprecation",
|
|
50
51
|
"logo_scale": "logo_skala",
|
|
51
52
|
"layout": {
|
|
52
53
|
"__": "layout",
|
|
@@ -291,6 +292,7 @@ exports.SCHEMAS = {
|
|
|
291
292
|
}
|
|
292
293
|
],
|
|
293
294
|
"serviceArticles": "leistungsArtikel",
|
|
295
|
+
"externalVouchers": "fremd",
|
|
294
296
|
"returnType": {
|
|
295
297
|
"__": "rueckgabe",
|
|
296
298
|
"typeId": "sorteId",
|
|
@@ -376,6 +378,11 @@ exports.SCHEMAS = {
|
|
|
376
378
|
},
|
|
377
379
|
"vouchers.types[].payout": {
|
|
378
380
|
"$catalog": "GUTSCHEIN_AUSZAHLUNG"
|
|
381
|
+
},
|
|
382
|
+
"vouchers.externalVouchers": {
|
|
383
|
+
"aus": "off",
|
|
384
|
+
"wert": "multi_purpose",
|
|
385
|
+
"beide": "all"
|
|
379
386
|
}
|
|
380
387
|
}
|
|
381
388
|
},
|
|
@@ -748,3 +755,9 @@ exports.KATALOGE = {
|
|
|
748
755
|
"sonstiges": "other"
|
|
749
756
|
}
|
|
750
757
|
};
|
|
758
|
+
/** Kataloge der Gutschein-Eintraege am Beleg ohne Schemaverweis (`quelle` eines Fremdgutscheins), innen -> aussen. */
|
|
759
|
+
exports.ZUSATZ_KATALOGE = {
|
|
760
|
+
"GUTSCHEIN_QUELLE": {
|
|
761
|
+
"extern": "external"
|
|
762
|
+
}
|
|
763
|
+
};
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -216,6 +216,11 @@ export interface ListReceiptsPage<V extends ListReceiptsView = 'summary'> {
|
|
|
216
216
|
}
|
|
217
217
|
/** Zeile `view: summary` vom Draht. */
|
|
218
218
|
export declare function fromListReceiptsSummaryPayload(payload: Record<string, unknown>): ListReceiptsSummary;
|
|
219
|
+
/**
|
|
220
|
+
* Ein Beleg der vollen Ansicht vom Draht: das Belegdokument und die Zusaetze, die `getReceipt` in der Huelle traegt.
|
|
221
|
+
* Paketintern auch fuer die Beleg-Webhooks (dieselbe Darstellung, `parseInventoryWebhookEvent`).
|
|
222
|
+
*/
|
|
223
|
+
export declare function vollerBeleg(roh: Record<string, unknown>): ListedFullReceipt;
|
|
219
224
|
/**
|
|
220
225
|
* Ein Beleg der vollen Ansicht mit den Druck- und Anzeigedaten seiner Seite, in derselben Form wie
|
|
221
226
|
* `getReceiptWithCompany` (ohne `outputs`): der Kopf der Version des Belegs aus `headers` (Nullbelege ohne
|
|
@@ -220,8 +220,11 @@ function kopfdaten(roh) {
|
|
|
220
220
|
return { ...fromReceiptCompanyPayload(roh), label: typeof label === 'string' ? label : '' };
|
|
221
221
|
}
|
|
222
222
|
const LOGO_STUFEN = ['S', 'M', 'L', 'XL'];
|
|
223
|
-
/**
|
|
224
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Ein Beleg der vollen Ansicht vom Draht: das Belegdokument und die Zusaetze, die `getReceipt` in der Huelle traegt.
|
|
225
|
+
* Paketintern auch fuer die Beleg-Webhooks (dieselbe Darstellung, `parseInventoryWebhookEvent`).
|
|
226
|
+
*/
|
|
227
|
+
export function vollerBeleg(roh) {
|
|
225
228
|
const beleg = fromReceiptPayload(roh);
|
|
226
229
|
if (typeof roh['testSignature'] === 'boolean')
|
|
227
230
|
beleg.testSignature = roh['testSignature'];
|
|
@@ -280,6 +280,12 @@ export interface ReceiptWithCompany {
|
|
|
280
280
|
* neuer Beleg). Fehlt sonst, auch beim ersten Verkauf mit Schluessel.
|
|
281
281
|
*/
|
|
282
282
|
replayed?: true;
|
|
283
|
+
/**
|
|
284
|
+
* Nur nach einem Verkauf auf einem veralteten Weg (Server 2026-11: Wertgutschein der Altform mit frei getipptem
|
|
285
|
+
* Code, `type: 'value'`): der Hinweis des Servers (englisch). Der Beleg gilt; kuenftig den Gutschein als
|
|
286
|
+
* Fremdgutschein (`source: 'external'`) bzw. als eigenen ueber eine Sorte senden. Fehlt sonst.
|
|
287
|
+
*/
|
|
288
|
+
deprecation?: string;
|
|
283
289
|
}
|
|
284
290
|
/**
|
|
285
291
|
* Das Zeilenmodell zum Drucken und Anzeigen eines Belegs aus einer Antwort.
|
|
@@ -1042,6 +1042,7 @@ export function belegMitFirmaAusHuelle(daten, functionName) {
|
|
|
1042
1042
|
...(outputs !== undefined ? { outputs } : {}),
|
|
1043
1043
|
// Nur genau true: ohne Wiederholung bleibt die Form des Ergebnisses wie bisher.
|
|
1044
1044
|
...(d.replayed === true ? { replayed: true } : {}),
|
|
1045
|
+
...(typeof d.deprecation === 'string' && d.deprecation !== '' ? { deprecation: d.deprecation } : {}),
|
|
1045
1046
|
};
|
|
1046
1047
|
}
|
|
1047
1048
|
/**
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* Gutscheinart — Zwilling von `VoucherType` in kasseneck_api/lib/enums/voucher_type.dart.
|
|
3
3
|
*/
|
|
4
4
|
export declare const VoucherType: {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Altform: Wertgutschein (Wert im Cent, Code frei). Gelesene Belege tragen `value` fuer jeden
|
|
7
|
+
* Mehrzweck-Eintrag (eigen und fremd); dort ist der Wert gueltig. Als Wunsch mit frei getipptem Code
|
|
8
|
+
* veraltet: siehe [LegacyValueVoucherWish].
|
|
9
|
+
*/
|
|
6
10
|
readonly value: "value";
|
|
7
11
|
/** Altform: Rabatt-/Aktionsgutschein. */
|
|
8
12
|
readonly promo: "promo";
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* Gutscheinart — Zwilling von `VoucherType` in kasseneck_api/lib/enums/voucher_type.dart.
|
|
3
3
|
*/
|
|
4
4
|
export const VoucherType = {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Altform: Wertgutschein (Wert im Cent, Code frei). Gelesene Belege tragen `value` fuer jeden
|
|
7
|
+
* Mehrzweck-Eintrag (eigen und fremd); dort ist der Wert gueltig. Als Wunsch mit frei getipptem Code
|
|
8
|
+
* veraltet: siehe [LegacyValueVoucherWish].
|
|
9
|
+
*/
|
|
6
10
|
value: 'value',
|
|
7
11
|
/** Altform: Rabatt-/Aktionsgutschein. */
|
|
8
12
|
promo: 'promo',
|
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, type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, 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, type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, 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';
|
|
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, 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, toVoucherPayload, fromVoucherPayload, voucherIsValid, 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, toVoucherPayload, fromVoucherPayload, voucherIsValid, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, 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, 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';
|
|
@@ -21,5 +21,5 @@ export { changeStockCondition, createArticle, createReservation, deactivateArtic
|
|
|
21
21
|
export { addVariant, createVariantGroup, getVariantGroup, iterateVariantGroups, listVariantGroups, updateVariantGroup, } from './varianten.js';
|
|
22
22
|
export { cancelStocktake, closeStocktake, createStocktake, getStocktake, getStocktakePdf, iterateStocktakeCounts, iterateStocktakeItems, iterateStocktakes, listStocktakeCounts, listStocktakeItems, listStocktakes, recordStocktakeCount, recountStocktake, reviewStocktake, voidStocktakeCount, } from './inventur.js';
|
|
23
23
|
export { verifyInventoryWebhookSignature, parseInventoryWebhookEvent, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_EVENT_HEADER, WEBHOOK_DELIVERY_HEADER, WEBHOOK_TOLERANCE_SEC, type VerifyInventoryWebhookOptions, } from './webhook.js';
|
|
24
|
-
export type { AddVariantRequest, Article, CancelStocktakeRequest, CloseStocktakeRequest, CloseStocktakeResult, CreateStocktakeRequest, RecordStocktakeCountRequest, RecountStocktakeRequest, ReviewStocktakeRequest, Stocktake, StocktakeActor, StocktakeCancellation, StocktakeClosing, StocktakeCount, StocktakeCountListQuery, StocktakeCountPage, StocktakeCountResult, StocktakeInventoryLine, StocktakeItem, StocktakeItemListQuery, StocktakeItemPage, StocktakeListQuery, StocktakeNotBooked, StocktakePage, StocktakePdf, StocktakePdfDownload, StocktakePdfInfo, StocktakeProgress, StocktakeRecount, StocktakeReview, StocktakeScope, StocktakeScopeInput, StocktakeSeal, StocktakeTotals, StocktakeWarning, VoidStocktakeCountRequest, ArticleInput, ArticleListQuery, ArticleLookup, ArticlePage, ChangeStockConditionRequest, CreateArticleRequest, CreateInventoryWebhookOptions, CreateReservationRequest, CreateVariantGroupRequest, DeactivateArticleRequest, ExtendReservationRequest, GoodsReceiptItem, GoodsReceiptPreview, GoodsReceiptPreviewLine, GoodsReceiptPreviewRequest, InventoryShortfall, InventoryWarning, InventoryWebhook, InventoryWebhookDelivery, InventoryWebhookEnvelope, InventoryWebhookEvent, InventoryWebhookList, InventoryWebhookPatch, InventoryWebhookTestDelivery, InventoryWebhookTestResult, InventoryWebhookWithSecret, LandedCost, Location, LocationAddress, ReceiveGoodsRequest, RecordStockLossRequest, ReleaseReservationItem, ReleaseReservationRequest, Reservation, ReservationItem, ReservationItemInput, ReservationListQuery, ReservationPage, ReverseStockMovementRequest, StockBelowMinimumEventData, StockChangedEventData, StockItem, StockLevel, StockListQuery, StockMovement, StockMovementLot, StockMovementPage, StockMovementQuery, StockMovementSourceRef, StockOperation, StockPage, StockResult, StockValue, TransferStockRequest, UpdateArticleRequest, UpdateVariantGroupRequest, VariantAttribute, VariantGroup, VariantGroupDefaults, VariantGroupDefaultsInput, VariantGroupListQuery, VariantGroupMember, VariantGroupPage, VariantInput, } from './typen.js';
|
|
25
|
-
export { INVENTORY_ENDPOINTS, INVENTORY_ERROR_CODES, INVENTORY_REQUEST_ERROR_CODES, INVENTORY_WEBHOOK_EVENTS, INVENTORY_WEBHOOK_ENVELOPE_FIELDS, INVENTORY_WEBHOOK_LIMIT, INVENTORY_LIST_LIMIT_MAX, LOCATION_TYPES, STOCK_MOVEMENT_TYPES, STOCK_MOVEMENT_SOURCES, STOCK_CONDITIONS, STOCK_CHANGE_CAUSES, WEBHOOK_DELIVERY_STATUSES, INVENTORY_WARNING_CODES, STOCK_KINDS, STOCK_LOSS_REASONS, WITHDRAWAL_TYPES, LANDED_COST_TYPES, LANDED_COST_ALLOCATIONS, RESERVATION_STATUSES, INVENTORY_IDEMPOTENCY_KEY_MAX, RESERVATION_MINUTES_MIN, RESERVATION_MINUTES_MAX, VARIANT_ATTRIBUTES_MAX, VARIANT_VALUES_MAX, VARIANT_MATRIX_MAX, VARIANT_GROUP_ACTIVE_MAX, STOCKTAKE_STATUSES, STOCKTAKE_TYPES, STOCKTAKE_SCOPE_TYPES, STOCKTAKE_CHECK_REASONS, STOCKTAKE_NOT_BOOKED_REASONS, STOCKTAKE_SOURCES, STOCKTAKE_ACTOR_TYPES, STOCKTAKE_INVENTORY_AS_OF, STOCKTAKE_ITEMS_MAX, STOCKTAKE_RECOUNT_ITEMS_MAX, STOCKTAKE_COUNTS_PER_ITEM_MAX, type StocktakeStatus, type StocktakeType, type StocktakeScopeType, type StocktakeCheckReason, type StocktakeNotBookedReason, type StocktakeSource, type StocktakeActorType, type StocktakeInventoryAsOf, type InventoryEndpoint, type InventoryErrorCode, type InventoryRequestErrorCode, type InventoryWebhookEventType, type LocationType, type StockMovementType, type StockMovementSource, type StockCondition, type StockChangeCause, type WebhookDeliveryStatus, type InventoryWarningCode, type StockKind, type StockLossReason, type WithdrawalType, type LandedCostType, type LandedCostAllocation, type ReservationStatus, } from './vertrag.js';
|
|
24
|
+
export type { AddVariantRequest, Article, CancelStocktakeRequest, CloseStocktakeRequest, CloseStocktakeResult, CreateStocktakeRequest, RecordStocktakeCountRequest, RecountStocktakeRequest, ReviewStocktakeRequest, Stocktake, StocktakeActor, StocktakeCancellation, StocktakeClosing, StocktakeCount, StocktakeCountListQuery, StocktakeCountPage, StocktakeCountResult, StocktakeInventoryLine, StocktakeItem, StocktakeItemListQuery, StocktakeItemPage, StocktakeListQuery, StocktakeNotBooked, StocktakePage, StocktakePdf, StocktakePdfDownload, StocktakePdfInfo, StocktakeProgress, StocktakeRecount, StocktakeReview, StocktakeScope, StocktakeScopeInput, StocktakeSeal, StocktakeTotals, StocktakeWarning, VoidStocktakeCountRequest, ArticleInput, ArticleListQuery, ArticleLookup, ArticlePage, ChangeStockConditionRequest, CreateArticleRequest, CreateInventoryWebhookOptions, CreateReservationRequest, CreateVariantGroupRequest, DeactivateArticleRequest, ExtendReservationRequest, GoodsReceiptItem, GoodsReceiptPreview, GoodsReceiptPreviewLine, GoodsReceiptPreviewRequest, InventoryShortfall, InventoryWarning, InventoryWebhook, InventoryWebhookDelivery, InventoryWebhookEnvelope, InventoryWebhookEvent, ReceiptCreatedEventData, ReceiptCancelledEventData, ReceiptCancelledItem, ReceiptRefund, InventoryWebhookList, InventoryWebhookPatch, InventoryWebhookTestDelivery, InventoryWebhookTestResult, InventoryWebhookWithSecret, LandedCost, Location, LocationAddress, ReceiveGoodsRequest, RecordStockLossRequest, ReleaseReservationItem, ReleaseReservationRequest, Reservation, ReservationItem, ReservationItemInput, ReservationListQuery, ReservationPage, ReverseStockMovementRequest, StockBelowMinimumEventData, StockChangedEventData, StockItem, StockLevel, StockListQuery, StockMovement, StockMovementLot, StockMovementPage, StockMovementQuery, StockMovementSourceRef, StockOperation, StockPage, StockResult, StockValue, TransferStockRequest, UpdateArticleRequest, UpdateVariantGroupRequest, VariantAttribute, VariantGroup, VariantGroupDefaults, VariantGroupDefaultsInput, VariantGroupListQuery, VariantGroupMember, VariantGroupPage, VariantInput, } from './typen.js';
|
|
25
|
+
export { INVENTORY_ENDPOINTS, INVENTORY_ERROR_CODES, INVENTORY_REQUEST_ERROR_CODES, INVENTORY_WEBHOOK_EVENTS, RECEIPT_WEBHOOK_EVENTS, INVENTORY_WEBHOOK_ENVELOPE_FIELDS, INVENTORY_WEBHOOK_LIMIT, INVENTORY_LIST_LIMIT_MAX, LOCATION_TYPES, STOCK_MOVEMENT_TYPES, STOCK_MOVEMENT_SOURCES, STOCK_CONDITIONS, STOCK_CHANGE_CAUSES, WEBHOOK_DELIVERY_STATUSES, INVENTORY_WARNING_CODES, STOCK_KINDS, STOCK_LOSS_REASONS, WITHDRAWAL_TYPES, LANDED_COST_TYPES, LANDED_COST_ALLOCATIONS, RESERVATION_STATUSES, INVENTORY_IDEMPOTENCY_KEY_MAX, RESERVATION_MINUTES_MIN, RESERVATION_MINUTES_MAX, VARIANT_ATTRIBUTES_MAX, VARIANT_VALUES_MAX, VARIANT_MATRIX_MAX, VARIANT_GROUP_ACTIVE_MAX, STOCKTAKE_STATUSES, STOCKTAKE_TYPES, STOCKTAKE_SCOPE_TYPES, STOCKTAKE_CHECK_REASONS, STOCKTAKE_NOT_BOOKED_REASONS, STOCKTAKE_SOURCES, STOCKTAKE_ACTOR_TYPES, STOCKTAKE_INVENTORY_AS_OF, STOCKTAKE_ITEMS_MAX, STOCKTAKE_RECOUNT_ITEMS_MAX, STOCKTAKE_COUNTS_PER_ITEM_MAX, type StocktakeStatus, type StocktakeType, type StocktakeScopeType, type StocktakeCheckReason, type StocktakeNotBookedReason, type StocktakeSource, type StocktakeActorType, type StocktakeInventoryAsOf, type InventoryEndpoint, type InventoryErrorCode, type InventoryRequestErrorCode, type InventoryWebhookEventType, type ReceiptWebhookEventType, type LocationType, type StockMovementType, type StockMovementSource, type StockCondition, type StockChangeCause, type WebhookDeliveryStatus, type InventoryWarningCode, type StockKind, type StockLossReason, type WithdrawalType, type LandedCostType, type LandedCostAllocation, type ReservationStatus, } from './vertrag.js';
|
|
@@ -21,4 +21,4 @@ export { changeStockCondition, createArticle, createReservation, deactivateArtic
|
|
|
21
21
|
export { addVariant, createVariantGroup, getVariantGroup, iterateVariantGroups, listVariantGroups, updateVariantGroup, } from './varianten.js';
|
|
22
22
|
export { cancelStocktake, closeStocktake, createStocktake, getStocktake, getStocktakePdf, iterateStocktakeCounts, iterateStocktakeItems, iterateStocktakes, listStocktakeCounts, listStocktakeItems, listStocktakes, recordStocktakeCount, recountStocktake, reviewStocktake, voidStocktakeCount, } from './inventur.js';
|
|
23
23
|
export { verifyInventoryWebhookSignature, parseInventoryWebhookEvent, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_EVENT_HEADER, WEBHOOK_DELIVERY_HEADER, WEBHOOK_TOLERANCE_SEC, } from './webhook.js';
|
|
24
|
-
export { INVENTORY_ENDPOINTS, INVENTORY_ERROR_CODES, INVENTORY_REQUEST_ERROR_CODES, INVENTORY_WEBHOOK_EVENTS, INVENTORY_WEBHOOK_ENVELOPE_FIELDS, INVENTORY_WEBHOOK_LIMIT, INVENTORY_LIST_LIMIT_MAX, LOCATION_TYPES, STOCK_MOVEMENT_TYPES, STOCK_MOVEMENT_SOURCES, STOCK_CONDITIONS, STOCK_CHANGE_CAUSES, WEBHOOK_DELIVERY_STATUSES, INVENTORY_WARNING_CODES, STOCK_KINDS, STOCK_LOSS_REASONS, WITHDRAWAL_TYPES, LANDED_COST_TYPES, LANDED_COST_ALLOCATIONS, RESERVATION_STATUSES, INVENTORY_IDEMPOTENCY_KEY_MAX, RESERVATION_MINUTES_MIN, RESERVATION_MINUTES_MAX, VARIANT_ATTRIBUTES_MAX, VARIANT_VALUES_MAX, VARIANT_MATRIX_MAX, VARIANT_GROUP_ACTIVE_MAX, STOCKTAKE_STATUSES, STOCKTAKE_TYPES, STOCKTAKE_SCOPE_TYPES, STOCKTAKE_CHECK_REASONS, STOCKTAKE_NOT_BOOKED_REASONS, STOCKTAKE_SOURCES, STOCKTAKE_ACTOR_TYPES, STOCKTAKE_INVENTORY_AS_OF, STOCKTAKE_ITEMS_MAX, STOCKTAKE_RECOUNT_ITEMS_MAX, STOCKTAKE_COUNTS_PER_ITEM_MAX, } from './vertrag.js';
|
|
24
|
+
export { INVENTORY_ENDPOINTS, INVENTORY_ERROR_CODES, INVENTORY_REQUEST_ERROR_CODES, INVENTORY_WEBHOOK_EVENTS, RECEIPT_WEBHOOK_EVENTS, INVENTORY_WEBHOOK_ENVELOPE_FIELDS, INVENTORY_WEBHOOK_LIMIT, INVENTORY_LIST_LIMIT_MAX, LOCATION_TYPES, STOCK_MOVEMENT_TYPES, STOCK_MOVEMENT_SOURCES, STOCK_CONDITIONS, STOCK_CHANGE_CAUSES, WEBHOOK_DELIVERY_STATUSES, INVENTORY_WARNING_CODES, STOCK_KINDS, STOCK_LOSS_REASONS, WITHDRAWAL_TYPES, LANDED_COST_TYPES, LANDED_COST_ALLOCATIONS, RESERVATION_STATUSES, INVENTORY_IDEMPOTENCY_KEY_MAX, RESERVATION_MINUTES_MIN, RESERVATION_MINUTES_MAX, VARIANT_ATTRIBUTES_MAX, VARIANT_VALUES_MAX, VARIANT_MATRIX_MAX, VARIANT_GROUP_ACTIVE_MAX, STOCKTAKE_STATUSES, STOCKTAKE_TYPES, STOCKTAKE_SCOPE_TYPES, STOCKTAKE_CHECK_REASONS, STOCKTAKE_NOT_BOOKED_REASONS, STOCKTAKE_SOURCES, STOCKTAKE_ACTOR_TYPES, STOCKTAKE_INVENTORY_AS_OF, STOCKTAKE_ITEMS_MAX, STOCKTAKE_RECOUNT_ITEMS_MAX, STOCKTAKE_COUNTS_PER_ITEM_MAX, } from './vertrag.js';
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* Tag) `YYYY-MM-DD`.
|
|
12
12
|
*/
|
|
13
13
|
import type { InventoryWarningCode, InventoryWebhookEventType, LandedCostAllocation, LandedCostType, LocationType, ReservationStatus, StockChangeCause, StockCondition, StockKind, StockLossReason, StockMovementSource, StockMovementType, StocktakeActorType, StocktakeCheckReason, StocktakeInventoryAsOf, StocktakeNotBookedReason, StocktakeScopeType, StocktakeSource, StocktakeStatus, StocktakeType, WebhookDeliveryStatus, WithdrawalType } from './vertrag.js';
|
|
14
|
+
import type { ListedFullReceipt } from '../client/list-receipts.js';
|
|
14
15
|
/**
|
|
15
16
|
* Ein Artikel, wie `getArticle`, `listArticles`, `lookupArticleByCode` und die
|
|
16
17
|
* Ereignisse `article.*` ihn senden.
|
|
@@ -355,7 +356,44 @@ export interface InventoryWebhookEnvelope<T extends InventoryWebhookEventType, D
|
|
|
355
356
|
test: boolean;
|
|
356
357
|
data: D;
|
|
357
358
|
}
|
|
358
|
-
|
|
359
|
+
/**
|
|
360
|
+
* Nutzlast von `receipt.created` (Beleg-Webhooks): der Beleg wie `listReceipts` mit `view: 'full'` (dieselbe
|
|
361
|
+
* Darstellung, auch Fremdgutscheine mit Nummer, eigene maskiert). Ist der Beleg fuer eine Zustellung zu gross,
|
|
362
|
+
* fehlen seine Positionen (`receipt.items` leer), `truncated` ist `true` und `hint` sagt, ihn mit `getReceipt`
|
|
363
|
+
* zu holen.
|
|
364
|
+
*/
|
|
365
|
+
export interface ReceiptCreatedEventData {
|
|
366
|
+
receipt: ListedFullReceipt;
|
|
367
|
+
/** Nur bei einer gekuerzten Zustellung: `true` (die Positionen fehlen). */
|
|
368
|
+
truncated?: true;
|
|
369
|
+
/** Nur bei einer gekuerzten Zustellung: Hinweis (deutsch). */
|
|
370
|
+
hint?: string;
|
|
371
|
+
}
|
|
372
|
+
/** Eine stornierte Position aus dem Storno-Beleg (`cancelledItems[]`). */
|
|
373
|
+
export interface ReceiptCancelledItem {
|
|
374
|
+
/** Index der Position im Original; `null`, wenn der Storno-Beleg ihn nicht traegt (Positionen ohne Artikel). */
|
|
375
|
+
index: number | null;
|
|
376
|
+
quantity: number | null;
|
|
377
|
+
}
|
|
378
|
+
/** Eine Rueckzahlung des Storno-Belegs (`refunds[]`): Betrag positiv in Cent. */
|
|
379
|
+
export interface ReceiptRefund {
|
|
380
|
+
/** Kennung der Zahlung im Original (`payments[].id`); `null` ohne Bezug (etwa bar zurueck). */
|
|
381
|
+
refundOf: string | null;
|
|
382
|
+
amountCents: number | null;
|
|
383
|
+
/** Zahlart wie in `payments[].method`. */
|
|
384
|
+
method: string | null;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Nutzlast von `receipt.cancelled`: der Storno-Beleg wie bei `receipt.created`, dazu Bezug, stornierte Positionen
|
|
388
|
+
* und Rueckzahlungen, abgeleitet aus dem Storno-Beleg selbst. `cancellationOf` ist die Beleg-ID des Originals;
|
|
389
|
+
* der veraltete Storno ohne Bezug traegt `null`.
|
|
390
|
+
*/
|
|
391
|
+
export interface ReceiptCancelledEventData extends ReceiptCreatedEventData {
|
|
392
|
+
cancellationOf: string | null;
|
|
393
|
+
cancelledItems: ReceiptCancelledItem[];
|
|
394
|
+
refunds: ReceiptRefund[];
|
|
395
|
+
}
|
|
396
|
+
export type InventoryWebhookEvent = InventoryWebhookEnvelope<'stock.changed', StockChangedEventData> | InventoryWebhookEnvelope<'stock.below_minimum', StockBelowMinimumEventData> | InventoryWebhookEnvelope<'article.created', Article> | InventoryWebhookEnvelope<'article.updated', Article> | InventoryWebhookEnvelope<'article.deactivated', Article> | InventoryWebhookEnvelope<'reservation.expired', Reservation> | InventoryWebhookEnvelope<'reservation.released', Reservation> | InventoryWebhookEnvelope<'reservation.redeemed', Reservation> | InventoryWebhookEnvelope<'variant_group.created', VariantGroup> | InventoryWebhookEnvelope<'variant_group.updated', VariantGroup> | InventoryWebhookEnvelope<'receipt.created', ReceiptCreatedEventData> | InventoryWebhookEnvelope<'receipt.cancelled', ReceiptCancelledEventData>;
|
|
359
397
|
/**
|
|
360
398
|
* Die Felder eines Artikels beim Anlegen. Bei der Anlage heisst `null` „nicht
|
|
361
399
|
* angegeben“ (ausser bei `name`, der Pflicht ist).
|