@kreiseck/kasseneck-api 1.7.1 → 1.10.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 +113 -0
- package/README.md +170 -1
- package/dist/cjs/client/api.d.ts +5 -3
- package/dist/cjs/client/api.js +1 -0
- package/dist/cjs/client/aufrufe.d.ts +9 -7
- package/dist/cjs/client/aufrufe.js +60 -2
- package/dist/cjs/client/errors.js +3 -0
- package/dist/cjs/client/index.d.ts +2 -2
- package/dist/cjs/client/index.js +3 -1
- package/dist/cjs/client/reports.d.ts +26 -0
- package/dist/cjs/client/reports.js +47 -0
- package/dist/cjs/client/transport.d.ts +27 -3
- package/dist/cjs/client/transport.js +29 -3
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/inventory/api.d.ts +21 -2
- package/dist/cjs/inventory/api.js +22 -3
- package/dist/cjs/inventory/fehler.d.ts +6 -0
- package/dist/cjs/inventory/fehler.js +12 -0
- package/dist/cjs/inventory/index.d.ts +6 -4
- package/dist/cjs/inventory/index.js +33 -3
- package/dist/cjs/inventory/inventur.d.ts +104 -0
- package/dist/cjs/inventory/inventur.js +245 -0
- package/dist/cjs/inventory/lesen.d.ts +20 -1
- package/dist/cjs/inventory/lesen.js +307 -0
- package/dist/cjs/inventory/typen.d.ts +410 -1
- package/dist/cjs/inventory/vertrag.d.ts +94 -8
- package/dist/cjs/inventory/vertrag.js +118 -5
- package/dist/cjs/invoice/index.d.ts +1 -1
- package/dist/cjs/invoice/typen.d.ts +12 -0
- package/dist/cjs/invoice/vertrag.d.ts +1 -1
- package/dist/cjs/invoice/vertrag.js +3 -0
- package/dist/cjs/models/cancellation.d.ts +1 -1
- package/dist/cjs/models/cancellation.js +3 -0
- package/dist/cjs/models/payment-errors.d.ts +1 -1
- package/dist/cjs/models/payment-errors.js +3 -0
- package/dist/cjs/models/receipt-email.d.ts +1 -1
- package/dist/cjs/models/receipt-email.js +3 -0
- package/dist/cjs/models/receipt-errors.d.ts +1 -1
- package/dist/cjs/models/receipt-errors.js +3 -0
- package/dist/cjs/pos/errors.d.ts +4 -3
- package/dist/cjs/pos/errors.js +24 -2
- package/dist/cjs/pos/index.d.ts +4 -1
- package/dist/cjs/pos/index.js +9 -2
- package/dist/cjs/pos/inventur.d.ts +104 -0
- package/dist/cjs/pos/inventur.js +117 -0
- package/dist/cjs/pos/texte.d.ts +82 -0
- package/dist/cjs/pos/texte.js +35 -0
- package/dist/cjs/register/errors.d.ts +1 -1
- package/dist/cjs/register/errors.js +3 -0
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/api.d.ts +5 -3
- package/dist/esm/client/api.js +2 -1
- package/dist/esm/client/aufrufe.d.ts +9 -7
- package/dist/esm/client/aufrufe.js +60 -2
- package/dist/esm/client/errors.js +3 -0
- package/dist/esm/client/index.d.ts +2 -2
- package/dist/esm/client/index.js +2 -2
- package/dist/esm/client/reports.d.ts +26 -0
- package/dist/esm/client/reports.js +46 -0
- package/dist/esm/client/transport.d.ts +27 -3
- package/dist/esm/client/transport.js +28 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/inventory/api.d.ts +21 -2
- package/dist/esm/inventory/api.js +23 -4
- package/dist/esm/inventory/fehler.d.ts +6 -0
- package/dist/esm/inventory/fehler.js +11 -0
- package/dist/esm/inventory/index.d.ts +6 -4
- package/dist/esm/inventory/index.js +5 -3
- package/dist/esm/inventory/inventur.d.ts +104 -0
- package/dist/esm/inventory/inventur.js +226 -0
- package/dist/esm/inventory/lesen.d.ts +20 -1
- package/dist/esm/inventory/lesen.js +301 -0
- package/dist/esm/inventory/typen.d.ts +410 -1
- package/dist/esm/inventory/vertrag.d.ts +94 -8
- package/dist/esm/inventory/vertrag.js +117 -4
- package/dist/esm/invoice/index.d.ts +1 -1
- package/dist/esm/invoice/typen.d.ts +12 -0
- package/dist/esm/invoice/vertrag.d.ts +1 -1
- package/dist/esm/invoice/vertrag.js +3 -0
- package/dist/esm/models/cancellation.d.ts +1 -1
- package/dist/esm/models/cancellation.js +3 -0
- package/dist/esm/models/payment-errors.d.ts +1 -1
- package/dist/esm/models/payment-errors.js +3 -0
- package/dist/esm/models/receipt-email.d.ts +1 -1
- package/dist/esm/models/receipt-email.js +3 -0
- package/dist/esm/models/receipt-errors.d.ts +1 -1
- package/dist/esm/models/receipt-errors.js +3 -0
- package/dist/esm/pos/errors.d.ts +4 -3
- package/dist/esm/pos/errors.js +24 -2
- package/dist/esm/pos/index.d.ts +4 -1
- package/dist/esm/pos/index.js +2 -1
- package/dist/esm/pos/inventur.d.ts +104 -0
- package/dist/esm/pos/inventur.js +109 -0
- package/dist/esm/pos/texte.d.ts +82 -0
- package/dist/esm/pos/texte.js +35 -0
- package/dist/esm/register/errors.d.ts +1 -1
- package/dist/esm/register/errors.js +3 -0
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- 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/pos-texts.json +94 -1
- package/fixtures/stocktake-quantity-cases.json +55 -0
- package/fixtures/surface.json +157 -8
- package/fixtures/v3/antworten/belege.json +1 -1
- package/fixtures/v3/antworten/belegmail.json +1 -1
- package/fixtures/v3/antworten/kasse-belege.json +1 -1
- package/fixtures/v3/antworten/kasse.json +2958 -3
- package/fixtures/v3/antworten/lager.json +1727 -3
- package/fixtures/v3/antworten/rechnungen.json +14 -6
- package/fixtures/v3/antworten/storno.json +1 -1
- package/fixtures/v3/stored/belege.json +1 -1
- package/fixtures/v3/stored/kasse.json +414 -3
- package/fixtures/v3/stored/rechnungen.json +1 -1
- package/fixtures/v3/v3-vokabular.json +530 -8
- package/fixtures/v3/zahlbetrag-faelle.json +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Der Vertrag der Lager-API (Backend Stufe 5a lesen, 5b schreiben und
|
|
3
|
-
* reservieren, 5c Varianten) als Daten:
|
|
4
|
-
* Hinweiscodes, englisch wie
|
|
3
|
+
* reservieren, 5c Varianten, Lager-Kern Stufe 3 Inventur) als Daten:
|
|
4
|
+
* Endpunkte, Wertkataloge, Ereignisse, Fehler- und Hinweiscodes, englisch wie
|
|
5
|
+
* am Draht `/v3`.
|
|
5
6
|
*
|
|
6
7
|
* Quelle ist der Vertrags-Export des Backends (`fixtures/v3/v3-vokabular.json`):
|
|
7
8
|
* `endpoints.public`, die Kataloge `STANDORT_TYP`, `BEWEGUNG_ART`,
|
|
8
9
|
* `BEWEGUNG_QUELLE`, `LAGER_ZUSTAND`, `LAGER_URSACHE`, `ZUSTELLUNG`,
|
|
9
10
|
* `LAGER_ABGANG_GRUND`, `LAGER_ENTNAHME_ART`, `LAGER_NEBENKOSTEN_ART`,
|
|
10
|
-
* `LAGER_VERTEILUNG`, `RESERVIERUNG_STATUS`,
|
|
11
|
+
* `LAGER_VERTEILUNG`, `RESERVIERUNG_STATUS`, die Inventur-Kataloge `INVENTUR_*`,
|
|
12
|
+
* dazu `events`, `errorCodes.inventory`
|
|
11
13
|
* und `warningCodes.inventory`. `test/inventory.test.ts` haelt jede Liste
|
|
12
14
|
* deckungsgleich mit dieser Datei; nichts hier wird geraten.
|
|
13
15
|
*/
|
|
14
|
-
/** Die
|
|
16
|
+
/** Die 44 Endpunkte (14 aus 5a, 13 aus 5b, 5 aus 5c, 12 der Inventur), in der Reihenfolge von `endpoints.public`. */
|
|
15
17
|
export const INVENTORY_ENDPOINTS = [
|
|
16
18
|
'getArticle',
|
|
17
19
|
'listArticles',
|
|
@@ -45,6 +47,18 @@ export const INVENTORY_ENDPOINTS = [
|
|
|
45
47
|
'getVariantGroup',
|
|
46
48
|
'listVariantGroups',
|
|
47
49
|
'addVariant',
|
|
50
|
+
'createStocktake',
|
|
51
|
+
'listStocktakes',
|
|
52
|
+
'getStocktake',
|
|
53
|
+
'listStocktakeItems',
|
|
54
|
+
'recordStocktakeCount',
|
|
55
|
+
'voidStocktakeCount',
|
|
56
|
+
'listStocktakeCounts',
|
|
57
|
+
'reviewStocktake',
|
|
58
|
+
'recountStocktake',
|
|
59
|
+
'closeStocktake',
|
|
60
|
+
'cancelStocktake',
|
|
61
|
+
'getStocktakePdf',
|
|
48
62
|
];
|
|
49
63
|
/** Art eines Standorts (Katalog `STANDORT_TYP`). */
|
|
50
64
|
export const LOCATION_TYPES = ['warehouse', 'store', 'vehicle', 'other'];
|
|
@@ -174,6 +188,22 @@ export const INVENTORY_LIST_LIMIT_MAX = 200;
|
|
|
174
188
|
* `too_many_positions` traegt bei Varianten `field` (`variants`,
|
|
175
189
|
* `createMatrix` bzw. `externalIds` bei `addVariant`): die Anfrage braeuchte
|
|
176
190
|
* mehr Schreibvorgaenge, als in einen Vorgang passen; geschrieben wurde nichts.
|
|
191
|
+
*
|
|
192
|
+
* Seit 1.8.0 dahinter die Codes der Inventur: `stocktake_not_found`,
|
|
193
|
+
* `stocktake_not_open` (Zaehlen oder Stornieren ausserhalb der Zaehlung bzw.
|
|
194
|
+
* an einer Position, die nicht zum Nachzaehlen frei ist), `stocktake_closed`
|
|
195
|
+
* (abgeschlossen oder abgebrochen: nichts mehr schreibbar),
|
|
196
|
+
* `stocktake_not_in_review` (Nachzaehlen und Abschluss nur in `review`),
|
|
197
|
+
* `stocktake_closing` (der Abschluss bucht gerade), `stocktake_location_busy`
|
|
198
|
+
* (am Standort laeuft schon eine Inventur; `data.stocktakeId` nennt sie),
|
|
199
|
+
* `stocktake_review_running` (die Pruefung rechnet noch), `stocktake_recount_open`
|
|
200
|
+
* (Abschluss, solange Positionen zum Nachzaehlen offen sind: erst nachzaehlen,
|
|
201
|
+
* dann erneut pruefen), `article_not_in_scope`, `article_not_tracked`,
|
|
202
|
+
* `count_not_found`, `count_already_voided`, `serial_already_counted` (dieselbe
|
|
203
|
+
* Seriennummer zweimal in einer Runde), `too_many_counts` (mehr als
|
|
204
|
+
* [STOCKTAKE_COUNTS_PER_ITEM_MAX] Zaehlungen je Position und Runde) und
|
|
205
|
+
* `stocktake_not_closed` (das Protokoll gibt es erst nach dem Abschluss, auch
|
|
206
|
+
* nicht fuer eine abgebrochene Inventur).
|
|
177
207
|
*/
|
|
178
208
|
export const INVENTORY_ERROR_CODES = [
|
|
179
209
|
'validation',
|
|
@@ -242,6 +272,21 @@ export const INVENTORY_ERROR_CODES = [
|
|
|
242
272
|
'invalid_variant_attributes',
|
|
243
273
|
'variant_group_inactive',
|
|
244
274
|
'variant_limit',
|
|
275
|
+
'stocktake_not_found',
|
|
276
|
+
'stocktake_not_open',
|
|
277
|
+
'stocktake_closed',
|
|
278
|
+
'stocktake_not_in_review',
|
|
279
|
+
'stocktake_closing',
|
|
280
|
+
'stocktake_location_busy',
|
|
281
|
+
'stocktake_review_running',
|
|
282
|
+
'stocktake_recount_open',
|
|
283
|
+
'article_not_in_scope',
|
|
284
|
+
'article_not_tracked',
|
|
285
|
+
'count_not_found',
|
|
286
|
+
'count_already_voided',
|
|
287
|
+
'serial_already_counted',
|
|
288
|
+
'too_many_counts',
|
|
289
|
+
'stocktake_not_closed',
|
|
245
290
|
];
|
|
246
291
|
/**
|
|
247
292
|
* Codes, die Anmeldung und Rand auf jedem Lager-Aufruf erzeugen koennen,
|
|
@@ -254,6 +299,8 @@ export const INVENTORY_REQUEST_ERROR_CODES = [
|
|
|
254
299
|
'account_not_found',
|
|
255
300
|
'admin_required',
|
|
256
301
|
'api_not_approved',
|
|
302
|
+
'app_check_invalid',
|
|
303
|
+
'app_check_missing',
|
|
257
304
|
'cashregister_not_assigned',
|
|
258
305
|
'cashregister_not_found',
|
|
259
306
|
'cashregister_token_invalid',
|
|
@@ -264,6 +311,7 @@ export const INVENTORY_REQUEST_ERROR_CODES = [
|
|
|
264
311
|
'method_not_allowed',
|
|
265
312
|
'mfa_required',
|
|
266
313
|
'not_found',
|
|
314
|
+
'password_change_required',
|
|
267
315
|
'register_user_no_business',
|
|
268
316
|
'register_user_not_allowed',
|
|
269
317
|
'register_user_not_found',
|
|
@@ -283,12 +331,24 @@ export const INVENTORY_REQUEST_ERROR_CODES = [
|
|
|
283
331
|
* `below_minimum` misst am verfuegbaren Bestand (`onHand − reserved`) gegen den
|
|
284
332
|
* Mindestbestand des Standorts, `reservation_exceeded` meldet eine Rechnung, die
|
|
285
333
|
* mehr verkauft als reserviert war.
|
|
334
|
+
*
|
|
335
|
+
* Seit 1.8.0 die Hinweise der Inventur, je mit der Zahl der Positionen
|
|
336
|
+
* (`items`): `defect_capped` (eine Fehlmenge im Zustand `defective` reichte
|
|
337
|
+
* ueber den Defektbestand, der Rest blieb ungebucht), `uncounted_items` (nicht
|
|
338
|
+
* gezaehlt und darum nicht gebucht), `not_booked` (nicht oder nicht ganz
|
|
339
|
+
* gebucht, Grund an der Position, `notBooked`) und `recount_uncounted`
|
|
340
|
+
* (Positionen zum Nachzaehlen blieben ungezaehlt; die Antwort von
|
|
341
|
+
* `closeStocktake` traegt ihn).
|
|
286
342
|
*/
|
|
287
343
|
export const INVENTORY_WARNING_CODES = [
|
|
288
344
|
'insufficient_stock',
|
|
289
345
|
'below_minimum',
|
|
290
346
|
'return_exceeds_sale',
|
|
291
347
|
'reservation_exceeded',
|
|
348
|
+
'defect_capped',
|
|
349
|
+
'uncounted_items',
|
|
350
|
+
'not_booked',
|
|
351
|
+
'recount_uncounted',
|
|
292
352
|
];
|
|
293
353
|
/**
|
|
294
354
|
* Bestandsart eines Artikels (`stockKind`): `quantity` = Menge, `serial` =
|
|
@@ -334,3 +394,56 @@ export const VARIANT_ATTRIBUTES_MAX = 3;
|
|
|
334
394
|
export const VARIANT_VALUES_MAX = 30;
|
|
335
395
|
export const VARIANT_MATRIX_MAX = 100;
|
|
336
396
|
export const VARIANT_GROUP_ACTIVE_MAX = 250;
|
|
397
|
+
// ---- Inventur (Lager-Kern Stufe 3, seit 1.8.0) ----------------------------------
|
|
398
|
+
/**
|
|
399
|
+
* Stand einer Inventur (Katalog `INVENTUR_STATUS`). Gezaehlt wird in
|
|
400
|
+
* `counting`; `review` rechnet Soll und Differenz (erst ab hier sichtbar,
|
|
401
|
+
* blind); `closing` bucht den Abschluss in Teilen; `closed` und `cancelled`
|
|
402
|
+
* sind endgueltig. `creating` steht nur, solange eine grosse Anlage ihre
|
|
403
|
+
* Positionen schreibt.
|
|
404
|
+
*/
|
|
405
|
+
export const STOCKTAKE_STATUSES = ['creating', 'counting', 'review', 'closing', 'closed', 'cancelled'];
|
|
406
|
+
/**
|
|
407
|
+
* Art einer Inventur (Katalog `INVENTUR_ART`): `key_date` zu einem Stichtag
|
|
408
|
+
* (`keyDate`), `perpetual` (permanente Inventur, ohne Stichtag).
|
|
409
|
+
*/
|
|
410
|
+
export const STOCKTAKE_TYPES = ['key_date', 'perpetual'];
|
|
411
|
+
/** Umfang einer Inventur (Katalog `INVENTUR_UMFANG`): alle bestandsgefuehrten Artikel des Standorts, Artikelgruppen oder genannte Artikel. */
|
|
412
|
+
export const STOCKTAKE_SCOPE_TYPES = ['all', 'groups', 'articles'];
|
|
413
|
+
/**
|
|
414
|
+
* Warum eine Position in der Pruefung „pruefen“ traegt (Katalog
|
|
415
|
+
* `INVENTUR_PRUEFGRUND`): Bewegung zwischen der ersten und letzten Zaehlung,
|
|
416
|
+
* Zaehlung mehr als 10 Tage vom Stichtag, Seriennummern weichen ab, nicht gezaehlt.
|
|
417
|
+
*/
|
|
418
|
+
export const STOCKTAKE_CHECK_REASONS = ['movements_between_counts', 'far_from_key_date', 'serial_mismatch', 'not_counted'];
|
|
419
|
+
/**
|
|
420
|
+
* Warum eine Position nicht oder nicht ganz gebucht wurde (`notBooked.code`,
|
|
421
|
+
* Katalog `INVENTUR_NICHT_GEBUCHT`). Dazu kommen Codes, die schon englisch
|
|
422
|
+
* sind (`serial_not_in_stock`, `serial_already_exists`, `article_not_found`);
|
|
423
|
+
* das Modell laesst darum jeden Text stehen.
|
|
424
|
+
*/
|
|
425
|
+
export const STOCKTAKE_NOT_BOOKED_REASONS = ['serial_mismatch', 'recount_open', 'defect_capped'];
|
|
426
|
+
/** Woher eine Zaehlung bzw. Inventur kam (Katalog `INVENTUR_QUELLE`). */
|
|
427
|
+
export const STOCKTAKE_SOURCES = ['register', 'panel', 'api'];
|
|
428
|
+
/** Wer handelte (Katalog `INVENTUR_AKTEUR`): Inhaber, Kasseneck-Admin, Kassen-Benutzer, API-Schluessel. */
|
|
429
|
+
export const STOCKTAKE_ACTOR_TYPES = ['owner', 'admin', 'register_user', 'api'];
|
|
430
|
+
/**
|
|
431
|
+
* Zu welchem Zeitpunkt das Inventar im Protokoll steht (Katalog
|
|
432
|
+
* `INVENTUR_INVENTAR_ZUM`): `key_date` (auf das Ende des Stichtags
|
|
433
|
+
* fortgeschrieben, Abschluss nach dem Stichtag) oder `count_date` (Menge zur
|
|
434
|
+
* Aufnahme: permanente Inventur oder Abschluss vor dem Stichtag).
|
|
435
|
+
*/
|
|
436
|
+
export const STOCKTAKE_INVENTORY_AS_OF = ['key_date', 'count_date'];
|
|
437
|
+
/**
|
|
438
|
+
* Grenzen einer Inventur, wie das Backend sie prueft. Wie bei den Varianten
|
|
439
|
+
* prueft das Paket sie **nicht** vor dem Senden:
|
|
440
|
+
*
|
|
441
|
+
* - [STOCKTAKE_ITEMS_MAX] Positionen je Inventur (`too_many_positions`;
|
|
442
|
+
* groessere Bestaende in mehreren Inventuren nacheinander),
|
|
443
|
+
* - [STOCKTAKE_RECOUNT_ITEMS_MAX] Positionen je `recountStocktake`,
|
|
444
|
+
* - [STOCKTAKE_COUNTS_PER_ITEM_MAX] Zaehlungen je Position und Runde
|
|
445
|
+
* (`too_many_counts`), hoechstens so viele Seriennummern je Zaehlung.
|
|
446
|
+
*/
|
|
447
|
+
export const STOCKTAKE_ITEMS_MAX = 5000;
|
|
448
|
+
export const STOCKTAKE_RECOUNT_ITEMS_MAX = 200;
|
|
449
|
+
export const STOCKTAKE_COUNTS_PER_ITEM_MAX = 200;
|
|
@@ -14,7 +14,7 @@ export { createInvoiceApi, type InvoiceApi, type InvoiceApiOptions } from './api
|
|
|
14
14
|
export { invoiceKeyAuth, type InvoiceKeyAuthOptions } from './auth.js';
|
|
15
15
|
export { isInvoiceError, isInvoiceErrorCode, invoiceErrorCode, invoiceFieldErrors, type InvoiceApiErrorCode, type InvoiceFieldError, } from './fehler.js';
|
|
16
16
|
export { cancelInvoice, createCreditNote, createCustomer, getCustomer, getInvoice, getInvoicePdf, getInvoiceSetupStatus, getInvoiceXml, issueInvoice, listBrands, listInvoices, previewInvoice, recordInvoicePayment, searchCustomers, updateCustomer, } from './endpunkte.js';
|
|
17
|
-
export type { Brand, CancelInvoiceRequest, CancelResult, CreditNoteItemInput, CreditNoteRequest, CreditNoteResult, Customer, CustomerInput, CustomerPage, CustomerSearch, EInvoiceStatus, Invoice, InvoiceDetail, InvoiceDetailPayment, InvoiceItem, InvoiceItemInput, IssueInvoiceItemInput, InvoiceListQuery, InvoicePage, InvoiceRecipient, InvoiceSetupGap, InvoiceSetupStatus, InvoiceTotals, InvoiceXml, InvoiceNotice, InvoicePayment, InvoicePreview, InvoiceRateTotals, InvoiceVatIdProof, InvoiceVatIdRisk, IssueInvoiceRequest, IssueResult, PaymentInput, PreviewResult, RecordPaymentRequest, RecordPaymentResult, } from './typen.js';
|
|
17
|
+
export type { Brand, CancelInvoiceRequest, CancelResult, CreditNoteItemInput, CreditNoteRequest, CreditNoteResult, Customer, CustomerInput, CustomerPage, CustomerSearch, EInvoiceStatus, Invoice, InvoiceDetail, InvoiceDetailPayment, InvoiceItem, InvoiceItemInput, IssueInvoiceItemInput, InvoiceListQuery, InvoicePage, InvoiceRecipient, InvoiceSetupGap, InvoiceSetupStatus, InvoiceTotals, InvoiceXml, InvoiceNotice, InvoicePayment, InvoicePreview, InvoiceRateTotals, InvoiceVatIdProof, InvoiceSupplyDateProof, InvoiceVatIdRisk, IssueInvoiceRequest, IssueResult, PaymentInput, PreviewResult, RecordPaymentRequest, RecordPaymentResult, } from './typen.js';
|
|
18
18
|
export { INVOICE_TEXTS, invoiceText, type InvoiceTextKey } from './texte.js';
|
|
19
19
|
export { computeInvoiceTotals, ZERO_RATED_TAX_SCHEMES, type TotalsItem } from './summen.js';
|
|
20
20
|
export { proratedPriceMicros, MAX_AMOUNT_CENTS, itemFromEuro, formatUnitPrice, CalcError, calculateInvoice, roundDiv, vatRateMapKey, formatVatRate, type CalcResult, type CalcErrorCode, type CalcOptions, type CalcItem, type RateTotal, type ItemConversion, type ConversionReason, type LineAmount, } from './calc.js';
|
|
@@ -277,6 +277,18 @@ export interface InvoiceVatIdProof {
|
|
|
277
277
|
level: 1 | 2;
|
|
278
278
|
/** Pruefcode fuer die oeffentliche Pruefseite (auf dem PDF als QR); `null`, wenn keiner vergeben wurde. */
|
|
279
279
|
code: string | null;
|
|
280
|
+
/** `true`, wenn erst nach dem Leistungstag geprueft wurde (kein Nachweis am oder vor dem Leistungstag). */
|
|
281
|
+
afterSupplyDate: boolean;
|
|
282
|
+
/** Pruefung am oder vor dem Leistungstag (ohne Pruefcode); `null`, wenn es keine gibt. */
|
|
283
|
+
supplyDateProof: InvoiceSupplyDateProof | null;
|
|
284
|
+
}
|
|
285
|
+
/** Nachweis am oder vor dem Leistungstag: wann, wer, welche Stufe. */
|
|
286
|
+
export interface InvoiceSupplyDateProof {
|
|
287
|
+
/** Wiener Tag der Pruefung (`YYYY-MM-DD`). */
|
|
288
|
+
checkedOn: string;
|
|
289
|
+
source: 'finanzonline' | 'vies';
|
|
290
|
+
/** Stufe der Pruefung: 1 = nur UID, 2 = UID mit Name und Anschrift. */
|
|
291
|
+
level: 1 | 2;
|
|
280
292
|
}
|
|
281
293
|
/** Ausgestellt ohne Ergebnis der UID-Pruefung, das Risiko traegt der Aussteller. */
|
|
282
294
|
export interface InvoiceVatIdRisk {
|
|
@@ -37,7 +37,7 @@ export type InvoiceErrorCode = (typeof INVOICE_ERROR_CODES)[number];
|
|
|
37
37
|
* genau der Katalog des Servers (das Backend vergleicht ihn mit dem Schema);
|
|
38
38
|
* die Helfer in `./invoice` erkennen beide Listen.
|
|
39
39
|
*/
|
|
40
|
-
export declare const INVOICE_REQUEST_ERROR_CODES: readonly ["account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing"];
|
|
40
|
+
export declare const INVOICE_REQUEST_ERROR_CODES: readonly ["account_not_found", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing"];
|
|
41
41
|
export type InvoiceRequestErrorCode = (typeof INVOICE_REQUEST_ERROR_CODES)[number];
|
|
42
42
|
/** Gruende einer Gutschrift. Der Server druckt den deutschen Anzeigetext. */
|
|
43
43
|
export declare const CREDIT_NOTE_REASONS: readonly ["cancellation", "price_reduction", "return", "incorrect_invoice", "other"];
|
|
@@ -90,6 +90,8 @@ export const INVOICE_REQUEST_ERROR_CODES = [
|
|
|
90
90
|
'account_not_found',
|
|
91
91
|
'admin_required',
|
|
92
92
|
'api_not_approved',
|
|
93
|
+
'app_check_invalid',
|
|
94
|
+
'app_check_missing',
|
|
93
95
|
'cashregister_not_assigned',
|
|
94
96
|
'cashregister_not_found',
|
|
95
97
|
'cashregister_token_invalid',
|
|
@@ -100,6 +102,7 @@ export const INVOICE_REQUEST_ERROR_CODES = [
|
|
|
100
102
|
'method_not_allowed',
|
|
101
103
|
'mfa_required',
|
|
102
104
|
'not_found',
|
|
105
|
+
'password_change_required',
|
|
103
106
|
'register_user_no_business',
|
|
104
107
|
'register_user_not_allowed',
|
|
105
108
|
'register_user_not_found',
|
|
@@ -53,7 +53,7 @@ export declare function isReturnDisposition(value: unknown): value is ReturnDisp
|
|
|
53
53
|
* [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
|
|
54
54
|
* `KasseneckApiError.code` lesbar.
|
|
55
55
|
*/
|
|
56
|
-
export declare const CANCELLATION_ERROR_CODES: readonly ["receipt_not_found", "receipt_type_not_cancellable", "training_receipt", "already_cancelled", "invalid_line", "quantity_exceeds_remaining", "unknown_reason", "note_too_long", "invalid_items", "cashregister_not_assigned", "not_permitted", "own_receipts_only", "cashregister_incomplete", "cancellation_failed", "cancellation_payments_required", "cancellation_refund_exceeds_payment", "cancellation_refund_reference_required", "cancellation_refund_reference_unknown", "cancellation_outcome_unknown", "invalid_return_disposition", "account_not_found", "admin_required", "api_not_approved", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
|
|
56
|
+
export declare const CANCELLATION_ERROR_CODES: readonly ["receipt_not_found", "receipt_type_not_cancellable", "training_receipt", "already_cancelled", "invalid_line", "quantity_exceeds_remaining", "unknown_reason", "note_too_long", "invalid_items", "cashregister_not_assigned", "not_permitted", "own_receipts_only", "cashregister_incomplete", "cancellation_failed", "cancellation_payments_required", "cancellation_refund_exceeds_payment", "cancellation_refund_reference_required", "cancellation_refund_reference_unknown", "cancellation_outcome_unknown", "invalid_return_disposition", "account_not_found", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
|
|
57
57
|
export type CancellationErrorCode = (typeof CANCELLATION_ERROR_CODES)[number];
|
|
58
58
|
export declare function isCancellationErrorCode(value: unknown): value is CancellationErrorCode;
|
|
59
59
|
/** Der Code eines geworfenen Fehlers, wenn er in [CANCELLATION_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -79,6 +79,8 @@ export const CANCELLATION_ERROR_CODES = Object.freeze([
|
|
|
79
79
|
'account_not_found',
|
|
80
80
|
'admin_required',
|
|
81
81
|
'api_not_approved',
|
|
82
|
+
'app_check_invalid',
|
|
83
|
+
'app_check_missing',
|
|
82
84
|
'cashregister_not_found',
|
|
83
85
|
'cashregister_token_invalid',
|
|
84
86
|
'cashregister_token_missing',
|
|
@@ -88,6 +90,7 @@ export const CANCELLATION_ERROR_CODES = Object.freeze([
|
|
|
88
90
|
'method_not_allowed',
|
|
89
91
|
'mfa_required',
|
|
90
92
|
'not_found',
|
|
93
|
+
'password_change_required',
|
|
91
94
|
'register_user_no_business',
|
|
92
95
|
'register_user_not_allowed',
|
|
93
96
|
'register_user_not_found',
|
|
@@ -19,7 +19,7 @@ import { KasseneckApiError } from '../client/errors.js';
|
|
|
19
19
|
* ...) und zuletzt `route_missing` (Code des Pakets). Ein Code ausserhalb
|
|
20
20
|
* bleibt ueber `KasseneckApiError.code` lesbar.
|
|
21
21
|
*/
|
|
22
|
-
export declare const PAYMENT_ERROR_CODES: readonly ["payments_invalid", "payment_method_invalid", "payment_amount_invalid", "payment_tendered_invalid", "payment_provider_invalid", "payment_provider_not_allowed", "payments_sum_mismatch", "payments_due_negative", "payments_not_allowed", "payments_conflict", "payments_required", "payment_method_not_supported", "tip_payment_method_invalid", "tip_payment_method_required", "tip_exceeds_payment", "payment_refund_not_allowed", "payment_tip_invalid", "tip_conflict", "account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
22
|
+
export declare const PAYMENT_ERROR_CODES: readonly ["payments_invalid", "payment_method_invalid", "payment_amount_invalid", "payment_tendered_invalid", "payment_provider_invalid", "payment_provider_not_allowed", "payments_sum_mismatch", "payments_due_negative", "payments_not_allowed", "payments_conflict", "payments_required", "payment_method_not_supported", "tip_payment_method_invalid", "tip_payment_method_required", "tip_exceeds_payment", "payment_refund_not_allowed", "payment_tip_invalid", "tip_conflict", "account_not_found", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
23
23
|
export type PaymentErrorCode = (typeof PAYMENT_ERROR_CODES)[number];
|
|
24
24
|
/** Erkennt einen Code aus [PAYMENT_ERROR_CODES], exakt (klein, wie unter `/v3`). */
|
|
25
25
|
export declare function isPaymentErrorCode(value: unknown): value is PaymentErrorCode;
|
|
@@ -42,6 +42,8 @@ export const PAYMENT_ERROR_CODES = Object.freeze([
|
|
|
42
42
|
'account_not_found',
|
|
43
43
|
'admin_required',
|
|
44
44
|
'api_not_approved',
|
|
45
|
+
'app_check_invalid',
|
|
46
|
+
'app_check_missing',
|
|
45
47
|
'cashregister_not_assigned',
|
|
46
48
|
'cashregister_not_found',
|
|
47
49
|
'cashregister_token_invalid',
|
|
@@ -52,6 +54,7 @@ export const PAYMENT_ERROR_CODES = Object.freeze([
|
|
|
52
54
|
'method_not_allowed',
|
|
53
55
|
'mfa_required',
|
|
54
56
|
'not_found',
|
|
57
|
+
'password_change_required',
|
|
55
58
|
'register_user_no_business',
|
|
56
59
|
'register_user_not_allowed',
|
|
57
60
|
'register_user_not_found',
|
|
@@ -11,7 +11,7 @@ export type ReceiptEmailSendErrorCode = (typeof RECEIPT_EMAIL_SEND_ERROR_CODES)[
|
|
|
11
11
|
* als [KasseneckApiError.code] durch; ein Code ausserhalb bleibt dort lesbar.
|
|
12
12
|
* Zuletzt `route_missing` (Code des Pakets).
|
|
13
13
|
*/
|
|
14
|
-
export declare const RECEIPT_EMAIL_ERROR_CODES: readonly ["invalid_address", "receipt_not_found", "too_many_requests", "send_failed", "account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
14
|
+
export declare const RECEIPT_EMAIL_ERROR_CODES: readonly ["invalid_address", "receipt_not_found", "too_many_requests", "send_failed", "account_not_found", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
15
15
|
export type ReceiptEmailErrorCode = (typeof RECEIPT_EMAIL_ERROR_CODES)[number];
|
|
16
16
|
export declare function isReceiptEmailErrorCode(value: unknown): value is ReceiptEmailErrorCode;
|
|
17
17
|
/** Der Code eines geworfenen Fehlers, wenn er in [RECEIPT_EMAIL_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -21,6 +21,8 @@ export const RECEIPT_EMAIL_ERROR_CODES = Object.freeze([
|
|
|
21
21
|
'account_not_found',
|
|
22
22
|
'admin_required',
|
|
23
23
|
'api_not_approved',
|
|
24
|
+
'app_check_invalid',
|
|
25
|
+
'app_check_missing',
|
|
24
26
|
'cashregister_not_assigned',
|
|
25
27
|
'cashregister_not_found',
|
|
26
28
|
'cashregister_token_invalid',
|
|
@@ -31,6 +33,7 @@ export const RECEIPT_EMAIL_ERROR_CODES = Object.freeze([
|
|
|
31
33
|
'method_not_allowed',
|
|
32
34
|
'mfa_required',
|
|
33
35
|
'not_found',
|
|
36
|
+
'password_change_required',
|
|
34
37
|
'register_user_no_business',
|
|
35
38
|
'register_user_not_allowed',
|
|
36
39
|
'register_user_not_found',
|
|
@@ -16,7 +16,7 @@ import { KasseneckApiError } from '../client/errors.js';
|
|
|
16
16
|
* ...) stehen in [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
|
|
17
17
|
* `KasseneckApiError.code` lesbar.
|
|
18
18
|
*/
|
|
19
|
-
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "final_receipt_expired", "final_receipt_not_allowed", "module_inactive", "not_permitted", "receipt_limit_exceeded", "receipt_not_found", "receipt_outcome_unknown", "receipt_type_invalid", "signature_incomplete", "signature_missing", "signing_failed", "small_business_vat_not_allowed", "tip_invalid", "tip_not_allowed", "tip_recipient_unknown", "validation", "account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing", "response_unreadable"];
|
|
19
|
+
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "final_receipt_expired", "final_receipt_not_allowed", "module_inactive", "not_permitted", "receipt_limit_exceeded", "receipt_not_found", "receipt_outcome_unknown", "receipt_type_invalid", "signature_incomplete", "signature_missing", "signing_failed", "small_business_vat_not_allowed", "tip_invalid", "tip_not_allowed", "tip_recipient_unknown", "validation", "account_not_found", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing", "response_unreadable"];
|
|
20
20
|
export type ReceiptErrorCode = (typeof RECEIPT_ERROR_CODES)[number];
|
|
21
21
|
export declare function isReceiptErrorCode(value: unknown): value is ReceiptErrorCode;
|
|
22
22
|
/** Der Code eines geworfenen Fehlers, wenn er in [RECEIPT_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -40,6 +40,8 @@ export const RECEIPT_ERROR_CODES = Object.freeze([
|
|
|
40
40
|
'account_not_found',
|
|
41
41
|
'admin_required',
|
|
42
42
|
'api_not_approved',
|
|
43
|
+
'app_check_invalid',
|
|
44
|
+
'app_check_missing',
|
|
43
45
|
'cashregister_not_assigned',
|
|
44
46
|
'cashregister_not_found',
|
|
45
47
|
'cashregister_token_invalid',
|
|
@@ -50,6 +52,7 @@ export const RECEIPT_ERROR_CODES = Object.freeze([
|
|
|
50
52
|
'method_not_allowed',
|
|
51
53
|
'mfa_required',
|
|
52
54
|
'not_found',
|
|
55
|
+
'password_change_required',
|
|
53
56
|
'register_user_no_business',
|
|
54
57
|
'register_user_not_allowed',
|
|
55
58
|
'register_user_not_found',
|
package/dist/esm/pos/errors.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { KasseneckApiError } from '../client/errors.js';
|
|
2
2
|
/**
|
|
3
3
|
* Fehler der Kassen-Aufrufe um den Verkauf herum (Einstellungen, Logo,
|
|
4
|
-
* Artikel, Drucker, Trinkgeld-Empfaenger, Lager) auswerten:
|
|
4
|
+
* Artikel, Drucker, Trinkgeld-Empfaenger, Lager, Inventur zaehlen) auswerten:
|
|
5
|
+
* am `code`, nie am Text.
|
|
5
6
|
* Belege, Storno und Belegmail haben eigene Listen (`RECEIPT_ERROR_CODES`,
|
|
6
7
|
* `CANCELLATION_ERROR_CODES`, `RECEIPT_EMAIL_ERROR_CODES`), die Anmeldung
|
|
7
8
|
* `REGISTER_ERROR_CODES` im Unterpfad `./register`.
|
|
8
9
|
*
|
|
9
|
-
* Abgeleitet aus dem Vertrags-Export (Fehlerfaelle dieser
|
|
10
|
+
* Abgeleitet aus dem Vertrags-Export (Fehlerfaelle dieser achtzehn Endpunkte in
|
|
10
11
|
* `fixtures/v3/antworten/kasse.json` und ihre Handler-Codes); ein Test haelt
|
|
11
12
|
* die Liste deckungsgleich. `validation` traegt `data.errors[]` mit dem
|
|
12
13
|
* aeusseren Feldpfad (`business.theme`, `device.shortcuts.splitPayment`).
|
|
@@ -19,7 +20,7 @@ import { KasseneckApiError } from '../client/errors.js';
|
|
|
19
20
|
* ueber `KasseneckApiError.code` lesbar; die Kasse braucht dafuer einen
|
|
20
21
|
* Rueckfallzweig.
|
|
21
22
|
*/
|
|
22
|
-
export declare const POS_ERROR_CODES: readonly ["account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "device_not_found", "dialect_mismatch", "internal_translation_error", "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", "print_job_not_found", "print_layout_failed", "printer_not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "server_error", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
23
|
+
export declare const POS_ERROR_CODES: readonly ["account_not_found", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "article_not_found", "article_not_in_scope", "article_not_tracked", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "count_already_voided", "count_not_found", "device_not_found", "dialect_mismatch", "idempotency_conflict", "idempotency_key_required", "internal_translation_error", "invalid_cursor", "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", "password_change_required", "print_job_not_found", "print_layout_failed", "printer_not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "serial_already_counted", "serial_not_allowed", "serial_required", "server_error", "session_expired", "session_other_cashregister", "stocktake_closed", "stocktake_closing", "stocktake_not_found", "stocktake_not_open", "too_many_counts", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
23
24
|
export type PosErrorCode = typeof POS_ERROR_CODES[number];
|
|
24
25
|
export declare function isPosErrorCode(value: unknown): value is PosErrorCode;
|
|
25
26
|
/** Der Code eines geworfenen Fehlers, wenn er in [POS_ERROR_CODES] steht; sonst `undefined`. */
|
package/dist/esm/pos/errors.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { KasseneckApiError } from '../client/errors.js';
|
|
2
2
|
/**
|
|
3
3
|
* Fehler der Kassen-Aufrufe um den Verkauf herum (Einstellungen, Logo,
|
|
4
|
-
* Artikel, Drucker, Trinkgeld-Empfaenger, Lager) auswerten:
|
|
4
|
+
* Artikel, Drucker, Trinkgeld-Empfaenger, Lager, Inventur zaehlen) auswerten:
|
|
5
|
+
* am `code`, nie am Text.
|
|
5
6
|
* Belege, Storno und Belegmail haben eigene Listen (`RECEIPT_ERROR_CODES`,
|
|
6
7
|
* `CANCELLATION_ERROR_CODES`, `RECEIPT_EMAIL_ERROR_CODES`), die Anmeldung
|
|
7
8
|
* `REGISTER_ERROR_CODES` im Unterpfad `./register`.
|
|
8
9
|
*
|
|
9
|
-
* Abgeleitet aus dem Vertrags-Export (Fehlerfaelle dieser
|
|
10
|
+
* Abgeleitet aus dem Vertrags-Export (Fehlerfaelle dieser achtzehn Endpunkte in
|
|
10
11
|
* `fixtures/v3/antworten/kasse.json` und ihre Handler-Codes); ein Test haelt
|
|
11
12
|
* die Liste deckungsgleich. `validation` traegt `data.errors[]` mit dem
|
|
12
13
|
* aeusseren Feldpfad (`business.theme`, `device.shortcuts.splitPayment`).
|
|
@@ -23,13 +24,25 @@ export const POS_ERROR_CODES = Object.freeze([
|
|
|
23
24
|
'account_not_found',
|
|
24
25
|
'admin_required',
|
|
25
26
|
'api_not_approved',
|
|
27
|
+
'app_check_invalid',
|
|
28
|
+
'app_check_missing',
|
|
29
|
+
'article_not_found',
|
|
30
|
+
'article_not_in_scope',
|
|
31
|
+
'article_not_tracked',
|
|
26
32
|
'cashregister_not_assigned',
|
|
27
33
|
'cashregister_not_found',
|
|
28
34
|
'cashregister_token_invalid',
|
|
29
35
|
'cashregister_token_missing',
|
|
36
|
+
'count_already_voided',
|
|
37
|
+
'count_not_found',
|
|
30
38
|
'device_not_found',
|
|
31
39
|
'dialect_mismatch',
|
|
40
|
+
'idempotency_conflict',
|
|
41
|
+
'idempotency_key_required',
|
|
32
42
|
'internal_translation_error',
|
|
43
|
+
'invalid_cursor',
|
|
44
|
+
'invalid_quantity',
|
|
45
|
+
'invalid_serial',
|
|
33
46
|
'live_not_enabled',
|
|
34
47
|
'location_inactive',
|
|
35
48
|
'location_not_found',
|
|
@@ -41,6 +54,7 @@ export const POS_ERROR_CODES = Object.freeze([
|
|
|
41
54
|
'module_inactive',
|
|
42
55
|
'not_found',
|
|
43
56
|
'not_permitted',
|
|
57
|
+
'password_change_required',
|
|
44
58
|
'print_job_not_found',
|
|
45
59
|
'print_layout_failed',
|
|
46
60
|
'printer_not_found',
|
|
@@ -48,9 +62,17 @@ export const POS_ERROR_CODES = Object.freeze([
|
|
|
48
62
|
'register_user_not_allowed',
|
|
49
63
|
'register_user_not_found',
|
|
50
64
|
'response_translation_failed',
|
|
65
|
+
'serial_already_counted',
|
|
66
|
+
'serial_not_allowed',
|
|
67
|
+
'serial_required',
|
|
51
68
|
'server_error',
|
|
52
69
|
'session_expired',
|
|
53
70
|
'session_other_cashregister',
|
|
71
|
+
'stocktake_closed',
|
|
72
|
+
'stocktake_closing',
|
|
73
|
+
'stocktake_not_found',
|
|
74
|
+
'stocktake_not_open',
|
|
75
|
+
'too_many_counts',
|
|
54
76
|
'unauthorized',
|
|
55
77
|
'user_disabled',
|
|
56
78
|
'user_verification_failed',
|
package/dist/esm/pos/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kachel-Kasse: Einstellungen, Artikelgruppen/Artikel fuer Kacheln,
|
|
3
3
|
* Rabattverteilung, Drucker, Trinkgeld-Empfaenger, Lager (Standorte, Bestand,
|
|
4
|
-
* Standort der Kasse). Die Aufrufe heissen 1:1 wie
|
|
4
|
+
* Standort der Kasse), Inventur zaehlen. Die Aufrufe heissen 1:1 wie
|
|
5
5
|
* die Backend-Functions (die Rewrites-Waechter der Web-App leiten daraus ab)
|
|
6
6
|
* und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
|
|
7
7
|
*/
|
|
@@ -14,5 +14,8 @@ export { cancelScopeOf, receiptsScopeOf, stockViewOf, type RegisterScope, type R
|
|
|
14
14
|
export { type NetworkPrinter, type PrintJob, type PrintJobStatus, PRINT_JOB_STATUSES, type PrintJobSource, PRINT_JOB_SOURCES, isPrintJobFinished, type CreatePrintJobOptions, listMyPrinters, createPrintJob, getPrintJob, } from './drucker.js';
|
|
15
15
|
export { listMyTipRecipients } from './trinkgeld.js';
|
|
16
16
|
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';
|
|
17
|
+
export { type ListMyStocktakesOptions, type ListMyStocktakeItemsOptions, type ListMyStocktakeCountsOptions, type RecordMyStocktakeCountOptions, type VoidMyStocktakeCountOptions, listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMyStocktakeCount, voidMyStocktakeCount, parseQuantityMilli, } from './inventur.js';
|
|
18
|
+
export type { Stocktake, StocktakeItem, StocktakeCount, StocktakeCountResult, StocktakeItemPage, StocktakeCountPage, StocktakeActor, StocktakeProgress, StocktakeReview, StocktakeRecount, StocktakeScope, } from '../inventory/typen.js';
|
|
19
|
+
export type { StocktakeStatus } from '../inventory/vertrag.js';
|
|
17
20
|
export { RETURN_DISPOSITIONS, isReturnDisposition, type ReturnDisposition } from '../models/cancellation.js';
|
|
18
21
|
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';
|
package/dist/esm/pos/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kachel-Kasse: Einstellungen, Artikelgruppen/Artikel fuer Kacheln,
|
|
3
3
|
* Rabattverteilung, Drucker, Trinkgeld-Empfaenger, Lager (Standorte, Bestand,
|
|
4
|
-
* Standort der Kasse). Die Aufrufe heissen 1:1 wie
|
|
4
|
+
* Standort der Kasse), Inventur zaehlen. Die Aufrufe heissen 1:1 wie
|
|
5
5
|
* die Backend-Functions (die Rewrites-Waechter der Web-App leiten daraus ab)
|
|
6
6
|
* und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
|
|
7
7
|
*/
|
|
@@ -18,6 +18,7 @@ export { cancelScopeOf, receiptsScopeOf, stockViewOf } from '../register/pairing
|
|
|
18
18
|
export { PRINT_JOB_STATUSES, PRINT_JOB_SOURCES, isPrintJobFinished, listMyPrinters, createPrintJob, getPrintJob, } from './drucker.js';
|
|
19
19
|
export { listMyTipRecipients } from './trinkgeld.js';
|
|
20
20
|
export { STOCK_LOCATION_TYPES, listMyStockLocations, listMyStock, setMyCashregisterStockLocation, } from './lager.js';
|
|
21
|
+
export { listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMyStocktakeCount, voidMyStocktakeCount, parseQuantityMilli, } from './inventur.js';
|
|
21
22
|
// Rueckgabe-Wahl beim Storno (Kassen-Dialog); dieselbe Liste wie an der Wurzel.
|
|
22
23
|
export { RETURN_DISPOSITIONS, isReturnDisposition } from '../models/cancellation.js';
|
|
23
24
|
// Was die Kasse selbst sagt: ein Katalog fuer Browser-Kasse und App.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { InternerTransport } from '../client/aufrufe.js';
|
|
2
|
+
import type { Stocktake, StocktakeCountPage, StocktakeCountResult, StocktakeItemPage } from '../inventory/typen.js';
|
|
3
|
+
import type { StockCondition, StocktakeStatus } from '../inventory/vertrag.js';
|
|
4
|
+
import { type QuantityRule } from './artikel.js';
|
|
5
|
+
/**
|
|
6
|
+
* Inventur zaehlen an der Kasse (Lager-Kern Stufe 3, Backend
|
|
7
|
+
* inventur-endpoints.js): offene Inventuren des Standorts, ihre Positionen und
|
|
8
|
+
* Zaehlungen lesen, zaehlen und eine Zaehlung stornieren. Alle fuenf Aufrufe
|
|
9
|
+
* gibt es nur ueber den Kassenweg `/api/v3`.
|
|
10
|
+
*
|
|
11
|
+
* Rechte am Server: `stocktakeCount` (zaehlen, eigene Zaehlungen stornieren,
|
|
12
|
+
* lesen) bzw. `stocktakeClose` (auch fremde Zaehlungen stornieren und ab der
|
|
13
|
+
* Pruefung das Soll sehen). Kassen-Benutzer sehen in [listMyStocktakes] nur
|
|
14
|
+
* Inventuren in `counting` und solche in `review` mit offenem Nachzaehlen.
|
|
15
|
+
* Anlegen, Pruefen und Abschliessen gibt es an der Kasse nicht.
|
|
16
|
+
*
|
|
17
|
+
* Gezaehlt wird nur online: die Serverzeit ist die Referenzzeit. Bei unklarem
|
|
18
|
+
* Ausgang (`outcome: 'unknown'`) dieselbe Zaehlung mit **demselben**
|
|
19
|
+
* `idempotencyKey` erneut senden; sie wirkt genau einmal.
|
|
20
|
+
*
|
|
21
|
+
* Die Modelle sind dieselben wie in `./inventory` (`Stocktake`,
|
|
22
|
+
* `StocktakeItem`, `StocktakeCount`); Mengen in Tausendstel.
|
|
23
|
+
*/
|
|
24
|
+
export interface ListMyStocktakesOptions {
|
|
25
|
+
/** Nur dieser Standort; `''` gilt wie nicht angegeben. */
|
|
26
|
+
locationId?: string;
|
|
27
|
+
/** Nur dieser Stand. */
|
|
28
|
+
status?: StocktakeStatus;
|
|
29
|
+
}
|
|
30
|
+
export interface ListMyStocktakeItemsOptions {
|
|
31
|
+
stocktakeId: string;
|
|
32
|
+
/** Nur ungezaehlte Positionen (in der Pruefung: die zum Nachzaehlen). */
|
|
33
|
+
openOnly?: boolean;
|
|
34
|
+
limit?: number;
|
|
35
|
+
cursor?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ListMyStocktakeCountsOptions {
|
|
38
|
+
stocktakeId: string;
|
|
39
|
+
articleId?: string;
|
|
40
|
+
/** Nur die eigenen Zaehlungen. */
|
|
41
|
+
ownOnly?: boolean;
|
|
42
|
+
limit?: number;
|
|
43
|
+
cursor?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface RecordMyStocktakeCountOptions {
|
|
46
|
+
/** Bei „Erneut senden“ derselbe Schluessel wie beim ersten Versuch. */
|
|
47
|
+
idempotencyKey: string;
|
|
48
|
+
stocktakeId: string;
|
|
49
|
+
articleId: string;
|
|
50
|
+
/** Vorgabe `sellable`. */
|
|
51
|
+
condition?: StockCondition;
|
|
52
|
+
/** Tausendstel, aus der Eingabe mit [parseQuantityMilli]; `0` = leer gezaehlt. */
|
|
53
|
+
quantity: number;
|
|
54
|
+
/** Einzelstueck: je Stueck genau eine Seriennummer. */
|
|
55
|
+
serialNumbers?: string[];
|
|
56
|
+
/** Hoechstens 200 Zeichen. */
|
|
57
|
+
note?: string | null;
|
|
58
|
+
/** Ohne Angabe gilt die Kasse der Anmeldung (`registerUserAuth`). */
|
|
59
|
+
cashregisterId?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface VoidMyStocktakeCountOptions {
|
|
62
|
+
idempotencyKey: string;
|
|
63
|
+
stocktakeId: string;
|
|
64
|
+
countId: string;
|
|
65
|
+
/** 1–500 Zeichen. */
|
|
66
|
+
reason: string;
|
|
67
|
+
}
|
|
68
|
+
/** Offene Inventuren (fuer Kassen-Benutzer nur `counting` und `review` mit offenem Nachzaehlen). */
|
|
69
|
+
export declare function listMyStocktakes(transport: InternerTransport, options?: ListMyStocktakesOptions): Promise<Stocktake[]>;
|
|
70
|
+
/** Positionen einer Inventur; ab der Pruefung mit Soll nur mit dem Recht `stocktakeClose`. */
|
|
71
|
+
export declare function listMyStocktakeItems(transport: InternerTransport, options: ListMyStocktakeItemsOptions): Promise<StocktakeItemPage>;
|
|
72
|
+
/** Zaehlungen einer Inventur, neueste zuerst; `ownOnly` nur die eigenen. */
|
|
73
|
+
export declare function listMyStocktakeCounts(transport: InternerTransport, options: ListMyStocktakeCountsOptions): Promise<StocktakeCountPage>;
|
|
74
|
+
/** Eine Zaehlung; Antwort: die Zaehlung und die Position danach (Ist-Summe, kein Soll). */
|
|
75
|
+
export declare function recordMyStocktakeCount(transport: InternerTransport, options: RecordMyStocktakeCountOptions): Promise<StocktakeCountResult>;
|
|
76
|
+
/** Storniert eine Zaehlung mit Grund (fremde nur mit dem Recht `stocktakeClose`). */
|
|
77
|
+
export declare function voidMyStocktakeCount(transport: InternerTransport, options: VoidMyStocktakeCountOptions): Promise<StocktakeCountResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Eine eingetippte Menge in Tausendstel der Basiseinheit, **ohne Gleitkomma**:
|
|
80
|
+
* `'12'` → `12000`, `'0,25'` → `250`, `'1.5'` → `1500`.
|
|
81
|
+
*
|
|
82
|
+
* - Dezimaltrenner Komma oder Punkt, hoechstens drei Nachkommastellen; weitere
|
|
83
|
+
* Nullen am Ende zaehlen nicht (`'1,2340'` → `1234`). `'0'` ist eine gueltige
|
|
84
|
+
* Menge (leer gezaehlt).
|
|
85
|
+
* - **Punkt mit genau drei Ziffern danach und einem Ganzteil ungleich 0**
|
|
86
|
+
* (`'1.000'`, `'12.500'`) ist bei jeder Einheit `null`: in oesterreichischer
|
|
87
|
+
* Schreibweise ist das ein Tausenderpunkt („tausend“), am Ziffernblock ein
|
|
88
|
+
* Dezimalpunkt („eins“); ein Faktor 1000 buchte der Abschluss als Differenz.
|
|
89
|
+
* Mit Komma ist es eindeutig (`'1,000'` → `1000`), ebenso `'0.500'`,
|
|
90
|
+
* `'1.5'`, `'1.25'`.
|
|
91
|
+
* - **Stueckware** nur als ganze Zahl ohne Trenner. Stueckware ist, was
|
|
92
|
+
* `rule` sagt (die gespeicherte Mengenregel des Artikels,
|
|
93
|
+
* `PosArticle.quantityRule`, `'piece'` | `'decimal'`), ohne `rule` die
|
|
94
|
+
* Vorgabe der Einheit (`quantityRuleForUnit`: Stk, g, ml …, auch ohne
|
|
95
|
+
* Einheit). Einzelstuecke (Seriennummer) sind immer Stueckware: dann
|
|
96
|
+
* `'piece'` uebergeben.
|
|
97
|
+
*
|
|
98
|
+
* `null` auch fuer: leer, Vorzeichen, Tausenderleerzeichen, Exponent, mehr als
|
|
99
|
+
* drei Nachkommastellen, groesser als eine sichere Ganzzahl. Die Kasse zeigt
|
|
100
|
+
* dann ihren Satz (`stocktake.quantity_invalid`), statt still zu runden.
|
|
101
|
+
* Gemeinsame Prueffaelle mit dem Dart-Zwilling:
|
|
102
|
+
* `fixtures/stocktake-quantity-cases.json`.
|
|
103
|
+
*/
|
|
104
|
+
export declare function parseQuantityMilli(text: string, unit?: string | null, rule?: QuantityRule | null): number | null;
|