@kreiseck/kasseneck-api 1.30.0 → 1.32.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/cjs/client/aufrufe.d.ts +3 -3
  3. package/dist/cjs/client/aufrufe.js +8 -0
  4. package/dist/cjs/client/receipts.d.ts +11 -0
  5. package/dist/cjs/client/receipts.js +14 -0
  6. package/dist/cjs/index.d.ts +2 -2
  7. package/dist/cjs/index.js +10 -5
  8. package/dist/cjs/models/index.d.ts +2 -2
  9. package/dist/cjs/models/index.js +7 -2
  10. package/dist/cjs/models/receipt-errors.d.ts +1 -1
  11. package/dist/cjs/models/receipt-errors.js +9 -0
  12. package/dist/cjs/models/receipt-item.d.ts +44 -2
  13. package/dist/cjs/models/receipt-item.js +56 -1
  14. package/dist/cjs/models/receipt.d.ts +17 -0
  15. package/dist/cjs/models/receipt.js +9 -0
  16. package/dist/cjs/models/voucher.d.ts +18 -0
  17. package/dist/cjs/models/voucher.js +32 -1
  18. package/dist/cjs/pos/artikel.d.ts +26 -0
  19. package/dist/cjs/pos/artikel.js +5 -0
  20. package/dist/cjs/pos/client.d.ts +1 -0
  21. package/dist/cjs/pos/client.js +14 -0
  22. package/dist/cjs/pos/errors.d.ts +1 -1
  23. package/dist/cjs/pos/errors.js +13 -0
  24. package/dist/cjs/pos/fremdgutschein-artikel.d.ts +66 -0
  25. package/dist/cjs/pos/fremdgutschein-artikel.js +74 -0
  26. package/dist/cjs/pos/index.d.ts +9 -4
  27. package/dist/cjs/pos/index.js +62 -4
  28. package/dist/cjs/pos/leergut.d.ts +60 -0
  29. package/dist/cjs/pos/leergut.js +82 -0
  30. package/dist/cjs/pos/pfand.d.ts +144 -0
  31. package/dist/cjs/pos/pfand.js +382 -0
  32. package/dist/cjs/pos/rabatt-vorlagen.d.ts +79 -0
  33. package/dist/cjs/pos/rabatt-vorlagen.js +156 -0
  34. package/dist/cjs/pos/schicht-lesen.js +8 -0
  35. package/dist/cjs/pos/schicht-typen.d.ts +15 -0
  36. package/dist/cjs/pos/settings.d.ts +72 -10
  37. package/dist/cjs/pos/settings.js +79 -5
  38. package/dist/cjs/pos/texte.d.ts +283 -0
  39. package/dist/cjs/pos/texte.js +163 -1
  40. package/dist/cjs/pos/zusaetze.d.ts +3 -3
  41. package/dist/cjs/pos/zusaetze.js +4 -2
  42. package/dist/cjs/receipt/discount.js +3 -0
  43. package/dist/cjs/receipt/due.d.ts +6 -0
  44. package/dist/cjs/receipt/due.js +16 -5
  45. package/dist/cjs/receipt/gutschein-plan.d.ts +7 -1
  46. package/dist/cjs/receipt/gutschein-plan.js +16 -2
  47. package/dist/cjs/receipt/layout.js +108 -2
  48. package/dist/cjs/receipt/shift-sheet.js +8 -0
  49. package/dist/cjs/register/pairing.d.ts +15 -1
  50. package/dist/cjs/register/pairing.js +14 -1
  51. package/dist/cjs/stored/draht.js +1 -0
  52. package/dist/cjs/stored/einstellungen.js +50 -2
  53. package/dist/cjs/stored/vokabular.d.ts +1 -1
  54. package/dist/cjs/stored/vokabular.js +107 -5
  55. package/dist/cjs/version.d.ts +1 -1
  56. package/dist/cjs/version.js +1 -1
  57. package/dist/esm/client/aufrufe.d.ts +3 -3
  58. package/dist/esm/client/aufrufe.js +8 -0
  59. package/dist/esm/client/receipts.d.ts +11 -0
  60. package/dist/esm/client/receipts.js +14 -0
  61. package/dist/esm/index.d.ts +2 -2
  62. package/dist/esm/index.js +2 -2
  63. package/dist/esm/models/index.d.ts +2 -2
  64. package/dist/esm/models/index.js +2 -2
  65. package/dist/esm/models/receipt-errors.d.ts +1 -1
  66. package/dist/esm/models/receipt-errors.js +9 -0
  67. package/dist/esm/models/receipt-item.d.ts +44 -2
  68. package/dist/esm/models/receipt-item.js +54 -1
  69. package/dist/esm/models/receipt.d.ts +17 -0
  70. package/dist/esm/models/receipt.js +9 -0
  71. package/dist/esm/models/voucher.d.ts +18 -0
  72. package/dist/esm/models/voucher.js +30 -0
  73. package/dist/esm/pos/artikel.d.ts +26 -0
  74. package/dist/esm/pos/artikel.js +5 -0
  75. package/dist/esm/pos/client.d.ts +1 -0
  76. package/dist/esm/pos/client.js +15 -1
  77. package/dist/esm/pos/errors.d.ts +1 -1
  78. package/dist/esm/pos/errors.js +13 -0
  79. package/dist/esm/pos/fremdgutschein-artikel.d.ts +66 -0
  80. package/dist/esm/pos/fremdgutschein-artikel.js +67 -0
  81. package/dist/esm/pos/index.d.ts +9 -4
  82. package/dist/esm/pos/index.js +10 -4
  83. package/dist/esm/pos/leergut.d.ts +60 -0
  84. package/dist/esm/pos/leergut.js +77 -0
  85. package/dist/esm/pos/pfand.d.ts +144 -0
  86. package/dist/esm/pos/pfand.js +371 -0
  87. package/dist/esm/pos/rabatt-vorlagen.d.ts +79 -0
  88. package/dist/esm/pos/rabatt-vorlagen.js +148 -0
  89. package/dist/esm/pos/schicht-lesen.js +8 -0
  90. package/dist/esm/pos/schicht-typen.d.ts +15 -0
  91. package/dist/esm/pos/settings.d.ts +72 -10
  92. package/dist/esm/pos/settings.js +74 -4
  93. package/dist/esm/pos/texte.d.ts +283 -0
  94. package/dist/esm/pos/texte.js +160 -0
  95. package/dist/esm/pos/zusaetze.d.ts +3 -3
  96. package/dist/esm/pos/zusaetze.js +4 -2
  97. package/dist/esm/receipt/discount.js +4 -1
  98. package/dist/esm/receipt/due.d.ts +6 -0
  99. package/dist/esm/receipt/due.js +17 -6
  100. package/dist/esm/receipt/gutschein-plan.d.ts +7 -1
  101. package/dist/esm/receipt/gutschein-plan.js +14 -2
  102. package/dist/esm/receipt/layout.js +109 -3
  103. package/dist/esm/receipt/shift-sheet.js +8 -0
  104. package/dist/esm/register/pairing.d.ts +15 -1
  105. package/dist/esm/register/pairing.js +13 -1
  106. package/dist/esm/stored/draht.js +1 -0
  107. package/dist/esm/stored/einstellungen.js +52 -4
  108. package/dist/esm/stored/vokabular.d.ts +1 -1
  109. package/dist/esm/stored/vokabular.js +107 -5
  110. package/dist/esm/version.d.ts +1 -1
  111. package/dist/esm/version.js +1 -1
  112. package/fixtures/add-on-cases.json +6 -4
  113. package/fixtures/deposit-cases.json +4758 -0
  114. package/fixtures/discount-preset-cases.json +1074 -0
  115. package/fixtures/expected/deposit-return.grid32.txt +28 -0
  116. package/fixtures/expected/deposit-return.grid48.txt +28 -0
  117. package/fixtures/expected/deposit-return.lines.json +275 -0
  118. package/fixtures/expected/deposit-return.sheet32.json +194 -0
  119. package/fixtures/expected/deposit-return.sheet48.json +194 -0
  120. package/fixtures/expected/deposit.grid32.txt +34 -0
  121. package/fixtures/expected/deposit.grid48.txt +32 -0
  122. package/fixtures/expected/deposit.lines.json +316 -0
  123. package/fixtures/expected/deposit.sheet32.json +230 -0
  124. package/fixtures/expected/deposit.sheet48.json +218 -0
  125. package/fixtures/external-voucher-article-cases.json +311 -0
  126. package/fixtures/hobex-hps-codes.json +1 -1
  127. package/fixtures/invoice-api.schema.json +1 -1
  128. package/fixtures/invoice-texts.json +1 -1
  129. package/fixtures/manifest.json +16 -0
  130. package/fixtures/pos-texts.json +266 -1
  131. package/fixtures/receipt-due-voucher-generated.json +1 -1
  132. package/fixtures/receipts/deposit-return.json +63 -0
  133. package/fixtures/receipts/deposit.json +83 -0
  134. package/fixtures/renames-1.0.json +18 -0
  135. package/fixtures/return-code-cases.json +1338 -0
  136. package/fixtures/surface.json +92 -7
  137. package/fixtures/v3/antworten/belege.json +2 -2
  138. package/fixtures/v3/antworten/belegmail.json +2 -2
  139. package/fixtures/v3/antworten/berichte.json +2 -2
  140. package/fixtures/v3/antworten/kasse-belege.json +2 -2
  141. package/fixtures/v3/antworten/kasse.json +428 -13
  142. package/fixtures/v3/antworten/lager.json +1 -1
  143. package/fixtures/v3/antworten/rechnungen.json +2 -2
  144. package/fixtures/v3/antworten/storno.json +2 -2
  145. package/fixtures/v3/stored/belege.json +2 -2
  146. package/fixtures/v3/stored/kasse.json +42 -4
  147. package/fixtures/v3/stored/rechnungen.json +2 -2
  148. package/fixtures/v3/v3-vokabular.json +898 -31
  149. package/fixtures/v3/zahlbetrag-faelle.json +187 -3
  150. package/package.json +1 -1
