@kreiseck/kasseneck-api 1.11.1 → 1.13.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 +2 -1
- package/dist/cjs/client/aufrufe.d.ts +4 -4
- package/dist/cjs/client/aufrufe.js +15 -0
- package/dist/cjs/client/receipts.d.ts +5 -0
- package/dist/cjs/client/receipts.js +65 -6
- package/dist/cjs/enums/voucher-action.d.ts +2 -0
- package/dist/cjs/enums/voucher-action.js +2 -0
- package/dist/cjs/enums/voucher-type.d.ts +10 -0
- package/dist/cjs/enums/voucher-type.js +10 -0
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +8 -3
- package/dist/cjs/models/index.d.ts +2 -2
- package/dist/cjs/models/index.js +6 -2
- package/dist/cjs/models/receipt-errors.d.ts +1 -1
- package/dist/cjs/models/receipt-errors.js +2 -0
- package/dist/cjs/models/receipt-item.d.ts +11 -3
- package/dist/cjs/models/receipt-item.js +22 -1
- package/dist/cjs/models/receipt.d.ts +13 -1
- package/dist/cjs/models/receipt.js +18 -2
- package/dist/cjs/models/voucher.d.ts +57 -4
- package/dist/cjs/models/voucher.js +111 -3
- package/dist/cjs/partner/fehler.d.ts +1 -1
- package/dist/cjs/partner/fehler.js +2 -0
- package/dist/cjs/partner/index.d.ts +1 -1
- package/dist/cjs/partner/typen.d.ts +7 -1
- package/dist/cjs/partner/typen.js +3 -0
- package/dist/cjs/pos/client.d.ts +2 -1
- package/dist/cjs/pos/client.js +3 -1
- package/dist/cjs/pos/gutschein.d.ts +90 -0
- package/dist/cjs/pos/gutschein.js +164 -0
- package/dist/cjs/pos/index.d.ts +3 -2
- package/dist/cjs/pos/index.js +13 -2
- package/dist/cjs/pos/settings.d.ts +3 -0
- package/dist/cjs/pos/settings.js +12 -10
- package/dist/cjs/pos/texte.d.ts +229 -0
- package/dist/cjs/pos/texte.js +96 -1
- package/dist/cjs/react/index.js +8 -2
- package/dist/cjs/receipt/due.d.ts +83 -2
- package/dist/cjs/receipt/due.js +202 -36
- package/dist/cjs/receipt/grid.js +13 -1
- package/dist/cjs/receipt/gutschein-plan.d.ts +104 -0
- package/dist/cjs/receipt/gutschein-plan.js +360 -0
- package/dist/cjs/receipt/index.d.ts +1 -1
- package/dist/cjs/receipt/index.js +3 -0
- package/dist/cjs/receipt/layout.js +175 -8
- package/dist/cjs/register/pairing.d.ts +21 -1
- package/dist/cjs/register/pairing.js +17 -0
- package/dist/cjs/stored/bon-layout.d.ts +8 -0
- package/dist/cjs/stored/bon-layout.js +23 -0
- package/dist/cjs/stored/draht.d.ts +3 -1
- package/dist/cjs/stored/draht.js +53 -6
- package/dist/cjs/stored/einstellungen.js +2 -1
- package/dist/cjs/stored/gutscheine.d.ts +3 -0
- package/dist/cjs/stored/gutscheine.js +60 -0
- package/dist/cjs/stored/index.js +2 -17
- package/dist/cjs/stored/vokabular.d.ts +6 -4
- package/dist/cjs/stored/vokabular.js +48 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/aufrufe.d.ts +4 -4
- package/dist/esm/client/aufrufe.js +15 -0
- package/dist/esm/client/receipts.d.ts +5 -0
- package/dist/esm/client/receipts.js +66 -8
- package/dist/esm/enums/voucher-action.d.ts +2 -0
- package/dist/esm/enums/voucher-action.js +2 -0
- package/dist/esm/enums/voucher-type.d.ts +10 -0
- package/dist/esm/enums/voucher-type.js +10 -0
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/esm/models/index.d.ts +2 -2
- package/dist/esm/models/index.js +2 -2
- package/dist/esm/models/receipt-errors.d.ts +1 -1
- package/dist/esm/models/receipt-errors.js +2 -0
- package/dist/esm/models/receipt-item.d.ts +11 -3
- package/dist/esm/models/receipt-item.js +20 -1
- package/dist/esm/models/receipt.d.ts +13 -1
- package/dist/esm/models/receipt.js +18 -2
- package/dist/esm/models/voucher.d.ts +57 -4
- package/dist/esm/models/voucher.js +108 -3
- package/dist/esm/partner/fehler.d.ts +1 -1
- package/dist/esm/partner/fehler.js +2 -0
- package/dist/esm/partner/index.d.ts +1 -1
- package/dist/esm/partner/typen.d.ts +7 -1
- package/dist/esm/partner/typen.js +3 -0
- package/dist/esm/pos/client.d.ts +2 -1
- package/dist/esm/pos/client.js +3 -1
- package/dist/esm/pos/gutschein.d.ts +90 -0
- package/dist/esm/pos/gutschein.js +158 -0
- package/dist/esm/pos/index.d.ts +3 -2
- package/dist/esm/pos/index.js +4 -2
- package/dist/esm/pos/settings.d.ts +3 -0
- package/dist/esm/pos/settings.js +2 -0
- package/dist/esm/pos/texte.d.ts +229 -0
- package/dist/esm/pos/texte.js +94 -0
- package/dist/esm/react/index.js +8 -2
- package/dist/esm/receipt/due.d.ts +83 -2
- package/dist/esm/receipt/due.js +198 -34
- package/dist/esm/receipt/grid.js +13 -1
- package/dist/esm/receipt/gutschein-plan.d.ts +104 -0
- package/dist/esm/receipt/gutschein-plan.js +352 -0
- package/dist/esm/receipt/index.d.ts +1 -1
- package/dist/esm/receipt/index.js +1 -1
- package/dist/esm/receipt/layout.js +175 -8
- package/dist/esm/register/pairing.d.ts +21 -1
- package/dist/esm/register/pairing.js +16 -0
- package/dist/esm/stored/bon-layout.d.ts +8 -0
- package/dist/esm/stored/bon-layout.js +20 -0
- package/dist/esm/stored/draht.d.ts +3 -1
- package/dist/esm/stored/draht.js +52 -6
- package/dist/esm/stored/einstellungen.js +3 -2
- package/dist/esm/stored/gutscheine.d.ts +3 -0
- package/dist/esm/stored/gutscheine.js +56 -0
- package/dist/esm/stored/index.js +2 -17
- package/dist/esm/stored/vokabular.d.ts +6 -4
- package/dist/esm/stored/vokabular.js +48 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/expected/voucher-cancellation.grid32.txt +30 -0
- package/fixtures/expected/voucher-cancellation.grid48.txt +29 -0
- package/fixtures/expected/voucher-cancellation.lines.json +252 -0
- package/fixtures/expected/voucher-cancellation.sheet32.json +206 -0
- package/fixtures/expected/voucher-cancellation.sheet48.json +200 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.grid32.txt +25 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.grid48.txt +25 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.lines.json +259 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.sheet32.json +176 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.sheet48.json +176 -0
- package/fixtures/expected/voucher-multi-purpose-sale.grid32.txt +24 -0
- package/fixtures/expected/voucher-multi-purpose-sale.grid48.txt +23 -0
- package/fixtures/expected/voucher-multi-purpose-sale.lines.json +216 -0
- package/fixtures/expected/voucher-multi-purpose-sale.sheet32.json +170 -0
- package/fixtures/expected/voucher-multi-purpose-sale.sheet48.json +164 -0
- package/fixtures/expected/voucher-payout.grid32.txt +23 -0
- package/fixtures/expected/voucher-payout.grid48.txt +22 -0
- package/fixtures/expected/voucher-payout.lines.json +216 -0
- package/fixtures/expected/voucher-payout.sheet32.json +164 -0
- package/fixtures/expected/voucher-payout.sheet48.json +158 -0
- package/fixtures/expected/voucher-service-redeem.grid32.txt +26 -0
- package/fixtures/expected/voucher-service-redeem.grid48.txt +25 -0
- package/fixtures/expected/voucher-service-redeem.lines.json +261 -0
- package/fixtures/expected/voucher-service-redeem.sheet32.json +182 -0
- package/fixtures/expected/voucher-service-redeem.sheet48.json +176 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.grid32.txt +30 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.grid48.txt +29 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.lines.json +331 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.sheet32.json +206 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.sheet48.json +200 -0
- package/fixtures/expected/voucher-single-purpose-redeem.grid32.txt +25 -0
- package/fixtures/expected/voucher-single-purpose-redeem.grid48.txt +24 -0
- package/fixtures/expected/voucher-single-purpose-redeem.lines.json +246 -0
- package/fixtures/expected/voucher-single-purpose-redeem.sheet32.json +176 -0
- package/fixtures/expected/voucher-single-purpose-redeem.sheet48.json +170 -0
- package/fixtures/expected/voucher-single-purpose-sale.grid32.txt +26 -0
- package/fixtures/expected/voucher-single-purpose-sale.grid48.txt +24 -0
- package/fixtures/expected/voucher-single-purpose-sale.lines.json +225 -0
- package/fixtures/expected/voucher-single-purpose-sale.sheet32.json +182 -0
- package/fixtures/expected/voucher-single-purpose-sale.sheet48.json +170 -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 +64 -0
- package/fixtures/pos-texts.json +257 -1
- package/fixtures/receipt-due-generated.json +1 -1
- package/fixtures/receipt-due-voucher-generated.json +494 -0
- package/fixtures/receipts/voucher-cancellation.json +76 -0
- package/fixtures/receipts/voucher-multi-purpose-redeem.json +62 -0
- package/fixtures/receipts/voucher-multi-purpose-sale.json +63 -0
- package/fixtures/receipts/voucher-payout.json +65 -0
- package/fixtures/receipts/voucher-service-redeem.json +82 -0
- package/fixtures/receipts/voucher-single-purpose-redeem-exempt.json +86 -0
- package/fixtures/receipts/voucher-single-purpose-redeem.json +71 -0
- package/fixtures/receipts/voucher-single-purpose-sale.json +88 -0
- package/fixtures/surface.json +35 -5
- package/fixtures/v3/antworten/belege.json +3405 -3
- package/fixtures/v3/antworten/belegmail.json +5 -2
- package/fixtures/v3/antworten/kasse-belege.json +3423 -3
- package/fixtures/v3/antworten/kasse.json +621 -14
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +5 -2
- package/fixtures/v3/antworten/storno.json +214 -3
- package/fixtures/v3/stored/belege.json +5 -2
- package/fixtures/v3/stored/kasse.json +225 -4
- package/fixtures/v3/stored/rechnungen.json +5 -2
- package/fixtures/v3/v3-vokabular.json +1375 -23
- package/fixtures/v3/zahlbetrag-faelle.json +293 -3
- package/package.json +4 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VOUCHER_SETTINGS_DEFAULTS = exports.VOUCHER_STATUSES = exports.VOUCHER_KINDS = void 0;
|
|
4
|
+
exports.posVoucherSettingsFromWire = posVoucherSettingsFromWire;
|
|
5
|
+
exports.checkVoucher = checkVoucher;
|
|
6
|
+
exports.reprintVoucherLabel = reprintVoucherLabel;
|
|
7
|
+
const validator_1 = require("@kreiseck/validator");
|
|
8
|
+
const errors_js_1 = require("../client/errors.js");
|
|
9
|
+
exports.VOUCHER_KINDS = Object.freeze(['multi_purpose', 'single_purpose', 'service', 'promotion']);
|
|
10
|
+
exports.VOUCHER_STATUSES = Object.freeze(['active', 'used_up', 'expired', 'paid_out', 'cancelled', 'blocked']);
|
|
11
|
+
const VOUCHER_VALIDITY_PATTERNS = ['unlimited', '1+3', 'custom'];
|
|
12
|
+
/** Ohne Block `vouchers` (alter Server, Konto ohne Schalter): Verkaufen ist aus. */
|
|
13
|
+
exports.VOUCHER_SETTINGS_DEFAULTS = Object.freeze({
|
|
14
|
+
sale: false, valueVoucherType: null, vatRateBp: null,
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Block `vouchers` einer Einstellungs-Antwort, geschlossen im Zweifel: ist
|
|
18
|
+
* irgendein Feld unstimmig, gilt der ganze Block als nicht gelesen und
|
|
19
|
+
* Verkaufen bleibt aus (kein Wurf, sonst ginge das Laden aller Einstellungen
|
|
20
|
+
* verloren). Stimmig heisst: `sale` ein Wahrheitswert, die Art
|
|
21
|
+
* `multi_purpose`/`single_purpose`/`null`, der Satz eine ganze Zahl >= 0 oder
|
|
22
|
+
* `null`; Mehrzweck traegt keinen Satz, Einzweck braucht einen, und ein
|
|
23
|
+
* eingeschalteter Verkauf braucht eine Art. Ein ausgeschalteter Verkauf darf
|
|
24
|
+
* eine Art behalten.
|
|
25
|
+
*/
|
|
26
|
+
function posVoucherSettingsFromWire(block) {
|
|
27
|
+
const zu = () => ({ ...exports.VOUCHER_SETTINGS_DEFAULTS });
|
|
28
|
+
if (block === null || typeof block !== 'object' || Array.isArray(block))
|
|
29
|
+
return zu();
|
|
30
|
+
const b = block;
|
|
31
|
+
const sale = b['sale'];
|
|
32
|
+
const art = b['valueVoucherType'] ?? null;
|
|
33
|
+
const satz = b['vatRateBp'] ?? null;
|
|
34
|
+
if (typeof sale !== 'boolean')
|
|
35
|
+
return zu();
|
|
36
|
+
if (art !== null && art !== 'multi_purpose' && art !== 'single_purpose')
|
|
37
|
+
return zu();
|
|
38
|
+
if (satz !== null && !(typeof satz === 'number' && Number.isInteger(satz) && satz >= 0))
|
|
39
|
+
return zu();
|
|
40
|
+
if (sale && art === null)
|
|
41
|
+
return zu();
|
|
42
|
+
if (art === 'single_purpose' && satz === null)
|
|
43
|
+
return zu();
|
|
44
|
+
if (art === 'multi_purpose' && satz !== null)
|
|
45
|
+
return zu();
|
|
46
|
+
return { sale, valueVoucherType: art, vatRateBp: satz };
|
|
47
|
+
}
|
|
48
|
+
function fehler(name, grund) {
|
|
49
|
+
return new errors_js_1.KasseneckValidationError(name, `Antwort: ${grund}`, 'response');
|
|
50
|
+
}
|
|
51
|
+
function objekt(name, pfad, w) {
|
|
52
|
+
if (w === null || typeof w !== 'object' || Array.isArray(w))
|
|
53
|
+
throw fehler(name, `${pfad} ist kein Objekt`);
|
|
54
|
+
return w;
|
|
55
|
+
}
|
|
56
|
+
const fehlt = (w) => w === undefined || w === null;
|
|
57
|
+
function ganzzahlWennDa(name, pfad, ziel, o, feld) {
|
|
58
|
+
const w = o[feld];
|
|
59
|
+
if (fehlt(w))
|
|
60
|
+
return;
|
|
61
|
+
if (typeof w !== 'number' || !Number.isSafeInteger(w))
|
|
62
|
+
throw fehler(name, `${pfad}.${feld} ist keine ganze Zahl`);
|
|
63
|
+
ziel[feld] = w;
|
|
64
|
+
}
|
|
65
|
+
function textPflicht(name, pfad, o, feld) {
|
|
66
|
+
const w = o[feld];
|
|
67
|
+
if (typeof w !== 'string' || w === '')
|
|
68
|
+
throw fehler(name, `${pfad}.${feld} fehlt`);
|
|
69
|
+
return w;
|
|
70
|
+
}
|
|
71
|
+
function wahl(name, pfad, o, feld, erlaubt) {
|
|
72
|
+
const w = o[feld];
|
|
73
|
+
if (typeof w !== 'string' || !erlaubt.includes(w))
|
|
74
|
+
throw fehler(name, `${pfad}.${feld} ist unbekannt`);
|
|
75
|
+
return w;
|
|
76
|
+
}
|
|
77
|
+
function gueltigkeit(name, w) {
|
|
78
|
+
const o = objekt(name, 'validity', w);
|
|
79
|
+
const raus = { pattern: wahl(name, 'validity', o, 'pattern', VOUCHER_VALIDITY_PATTERNS) };
|
|
80
|
+
for (const feld of ['redeemableUntil', 'refundableUntil', 'validUntil']) {
|
|
81
|
+
const t = o[feld];
|
|
82
|
+
if (fehlt(t))
|
|
83
|
+
continue;
|
|
84
|
+
if (typeof t !== 'string' || t === '')
|
|
85
|
+
throw fehler(name, `validity.${feld} ist kein Datum`);
|
|
86
|
+
raus[feld] = t;
|
|
87
|
+
}
|
|
88
|
+
return raus;
|
|
89
|
+
}
|
|
90
|
+
function artikel(name, w) {
|
|
91
|
+
const o = objekt(name, 'article', w);
|
|
92
|
+
const raus = { id: textPflicht(name, 'article', o, 'id'), name: textPflicht(name, 'article', o, 'name') };
|
|
93
|
+
for (const feld of ['vatRateBp', 'priceCents']) {
|
|
94
|
+
const z = o[feld];
|
|
95
|
+
if (typeof z !== 'number' || !Number.isSafeInteger(z))
|
|
96
|
+
throw fehler(name, `article.${feld} ist keine ganze Zahl`);
|
|
97
|
+
raus[feld] = z;
|
|
98
|
+
}
|
|
99
|
+
return raus;
|
|
100
|
+
}
|
|
101
|
+
function leseCheck(name, w) {
|
|
102
|
+
const o = objekt(name, 'data', w);
|
|
103
|
+
const raus = {
|
|
104
|
+
type: wahl(name, 'data', o, 'type', exports.VOUCHER_KINDS),
|
|
105
|
+
status: wahl(name, 'data', o, 'status', exports.VOUCHER_STATUSES),
|
|
106
|
+
codeSuffix: textPflicht(name, 'data', o, 'codeSuffix'),
|
|
107
|
+
};
|
|
108
|
+
for (const feld of ['balanceCents', 'faceValueCents', 'quantity', 'remainingQuantity', 'vatRateBp', 'discountCents', 'discountPercentBp']) {
|
|
109
|
+
ganzzahlWennDa(name, 'data', raus, o, feld);
|
|
110
|
+
}
|
|
111
|
+
if (!fehlt(o.article))
|
|
112
|
+
raus.article = artikel(name, o.article);
|
|
113
|
+
if (!fehlt(o.validity))
|
|
114
|
+
raus.validity = gueltigkeit(name, o.validity);
|
|
115
|
+
if (!fehlt(o.exempt)) {
|
|
116
|
+
if (typeof o.exempt !== 'boolean')
|
|
117
|
+
throw fehler(name, 'data.exempt ist kein Wahrheitswert');
|
|
118
|
+
raus.exempt = o.exempt;
|
|
119
|
+
}
|
|
120
|
+
return raus;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Gutschein am Code pruefen (Gutschein-Recht `voucherRedeem`). Der Code wird
|
|
124
|
+
* tolerant eingelesen (Gross/klein, Bindestriche, `O`/`0`, `I`/`L`/`1`) und
|
|
125
|
+
* vor dem Senden auf sein Pruefzeichen geprueft: ein Tippfehler geht nie ueber
|
|
126
|
+
* das Netz, sondern endet mit `KasseneckValidationError`. Fachliche Fehler
|
|
127
|
+
* kommen als `KasseneckApiError` mit dem Code des Servers
|
|
128
|
+
* (`voucher_not_found`, `too_many_voucher_checks`, `not_permitted` …).
|
|
129
|
+
*/
|
|
130
|
+
async function checkVoucher(transport, code) {
|
|
131
|
+
const name = 'checkVoucher';
|
|
132
|
+
const geprueft = typeof code === 'string' ? validator_1.VoucherCode.validate(code) : null;
|
|
133
|
+
// Der Code steht bewusst nicht in der Meldung.
|
|
134
|
+
if (!geprueft || !geprueft.ok)
|
|
135
|
+
throw new errors_js_1.KasseneckValidationError(name, 'code ist kein gueltiger Gutscheincode', 'request');
|
|
136
|
+
// Der Code reist im Rumpf: als Geheimnis nennen, damit er in keinem Fehler (Servertext, Ursache) auftaucht.
|
|
137
|
+
const geheim = [geprueft.normalized, validator_1.VoucherCode.format(geprueft.normalized)];
|
|
138
|
+
let antwort;
|
|
139
|
+
try {
|
|
140
|
+
antwort = await transport(name, { code: geprueft.normalized }, undefined, geheim);
|
|
141
|
+
}
|
|
142
|
+
catch (fehler) {
|
|
143
|
+
// Der Transport siebt nur Ursachen; ein Servertext, der den Code wiederholt, wird hier geschwaerzt.
|
|
144
|
+
if (fehler instanceof errors_js_1.KasseneckApiError && geheim.some((g) => fehler.serverMessage.includes(g))) {
|
|
145
|
+
const text = geheim.reduce((t, g) => t.split(g).join('****'), fehler.serverMessage);
|
|
146
|
+
throw new errors_js_1.KasseneckApiError(name, text, fehler.details, fehler.code);
|
|
147
|
+
}
|
|
148
|
+
throw fehler;
|
|
149
|
+
}
|
|
150
|
+
return leseCheck(name, antwort);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Etikett eines Gutscheins noch einmal drucken (Gutschein-Recht
|
|
154
|
+
* `voucherManage`). Antwort ist der Klartext-Code zum Drucken; er gehoert
|
|
155
|
+
* nur in den Speicher bis zum Druck. Aufrufer duerfen ihn nicht protokollieren,
|
|
156
|
+
* speichern oder in Meldungen nennen; Lesefehler dieser Antwort nennen ihn nie.
|
|
157
|
+
*/
|
|
158
|
+
async function reprintVoucherLabel(transport, id) {
|
|
159
|
+
const name = 'reprintVoucherLabel';
|
|
160
|
+
if (typeof id !== 'string' || id.trim() === '')
|
|
161
|
+
throw new errors_js_1.KasseneckValidationError(name, 'id fehlt', 'request');
|
|
162
|
+
const o = objekt(name, 'data', await transport(name, { id }));
|
|
163
|
+
return { code: textPflicht(name, 'data', o, 'code') };
|
|
164
|
+
}
|
package/dist/cjs/pos/index.d.ts
CHANGED
|
@@ -11,15 +11,16 @@ export { type ArticleGroup, type ArticleGroupPayload, fromArticleGroupPayload, t
|
|
|
11
11
|
export { getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, setMyPosLogo, posSettingsFromWire, type SetMyPosLogoOptions, } from './client.js';
|
|
12
12
|
export { POS_ERROR_CODES, type PosErrorCode, isPosErrorCode, posErrorCode, isPosError, type PosFieldError, posFieldErrors, } from './errors.js';
|
|
13
13
|
export { distributeDiscount } from '../receipt/discount.js';
|
|
14
|
-
export { cancelScopeOf, receiptsScopeOf, stockViewOf, type RegisterScope, type RegisterUserPerms } from '../register/pairing.js';
|
|
14
|
+
export { cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, type VoucherPerms, type RegisterScope, type RegisterUserPerms } from '../register/pairing.js';
|
|
15
15
|
export { type NetworkPrinter, type PrintJob, type PrintJobStatus, PRINT_JOB_STATUSES, type PrintJobSource, PRINT_JOB_SOURCES, isPrintJobFinished, type CreatePrintJobOptions, listMyPrinters, createPrintJob, getPrintJob, } from './drucker.js';
|
|
16
16
|
export { listMyTipRecipients } from './trinkgeld.js';
|
|
17
17
|
export { STOCK_LOCATION_TYPES, type StockLocationType, type StockLocation, type StockLocationAddress, type StockLevel, type StockValue, type StockList, type ListMyStockOptions, type SetMyCashregisterStockLocationOptions, type CashregisterStockLocation, listMyStockLocations, listMyStock, setMyCashregisterStockLocation, } from './lager.js';
|
|
18
18
|
export { type ListMyStocktakesOptions, type ListMyStocktakeItemsOptions, type ListMyStocktakeCountsOptions, type RecordMyStocktakeCountOptions, type VoidMyStocktakeCountOptions, listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMyStocktakeCount, voidMyStocktakeCount, parseQuantityMilli, } from './inventur.js';
|
|
19
19
|
export type { Stocktake, StocktakeItem, StocktakeCount, StocktakeCountResult, StocktakeItemPage, StocktakeCountPage, StocktakeActor, StocktakeProgress, StocktakeReview, StocktakeRecount, StocktakeScope, } from '../inventory/typen.js';
|
|
20
20
|
export type { StocktakeStatus } from '../inventory/vertrag.js';
|
|
21
|
+
export { VOUCHER_KINDS, VOUCHER_STATUSES, checkVoucher, reprintVoucherLabel, VOUCHER_SETTINGS_DEFAULTS, posVoucherSettingsFromWire, type VoucherKind, type VoucherStatus, type VoucherValidity, type VoucherArticle, type VoucherCheck, type PosVoucherSettings, } from './gutschein.js';
|
|
21
22
|
export { type GetMyDrawerStateOptions, type OpenMyShiftOptions, type RecordMyCashMovementOptions, type DrawerOpeningEntry, type LogMyDrawerOpeningsOptions, type GetMyShiftReportOptions, type TipPayout, type CloseMyShiftOptions, type AfterCountOption, getMyDrawerState, openMyShift, recordMyCashMovement, logMyDrawerOpenings, getMyShiftReport, closeMyShift, sumDenominations, parseCentsAllowZero, newIdempotencyKey, shiftTipLines, durationText, type ShiftTipLine, type ShiftTipLineKey, } from './schicht.js';
|
|
22
23
|
export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATIONS, OPENING_REASONS, MANUAL_OPENING_REASONS, SHIFT_RECEIPT_KINDS, AFTER_COUNT_TYPES, type AfterCountType, type AfterCount, type EurDenomination, type MovementType, type ManualMovementType, type CashLocation, type OpeningReason, type ManualOpeningReason, type ShiftReceiptKind, type ShiftStatus, type ShiftActorRole, type Denominations, type ShiftActor, type DrawerInfo, type DrawerRights, type NonCashAmount, type ShiftTipTotals, type ShiftTip, type ShiftRunningTotals, type ShiftReconciliation, type Shift, type TipClaim, type DrawerOpening, type DrawerState, type CashMovement, type ShiftReceiptHeader, type ShiftReceiptMovement, type ShiftReceiptTip, type ShiftSummaryReceipt, type CashMovementReceipt, type ShiftReceipt, type OpenShiftResult, type CashMovementResult, type DrawerOpeningsResult, type ShiftReport, type CloseShiftResult, } from './schicht-typen.js';
|
|
23
24
|
export { type ShiftReceiptLayoutOptions, shiftReceiptLayout, cashMovementLayout } from '../receipt/shift-sheet.js';
|
|
24
25
|
export { RETURN_DISPOSITIONS, isReturnDisposition, type ReturnDisposition } from '../models/cancellation.js';
|
|
25
|
-
export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
|
|
26
|
+
export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
|
package/dist/cjs/pos/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.quantityRuleForUnit = exports.QUANTITY_RULES = exports.listMyArticles = exports.listMyArticleGroups = exports.fromPosArticlePayload = exports.fromArticleGroupPayload = exports.DONE_SCREEN_SECONDS = exports.WATERMARK_SCALE = exports.LOGO_SCALE = exports.WATERMARK_STRENGTH = exports.WATERMARK_SIDE = exports.DISCOUNT = exports.AUTO_LOGOUT_MINUTES = exports.TILE_STYLE = exports.SETTINGS_FONT_SIZE = exports.LOGO_SIZE = exports.QR_MODE = exports.DRAWER_AUTO_OPEN = exports.CUT = exports.CODE_PAGE = exports.PAPER_SIZE = exports.TERMINAL_TYPE = exports.TERMINAL_VIA = exports.PRINTER_TYPE = exports.TILE_HEIGHT = exports.CATEGORY_POSITION = exports.LAYOUT = exports.RECEIPT_OUTPUT = exports.CARD_PROVIDER = exports.CHECKOUT_MODE = exports.TIP_MODE = exports.QUANTITY = exports.WATERMARK = exports.FONT_SIZE = exports.THEME = exports.posShortcutConflict = exports.POS_SHORTCUT_SHARED_PAIRS = exports.posSettingsChanges = exports.unknownPosSettingValues = exports.sanitizePosSettings = exports.mergePosSettings = exports.POS_DEVICE_VALUES = exports.POS_BUSINESS_VALUES = exports.posTipKeptByDefault = exports.POS_BUSINESS_OPTIONAL_FIELDS = exports.POS_DEVICE_OPTIONAL_FIELDS = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.POS_SHORTCUT_DEFAULTS = exports.POS_SHORTCUT_ACTIONS = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.RETURN_DISPOSITION_LABELS = exports.labelText = exports.LABELS = exports.cancellationPaymentErrorMessage = exports.CANCELLATION_PAYMENT_ERROR_MESSAGES = exports.receiptEmailErrorMessage = exports.RECEIPT_EMAIL_ERROR_MESSAGES = exports.messageAppliesTo = exports.messageText = exports.messageOutcome = exports.findErrorRule = exports.CALLS_WITH_EFFECT = exports.ERROR_OUTCOME_RULES = exports.ERROR_CODE_RULES = exports.ERROR_RULES = exports.MESSAGES = exports.isReturnDisposition = exports.RETURN_DISPOSITIONS = exports.cashMovementLayout = exports.shiftReceiptLayout = exports.AFTER_COUNT_TYPES = exports.SHIFT_RECEIPT_KINDS = void 0;
|
|
4
|
+
exports.shiftTipLines = exports.newIdempotencyKey = exports.parseCentsAllowZero = exports.sumDenominations = exports.closeMyShift = exports.getMyShiftReport = exports.logMyDrawerOpenings = exports.recordMyCashMovement = exports.openMyShift = exports.getMyDrawerState = exports.posVoucherSettingsFromWire = exports.VOUCHER_SETTINGS_DEFAULTS = exports.reprintVoucherLabel = exports.checkVoucher = exports.VOUCHER_STATUSES = exports.VOUCHER_KINDS = exports.parseQuantityMilli = exports.voidMyStocktakeCount = exports.recordMyStocktakeCount = exports.listMyStocktakeCounts = exports.listMyStocktakeItems = exports.listMyStocktakes = exports.setMyCashregisterStockLocation = exports.listMyStock = exports.listMyStockLocations = exports.STOCK_LOCATION_TYPES = exports.listMyTipRecipients = exports.getPrintJob = exports.createPrintJob = exports.listMyPrinters = exports.isPrintJobFinished = exports.PRINT_JOB_SOURCES = exports.PRINT_JOB_STATUSES = exports.voucherPermsOf = exports.stockViewOf = exports.receiptsScopeOf = exports.cancelScopeOf = exports.distributeDiscount = exports.posFieldErrors = exports.isPosError = exports.posErrorCode = exports.isPosErrorCode = exports.POS_ERROR_CODES = exports.posSettingsFromWire = exports.setMyPosLogo = exports.setMyRegisterDeviceSettings = exports.setMyPosSettings = exports.getPosSettings = exports.allowedQuantity = exports.quantityDefaults = void 0;
|
|
5
|
+
exports.RETURN_DISPOSITION_LABELS = exports.labelText = exports.LABELS = exports.voucherErrorMessage = exports.VOUCHER_ERROR_MESSAGES = exports.cancellationPaymentErrorMessage = exports.CANCELLATION_PAYMENT_ERROR_MESSAGES = exports.receiptEmailErrorMessage = exports.RECEIPT_EMAIL_ERROR_MESSAGES = exports.messageAppliesTo = exports.messageText = exports.messageOutcome = exports.findErrorRule = exports.CALLS_WITH_EFFECT = exports.ERROR_OUTCOME_RULES = exports.ERROR_CODE_RULES = exports.ERROR_RULES = exports.MESSAGES = exports.isReturnDisposition = exports.RETURN_DISPOSITIONS = exports.cashMovementLayout = exports.shiftReceiptLayout = exports.AFTER_COUNT_TYPES = exports.SHIFT_RECEIPT_KINDS = exports.MANUAL_OPENING_REASONS = exports.OPENING_REASONS = exports.CASH_LOCATIONS = exports.MANUAL_MOVEMENT_TYPES = exports.MOVEMENT_TYPES = exports.EUR_DENOMINATIONS = exports.durationText = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* Kachel-Kasse: Einstellungen, Artikelgruppen/Artikel fuer Kacheln,
|
|
8
8
|
* Rabattverteilung, Drucker, Trinkgeld-Empfaenger, Lager (Standorte, Bestand,
|
|
@@ -86,6 +86,7 @@ var pairing_js_1 = require("../register/pairing.js");
|
|
|
86
86
|
Object.defineProperty(exports, "cancelScopeOf", { enumerable: true, get: function () { return pairing_js_1.cancelScopeOf; } });
|
|
87
87
|
Object.defineProperty(exports, "receiptsScopeOf", { enumerable: true, get: function () { return pairing_js_1.receiptsScopeOf; } });
|
|
88
88
|
Object.defineProperty(exports, "stockViewOf", { enumerable: true, get: function () { return pairing_js_1.stockViewOf; } });
|
|
89
|
+
Object.defineProperty(exports, "voucherPermsOf", { enumerable: true, get: function () { return pairing_js_1.voucherPermsOf; } });
|
|
89
90
|
var drucker_js_1 = require("./drucker.js");
|
|
90
91
|
Object.defineProperty(exports, "PRINT_JOB_STATUSES", { enumerable: true, get: function () { return drucker_js_1.PRINT_JOB_STATUSES; } });
|
|
91
92
|
Object.defineProperty(exports, "PRINT_JOB_SOURCES", { enumerable: true, get: function () { return drucker_js_1.PRINT_JOB_SOURCES; } });
|
|
@@ -107,6 +108,14 @@ Object.defineProperty(exports, "listMyStocktakeCounts", { enumerable: true, get:
|
|
|
107
108
|
Object.defineProperty(exports, "recordMyStocktakeCount", { enumerable: true, get: function () { return inventur_js_1.recordMyStocktakeCount; } });
|
|
108
109
|
Object.defineProperty(exports, "voidMyStocktakeCount", { enumerable: true, get: function () { return inventur_js_1.voidMyStocktakeCount; } });
|
|
109
110
|
Object.defineProperty(exports, "parseQuantityMilli", { enumerable: true, get: function () { return inventur_js_1.parseQuantityMilli; } });
|
|
111
|
+
// Gutschein pruefen und Etikett nachdrucken an der Kasse.
|
|
112
|
+
var gutschein_js_1 = require("./gutschein.js");
|
|
113
|
+
Object.defineProperty(exports, "VOUCHER_KINDS", { enumerable: true, get: function () { return gutschein_js_1.VOUCHER_KINDS; } });
|
|
114
|
+
Object.defineProperty(exports, "VOUCHER_STATUSES", { enumerable: true, get: function () { return gutschein_js_1.VOUCHER_STATUSES; } });
|
|
115
|
+
Object.defineProperty(exports, "checkVoucher", { enumerable: true, get: function () { return gutschein_js_1.checkVoucher; } });
|
|
116
|
+
Object.defineProperty(exports, "reprintVoucherLabel", { enumerable: true, get: function () { return gutschein_js_1.reprintVoucherLabel; } });
|
|
117
|
+
Object.defineProperty(exports, "VOUCHER_SETTINGS_DEFAULTS", { enumerable: true, get: function () { return gutschein_js_1.VOUCHER_SETTINGS_DEFAULTS; } });
|
|
118
|
+
Object.defineProperty(exports, "posVoucherSettingsFromWire", { enumerable: true, get: function () { return gutschein_js_1.posVoucherSettingsFromWire; } });
|
|
110
119
|
// Schicht, Kassenstand und Lade-Protokoll (1.9.0): Aufrufe, Kataloge, Helfer, Bons.
|
|
111
120
|
var schicht_js_1 = require("./schicht.js");
|
|
112
121
|
Object.defineProperty(exports, "getMyDrawerState", { enumerable: true, get: function () { return schicht_js_1.getMyDrawerState; } });
|
|
@@ -151,6 +160,8 @@ Object.defineProperty(exports, "RECEIPT_EMAIL_ERROR_MESSAGES", { enumerable: tru
|
|
|
151
160
|
Object.defineProperty(exports, "receiptEmailErrorMessage", { enumerable: true, get: function () { return texte_js_1.receiptEmailErrorMessage; } });
|
|
152
161
|
Object.defineProperty(exports, "CANCELLATION_PAYMENT_ERROR_MESSAGES", { enumerable: true, get: function () { return texte_js_1.CANCELLATION_PAYMENT_ERROR_MESSAGES; } });
|
|
153
162
|
Object.defineProperty(exports, "cancellationPaymentErrorMessage", { enumerable: true, get: function () { return texte_js_1.cancellationPaymentErrorMessage; } });
|
|
163
|
+
Object.defineProperty(exports, "VOUCHER_ERROR_MESSAGES", { enumerable: true, get: function () { return texte_js_1.VOUCHER_ERROR_MESSAGES; } });
|
|
164
|
+
Object.defineProperty(exports, "voucherErrorMessage", { enumerable: true, get: function () { return texte_js_1.voucherErrorMessage; } });
|
|
154
165
|
Object.defineProperty(exports, "LABELS", { enumerable: true, get: function () { return texte_js_1.LABELS; } });
|
|
155
166
|
Object.defineProperty(exports, "labelText", { enumerable: true, get: function () { return texte_js_1.labelText; } });
|
|
156
167
|
Object.defineProperty(exports, "RETURN_DISPOSITION_LABELS", { enumerable: true, get: function () { return texte_js_1.RETURN_DISPOSITION_LABELS; } });
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* derselben Werte liegt unter `fixtures/stored/`. Trinkgeld ist bewusst AUS,
|
|
12
12
|
* bis die Buchung geklaert ist (Spec kachel-kasse § 9).
|
|
13
13
|
*/
|
|
14
|
+
import { type PosVoucherSettings } from './gutschein.js';
|
|
14
15
|
export declare const THEME: readonly ["clear", "warm", "night", "contrast"];
|
|
15
16
|
export type PosTheme = typeof THEME[number];
|
|
16
17
|
export declare const FONT_SIZE: readonly ["S", "M", "L", "XL"];
|
|
@@ -268,6 +269,8 @@ export interface PosDeviceSettings {
|
|
|
268
269
|
export interface PosSettings {
|
|
269
270
|
business: PosBusinessSettings;
|
|
270
271
|
device: PosDeviceSettings;
|
|
272
|
+
/** Gutschein-Verkauf der Kasse (Block `vouchers`); ohne Block ist Verkaufen aus. */
|
|
273
|
+
vouchers: PosVoucherSettings;
|
|
271
274
|
}
|
|
272
275
|
export declare const POS_BUSINESS_DEFAULTS: Readonly<PosBusinessSettings>;
|
|
273
276
|
export declare const POS_DEVICE_DEFAULTS: Readonly<PosDeviceSettings>;
|
package/dist/cjs/pos/settings.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._ALTFORM_0X = exports.POS_DEVICE_VALUES = exports.POS_BUSINESS_VALUES = exports.POS_BUSINESS_OPTIONAL_FIELDS = exports.POS_DEVICE_OPTIONAL_FIELDS = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.POS_SHORTCUT_SHARED_PAIRS = exports.POS_SHORTCUT_DEFAULTS = exports.POS_SHORTCUT_ACTIONS = exports.DONE_SCREEN_SECONDS = exports.WATERMARK_SCALE = exports.LOGO_SCALE = exports.WATERMARK_STRENGTH = exports.WATERMARK_SIDE = exports.DISCOUNT = exports.AUTO_LOGOUT_MINUTES = exports.TILE_STYLE = exports.SETTINGS_FONT_SIZE = exports.LOGO_SIZE = exports.QR_MODE = exports.DRAWER_AUTO_OPEN = exports.CUT = exports.CODE_PAGE = exports.PAPER_SIZE = exports.TERMINAL_TYPE = exports.TERMINAL_VIA = exports.PRINTER_TYPE = exports.TILE_HEIGHT = exports.CATEGORY_POSITION = exports.LAYOUT = exports.RECEIPT_OUTPUT = exports.CARD_PROVIDER = exports.CHECKOUT_MODE = exports.TIP_MODE = exports.QUANTITY = exports.WATERMARK = exports.FONT_SIZE = exports.THEME = void 0;
|
|
4
|
+
exports.posShortcutConflict = posShortcutConflict;
|
|
5
|
+
exports._optionalerWert = _optionalerWert;
|
|
6
|
+
exports.posTipKeptByDefault = posTipKeptByDefault;
|
|
7
|
+
exports._istAltwert0x = _istAltwert0x;
|
|
8
|
+
exports.mergePosSettings = mergePosSettings;
|
|
9
|
+
exports.sanitizePosSettings = sanitizePosSettings;
|
|
10
|
+
exports.unknownPosSettingValues = unknownPosSettingValues;
|
|
11
|
+
exports.posSettingsChanges = posSettingsChanges;
|
|
2
12
|
/**
|
|
3
13
|
* Kassen-Einstellungen der Browser-Kasse und der Kassen-App in der Form des
|
|
4
14
|
* Drahts `/api/v3` (Nachtrag Stufe 4, §11.7.2): Schluessel und Katalogwerte
|
|
@@ -12,16 +22,7 @@
|
|
|
12
22
|
* derselben Werte liegt unter `fixtures/stored/`. Trinkgeld ist bewusst AUS,
|
|
13
23
|
* bis die Buchung geklaert ist (Spec kachel-kasse § 9).
|
|
14
24
|
*/
|
|
15
|
-
|
|
16
|
-
exports._ALTFORM_0X = exports.POS_DEVICE_VALUES = exports.POS_BUSINESS_VALUES = exports.POS_BUSINESS_OPTIONAL_FIELDS = exports.POS_DEVICE_OPTIONAL_FIELDS = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.POS_SHORTCUT_SHARED_PAIRS = exports.POS_SHORTCUT_DEFAULTS = exports.POS_SHORTCUT_ACTIONS = exports.DONE_SCREEN_SECONDS = exports.WATERMARK_SCALE = exports.LOGO_SCALE = exports.WATERMARK_STRENGTH = exports.WATERMARK_SIDE = exports.DISCOUNT = exports.AUTO_LOGOUT_MINUTES = exports.TILE_STYLE = exports.SETTINGS_FONT_SIZE = exports.LOGO_SIZE = exports.QR_MODE = exports.DRAWER_AUTO_OPEN = exports.CUT = exports.CODE_PAGE = exports.PAPER_SIZE = exports.TERMINAL_TYPE = exports.TERMINAL_VIA = exports.PRINTER_TYPE = exports.TILE_HEIGHT = exports.CATEGORY_POSITION = exports.LAYOUT = exports.RECEIPT_OUTPUT = exports.CARD_PROVIDER = exports.CHECKOUT_MODE = exports.TIP_MODE = exports.QUANTITY = exports.WATERMARK = exports.FONT_SIZE = exports.THEME = void 0;
|
|
17
|
-
exports.posShortcutConflict = posShortcutConflict;
|
|
18
|
-
exports._optionalerWert = _optionalerWert;
|
|
19
|
-
exports.posTipKeptByDefault = posTipKeptByDefault;
|
|
20
|
-
exports._istAltwert0x = _istAltwert0x;
|
|
21
|
-
exports.mergePosSettings = mergePosSettings;
|
|
22
|
-
exports.sanitizePosSettings = sanitizePosSettings;
|
|
23
|
-
exports.unknownPosSettingValues = unknownPosSettingValues;
|
|
24
|
-
exports.posSettingsChanges = posSettingsChanges;
|
|
25
|
+
const gutschein_js_1 = require("./gutschein.js");
|
|
25
26
|
/*
|
|
26
27
|
* Jedes Enum steht als Liste zur Laufzeit da, der Typ leitet sich daraus ab
|
|
27
28
|
* (`typeof LISTE[number]`). So gibt es die Werte nur einmal, und die Zwillinge
|
|
@@ -337,6 +338,7 @@ function sanitizePosSettings(stored) {
|
|
|
337
338
|
return {
|
|
338
339
|
business: mergePosSettings(exports.POS_BUSINESS_DEFAULTS, teil('business')),
|
|
339
340
|
device: mergePosSettings(exports.POS_DEVICE_DEFAULTS, teil('device')),
|
|
341
|
+
vouchers: (0, gutschein_js_1.posVoucherSettingsFromWire)(eigen(roh, 'vouchers') ? roh['vouchers'] : undefined),
|
|
340
342
|
};
|
|
341
343
|
}
|
|
342
344
|
/**
|
package/dist/cjs/pos/texte.d.ts
CHANGED
|
@@ -318,6 +318,104 @@ declare const MELDUNGEN_ROH: {
|
|
|
318
318
|
readonly 'cancellation.tip_refunded_with_voucher': {
|
|
319
319
|
readonly text: "Beleg mit Gutschein: Das Trinkgeld wird mitstorniert.";
|
|
320
320
|
};
|
|
321
|
+
readonly 'voucher_error.not_found': {
|
|
322
|
+
readonly text: "Diesen Gutschein gibt es in diesem Betrieb nicht.";
|
|
323
|
+
};
|
|
324
|
+
readonly 'voucher_error.invalid': {
|
|
325
|
+
readonly text: "Dieser Gutschein ist nicht gültig.";
|
|
326
|
+
};
|
|
327
|
+
readonly 'voucher_error.invalid_code': {
|
|
328
|
+
readonly text: "Der Code ist nicht vollständig oder falsch abgetippt.";
|
|
329
|
+
};
|
|
330
|
+
readonly 'voucher_error.expired': {
|
|
331
|
+
readonly text: "Der Gutschein ist abgelaufen.";
|
|
332
|
+
};
|
|
333
|
+
readonly 'voucher_error.used_up': {
|
|
334
|
+
readonly text: "Der Gutschein ist bereits aufgebraucht.";
|
|
335
|
+
};
|
|
336
|
+
readonly 'voucher_error.blocked': {
|
|
337
|
+
readonly text: "Der Gutschein ist gesperrt.";
|
|
338
|
+
};
|
|
339
|
+
readonly 'voucher_error.cancelled': {
|
|
340
|
+
readonly text: "Der Gutschein wurde storniert.";
|
|
341
|
+
};
|
|
342
|
+
readonly 'voucher_error.insufficient_balance': {
|
|
343
|
+
readonly text: "Auf dem Gutschein ist nicht genug Guthaben.";
|
|
344
|
+
};
|
|
345
|
+
readonly 'voucher_error.exceeds_total': {
|
|
346
|
+
readonly text: "Der Gutschein deckt mehr, als offen ist. Bitte den Betrag anpassen.";
|
|
347
|
+
};
|
|
348
|
+
readonly 'voucher_error.balance_changed': {
|
|
349
|
+
readonly text: "Der Gutschein wurde gerade anderswo verwendet. Bitte neu prüfen.";
|
|
350
|
+
};
|
|
351
|
+
readonly 'voucher_error.rate_mismatch': {
|
|
352
|
+
readonly text: "Dieser Gutschein gilt nur für Leistungen mit {rate} %.";
|
|
353
|
+
readonly placeholders: readonly ["rate"];
|
|
354
|
+
};
|
|
355
|
+
readonly 'voucher_error.item_mismatch': {
|
|
356
|
+
readonly text: "Dieser Gutschein gilt nicht für die gewählten Positionen.";
|
|
357
|
+
};
|
|
358
|
+
readonly 'voucher_error.already_used': {
|
|
359
|
+
readonly text: "Dieser Gutschein wurde bereits verwendet.";
|
|
360
|
+
};
|
|
361
|
+
readonly 'voucher_error.partial_cancel': {
|
|
362
|
+
readonly text: "Belege mit Gutschein lassen sich nur ganz stornieren.";
|
|
363
|
+
};
|
|
364
|
+
readonly 'voucher_error.settings_missing': {
|
|
365
|
+
readonly text: "Die Gutschein-Einstellungen fehlen. Bitte die Kasse neu laden.";
|
|
366
|
+
};
|
|
367
|
+
readonly 'voucher_error.too_many_checks': {
|
|
368
|
+
readonly text: "Zu viele Versuche. Bitte in einer Stunde wieder.";
|
|
369
|
+
};
|
|
370
|
+
readonly 'voucher_error.sale_off': {
|
|
371
|
+
readonly text: "Gutscheine verkaufen geht hier noch nicht.";
|
|
372
|
+
};
|
|
373
|
+
readonly 'voucher.reentry_needed': {
|
|
374
|
+
readonly text: "Die Karte ist belastet, der Beleg fehlt noch: zu jedem Gutschein den Code erneut eingeben, dann den Beleg abschließen.";
|
|
375
|
+
};
|
|
376
|
+
readonly 'voucher.reentry_mismatch': {
|
|
377
|
+
readonly text: "Mit diesen Gutscheinen ergibt der Beleg nicht mehr den belasteten Betrag – die Karte zurückbuchen.";
|
|
378
|
+
};
|
|
379
|
+
readonly 'voucher.not_this_voucher': {
|
|
380
|
+
readonly text: "Das ist nicht der Gutschein ····-{suffix}.";
|
|
381
|
+
readonly placeholders: readonly ["suffix"];
|
|
382
|
+
};
|
|
383
|
+
readonly 'voucher.reentry_no_permission': {
|
|
384
|
+
readonly text: "Die Karte ist belastet, der Beleg fehlt noch: den Gutschein-Code kann nur jemand mit dem Recht zum Einlösen nachtragen – sonst die Karte zurückbuchen.";
|
|
385
|
+
};
|
|
386
|
+
readonly 'voucher.already_covered': {
|
|
387
|
+
readonly text: "Diese Positionen deckt schon ein anderer Gutschein.";
|
|
388
|
+
};
|
|
389
|
+
readonly 'voucher.payout_reason_too_long': {
|
|
390
|
+
readonly text: "Der Grund hat höchstens 200 Zeichen.";
|
|
391
|
+
};
|
|
392
|
+
readonly 'voucher.payout_reason_missing': {
|
|
393
|
+
readonly text: "Für die Auszahlung fehlt der Grund.";
|
|
394
|
+
};
|
|
395
|
+
readonly 'voucher.payout_check_first': {
|
|
396
|
+
readonly text: "Die letzte Auszahlung ging unklar aus und kann schon gebucht sein. Erst unter „Belege“ die Liste neu laden und nachsehen, dann ist eine neue möglich.";
|
|
397
|
+
};
|
|
398
|
+
readonly 'voucher.sale_max_amount': {
|
|
399
|
+
readonly text: "Höchstens {amount} je Gutschein.";
|
|
400
|
+
readonly placeholders: readonly ["amount"];
|
|
401
|
+
};
|
|
402
|
+
readonly 'voucher.sale_not_at_terminal': {
|
|
403
|
+
readonly text: "Gutscheine mit Karte am Terminal zu verkaufen geht an dieser Kasse noch nicht – bar kassieren.";
|
|
404
|
+
};
|
|
405
|
+
readonly 'voucher.no_redeem_with_sale': {
|
|
406
|
+
readonly text: "Auf einem Beleg, der Gutscheine verkauft, lässt sich kein Gutschein einlösen.";
|
|
407
|
+
};
|
|
408
|
+
readonly 'voucher.code_not_on_receipt': {
|
|
409
|
+
readonly text: "Der Code steht nicht auf dem Bon – jetzt auf den Gutschein schreiben.";
|
|
410
|
+
};
|
|
411
|
+
readonly 'cancellation.voucher_sale_cancelled': {
|
|
412
|
+
readonly text: "Der Gutschein ····-{suffix} wird mitstorniert und gilt danach nicht mehr.";
|
|
413
|
+
readonly placeholders: readonly ["suffix"];
|
|
414
|
+
};
|
|
415
|
+
readonly 'cancellation.promo_valid_again': {
|
|
416
|
+
readonly text: "Der Aktionsgutschein ····-{suffix} gilt danach wieder.";
|
|
417
|
+
readonly placeholders: readonly ["suffix"];
|
|
418
|
+
};
|
|
321
419
|
readonly 'split.setting_hint': {
|
|
322
420
|
readonly text: "Ein Tisch zahlt in Teilen: jede Zahlung bar oder mit Karte, mit eigenem Trinkgeld – am Ende ein Beleg für alles.";
|
|
323
421
|
};
|
|
@@ -927,6 +1025,32 @@ export type CancellationPaymentMessageCode = keyof typeof CANCELLATION_PAYMENT_E
|
|
|
927
1025
|
* `cancellation.failed` auf – wie bei `receiptEmailErrorMessage`.
|
|
928
1026
|
*/
|
|
929
1027
|
export declare function cancellationPaymentErrorMessage(code: string | undefined | null): MessageKey;
|
|
1028
|
+
/**
|
|
1029
|
+
* Gutschein-Fehler (`/v3`): welcher `code` des Backends welchen Satz bekommt.
|
|
1030
|
+
* Wie RECEIPT_EMAIL_ERROR_MESSAGES: beide Kassen entscheiden am Code. Ein
|
|
1031
|
+
* unbekannter Code geht den allgemeinen Weg des Aufrufs.
|
|
1032
|
+
*/
|
|
1033
|
+
export declare const VOUCHER_ERROR_MESSAGES: {
|
|
1034
|
+
readonly voucher_not_found: "voucher_error.not_found";
|
|
1035
|
+
readonly voucher_invalid: "voucher_error.invalid";
|
|
1036
|
+
readonly voucher_invalid_code: "voucher_error.invalid_code";
|
|
1037
|
+
readonly voucher_expired: "voucher_error.expired";
|
|
1038
|
+
readonly voucher_used_up: "voucher_error.used_up";
|
|
1039
|
+
readonly voucher_blocked: "voucher_error.blocked";
|
|
1040
|
+
readonly voucher_cancelled: "voucher_error.cancelled";
|
|
1041
|
+
readonly voucher_insufficient_balance: "voucher_error.insufficient_balance";
|
|
1042
|
+
readonly voucher_exceeds_total: "voucher_error.exceeds_total";
|
|
1043
|
+
readonly voucher_balance_changed: "voucher_error.balance_changed";
|
|
1044
|
+
readonly voucher_rate_mismatch: "voucher_error.rate_mismatch";
|
|
1045
|
+
readonly voucher_item_mismatch: "voucher_error.item_mismatch";
|
|
1046
|
+
readonly voucher_already_used: "voucher_error.already_used";
|
|
1047
|
+
readonly voucher_partial_cancel: "voucher_error.partial_cancel";
|
|
1048
|
+
readonly voucher_settings_missing: "voucher_error.settings_missing";
|
|
1049
|
+
readonly too_many_voucher_checks: "voucher_error.too_many_checks";
|
|
1050
|
+
};
|
|
1051
|
+
export type VoucherMessageCode = keyof typeof VOUCHER_ERROR_MESSAGES;
|
|
1052
|
+
/** Der Satz zu einem Gutschein-`code`; `undefined` für jeden anderen Code. */
|
|
1053
|
+
export declare function voucherErrorMessage(code: string | undefined | null): MessageKey | undefined;
|
|
930
1054
|
/**
|
|
931
1055
|
* Beschriftungen: Knoepfe, Ueberschriften, Zeilennamen – was kein Satz ist.
|
|
932
1056
|
*
|
|
@@ -1590,6 +1714,111 @@ declare const BESCHRIFTUNGEN_ROH: {
|
|
|
1590
1714
|
readonly 'shift.voucher_redeemed': {
|
|
1591
1715
|
readonly text: "Gutschein eingelöst";
|
|
1592
1716
|
};
|
|
1717
|
+
readonly 'voucher.button': {
|
|
1718
|
+
readonly text: "Gutschein";
|
|
1719
|
+
};
|
|
1720
|
+
readonly 'voucher.redeem': {
|
|
1721
|
+
readonly text: "Gutschein einlösen";
|
|
1722
|
+
};
|
|
1723
|
+
readonly 'voucher.sell': {
|
|
1724
|
+
readonly text: "Gutschein verkaufen";
|
|
1725
|
+
};
|
|
1726
|
+
readonly 'voucher.payout': {
|
|
1727
|
+
readonly text: "Gutschein auszahlen";
|
|
1728
|
+
};
|
|
1729
|
+
readonly 'voucher.code': {
|
|
1730
|
+
readonly text: "Code";
|
|
1731
|
+
};
|
|
1732
|
+
readonly 'voucher.scan': {
|
|
1733
|
+
readonly text: "Code scannen";
|
|
1734
|
+
};
|
|
1735
|
+
readonly 'voucher.check': {
|
|
1736
|
+
readonly text: "Prüfen";
|
|
1737
|
+
};
|
|
1738
|
+
readonly 'voucher.amount': {
|
|
1739
|
+
readonly text: "Betrag";
|
|
1740
|
+
};
|
|
1741
|
+
readonly 'voucher.balance': {
|
|
1742
|
+
readonly text: "Rest am Gutschein: {amount}";
|
|
1743
|
+
readonly placeholders: readonly ["amount"];
|
|
1744
|
+
};
|
|
1745
|
+
readonly 'voucher.remaining_quantity': {
|
|
1746
|
+
readonly text: "{n} von {total} übrig";
|
|
1747
|
+
readonly placeholders: readonly ["n", "total"];
|
|
1748
|
+
};
|
|
1749
|
+
readonly 'voucher.reason': {
|
|
1750
|
+
readonly text: "Grund";
|
|
1751
|
+
};
|
|
1752
|
+
readonly 'voucher.multi_purpose': {
|
|
1753
|
+
readonly text: "Mehrzweckgutschein";
|
|
1754
|
+
};
|
|
1755
|
+
readonly 'voucher.single_purpose': {
|
|
1756
|
+
readonly text: "Einzweckgutschein {rate} %";
|
|
1757
|
+
readonly placeholders: readonly ["rate"];
|
|
1758
|
+
};
|
|
1759
|
+
readonly 'voucher.service': {
|
|
1760
|
+
readonly text: "Leistungsgutschein";
|
|
1761
|
+
};
|
|
1762
|
+
readonly 'voucher.promotion': {
|
|
1763
|
+
readonly text: "Aktionsgutschein";
|
|
1764
|
+
};
|
|
1765
|
+
readonly 'voucher.payment_line': {
|
|
1766
|
+
readonly text: "Gutschein ····-{suffix}";
|
|
1767
|
+
readonly placeholders: readonly ["suffix"];
|
|
1768
|
+
};
|
|
1769
|
+
readonly 'voucher.covers_items': {
|
|
1770
|
+
readonly text: "Deckt: {items}";
|
|
1771
|
+
readonly placeholders: readonly ["items"];
|
|
1772
|
+
};
|
|
1773
|
+
readonly 'voucher.code_shown_once': {
|
|
1774
|
+
readonly text: "Code nur jetzt sichtbar: {code}";
|
|
1775
|
+
readonly placeholders: readonly ["code"];
|
|
1776
|
+
};
|
|
1777
|
+
readonly 'voucher.not_in_split': {
|
|
1778
|
+
readonly text: "Gutscheine gehen beim getrennten Kassieren nicht.";
|
|
1779
|
+
};
|
|
1780
|
+
readonly 'voucher.payout_not_possible': {
|
|
1781
|
+
readonly text: "Dieser Gutschein lässt sich nicht auszahlen.";
|
|
1782
|
+
};
|
|
1783
|
+
readonly 'voucher.add_article': {
|
|
1784
|
+
readonly text: "{article} hinzufügen";
|
|
1785
|
+
readonly placeholders: readonly ["article"];
|
|
1786
|
+
};
|
|
1787
|
+
readonly 'voucher.payout_confirm': {
|
|
1788
|
+
readonly text: "{amount} bar auszahlen?";
|
|
1789
|
+
readonly placeholders: readonly ["amount"];
|
|
1790
|
+
};
|
|
1791
|
+
readonly 'cancellation.voucher_back': {
|
|
1792
|
+
readonly text: "{amount} geht zurück auf den Gutschein";
|
|
1793
|
+
readonly placeholders: readonly ["amount"];
|
|
1794
|
+
};
|
|
1795
|
+
readonly 'voucher.apply': {
|
|
1796
|
+
readonly text: "Übernehmen";
|
|
1797
|
+
};
|
|
1798
|
+
readonly 'voucher.redeemable_until': {
|
|
1799
|
+
readonly text: "einlösbar bis {date}";
|
|
1800
|
+
readonly placeholders: readonly ["date"];
|
|
1801
|
+
};
|
|
1802
|
+
readonly 'voucher.remove_line': {
|
|
1803
|
+
readonly text: "{line} entfernen";
|
|
1804
|
+
readonly placeholders: readonly ["line"];
|
|
1805
|
+
};
|
|
1806
|
+
readonly 'voucher.reenter_code': {
|
|
1807
|
+
readonly text: "Code erneut eingeben";
|
|
1808
|
+
};
|
|
1809
|
+
readonly 'voucher.refundable_until': {
|
|
1810
|
+
readonly text: "rückzahlbar bis {date}";
|
|
1811
|
+
readonly placeholders: readonly ["date"];
|
|
1812
|
+
};
|
|
1813
|
+
readonly 'voucher.code_done': {
|
|
1814
|
+
readonly text: "Fertig";
|
|
1815
|
+
};
|
|
1816
|
+
readonly 'voucher.article': {
|
|
1817
|
+
readonly text: "Artikel";
|
|
1818
|
+
};
|
|
1819
|
+
readonly 'voucher.add': {
|
|
1820
|
+
readonly text: "Hinzufügen";
|
|
1821
|
+
};
|
|
1593
1822
|
readonly 'shift.all_payments': {
|
|
1594
1823
|
readonly text: "Alle Zahlungen dieser Schicht (bar + unbar)";
|
|
1595
1824
|
};
|