@@ -97,8 +97,17 @@ function fromReceiptPayload(payload) {
97
97
  ? { registrationInfo: readRegistrationInfo(payload.registrationInfo) }
98
98
  : {}),
99
99
  ...handbelegFeld(payload.manualReceipt),
100
+ ...(typeof payload.onPremises === 'boolean' ? { onPremises: payload.onPremises } : {}),
101
+ ...pfandStelleFeld(payload.sharedReturnPoint),
100
102
  };
101
103
  }
104
+ function pfandStelleFeld(roh) {
105
+ if (roh == null || typeof roh !== 'object')
106
+ return {};
107
+ const name = typeof roh.name === 'string' ? roh.name : '';
108
+ const address = typeof roh.address === 'string' ? roh.address : '';
109
+ return name !== '' || address !== '' ? { sharedReturnPoint: { name, address } } : {};
110
+ }
102
111
  function handbelegFeld(roh) {
103
112
  const manualReceipt = (0, manual_receipt_js_1.readManualReceipt)(roh);
104
113
  return manualReceipt ? { manualReceipt } : {};
@@ -242,6 +242,24 @@ export type ExternalVoucherNumberCheck = {
242
242
  * `external_voucher_number_is_own_code`, der Gutschein gehoert als eigener eingeloest –, danach die Form.
243
243
  */
244
244
  export declare function checkExternalVoucherNumber(text: unknown): ExternalVoucherNumberCheck;
245
+ /**
246
+ * Wie sehr eine Eingabe einem eigenen Gutscheincode gleicht ([ownVoucherCodeShape]): `valid` = gueltiger eigener
247
+ * Code; `checksum` = 12 Zeichen des Code-Alphabets mit falschem Pruefzeichen (z. B. eine zwoelfstellige
248
+ * Webshop-Nummer); `length` = Muster `4-4-x` mit echten Bindestrichen `-` (nie `.`, `_`, `/`), aber nicht 12 Zeichen;
249
+ * `none` = keine Aehnlichkeit.
250
+ */
251
+ export type OwnVoucherCodeShape = 'valid' | 'checksum' | 'length' | 'none';
252
+ export declare const OWN_VOUCHER_CODE_SHAPES: readonly OwnVoucherCodeShape[];
253
+ /**
254
+ * Form-Erkennung eigener Codes fuer das Feld „Code eingeben oder scannen“ (Web-Kasse und Kassen-App gleich):
255
+ * `valid` laeuft als eigener Gutschein, `checksum`/`length` fragt die Kasse nach („Sieht aus wie ein
256
+ * Kasseneck-Code, ist aber keiner. Als fremden Gutschein verwenden?“, `external_voucher.looks_like_own_code`),
257
+ * `none` geht bei Freigabe direkt in das Blatt „Fremder Gutschein“. Gelesen wie [checkExternalVoucherNumber]:
258
+ * Rand weg, `.`, `_`, `/` wie `-`, dann die Normalisierung von `VoucherCode` (gross, ohne Leerraum und `-`,
259
+ * O → 0, I/L → 1); `length` nur mit echten Bindestrichen. Eine Nachfrage weist nichts ab: der Server prueft die Fremdnummer selbst
260
+ * (`external_voucher_number_is_own_code` nur bei `valid`).
261
+ */
262
+ export declare function ownVoucherCodeShape(text: unknown): OwnVoucherCodeShape;
245
263
  /**
246
264
  * Ist der Fremdgutschein sendbar? Die Form wie `gutschein-beleg.pruefeFremd` (ohne die Freigabe des Kontos, die
247
265
  * kennt nur der Server bzw. `PosVoucherSettings.externalVouchers`): Aktion `sell`/`redeem`/`payout`, Art
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EXTERNAL_VOUCHER_VAT_RATES_BP = exports.EXTERNAL_VOUCHER_TAXED_WITH_MAX = exports.EXTERNAL_VOUCHER_NUMBER_MAX = exports.GUTSCHEIN_SERVERFELDER = exports.VOUCHER_SOURCES = exports.NEUE_GUTSCHEINARTEN = void 0;
3
+ exports.OWN_VOUCHER_CODE_SHAPES = exports.EXTERNAL_VOUCHER_VAT_RATES_BP = exports.EXTERNAL_VOUCHER_TAXED_WITH_MAX = exports.EXTERNAL_VOUCHER_NUMBER_MAX = exports.GUTSCHEIN_SERVERFELDER = exports.VOUCHER_SOURCES = exports.NEUE_GUTSCHEINARTEN = void 0;
4
4
  exports.isExternalVoucher = isExternalVoucher;
5
5
  exports.isNewFormVoucher = isNewFormVoucher;
6
6
  exports.istWertVerkauf = istWertVerkauf;
@@ -11,6 +11,7 @@ exports.fromVoucherPayload = fromVoucherPayload;
11
11
  exports.wunschFormGueltig = wunschFormGueltig;
12
12
  exports.normalizeExternalVoucherNumber = normalizeExternalVoucherNumber;
13
13
  exports.checkExternalVoucherNumber = checkExternalVoucherNumber;
14
+ exports.ownVoucherCodeShape = ownVoucherCodeShape;
14
15
  exports.externalVoucherIsValid = externalVoucherIsValid;
15
16
  const index_js_1 = require("../enums/index.js");
16
17
  const validator_1 = require("@kreiseck/validator");
@@ -285,6 +286,36 @@ function checkExternalVoucherNumber(text) {
285
286
  const number = normalizeExternalVoucherNumber(text);
286
287
  return number === null ? { ok: false, code: 'external_voucher_number_invalid' } : { ok: true, number };
287
288
  }
289
+ exports.OWN_VOUCHER_CODE_SHAPES = Object.freeze(['valid', 'checksum', 'length', 'none']);
290
+ /** Alphabet der eigenen Codes (Crockford-Base32 ohne U), nach der Normalisierung von `VoucherCode`. */
291
+ const CODE_ALPHABET = /^[0-9A-HJKMNP-TV-Z]+$/;
292
+ const CODE_GRUPPEN = /^[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]+$/;
293
+ /**
294
+ * Form-Erkennung eigener Codes fuer das Feld „Code eingeben oder scannen“ (Web-Kasse und Kassen-App gleich):
295
+ * `valid` laeuft als eigener Gutschein, `checksum`/`length` fragt die Kasse nach („Sieht aus wie ein
296
+ * Kasseneck-Code, ist aber keiner. Als fremden Gutschein verwenden?“, `external_voucher.looks_like_own_code`),
297
+ * `none` geht bei Freigabe direkt in das Blatt „Fremder Gutschein“. Gelesen wie [checkExternalVoucherNumber]:
298
+ * Rand weg, `.`, `_`, `/` wie `-`, dann die Normalisierung von `VoucherCode` (gross, ohne Leerraum und `-`,
299
+ * O → 0, I/L → 1); `length` nur mit echten Bindestrichen. Eine Nachfrage weist nichts ab: der Server prueft die Fremdnummer selbst
300
+ * (`external_voucher_number_is_own_code` nur bei `valid`).
301
+ */
302
+ function ownVoucherCodeShape(text) {
303
+ if (typeof text !== 'string')
304
+ return 'none';
305
+ const roh = text.replace(FREMD_RAND_MUSTER, '');
306
+ const t = roh.replace(/[._/]/g, '-');
307
+ if (t === '')
308
+ return 'none';
309
+ if (validator_1.VoucherCode.validate(t).ok)
310
+ return 'valid';
311
+ const s = t.toUpperCase().replace(/[\s-]/g, '').replace(/O/g, '0').replace(/[IL]/g, '1');
312
+ if (!CODE_ALPHABET.test(s))
313
+ return 'none';
314
+ if (s.length === 12)
315
+ return 'checksum';
316
+ // Falsche Laenge nur mit echten Bindestrichen: eigene Codes stehen immer so da, `WEIN.2026/7` ist keiner.
317
+ return CODE_GRUPPEN.test(roh) ? 'length' : 'none';
318
+ }
288
319
  /** Steuer- und Formatzeichen (`gutschein-core.STEUERZEICHEN`): nie in `taxedWith`. */
289
320
  const STEUERZEICHEN = /[\p{Cc}\p{Cf}]/u;
290
321
  /**
@@ -1,5 +1,7 @@
1
1
  import type { InternerTransport } from '../client/aufrufe.js';
2
2
  import { type PosReference } from './kachel-referenz.js';
3
+ import { type DepositEntry } from './pfand.js';
4
+ import { type ArticleExternalVoucher } from './fremdgutschein-artikel.js';
3
5
  /**
4
6
  * Artikelgruppen (Kategorien der Kachel-Kasse) und Artikel in der Form, die
5
7
  * die Kacheln brauchen, Backend: `article-endpoints.js`
@@ -21,6 +23,11 @@ export interface ArticleGroup {
21
23
  * erst ueber [addOnsFor].
22
24
  */
23
25
  addOns?: string[] | null;
26
+ /**
27
+ * Pfand der Gruppe (Pfand & Leergut): gilt fuer Artikel ohne eigene Liste; null = keines.
28
+ * Optional wie `addOns`, der Leser setzt es immer.
29
+ */
30
+ deposits?: DepositEntry[] | null;
24
31
  }
25
32
  export interface ArticleGroupPayload {
26
33
  id?: string | null;
@@ -30,6 +37,7 @@ export interface ArticleGroupPayload {
30
37
  sort?: number | null;
31
38
  vatRate?: number | null;
32
39
  addOns?: unknown;
40
+ deposits?: unknown;
33
41
  }
34
42
  /** Zusatzliste am Draht: nur eine Liste von Texten zaehlt, sonst null. Paketintern. */
35
43
  export declare function addOnListe(wert: unknown): string[] | null;
@@ -121,6 +129,22 @@ export interface PosArticle {
121
129
  * immer; wirksam wird es ueber [addOnsFor].
122
130
  */
123
131
  addOns?: string[] | null;
132
+ /**
133
+ * Kachel verkauft einen fremden Gutschein (1.31.0): `multi_purpose` =
134
+ * Wertgutschein, `single_purpose` = Leistungsgutschein mit dem Satz des
135
+ * Artikels; null = normaler Artikel. Die Kasse fragt die Gutscheinnummer ab
136
+ * und sendet einen `vouchers[]`-Eintrag statt einer Position; sperren ueber
137
+ * [externalVoucherTileBlock]. Vor `stockTracked` werten (ein Fremdgutschein
138
+ * fuehrt nie Bestand). Optional wie `addOns`, der Leser setzt es immer; ein
139
+ * unbekannter Wert wird null.
140
+ */
141
+ externalVoucher?: ArticleExternalVoucher | null;
142
+ /**
143
+ * Pfand des Artikels (Pfand & Leergut): `null` = keine eigene Angabe (die Gruppe gilt), `[]` = ausdruecklich
144
+ * ohne Pfand, sonst die Eintraege. Der Server setzt die Pfandzeilen am Beleg daraus (`autoDeposits`). Optional wie
145
+ * `addOns`, der Leser setzt es immer.
146
+ */
147
+ deposits?: DepositEntry[] | null;
124
148
  }
125
149
  /**
126
150
  * Kann die Kachel gebucht werden? Mit festem Preis immer, ohne Preis nur mit
@@ -161,6 +185,8 @@ export interface PosArticlePayload {
161
185
  askPrice?: boolean | null;
162
186
  reference?: unknown;
163
187
  addOns?: unknown;
188
+ externalVoucher?: unknown;
189
+ deposits?: unknown;
164
190
  }
165
191
  export declare function fromPosArticlePayload(p: PosArticlePayload): PosArticle;
166
192
  /**
@@ -14,6 +14,8 @@ exports.listMyArticleGroups = listMyArticleGroups;
14
14
  exports.listMyArticles = listMyArticles;
15
15
  const errors_js_1 = require("../client/errors.js");
16
16
  const kachel_referenz_js_1 = require("./kachel-referenz.js");
17
+ const pfand_js_1 = require("./pfand.js");
18
+ const fremdgutschein_artikel_js_1 = require("./fremdgutschein-artikel.js");
17
19
  /** Zusatzliste am Draht: nur eine Liste von Texten zaehlt, sonst null. Paketintern. */
18
20
  function addOnListe(wert) {
19
21
  return Array.isArray(wert) ? wert.filter((s) => typeof s === 'string' && s !== '') : null;
@@ -27,6 +29,7 @@ function fromArticleGroupPayload(p) {
27
29
  sort: typeof p.sort === 'number' ? p.sort : 0,
28
30
  vatRate: typeof p.vatRate === 'number' ? p.vatRate : null,
29
31
  addOns: addOnListe(p.addOns),
32
+ deposits: (0, pfand_js_1.depositEntriesFromWire)(p.deposits),
30
33
  };
31
34
  }
32
35
  /**
@@ -106,6 +109,8 @@ function fromPosArticlePayload(p) {
106
109
  askPrice: p.askPrice === true,
107
110
  reference: (0, kachel_referenz_js_1.fromReferencePayload)(p.reference),
108
111
  addOns: addOnListe(p.addOns),
112
+ externalVoucher: (0, fremdgutschein_artikel_js_1.isArticleExternalVoucher)(p.externalVoucher) ? p.externalVoucher : null,
113
+ deposits: (0, pfand_js_1.depositEntriesFromWire)(p.deposits),
109
114
  };
110
115
  }
111
116
  /**
@@ -9,6 +9,7 @@ export declare function posSettingsFromWire(data: {
9
9
  business?: unknown;
10
10
  device?: unknown;
11
11
  vouchers?: unknown;
12
+ deposit?: unknown;
12
13
  } | null | undefined): PosSettings;
13
14
  /** Betriebsweite Einstellungen schreiben (Recht `layout`); liefert den gemischten Stand. */
14
15
  export declare function setMyPosSettings(transport: InternerTransport, business: Partial<PosBusinessSettings>): Promise<PosBusinessSettings>;
@@ -7,6 +7,8 @@ exports.setMyRegisterDeviceSettings = setMyRegisterDeviceSettings;
7
7
  exports.setMyPosLogo = setMyPosLogo;
8
8
  const errors_js_1 = require("../client/errors.js");
9
9
  const gutschein_js_1 = require("./gutschein.js");
10
+ const pfand_js_1 = require("./pfand.js");
11
+ const rabatt_vorlagen_js_1 = require("./rabatt-vorlagen.js");
10
12
  const settings_js_1 = require("./settings.js");
11
13
  /*
12
14
  * Die Einstellungs-Aufrufe am Draht `/api/v3`: Parameter und Antwort heissen
@@ -37,10 +39,12 @@ async function getPosSettings(transport, options = {}) {
37
39
  }
38
40
  /** `{business, device, vouchers}` einer Antwort, gemischt mit den Standardwerten. */
39
41
  function posSettingsFromWire(data) {
42
+ const deposit = (0, pfand_js_1.posDepositSettingsFromWire)(data?.deposit);
40
43
  return {
41
44
  vouchers: (0, gutschein_js_1.posVoucherSettingsFromWire)(data?.vouchers),
42
45
  business: (0, settings_js_1.mergePosSettings)(settings_js_1.POS_BUSINESS_DEFAULTS, objekt(data?.business)),
43
46
  device: (0, settings_js_1.mergePosSettings)(settings_js_1.POS_DEVICE_DEFAULTS, objekt(data?.device)),
47
+ ...(deposit ? { deposit } : {}),
44
48
  };
45
49
  }
46
50
  /** Betriebsweite Einstellungen schreiben (Recht `layout`); liefert den gemischten Stand. */
@@ -151,6 +155,16 @@ function pruefeTeil(name, teil, block, standard, werte) {
151
155
  throw new errors_js_1.KasseneckValidationError(name, `${teil}.${schluessel}: true oder false erwartet`, 'request');
152
156
  continue;
153
157
  }
158
+ // Rabatt-Vorlagen: dieselbe Pruefung wie am Server, der erste Fehler mit Vorlage, Feld und Satz.
159
+ if (teil === 'business' && settings_js_1.POS_BUSINESS_OPTIONAL_LISTS.includes(schluessel)) {
160
+ const geprueft = (0, rabatt_vorlagen_js_1.checkDiscountPresets)(wert);
161
+ if (!geprueft.ok) {
162
+ const f = geprueft.errors[0];
163
+ const ort = `${teil}.${schluessel}${f.index === null ? '' : `[${f.index}]`}${f.field === null ? '' : `.${f.field}`}`;
164
+ throw new errors_js_1.KasseneckValidationError(name, `${ort}: ${f.message} (${rabatt_vorlagen_js_1.INVALID_DISCOUNT_PRESET})`, 'request');
165
+ }
166
+ continue;
167
+ }
154
168
  const wahl = teil === 'business' ? settings_js_1.POS_BUSINESS_OPTIONAL_CHOICES : settings_js_1.POS_DEVICE_OPTIONAL_CHOICES;
155
169
  if (!Object.prototype.hasOwnProperty.call(standard, schluessel) && !wahl.includes(schluessel)) {
156
170
  throw new errors_js_1.KasseneckValidationError(name, `${teil}.${schluessel}: unbekanntes Feld`, 'request');
@@ -21,7 +21,7 @@ import { KasseneckApiError } from '../client/errors.js';
21
21
  * ueber `KasseneckApiError.code` lesbar; die Kasse braucht dafuer einen
22
22
  * Rueckfallzweig.
23
23
  */
24
- export declare const POS_ERROR_CODES: readonly ["account_not_found", "action_confirmation_required", "admin_required", "after_count_not_permitted", "api_not_approved", "app_check_invalid", "app_check_missing", "article_not_found", "article_not_in_scope", "article_not_tracked", "cash_movement_exceeds_balance", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "comment_required", "count_already_voided", "count_not_found", "device_not_found", "dialect_mismatch", "drawer_inactive", "drawer_not_found", "idempotency_conflict", "idempotency_key_required", "internal_translation_error", "invalid_amount", "invalid_cursor", "invalid_denominations", "invalid_movement_type", "invalid_quantity", "invalid_serial", "live_not_enabled", "location_inactive", "location_not_found", "logo_invalid", "logo_invalid_type", "logo_too_large", "method_not_allowed", "mfa_required", "module_inactive", "not_found", "not_permitted", "note_required", "password_change_required", "print_job_not_found", "print_layout_failed", "printer_not_found", "recount_exhausted", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "serial_already_counted", "serial_not_allowed", "serial_required", "server_error", "session_expired", "session_other_cashregister", "shift_already_open", "shift_closed", "shift_mode_off", "shift_not_open", "stocktake_closed", "stocktake_closing", "stocktake_not_found", "stocktake_not_open", "tip_payout_exceeds_claim", "too_many_counts", "transfer_same_drawer", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
24
+ export declare const POS_ERROR_CODES: readonly ["account_not_found", "action_confirmation_required", "admin_required", "after_count_not_permitted", "api_not_approved", "app_check_invalid", "app_check_missing", "article_not_found", "article_not_in_scope", "article_not_tracked", "cash_movement_exceeds_balance", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "comment_required", "count_already_voided", "count_not_found", "deposit_follows_item", "deposit_not_enabled", "deposit_return_not_offered", "deposit_set_by_server", "deposit_type_in_use", "deposit_type_not_found", "deposit_type_not_issued", "device_not_found", "dialect_mismatch", "drawer_inactive", "drawer_not_found", "filler_role_required", "idempotency_conflict", "idempotency_key_required", "internal_translation_error", "invalid_amount", "invalid_cursor", "invalid_denominations", "invalid_deposit", "invalid_deposit_quantity", "invalid_discount_preset", "invalid_item_kind", "invalid_movement_type", "invalid_quantity", "invalid_serial", "live_not_enabled", "location_inactive", "location_not_found", "logo_invalid", "logo_invalid_type", "logo_too_large", "method_not_allowed", "mfa_required", "module_inactive", "not_found", "not_permitted", "note_required", "password_change_required", "print_job_not_found", "print_layout_failed", "printer_not_found", "recount_exhausted", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "serial_already_counted", "serial_not_allowed", "serial_required", "server_error", "session_expired", "session_other_cashregister", "shift_already_open", "shift_closed", "shift_mode_off", "shift_not_open", "stocktake_closed", "stocktake_closing", "stocktake_not_found", "stocktake_not_open", "tip_payout_exceeds_claim", "too_many_counts", "too_many_deposit_types", "transfer_same_drawer", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
25
25
  export type PosErrorCode = typeof POS_ERROR_CODES[number];
26
26
  export declare function isPosErrorCode(value: unknown): value is PosErrorCode;
27
27
  /** Der Code eines geworfenen Fehlers, wenn er in [POS_ERROR_CODES] steht; sonst `undefined`. */
@@ -47,16 +47,28 @@ exports.POS_ERROR_CODES = Object.freeze([
47
47
  'comment_required',
48
48
  'count_already_voided',
49
49
  'count_not_found',
50
+ 'deposit_follows_item',
51
+ 'deposit_not_enabled',
52
+ 'deposit_return_not_offered',
53
+ 'deposit_set_by_server',
54
+ 'deposit_type_in_use',
55
+ 'deposit_type_not_found',
56
+ 'deposit_type_not_issued',
50
57
  'device_not_found',
51
58
  'dialect_mismatch',
52
59
  'drawer_inactive',
53
60
  'drawer_not_found',
61
+ 'filler_role_required',
54
62
  'idempotency_conflict',
55
63
  'idempotency_key_required',
56
64
  'internal_translation_error',
57
65
  'invalid_amount',
58
66
  'invalid_cursor',
59
67
  'invalid_denominations',
68
+ 'invalid_deposit',
69
+ 'invalid_deposit_quantity',
70
+ 'invalid_discount_preset',
71
+ 'invalid_item_kind',
60
72
  'invalid_movement_type',
61
73
  'invalid_quantity',
62
74
  'invalid_serial',
@@ -98,6 +110,7 @@ exports.POS_ERROR_CODES = Object.freeze([
98
110
  'stocktake_not_open',
99
111
  'tip_payout_exceeds_claim',
100
112
  'too_many_counts',
113
+ 'too_many_deposit_types',
101
114
  'transfer_same_drawer',
102
115
  'unauthorized',
103
116
  'user_disabled',
@@ -0,0 +1,66 @@
1
+ import type { PosExternalVouchers } from './gutschein.js';
2
+ /**
3
+ * Artikel als fremder Gutschein (Fremdgutscheine an der Kasse, 1.31.0): der
4
+ * Chef legt einen Artikel als Kachel „fremder Gutschein“ an. Die Kasse fragt
5
+ * beim Antippen die Gutscheinnummer (und ohne Preis den Betrag) ab und sendet
6
+ * statt einer Position einen `vouchers[]`-Eintrag
7
+ * `{ source: 'external', action: 'sell', type: externalVoucher, number, amountCents, vatRateBp? }`.
8
+ *
9
+ * Die Regeln am Artikel rechnet das Backend (`functions-kasse/fremdgutschein-artikel-core.js`)
10
+ * beim Speichern (`createMyArticle`/`updateMyArticle`, Code `article_external_voucher_invalid`
11
+ * mit `data.grund`); der Artikel-Editor des Kundenbereichs prueft vorher gleich. Vertrag sind
12
+ * die Pruefaelle `fixtures/external-voucher-article-cases.json` (byte-gleich mit dem Backend).
13
+ */
14
+ /** Art des fremden Gutscheins am Artikel (`/v3` `externalVoucher`, gespeichert `fremdgutschein`). */
15
+ export type ArticleExternalVoucher = 'multi_purpose' | 'single_purpose';
16
+ export declare const ARTICLE_EXTERNAL_VOUCHER_TYPES: readonly ArticleExternalVoucher[];
17
+ /** Fehlercode beim Speichern eines Artikels, intern und unter `/v3` gleich. */
18
+ export declare const ARTICLE_EXTERNAL_VOUCHER_INVALID = "article_external_voucher_invalid";
19
+ /** Welche Regel verletzt ist (Antwortfeld `data.grund`), in der Reihenfolge, in der der Server prueft. */
20
+ export declare const EXTERNAL_VOUCHER_ARTICLE_REASONS: readonly ["invalid_type", "service_voucher", "add_ons", "stock_tracked", "reference", "asks_quantity", "rate_required", "invalid_rate", "price_required"];
21
+ export type ExternalVoucherArticleReason = typeof EXTERNAL_VOUCHER_ARTICLE_REASONS[number];
22
+ /**
23
+ * Ein Artikel im Editor (`/v3`-Form), soweit die Regeln ihn lesen. Bewusst
24
+ * `unknown` beim Wert: der Editor prueft auch, was nicht in den Typ passt.
25
+ */
26
+ export interface ExternalVoucherArticleInput {
27
+ externalVoucher?: unknown;
28
+ unitPriceCents?: number | null;
29
+ vatRate?: number | null;
30
+ askPrice?: boolean | null;
31
+ serviceVoucher?: boolean | null;
32
+ addOns?: readonly unknown[] | null;
33
+ stockTracked?: boolean | null;
34
+ reference?: unknown;
35
+ askQuantity?: boolean | null;
36
+ }
37
+ /**
38
+ * Saetze, mit denen ein Einzweckgutschein verkauft werden kann (Prozent wie
39
+ * `PosArticle.vatRate`; 0 = befreit verkauft): die Saetze der Kasse, Backend
40
+ * `article-groups-core.STEUERSAETZE`, dieselben wie [EXTERNAL_VOUCHER_VAT_RATES_BP] / 100.
41
+ */
42
+ export declare const ARTICLE_EXTERNAL_VOUCHER_VAT_RATES: readonly number[];
43
+ /** Ist der Wert eine Art fremder Gutschein? */
44
+ export declare function isArticleExternalVoucher(value: unknown): value is ArticleExternalVoucher;
45
+ /** Form des Werts beim Speichern: `null` heisst entfernen und ist gueltig. Zwilling von `pruefeWert`. */
46
+ export declare function checkExternalVoucherValue(value: unknown): ExternalVoucherArticleReason | null;
47
+ /**
48
+ * Regeln am wirksamen Artikelstand (Bestand + Aenderung), Zwilling von
49
+ * `pruefeArtikel`: `null` = passt. Ohne `externalVoucher` gilt keine Regel.
50
+ * Einzweck verlangt einen Satz der Kasse (0 = befreit verkauft), Mehrzweck ignoriert ihn;
51
+ * nie zusammen mit Leistungsgutschein, eigener Zusatzliste, Lagerbestand,
52
+ * Referenz oder Mengenabfrage (die Kasse fragt die Nummer selbst und bucht
53
+ * genau einen); ohne `askPrice` braucht er einen Preis ab 1 Cent.
54
+ */
55
+ export declare function checkExternalVoucherArticle(a: ExternalVoucherArticleInput): ExternalVoucherArticleReason | null;
56
+ /** Warum die Kachel eines fremden Gutscheins gesperrt ist. */
57
+ export type ExternalVoucherTileBlock = 'not_enabled' | 'type_not_enabled';
58
+ /**
59
+ * Darf die Kachel verkaufen? `null` = ja (auch fuer jeden Artikel ohne
60
+ * `externalVoucher`). Gesperrt bei Freigabe `off` (oder ohne Angabe) und bei
61
+ * Einzweck ohne `all` -- dieselbe Regel, mit der der Server den Beleg abweist
62
+ * (`external_voucher_not_enabled`, `external_voucher_type_not_enabled`).
63
+ */
64
+ export declare function externalVoucherTileBlock(article: {
65
+ externalVoucher?: ArticleExternalVoucher | null;
66
+ }, externalVouchers: PosExternalVouchers | null | undefined): ExternalVoucherTileBlock | null;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ARTICLE_EXTERNAL_VOUCHER_VAT_RATES = exports.EXTERNAL_VOUCHER_ARTICLE_REASONS = exports.ARTICLE_EXTERNAL_VOUCHER_INVALID = exports.ARTICLE_EXTERNAL_VOUCHER_TYPES = void 0;
4
+ exports.isArticleExternalVoucher = isArticleExternalVoucher;
5
+ exports.checkExternalVoucherValue = checkExternalVoucherValue;
6
+ exports.checkExternalVoucherArticle = checkExternalVoucherArticle;
7
+ exports.externalVoucherTileBlock = externalVoucherTileBlock;
8
+ exports.ARTICLE_EXTERNAL_VOUCHER_TYPES = Object.freeze(['multi_purpose', 'single_purpose']);
9
+ /** Fehlercode beim Speichern eines Artikels, intern und unter `/v3` gleich. */
10
+ exports.ARTICLE_EXTERNAL_VOUCHER_INVALID = 'article_external_voucher_invalid';
11
+ /** Welche Regel verletzt ist (Antwortfeld `data.grund`), in der Reihenfolge, in der der Server prueft. */
12
+ exports.EXTERNAL_VOUCHER_ARTICLE_REASONS = Object.freeze([
13
+ 'invalid_type', 'service_voucher', 'add_ons', 'stock_tracked', 'reference', 'asks_quantity', 'rate_required', 'invalid_rate', 'price_required',
14
+ ]);
15
+ /**
16
+ * Saetze, mit denen ein Einzweckgutschein verkauft werden kann (Prozent wie
17
+ * `PosArticle.vatRate`; 0 = befreit verkauft): die Saetze der Kasse, Backend
18
+ * `article-groups-core.STEUERSAETZE`, dieselben wie [EXTERNAL_VOUCHER_VAT_RATES_BP] / 100.
19
+ */
20
+ exports.ARTICLE_EXTERNAL_VOUCHER_VAT_RATES = Object.freeze([20, 13, 10, 4.9, 0, 19]);
21
+ /** Ist der Wert eine Art fremder Gutschein? */
22
+ function isArticleExternalVoucher(value) {
23
+ return exports.ARTICLE_EXTERNAL_VOUCHER_TYPES.includes(value);
24
+ }
25
+ /** Form des Werts beim Speichern: `null` heisst entfernen und ist gueltig. Zwilling von `pruefeWert`. */
26
+ function checkExternalVoucherValue(value) {
27
+ return value === null || isArticleExternalVoucher(value) ? null : 'invalid_type';
28
+ }
29
+ /**
30
+ * Regeln am wirksamen Artikelstand (Bestand + Aenderung), Zwilling von
31
+ * `pruefeArtikel`: `null` = passt. Ohne `externalVoucher` gilt keine Regel.
32
+ * Einzweck verlangt einen Satz der Kasse (0 = befreit verkauft), Mehrzweck ignoriert ihn;
33
+ * nie zusammen mit Leistungsgutschein, eigener Zusatzliste, Lagerbestand,
34
+ * Referenz oder Mengenabfrage (die Kasse fragt die Nummer selbst und bucht
35
+ * genau einen); ohne `askPrice` braucht er einen Preis ab 1 Cent.
36
+ */
37
+ function checkExternalVoucherArticle(a) {
38
+ if (a.externalVoucher == null)
39
+ return null;
40
+ if (!isArticleExternalVoucher(a.externalVoucher))
41
+ return 'invalid_type';
42
+ if (a.serviceVoucher === true)
43
+ return 'service_voucher';
44
+ if (Array.isArray(a.addOns) && a.addOns.length > 0)
45
+ return 'add_ons';
46
+ if (a.stockTracked === true)
47
+ return 'stock_tracked';
48
+ if (a.reference)
49
+ return 'reference';
50
+ if (a.askQuantity === true)
51
+ return 'asks_quantity';
52
+ if (a.externalVoucher === 'single_purpose' && !(typeof a.vatRate === 'number' && Number.isFinite(a.vatRate)))
53
+ return 'rate_required';
54
+ if (a.externalVoucher === 'single_purpose' && !exports.ARTICLE_EXTERNAL_VOUCHER_VAT_RATES.includes(a.vatRate))
55
+ return 'invalid_rate';
56
+ if (a.askPrice !== true && !(typeof a.unitPriceCents === 'number' && Number.isInteger(a.unitPriceCents) && a.unitPriceCents >= 1))
57
+ return 'price_required';
58
+ return null;
59
+ }
60
+ /**
61
+ * Darf die Kachel verkaufen? `null` = ja (auch fuer jeden Artikel ohne
62
+ * `externalVoucher`). Gesperrt bei Freigabe `off` (oder ohne Angabe) und bei
63
+ * Einzweck ohne `all` -- dieselbe Regel, mit der der Server den Beleg abweist
64
+ * (`external_voucher_not_enabled`, `external_voucher_type_not_enabled`).
65
+ */
66
+ function externalVoucherTileBlock(article, externalVouchers) {
67
+ if (article.externalVoucher == null)
68
+ return null;
69
+ if (externalVouchers !== 'multi_purpose' && externalVouchers !== 'all')
70
+ return 'not_enabled';
71
+ if (article.externalVoucher === 'single_purpose' && externalVouchers !== 'all')
72
+ return 'type_not_enabled';
73
+ return null;
74
+ }
@@ -6,28 +6,33 @@
6
6
  * die Backend-Functions (die Rewrites-Waechter der Web-App leiten daraus ab)
7
7
  * und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
8
8
  */
9
- export { type PosTheme, type PosFontSize, type PosWatermark, type PosQuantity, type PosTipMode, type PosCheckoutMode, type PosCardProvider, type PosReceiptOutput, type PosShortcutAction, type PosShortcutMap, POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, type PosLayout, type PosCategoryPosition, type PosTileHeight, type PosPrinterType, type PosTerminalVia, type PosTerminalType, type PosPaperSize, type PosCodePage, type PosCut, type PosDrawerAutoOpen, type PosQrMode, type PosLogoSize, type PosSettingsFontSize, type PosTileStyle, type PosAutoLogoutMinutes, type PosDiscount, type PosWatermarkSide, type PosWatermarkStrength, type PosLogoScale, type PosWatermarkScale, type PosDoneScreenSeconds, type PosToggleMap, type PosBusinessSettings, type PosDeviceSettings, type PosSettings, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, type PosOpen, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict, THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, CART_WIDTH, type PosTipKind, type PosCartWidth, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
9
+ export { type PosTheme, type PosFontSize, type PosWatermark, type PosQuantity, type PosTipMode, type PosCheckoutMode, type PosCardProvider, type PosReceiptOutput, type PosShortcutAction, type PosShortcutMap, POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, type PosLayout, type PosCategoryPosition, type PosTileHeight, type PosPrinterType, type PosTerminalVia, type PosTerminalType, type PosPaperSize, type PosCodePage, type PosCut, type PosDrawerAutoOpen, type PosQrMode, type PosLogoSize, type PosSettingsFontSize, type PosTileStyle, type PosAutoLogoutMinutes, type PosDiscount, type PosWatermarkSide, type PosWatermarkStrength, type PosLogoScale, type PosWatermarkScale, type PosDoneScreenSeconds, type PosToggleMap, type PosBusinessSettings, type PosDeviceSettings, type PosSettings, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posCustomDiscountAllowed, posTipKeptMode, tipKeptFor, type TipKeptDecision, DISCOUNT_PRESET_KIND, type PosDiscountPreset, type PosDiscountPresetKind, POS_BUSINESS_OPTIONAL_LISTS, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, type PosOpen, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict, THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, TIP_KEPT_MODE, type PosTipKeptMode, CART_WIDTH, type PosTipKind, type PosCartWidth, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
10
10
  export { type ArticleGroup, type ArticleGroupPayload, fromArticleGroupPayload, type PosArticle, type PosArticlePayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, QUANTITY_RULES, type QuantityRule, type QuantityDefaults, quantityRuleForUnit, quantityDefaults, allowedQuantity, isBookableArticle, tilePrompts, } from './artikel.js';
11
11
  export { REFERENCE_MODES, type ReferenceMode, type PosReference, REFERENCE_INPUT_MAX, REFERENCE_LABEL_MAX, REFERENCE_HINT_MAX, REFERENCE_PATTERN_MAX, REFERENCE_PATTERN_TEMPLATES, cleanReferenceText, isValidReferencePattern, isDigitsOnlyPattern, type ReferenceCheckResult, checkReference, referenceLineName, fromReferencePayload, } from './kachel-referenz.js';
12
12
  export { ADD_ONS_MAX, ADD_ON_BLOCK_REASONS, type AddOnBlockReason, isSelectableAddOn, addOnsFor, addOnReferencesValid, addOnsOfItem, addOnRemap, addOnDisplayOrder, orderAddOnLines, } from './zusaetze.js';
13
+ export { DEPOSIT_KINDS, type DepositKind, DEPOSIT_TYPES, type DepositContainerType, DEPOSIT_RETURN_MODES, type DepositReturnMode, DEPOSIT_ON_PREMISES_DEFAULTS, type DepositOnPremisesDefault, type DepositAmount, type DepositType, type DepositSettings, type DepositEntry, type DepositSharedReturnPoint, type CashRegisterDeposit, posDepositSettingsFromWire, depositEntriesFromWire, cashRegisterDepositFromWire, depositsFor, depositAmountOn, viennaDay, withDepositLines, depositReturnLine, type DepositPreviewItem, type DepositPreviewLine, type DepositPreviewInput, type DepositPreviewArticle, type DepositPreviewResult, type DepositPreviewErrorCode, } from './pfand.js';
14
+ export { ARTICLE_EXTERNAL_VOUCHER_TYPES, type ArticleExternalVoucher, ARTICLE_EXTERNAL_VOUCHER_INVALID, ARTICLE_EXTERNAL_VOUCHER_VAT_RATES, EXTERNAL_VOUCHER_ARTICLE_REASONS, type ExternalVoucherArticleReason, type ExternalVoucherArticleInput, isArticleExternalVoucher, checkExternalVoucherValue, checkExternalVoucherArticle, type ExternalVoucherTileBlock, externalVoucherTileBlock, } from './fremdgutschein-artikel.js';
15
+ export { ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape } from '../models/voucher.js';
13
16
  export { getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, setMyPosLogo, posSettingsFromWire, type SetMyPosLogoOptions, } from './client.js';
14
17
  export { POS_ERROR_CODES, type PosErrorCode, isPosErrorCode, posErrorCode, isPosError, type PosFieldError, posFieldErrors, } from './errors.js';
15
18
  export { distributeDiscount } from '../receipt/discount.js';
16
- export { cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, type VoucherPerms, type RegisterScope, type RegisterUserPerms } from '../register/pairing.js';
19
+ export { cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, depositReturnOf, type VoucherPerms, type RegisterScope, type RegisterUserPerms } from '../register/pairing.js';
17
20
  export { type NetworkPrinter, type PrintJob, type PrintJobStatus, PRINT_JOB_STATUSES, type PrintJobSource, PRINT_JOB_SOURCES, isPrintJobFinished, type CreatePrintJobOptions, listMyPrinters, createPrintJob, getPrintJob, } from './drucker.js';
18
21
  export { listMyTipRecipients } from './trinkgeld.js';
22
+ export { posDiscountPresets, discountPresetChipText, discountChipsFromPresets, checkDiscountPresets, discountBlockLines, INVALID_DISCOUNT_PRESET, DISCOUNT_PRESETS_MAX, DISCOUNT_PRESET_NAME_MAX, DISCOUNT_PRESET_PERCENT_BP, DISCOUNT_PRESET_AMOUNT_CENTS, DISCOUNT_PRESET_MESSAGES, type DiscountPresetReason, type DiscountPresetError, type DiscountPresetsCheck, type DiscountBlockLine, type DiscountTotal, } from './rabatt-vorlagen.js';
19
23
  export { depFolderName } from './dep.js';
20
24
  export { type RegisterInspectionInfo, type RegisterInspectionSignature, type InspectionSignatureStatus, type InspectionInfoRow, type InspectionInfoRowKey, type InspectionInfoSection, type InspectionInfoLinesOptions, getRegisterInspectionInfo, inspectionInfoRows, inspectionInfoLines, } from './kasseninfo.js';
21
25
  export { type ConnectStateReport, reportConnectState } from './connect-bestand.js';
26
+ export { type ReturnCode, type ReturnCodeEntry, type ReturnCodeMatch, type ReturnCodeArticle, type ReturnCodeGroup, type ReturnCodeInput, learnReturnCode, listReturnCodes, matchReturnCode, } from './leergut.js';
22
27
  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';
23
28
  export { type ListMyStocktakesOptions, type ListMyStocktakeItemsOptions, type ListMyStocktakeCountsOptions, type RecordMyStocktakeCountOptions, type VoidMyStocktakeCountOptions, listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMyStocktakeCount, voidMyStocktakeCount, parseQuantityMilli, } from './inventur.js';
24
29
  export type { Stocktake, StocktakeItem, StocktakeCount, StocktakeCountResult, StocktakeItemPage, StocktakeCountPage, StocktakeActor, StocktakeProgress, StocktakeReview, StocktakeRecount, StocktakeScope, } from '../inventory/typen.js';
25
30
  export type { StocktakeStatus } from '../inventory/vertrag.js';
26
31
  export { VOUCHER_KINDS, VOUCHER_STATUSES, checkVoucher, reprintVoucherLabel, VOUCHER_SETTINGS_DEFAULTS, posVoucherSettingsFromWire, VOUCHER_PAYOUTS, VOUCHER_TYPE_KINDS, VOUCHER_AMOUNT_MODES, VOUCHER_TYPE_VALIDITY_PATTERNS, EXTERNAL_VOUCHERS, type PosExternalVouchers, type VoucherKind, type VoucherStatus, type VoucherValidity, type VoucherArticle, type VoucherCheck, type PosVoucherSettings, type PosVoucherReturnType, type VoucherPayout, type VoucherTypeKind, type PosVoucherType, type VoucherLabelTemplate, } from './gutschein.js';
27
32
  export { type GetMyDrawerStateOptions, type OpenMyShiftOptions, type RecordMyCashMovementOptions, type DrawerOpeningEntry, type LogMyDrawerOpeningsOptions, type GetMyShiftReportOptions, type TipPayout, type CloseMyShiftOptions, type AfterCountOption, type RecordMyShiftCountOptions, getMyDrawerState, openMyShift, recordMyCashMovement, logMyDrawerOpenings, getMyShiftReport, closeMyShift, recordMyShiftCount, sumDenominations, parseCentsAllowZero, newIdempotencyKey, shiftTipLines, durationText, type ShiftTipLine, type ShiftTipLineKey, } from './schicht.js';
28
- 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, EXPECTED_PART_KEYS, DIFFERENCE_PART_TYPES, type ExpectedPartKey, type ShiftExpectedPart, type DifferencePartType, type ShiftDifferencePart, type LastShift, type ShiftCountResult, 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 ShiftOwnerTip, 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';
33
+ 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, EXPECTED_PART_KEYS, DIFFERENCE_PART_TYPES, type ExpectedPartKey, type ShiftExpectedPart, type DifferencePartType, type ShiftDifferencePart, type LastShift, type ShiftCountResult, 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 ShiftOwnerTip, type ShiftDiscount, 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';
29
34
  export { type ShiftReceiptLayoutOptions, shiftReceiptLayout, cashMovementLayout } from '../receipt/shift-sheet.js';
30
35
  export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputKind, type ReceiptOutputResult } from '../models/receipt-output.js';
31
36
  export { RETURN_DISPOSITIONS, isReturnDisposition, type ReturnDisposition } from '../models/cancellation.js';
32
- 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, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
37
+ 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, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, DEPOSIT_ERROR_MESSAGES, depositErrorMessage, EXTERNAL_VOUCHER_TILE_MESSAGES, EXTERNAL_VOUCHER_ARTICLE_MESSAGES, externalVoucherArticleErrorMessage, EXTERNAL_VOUCHERS_LABELS, EXTERNAL_VOUCHER_KIND_LABELS, TIP_KEPT_MODE_LABELS, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
33
38
  export { roundUpSuggestions } from './aufrunden.js';