@kreiseck/kasseneck-api 1.31.0 → 1.32.1
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 +22 -0
- package/dist/cjs/client/aufrufe.d.ts +3 -3
- package/dist/cjs/client/aufrufe.js +8 -0
- package/dist/cjs/client/receipts.d.ts +11 -0
- package/dist/cjs/client/receipts.js +28 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +8 -5
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/index.js +5 -2
- package/dist/cjs/models/receipt-errors.d.ts +1 -1
- package/dist/cjs/models/receipt-errors.js +9 -0
- package/dist/cjs/models/receipt-item.d.ts +44 -2
- package/dist/cjs/models/receipt-item.js +56 -1
- package/dist/cjs/models/receipt.d.ts +17 -0
- package/dist/cjs/models/receipt.js +9 -0
- package/dist/cjs/pos/artikel.d.ts +14 -0
- package/dist/cjs/pos/artikel.js +3 -0
- package/dist/cjs/pos/client.d.ts +1 -0
- package/dist/cjs/pos/client.js +3 -0
- package/dist/cjs/pos/errors.d.ts +1 -1
- package/dist/cjs/pos/errors.js +12 -0
- package/dist/cjs/pos/fremdgutschein-artikel.d.ts +3 -2
- package/dist/cjs/pos/fremdgutschein-artikel.js +4 -2
- package/dist/cjs/pos/index.d.ts +4 -2
- package/dist/cjs/pos/index.js +24 -4
- package/dist/cjs/pos/leergut.d.ts +60 -0
- package/dist/cjs/pos/leergut.js +82 -0
- package/dist/cjs/pos/pfand.d.ts +144 -0
- package/dist/cjs/pos/pfand.js +382 -0
- package/dist/cjs/pos/settings.d.ts +3 -7
- package/dist/cjs/pos/settings.js +7 -0
- package/dist/cjs/pos/texte.d.ts +72 -0
- package/dist/cjs/pos/texte.js +42 -1
- package/dist/cjs/receipt/discount.js +3 -0
- package/dist/cjs/receipt/due.d.ts +6 -0
- package/dist/cjs/receipt/due.js +16 -5
- package/dist/cjs/receipt/gutschein-plan.d.ts +7 -1
- package/dist/cjs/receipt/gutschein-plan.js +16 -2
- package/dist/cjs/receipt/layout.js +108 -2
- package/dist/cjs/register/pairing.d.ts +15 -1
- package/dist/cjs/register/pairing.js +14 -1
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +72 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/aufrufe.d.ts +3 -3
- package/dist/esm/client/aufrufe.js +8 -0
- package/dist/esm/client/receipts.d.ts +11 -0
- package/dist/esm/client/receipts.js +29 -3
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/esm/models/receipt-errors.d.ts +1 -1
- package/dist/esm/models/receipt-errors.js +9 -0
- package/dist/esm/models/receipt-item.d.ts +44 -2
- package/dist/esm/models/receipt-item.js +54 -1
- package/dist/esm/models/receipt.d.ts +17 -0
- package/dist/esm/models/receipt.js +9 -0
- package/dist/esm/pos/artikel.d.ts +14 -0
- package/dist/esm/pos/artikel.js +3 -0
- package/dist/esm/pos/client.d.ts +1 -0
- package/dist/esm/pos/client.js +3 -0
- package/dist/esm/pos/errors.d.ts +1 -1
- package/dist/esm/pos/errors.js +12 -0
- package/dist/esm/pos/fremdgutschein-artikel.d.ts +3 -2
- package/dist/esm/pos/fremdgutschein-artikel.js +4 -2
- package/dist/esm/pos/index.d.ts +4 -2
- package/dist/esm/pos/index.js +4 -2
- package/dist/esm/pos/leergut.d.ts +60 -0
- package/dist/esm/pos/leergut.js +77 -0
- package/dist/esm/pos/pfand.d.ts +144 -0
- package/dist/esm/pos/pfand.js +371 -0
- package/dist/esm/pos/settings.d.ts +3 -7
- package/dist/esm/pos/settings.js +7 -0
- package/dist/esm/pos/texte.d.ts +72 -0
- package/dist/esm/pos/texte.js +40 -0
- package/dist/esm/receipt/discount.js +4 -1
- package/dist/esm/receipt/due.d.ts +6 -0
- package/dist/esm/receipt/due.js +17 -6
- package/dist/esm/receipt/gutschein-plan.d.ts +7 -1
- package/dist/esm/receipt/gutschein-plan.js +14 -2
- package/dist/esm/receipt/layout.js +109 -3
- package/dist/esm/register/pairing.d.ts +15 -1
- package/dist/esm/register/pairing.js +13 -1
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +72 -4
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/deposit-cases.json +4758 -0
- package/fixtures/expected/deposit-return.grid32.txt +28 -0
- package/fixtures/expected/deposit-return.grid48.txt +28 -0
- package/fixtures/expected/deposit-return.lines.json +275 -0
- package/fixtures/expected/deposit-return.sheet32.json +194 -0
- package/fixtures/expected/deposit-return.sheet48.json +194 -0
- package/fixtures/expected/deposit.grid32.txt +34 -0
- package/fixtures/expected/deposit.grid48.txt +32 -0
- package/fixtures/expected/deposit.lines.json +316 -0
- package/fixtures/expected/deposit.sheet32.json +230 -0
- package/fixtures/expected/deposit.sheet48.json +218 -0
- package/fixtures/external-voucher-article-cases.json +20 -0
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +1 -1
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/manifest.json +16 -0
- package/fixtures/pos-texts.json +66 -1
- package/fixtures/receipts/deposit-return.json +63 -0
- package/fixtures/receipts/deposit.json +83 -0
- package/fixtures/return-code-cases.json +1338 -0
- package/fixtures/surface.json +45 -4
- package/fixtures/v3/antworten/belege.json +2 -2
- package/fixtures/v3/antworten/belegmail.json +2 -2
- package/fixtures/v3/antworten/berichte.json +2 -2
- package/fixtures/v3/antworten/kasse-belege.json +2 -2
- package/fixtures/v3/antworten/kasse.json +428 -13
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +2 -2
- package/fixtures/v3/antworten/storno.json +2 -2
- package/fixtures/v3/stored/belege.json +2 -2
- package/fixtures/v3/stored/kasse.json +42 -4
- package/fixtures/v3/stored/rechnungen.json +2 -2
- package/fixtures/v3/v3-vokabular.json +808 -27
- package/fixtures/v3/zahlbetrag-faelle.json +187 -3
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.ZUSATZ_KATALOGE = exports.KATALOGE = exports.ARTIKEL_FELDER = exports.SCHEMAS = exports.VOKABULAR_QUELLE = void 0;
|
|
6
6
|
/** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
|
|
7
|
-
exports.VOKABULAR_QUELLE = "
|
|
7
|
+
exports.VOKABULAR_QUELLE = "168261a0b5130d454fc3b5d51e8ee567d6a3e9a5d2d8e172829e9ccb17c47f31";
|
|
8
8
|
/** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
|
|
9
9
|
exports.SCHEMAS = {
|
|
10
10
|
"getReceipt": {
|
|
@@ -23,7 +23,12 @@ exports.SCHEMAS = {
|
|
|
23
23
|
"__": "items",
|
|
24
24
|
"receivedImmediately": "sofortErhalten",
|
|
25
25
|
"keptByEmployee": "direkt",
|
|
26
|
-
"addOnOf": "zusatzZu"
|
|
26
|
+
"addOnOf": "zusatzZu",
|
|
27
|
+
"depositTypeId": "pfandartId",
|
|
28
|
+
"depositFor": "pfandZu",
|
|
29
|
+
"depositKind": "pfandArt",
|
|
30
|
+
"perUnit": "jeStueck",
|
|
31
|
+
"ownFilling": "eigen"
|
|
27
32
|
}
|
|
28
33
|
],
|
|
29
34
|
"manualReceipt": {
|
|
@@ -35,6 +40,11 @@ exports.SCHEMAS = {
|
|
|
35
40
|
"time": "uhrzeit",
|
|
36
41
|
"reason": "grund",
|
|
37
42
|
"note": "grundText"
|
|
43
|
+
},
|
|
44
|
+
"onPremises": "vorOrt",
|
|
45
|
+
"sharedReturnPoint": {
|
|
46
|
+
"__": "pfandStelle",
|
|
47
|
+
"address": "adresse"
|
|
38
48
|
}
|
|
39
49
|
},
|
|
40
50
|
"taxNumber": "taxnr",
|
|
@@ -99,6 +109,12 @@ exports.SCHEMAS = {
|
|
|
99
109
|
"layout.lines[].tone": {
|
|
100
110
|
"$catalog": "LAYOUT_TON"
|
|
101
111
|
},
|
|
112
|
+
"receipt.items[].kind": {
|
|
113
|
+
"$catalog": "PFAND_KIND"
|
|
114
|
+
},
|
|
115
|
+
"receipt.items[].depositKind": {
|
|
116
|
+
"$catalog": "PFAND_ART"
|
|
117
|
+
},
|
|
102
118
|
"issuedVouchers[].type": {
|
|
103
119
|
"$catalog": "GUTSCHEIN_ART"
|
|
104
120
|
},
|
|
@@ -313,9 +329,36 @@ exports.SCHEMAS = {
|
|
|
313
329
|
"__": "connect",
|
|
314
330
|
"minimumVersion": "mindestversion",
|
|
315
331
|
"deadline": "frist"
|
|
332
|
+
},
|
|
333
|
+
"deposit": {
|
|
334
|
+
"__": "pfand",
|
|
335
|
+
"singleUse": "einweg",
|
|
336
|
+
"reusable": "mehrweg",
|
|
337
|
+
"depositTypes": [
|
|
338
|
+
{
|
|
339
|
+
"__": "pfandarten",
|
|
340
|
+
"kind": "art",
|
|
341
|
+
"type": "typ",
|
|
342
|
+
"amounts": [
|
|
343
|
+
{
|
|
344
|
+
"__": "betraege",
|
|
345
|
+
"from": "ab"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"returnRate": "rueckgabeSatz",
|
|
349
|
+
"used": "verwendet",
|
|
350
|
+
"active": "aktiv"
|
|
351
|
+
}
|
|
352
|
+
]
|
|
316
353
|
}
|
|
317
354
|
},
|
|
318
355
|
"werte": {
|
|
356
|
+
"deposit.depositTypes[].kind": {
|
|
357
|
+
"$catalog": "PFAND_ART"
|
|
358
|
+
},
|
|
359
|
+
"deposit.depositTypes[].type": {
|
|
360
|
+
"$catalog": "PFAND_TYP"
|
|
361
|
+
},
|
|
319
362
|
"business.watermark": {
|
|
320
363
|
"$catalog": "KASSE_BETRIEB_WERTE.watermark"
|
|
321
364
|
},
|
|
@@ -428,7 +471,15 @@ exports.SCHEMAS = {
|
|
|
428
471
|
"patternStrict": "musterStreng"
|
|
429
472
|
},
|
|
430
473
|
"addOns": "zusaetze",
|
|
431
|
-
"externalVoucher": "fremdgutschein"
|
|
474
|
+
"externalVoucher": "fremdgutschein",
|
|
475
|
+
"deposits": [
|
|
476
|
+
{
|
|
477
|
+
"__": "pfand",
|
|
478
|
+
"depositTypeId": "pfandartId",
|
|
479
|
+
"quantity": "menge",
|
|
480
|
+
"ownFilling": "eigen"
|
|
481
|
+
}
|
|
482
|
+
]
|
|
432
483
|
}
|
|
433
484
|
]
|
|
434
485
|
},
|
|
@@ -478,7 +529,8 @@ exports.ARTIKEL_FELDER = [
|
|
|
478
529
|
"askPrice",
|
|
479
530
|
"reference",
|
|
480
531
|
"addOns",
|
|
481
|
-
"externalVoucher"
|
|
532
|
+
"externalVoucher",
|
|
533
|
+
"deposits"
|
|
482
534
|
];
|
|
483
535
|
/** Wertkataloge innen (deutsch) -> aussen (englisch). */
|
|
484
536
|
exports.KATALOGE = {
|
|
@@ -777,6 +829,22 @@ exports.KATALOGE = {
|
|
|
777
829
|
"stueck": "piece",
|
|
778
830
|
"dezimal": "decimal"
|
|
779
831
|
},
|
|
832
|
+
"PFAND_ART": {
|
|
833
|
+
"einweg": "single_use",
|
|
834
|
+
"mehrweg": "reusable"
|
|
835
|
+
},
|
|
836
|
+
"PFAND_KIND": {
|
|
837
|
+
"pfand": "deposit",
|
|
838
|
+
"pfand_rueckgabe": "deposit_return"
|
|
839
|
+
},
|
|
840
|
+
"PFAND_TYP": {
|
|
841
|
+
"flasche": "bottle",
|
|
842
|
+
"kiste": "crate",
|
|
843
|
+
"fass": "keg",
|
|
844
|
+
"becher": "cup",
|
|
845
|
+
"glas": "glass",
|
|
846
|
+
"sonstiges": "other"
|
|
847
|
+
},
|
|
780
848
|
"REFERENZ_STUFE": {
|
|
781
849
|
"fragen": "optional",
|
|
782
850
|
"pflicht": "required"
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* umhuellt, muss ihn weiterhin absetzen koennen.
|
|
14
14
|
*/
|
|
15
15
|
import type { FileOrData, FileOrDataCallOptions, PdfOrData, TransportBodyFields, TransportCallOptions } from './transport.js';
|
|
16
|
-
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createDepExport", "createDepHandoverLink", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getDepExport", "getDepExportFile", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listReceipts", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "revokeDepHandoverLink", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "orderSignatureCard", "getSignatureCardOrder", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "getRegisterInspectionInfo", "reportConnectState", "registerTerminalDevice", "getTerminalAccess", "claimTerminal", "requestTerminalCode", "getTerminalCode", "reportTerminalLogin", "reportTerminalReady"];
|
|
16
|
+
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createDepExport", "createDepHandoverLink", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getDepExport", "getDepExportFile", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listReceipts", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "revokeDepHandoverLink", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "orderSignatureCard", "getSignatureCardOrder", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "getRegisterInspectionInfo", "reportConnectState", "learnMyLeergutCode", "listMyLeergutCodes", "registerTerminalDevice", "getTerminalAccess", "claimTerminal", "requestTerminalCode", "getTerminalCode", "reportTerminalLogin", "reportTerminalReady"];
|
|
17
17
|
export type ApiCall = typeof ALL_CALLS[number];
|
|
18
18
|
/**
|
|
19
19
|
* Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
|
|
@@ -29,7 +29,7 @@ export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "can
|
|
|
29
29
|
* die fuenf DEP-Aufrufe); die Kasse ruft sie trotzdem ueber diesen Weg (ein Dialekt
|
|
30
30
|
* je Client, Nachtrag §5.2).
|
|
31
31
|
*/
|
|
32
|
-
export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "createDepExport", "getDepExport", "getDepExportFile", "createDepHandoverLink", "revokeDepHandoverLink", "getRegisterInspectionInfo", "reportConnectState"];
|
|
32
|
+
export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "createDepExport", "getDepExport", "getDepExportFile", "createDepHandoverLink", "revokeDepHandoverLink", "getRegisterInspectionInfo", "reportConnectState", "learnMyLeergutCode", "listMyLeergutCodes"];
|
|
33
33
|
export type PublicCall = typeof PUBLIC_CALLS[number];
|
|
34
34
|
export type PosCall = typeof POS_CALLS[number];
|
|
35
35
|
/**
|
|
@@ -50,7 +50,7 @@ export type PosCall = typeof POS_CALLS[number];
|
|
|
50
50
|
* [ALL_CALLS], [PUBLIC_CALLS] und [POS_CALLS] steht entweder hier oder in
|
|
51
51
|
* [CALLS_WITHOUT_EFFECT] (Waechter `test/ausgang-einordnung.test.ts`).
|
|
52
52
|
*/
|
|
53
|
-
export declare const UNKNOWN_OUTCOME_CALLS: readonly ["activateCashregister", "addVariant", "cancelInvoice", "cancelReceipt", "cancelStocktake", "changeStockCondition", "closeMyShift", "closeStocktake", "createArticle", "createCreditNote", "createCustomer", "createCustomerCashregister", "createInvoiceItem", "createPartnerCustomer", "createPartnerWebhook", "createPrintJob", "createReceipt", "createReservation", "createStocktake", "createVariantGroup", "createWebhook", "deactivateArticle", "deletePartnerWebhook", "deleteWebhook", "extendReservation", "financeWebService", "getTerminalCode", "hobexPayApi", "hobexRefundApi", "issueInvoice", "logMyDrawerOpenings", "logReceiptOutputs", "openMyShift", "orderSignatureCard", "pairRegisterDevice", "receiveGoods", "recordInvoicePayment", "recordMyCashMovement", "recordMyShiftCount", "recordMyStocktakeCount", "recordStockLoss", "recordStocktakeCount", "recountStocktake", "registerTerminalDevice", "releaseReservation", "reportConnectState", "reportCustomerContract", "requestCustomerSignature", "reverseStockMovement", "reviewStocktake", "revokeCustomerMandate", "rotatePartnerWebhookSecret", "rotateWebhookSecret", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "sendWebhookTest", "setCustomerMandate", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "transferStock", "unpairRegisterDevice", "updateArticle", "updateCustomer", "updateInvoiceItem", "updatePartnerWebhook", "updateVariantGroup", "updateWebhook", "voidMyStocktakeCount", "voidStocktakeCount", "withdrawInvoiceItem"];
|
|
53
|
+
export declare const UNKNOWN_OUTCOME_CALLS: readonly ["activateCashregister", "addVariant", "cancelInvoice", "cancelReceipt", "cancelStocktake", "changeStockCondition", "closeMyShift", "closeStocktake", "createArticle", "createCreditNote", "createCustomer", "createCustomerCashregister", "createInvoiceItem", "createPartnerCustomer", "createPartnerWebhook", "createPrintJob", "createReceipt", "createReservation", "createStocktake", "createVariantGroup", "createWebhook", "deactivateArticle", "deletePartnerWebhook", "deleteWebhook", "extendReservation", "financeWebService", "getTerminalCode", "hobexPayApi", "hobexRefundApi", "issueInvoice", "learnMyLeergutCode", "logMyDrawerOpenings", "logReceiptOutputs", "openMyShift", "orderSignatureCard", "pairRegisterDevice", "receiveGoods", "recordInvoicePayment", "recordMyCashMovement", "recordMyShiftCount", "recordMyStocktakeCount", "recordStockLoss", "recordStocktakeCount", "recountStocktake", "registerTerminalDevice", "releaseReservation", "reportConnectState", "reportCustomerContract", "requestCustomerSignature", "reverseStockMovement", "reviewStocktake", "revokeCustomerMandate", "rotatePartnerWebhookSecret", "rotateWebhookSecret", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "sendWebhookTest", "setCustomerMandate", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "transferStock", "unpairRegisterDevice", "updateArticle", "updateCustomer", "updateInvoiceItem", "updatePartnerWebhook", "updateVariantGroup", "updateWebhook", "voidMyStocktakeCount", "voidStocktakeCount", "withdrawInvoiceItem"];
|
|
54
54
|
/** Warum ein Aufruf keine Wirkung hat, die ein Zeitlimit offen lassen koennte. */
|
|
55
55
|
export type CallWithoutEffectReason = 'read' | 'repeatable';
|
|
56
56
|
/**
|
|
@@ -151,6 +151,9 @@ export const ALL_CALLS = [
|
|
|
151
151
|
'getRegisterInspectionInfo',
|
|
152
152
|
// Connect-Bestand (./pos): welche Connect-Version an welchem Kassengeraet laeuft; nur ueber den Kassenweg.
|
|
153
153
|
'reportConnectState',
|
|
154
|
+
// Leergut-Codes (Pfand, ./pos): Codes lernen und lesen; nur ueber den Kassenweg.
|
|
155
|
+
'learnMyLeergutCode',
|
|
156
|
+
'listMyLeergutCodes',
|
|
154
157
|
// Kartenterminal am Handy: Geraet, Zugang, TID und Code (nur /v3).
|
|
155
158
|
'registerTerminalDevice',
|
|
156
159
|
'getTerminalAccess',
|
|
@@ -364,6 +367,9 @@ export const POS_CALLS = [
|
|
|
364
367
|
'getRegisterInspectionInfo',
|
|
365
368
|
// Connect-Bestand: nur ueber den Kassenweg, jeder Kassen-Benutzer.
|
|
366
369
|
'reportConnectState',
|
|
370
|
+
// Leergut-Codes lernen und lesen: Kassen-Benutzer mit dem Recht depositReturn.
|
|
371
|
+
'learnMyLeergutCode',
|
|
372
|
+
'listMyLeergutCodes',
|
|
367
373
|
];
|
|
368
374
|
/**
|
|
369
375
|
* Die Aufrufe **mit Wirkung**, alphabetisch: sie legen etwas an, aendern oder
|
|
@@ -415,6 +421,7 @@ export const UNKNOWN_OUTCOME_CALLS = [
|
|
|
415
421
|
'hobexPayApi',
|
|
416
422
|
'hobexRefundApi',
|
|
417
423
|
'issueInvoice',
|
|
424
|
+
'learnMyLeergutCode',
|
|
418
425
|
'logMyDrawerOpenings',
|
|
419
426
|
'logReceiptOutputs',
|
|
420
427
|
'openMyShift',
|
|
@@ -497,6 +504,7 @@ export const CALLS_WITHOUT_EFFECT = Object.freeze({
|
|
|
497
504
|
generateFullReceiptId: 'read',
|
|
498
505
|
getCashregisterReport: 'read',
|
|
499
506
|
getArticle: 'read',
|
|
507
|
+
listMyLeergutCodes: 'read',
|
|
500
508
|
getCustomer: 'read',
|
|
501
509
|
getCustomerCredentials: 'read',
|
|
502
510
|
getCustomerSignatureStatus: 'read',
|
|
@@ -66,6 +66,17 @@ export interface ReceiptCommonOptions {
|
|
|
66
66
|
* Hauptlade der Kasse. Leer oder kein Text: wirft vor dem Senden.
|
|
67
67
|
*/
|
|
68
68
|
drawerId?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Pfand & Leergut: der Server setzt die Pfandzeilen aus den Artikeln (`deposits`) selbst und rechnet den Betrag.
|
|
71
|
+
* Ohne Angabe gilt die Vorgabe des Servers (an, solange der Betrieb Pfand eingeschaltet hat). Mit `false` setzt er
|
|
72
|
+
* keine; ausdrueckliche Zeilen `deposit` ohne `articleId` und `deposit_return` bleiben erlaubt.
|
|
73
|
+
*/
|
|
74
|
+
autoDeposits?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Pfand & Leergut: der Verkauf wird vor Ort verzehrt (`true`) oder mitgenommen (`false`). Ohne Angabe gilt die
|
|
77
|
+
* Vorgabe der Kasse (`CashRegisterDeposit.onPremisesDefault`). Nur ein Wahrheitswert; anderes wirft vor dem Senden.
|
|
78
|
+
*/
|
|
79
|
+
onPremises?: boolean;
|
|
69
80
|
/**
|
|
70
81
|
* Schutz vor einem zweiten Beleg, wenn die Antwort verloren geht (Netzabbruch,
|
|
71
82
|
* Zeitablauf, `outcome: 'unknown'`). Gilt je Kasse: dieselbe Anfrage mit
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReceiptType, KeckPaymentMethod, CreditCardProvider, VoucherAction, VoucherType, } from '../enums/index.js';
|
|
2
2
|
import { istWertVerkauf } from '../models/voucher.js';
|
|
3
|
-
import { fromReceiptCompanyPayload, fromReceiptPayload, toReceiptItemPayload, toVoucherPayload, receiptItemIsValid, voucherIsValid, isNewFormVoucher, voucherServerFields, fromReceiptSummaryPayload, isCancellationReason, isReturnDisposition, RETURN_DISPOSITIONS, isTipRefundSource, TIP_REFUND_SOURCES, RECEIPT_EMAIL_VIAS, readRegistrationInfo, } from '../models/index.js';
|
|
3
|
+
import { fromReceiptCompanyPayload, fromReceiptPayload, toReceiptItemPayload, isDepositReturnItem, receiptItemTotalCents, toVoucherPayload, receiptItemIsValid, voucherIsValid, isNewFormVoucher, voucherServerFields, fromReceiptSummaryPayload, isCancellationReason, isReturnDisposition, RETURN_DISPOSITIONS, isTipRefundSource, TIP_REFUND_SOURCES, RECEIPT_EMAIL_VIAS, readRegistrationInfo, } from '../models/index.js';
|
|
4
4
|
import { RECEIPT_OUTPUT_ENTRIES_MAX, RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS, receiptOutputsFromWire, } from '../models/receipt-output.js';
|
|
5
5
|
import { VoucherCode } from '@kreiseck/validator';
|
|
6
6
|
import { parseServerTimeStamp, toViennaWallClock } from '../vienna-time.js';
|
|
@@ -99,6 +99,16 @@ export function createReceiptParams(options) {
|
|
|
99
99
|
if (items?.some((item) => item.kind === 'voucher' || item.kind === 'voucher_float') ?? false) {
|
|
100
100
|
throw eingabefehler('voucher_invalid: Gutschein-Positionen (kind voucher, voucher_float) setzt nur der Server.');
|
|
101
101
|
}
|
|
102
|
+
// Pfandzeilen setzt der Server aus den Artikeln: eine Zeile `deposit` mit `articleId` waere doppelt gemeint.
|
|
103
|
+
if (items?.some((item) => item.kind === 'deposit' && item.articleId != null && item.articleId !== '') ?? false) {
|
|
104
|
+
throw eingabefehler('invalid_deposit: Eine Pfandzeile (kind deposit) traegt keine articleId; der Server setzt sie aus dem Artikel (autoDeposits).');
|
|
105
|
+
}
|
|
106
|
+
for (const feld of ['autoDeposits', 'onPremises']) {
|
|
107
|
+
const wert = options[feld];
|
|
108
|
+
if (wert !== undefined && typeof wert !== 'boolean') {
|
|
109
|
+
throw eingabefehler(`${feld} muss true oder false sein (oder weglassen).`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
102
112
|
if (typ.needsItems) {
|
|
103
113
|
// Ein reiner Gutscheinverkauf ist ein Umsatz ohne Positionen, deshalb
|
|
104
114
|
// zaehlt er hier wie eine Position (wie im Flutter-Vorbild).
|
|
@@ -159,7 +169,14 @@ export function createReceiptParams(options) {
|
|
|
159
169
|
// Wie der Server erst nach dem Anhaengen des Trinkgelds: eine Trinkgeldzeile ist keine Gutscheinzeile.
|
|
160
170
|
const nurAuszahlung = (vouchers?.length ?? 0) > 0 && vouchers.every((v) => v.action === VoucherAction.payout)
|
|
161
171
|
&& (items?.length ?? 0) === 0 && options.tip == null;
|
|
162
|
-
|
|
172
|
+
// Leergut-Auszahlung (Server pfand-core istLeergutAuszahlung): Leergut auf dem Beleg und eine negative Zahlung.
|
|
173
|
+
const leergut = (items ?? []).filter(isDepositReturnItem);
|
|
174
|
+
const leergutAuszahlung = leergut.length > 0 && Array.isArray(options.payments)
|
|
175
|
+
&& options.payments.some((z) => typeof z?.amountCents === 'number' && z.amountCents < 0);
|
|
176
|
+
const leergutSummeCents = leergutAuszahlung
|
|
177
|
+
? leergut.reduce((summe, p) => summe + Math.abs(receiptItemTotalCents(p)), 0)
|
|
178
|
+
: undefined;
|
|
179
|
+
params['payments'] = gepruefteZahlungen(options.payments, false, 'createReceipt', nurAuszahlung || leergutAuszahlung, false, leergutSummeCents);
|
|
163
180
|
}
|
|
164
181
|
else if (options.payments != null) {
|
|
165
182
|
throw eingabefehler(`payments sind bei receiptType "${typ.value}" nicht erlaubt.`);
|
|
@@ -191,6 +208,10 @@ export function createReceiptParams(options) {
|
|
|
191
208
|
if (options.idempotencyKey != null) {
|
|
192
209
|
params['idempotencyKey'] = belegSchluessel(options.idempotencyKey);
|
|
193
210
|
}
|
|
211
|
+
if (options.autoDeposits !== undefined)
|
|
212
|
+
params['autoDeposits'] = options.autoDeposits;
|
|
213
|
+
if (options.onPremises !== undefined)
|
|
214
|
+
params['onPremises'] = options.onPremises;
|
|
194
215
|
return params;
|
|
195
216
|
}
|
|
196
217
|
/** Hoechstlaenge des `idempotencyKey` am Beleg, wie am Server (beleg-idempotenz-core `SCHLUESSEL_MAX`). */
|
|
@@ -846,7 +867,7 @@ const MAX_ZAHLUNGEN = 20;
|
|
|
846
867
|
* (Summe, Anbieter-Pflicht und Trinkgeld prueft der Server). Wirft, bevor
|
|
847
868
|
* etwas hinausgeht.
|
|
848
869
|
*/
|
|
849
|
-
function gepruefteZahlungen(roh, storno, functionName, auszahlung = false, stornoAuszahlung = false) {
|
|
870
|
+
function gepruefteZahlungen(roh, storno, functionName, auszahlung = false, stornoAuszahlung = false, leergutSummeCents) {
|
|
850
871
|
const fehler = (grund) => new KasseneckValidationError(functionName, grund, 'request');
|
|
851
872
|
if (!Array.isArray(roh))
|
|
852
873
|
throw fehler('payments muss eine Liste sein.');
|
|
@@ -867,6 +888,11 @@ function gepruefteZahlungen(roh, storno, functionName, auszahlung = false, storn
|
|
|
867
888
|
throw fehler('Auszahlung: tenderedCents ist nicht moeglich.');
|
|
868
889
|
if (e['tipCents'] !== undefined)
|
|
869
890
|
throw fehler('Auszahlung: tipCents ist nicht moeglich.');
|
|
891
|
+
// Leergut-Auszahlung: Ware zahlt nie aus, hoechstens die Leergutsumme (der Server prueft ebenso).
|
|
892
|
+
const b = e['amountCents'];
|
|
893
|
+
if (leergutSummeCents !== undefined && typeof b === 'number' && -b > leergutSummeCents) {
|
|
894
|
+
throw fehler('Auszahlung: der Betrag ist hoeher als die Leergutsumme des Belegs.');
|
|
895
|
+
}
|
|
870
896
|
}
|
|
871
897
|
}
|
|
872
898
|
return roh.map((eintrag, i) => {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
|
|
2
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape, type ExternalVoucherNumberCheck, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS, type ReceiptOutputLogKind, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputResult, RECEIPT_OUTPUT_ENTRIES_MAX, type ReceiptOutput, type ReceiptOutputActor, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, type ReceiptOutputEntryErrorCode, RECEIPT_OUTPUT_ERROR_CODES, type ReceiptOutputErrorCode, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, type ReceiptOutputFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape, type ExternalVoucherNumberCheck, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS, type ReceiptOutputLogKind, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputResult, RECEIPT_OUTPUT_ENTRIES_MAX, type ReceiptOutput, type ReceiptOutputActor, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, type ReceiptOutputEntryErrorCode, RECEIPT_OUTPUT_ERROR_CODES, type ReceiptOutputErrorCode, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, type ReceiptOutputFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type TransportCallOptions, type KasseneckTransport, type KasseneckBinaryTransport, type KasseneckPdfOrDataTransport, type PdfOrData, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, createPdfOrDataTransport, createFileOrDataTransport, type FileOrData, type FileOrDataCallOptions, type KasseneckFileOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, type ReceiptOutputEntry, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type RejectedReceiptOutput, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, type CashregisterReportPeriod, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, listedReceiptWithCompany, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, type ListReceiptsErrorCode, type ListReceiptsView, type ListReceiptsOrder, type ListReceiptsOptions, type ListReceiptsWindow, type ListReceiptsGrossByRate, type ListReceiptsSummary, type ListReceiptsDaySummary, type ListReceiptsPage, type ListedReceipt, createDepExport, getDepExport, waitForDepExport, getDepExportFile, createDepHandoverLink, revokeDepHandoverLink, DepExportTimeoutError, DepExportChecksumError, DEP_EXPORT_STATUSES, DEP_EXPORT_FILES, DEP_EXPORT_ERROR_CODES, DEP_EXPORT_FAILURES, DEP_EXPORT_POLL_START_MS, DEP_EXPORT_POLL_FACTOR, DEP_EXPORT_POLL_MAX_MS, DEP_EXPORT_WAIT_TIMEOUT_MS, DEP_EXPORT_DOWNLOAD_TIMEOUT_MS, type DepExportStatus, type DepExportFileKind, type DepExportErrorCode, type DepExportFailure, type CreateDepExportOptions, type CreateDepExportResult, type DepExportGap, type DepExportChainBreak, type DepExportFindings, type DepExportItems, type DepHandoverLinkInfo, type DepExport, type WaitForDepExportOptions, type GetDepExportFileOptions, type DepExportFile, type DepHandoverLink, type RevokedDepHandoverLink, registerTerminalDevice, getTerminalAccess, claimTerminal, requestTerminalCode, getTerminalCode, reportTerminalLogin, reportTerminalReady, TERMINAL_PLATFORMS, TERMINAL_SETUP_STATES, TERMINAL_CODE_STATUSES, TERMINAL_CODE_SOURCES, TERMINAL_ERROR_CODES, TERMINAL_LABEL_MAX, TERMINAL_APP_MAX, TERMINAL_REQUESTED_BY_MAX, type TerminalPlatform, type TerminalSetupState, type TerminalCodeStatus, type TerminalCodeSource, type TerminalErrorCode, type TerminalDeviceCredentials, type RegisterTerminalDeviceOptions, type RegisteredTerminalDevice, type GetTerminalAccessOptions, type ClaimTerminalOptions, type RequestTerminalCodeOptions, type ReportTerminalLoginOptions, type TerminalSetup, type TerminalCodeFormat, type TerminalAccess, type TerminalListEntry, type TerminalAccessUnavailable, type TerminalAccessResult, type TerminalCodeRequest, type TerminalCode, type ListedFullReceipt, type ListReceiptsHeader, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { type ReceiptDueTip, type ReceiptDueTipRecipient, type ReceiptDueOptions, type ReceiptDueBuckets, type ReceiptDueBreakdown, type ReceiptDueErrorReason, receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, type VoucherDueInfo, type VoucherDueArticle, type VoucherDueType, type VoucherRedeemContext, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
|
|
6
|
-
export { type PosBusinessSettings, type PosDeviceSettings, type PosSettings, type ArticleGroup, type PosArticle, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, } from './pos/index.js';
|
|
6
|
+
export { type PosBusinessSettings, type PosDeviceSettings, type PosSettings, type ArticleGroup, type PosArticle, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, depositReturnOf, } from './pos/index.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ReceiptType, VatRate, KeckPaymentMethod, CreditCardProvider, VoucherType, VoucherAction, StripeLinkMode, } from './enums/index.js';
|
|
2
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isVoucherItem, isVoucherFloatItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, fromReceiptPaymentPayload, toReceiptPaymentPayload, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_LOG_KINDS, RECEIPT_OUTPUT_RESULTS, RECEIPT_OUTPUT_ENTRIES_MAX, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, RECEIPT_OUTPUT_ERROR_CODES, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, fromReceiptPaymentPayload, toReceiptPaymentPayload, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_LOG_KINDS, RECEIPT_OUTPUT_RESULTS, RECEIPT_OUTPUT_ENTRIES_MAX, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, RECEIPT_OUTPUT_ERROR_CODES, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, ALL_CALLS, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, createTransport, createBinaryTransport, createPdfOrDataTransport, createFileOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, CLIENT_ERROR_CODES, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, listMyCashregisters, checkVoucherCombinationError, sendReceiptEmail, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2, listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, listedReceiptWithCompany, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, createDepExport, getDepExport, waitForDepExport, getDepExportFile, createDepHandoverLink, revokeDepHandoverLink, DepExportTimeoutError, DepExportChecksumError, DEP_EXPORT_STATUSES, DEP_EXPORT_FILES, DEP_EXPORT_ERROR_CODES, DEP_EXPORT_FAILURES, DEP_EXPORT_POLL_START_MS, DEP_EXPORT_POLL_FACTOR, DEP_EXPORT_POLL_MAX_MS, DEP_EXPORT_WAIT_TIMEOUT_MS, DEP_EXPORT_DOWNLOAD_TIMEOUT_MS, registerTerminalDevice, getTerminalAccess, claimTerminal, requestTerminalCode, getTerminalCode, reportTerminalLogin, reportTerminalReady, TERMINAL_PLATFORMS, TERMINAL_SETUP_STATES, TERMINAL_CODE_STATUSES, TERMINAL_CODE_SOURCES, TERMINAL_ERROR_CODES, TERMINAL_LABEL_MAX, TERMINAL_APP_MAX, TERMINAL_REQUESTED_BY_MAX, getCashboxStatus, getSignatureStatus, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock } from './vienna-time.js';
|
|
6
|
-
export { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, } from './pos/index.js';
|
|
6
|
+
export { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, depositReturnOf, } from './pos/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, } from './receipt-item.js';
|
|
1
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, } from './receipt-item.js';
|
|
2
2
|
export { type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, type ExternalVoucherNumberCheck, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, } from './voucher.js';
|
|
3
3
|
export { type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, readRegistrationInfo, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, } from './receipt.js';
|
|
4
4
|
export { type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, } from './cancellation.js';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, } from './receipt-item.js';
|
|
1
|
+
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, } from './receipt-item.js';
|
|
2
2
|
export { toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, } from './voucher.js';
|
|
3
3
|
export { toReceiptPayload, fromReceiptPayload, readRegistrationInfo, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, } from './receipt.js';
|
|
4
4
|
export { RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, } from './cancellation.js';
|
|
@@ -18,7 +18,7 @@ import { KasseneckApiError } from '../client/errors.js';
|
|
|
18
18
|
* ...) stehen in [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
|
|
19
19
|
* `KasseneckApiError.code` lesbar.
|
|
20
20
|
*/
|
|
21
|
-
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "final_receipt_expired", "final_receipt_not_allowed", "idempotency_conflict", "invalid_add_on_reference", "module_inactive", "not_permitted", "receipt_limit_exceeded", "receipt_not_found", "receipt_outcome_unknown", "receipt_type_invalid", "server_error", "signature_incomplete", "signature_missing", "signing_failed", "small_business_vat_not_allowed", "tip_invalid", "tip_not_allowed", "tip_recipient_unknown", "validation", "voucher_balance_changed", "account_not_found", "action_confirmation_required", "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", "second_factor_required", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing", "response_unreadable"];
|
|
21
|
+
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "deposit_not_enabled", "deposit_return_not_offered", "deposit_set_by_server", "deposit_type_not_found", "deposit_type_not_issued", "final_receipt_expired", "final_receipt_not_allowed", "idempotency_conflict", "invalid_add_on_reference", "invalid_deposit", "invalid_deposit_quantity", "invalid_item_kind", "module_inactive", "not_permitted", "receipt_limit_exceeded", "receipt_not_found", "receipt_outcome_unknown", "receipt_type_invalid", "server_error", "signature_incomplete", "signature_missing", "signing_failed", "small_business_vat_not_allowed", "tip_invalid", "tip_not_allowed", "tip_recipient_unknown", "validation", "voucher_balance_changed", "account_not_found", "action_confirmation_required", "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", "second_factor_required", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing", "response_unreadable"];
|
|
22
22
|
export type ReceiptErrorCode = (typeof RECEIPT_ERROR_CODES)[number];
|
|
23
23
|
export declare function isReceiptErrorCode(value: unknown): value is ReceiptErrorCode;
|
|
24
24
|
/** Der Code eines geworfenen Fehlers, wenn er in [RECEIPT_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -22,6 +22,12 @@ export const RECEIPT_ERROR_CODES = Object.freeze([
|
|
|
22
22
|
'cancellation_reference_unavailable',
|
|
23
23
|
'cashregister_closed',
|
|
24
24
|
'cashregister_decommissioned',
|
|
25
|
+
// Seit Pfand & Leergut Teil 2: Pfandzeilen an createReceipt (Antworten des Servers, errorCodes.registerHandlersByEndpoint).
|
|
26
|
+
'deposit_not_enabled',
|
|
27
|
+
'deposit_return_not_offered',
|
|
28
|
+
'deposit_set_by_server',
|
|
29
|
+
'deposit_type_not_found',
|
|
30
|
+
'deposit_type_not_issued',
|
|
25
31
|
'final_receipt_expired',
|
|
26
32
|
'final_receipt_not_allowed',
|
|
27
33
|
// Seit 1.15.0 (Vertrag): derselbe idempotencyKey mit anderem Inhalt, nichts geschrieben. Seit 1.22.0 sendet
|
|
@@ -29,6 +35,9 @@ export const RECEIPT_ERROR_CODES = Object.freeze([
|
|
|
29
35
|
'idempotency_conflict',
|
|
30
36
|
// Seit 1.27.0 (Zusatz-Kacheln): addOnOf zeigt nicht nach vorne auf eine Warenposition, die selbst kein Zusatz ist.
|
|
31
37
|
'invalid_add_on_reference',
|
|
38
|
+
'invalid_deposit',
|
|
39
|
+
'invalid_deposit_quantity',
|
|
40
|
+
'invalid_item_kind',
|
|
32
41
|
'module_inactive',
|
|
33
42
|
'not_permitted',
|
|
34
43
|
'receipt_limit_exceeded',
|
|
@@ -36,7 +36,7 @@ export interface ReceiptItem {
|
|
|
36
36
|
* negative Entgeltminderungen je Steuersatz; die Kennzeichnung steuert nur
|
|
37
37
|
* die Bon-Darstellung (Summenzeile mit Aufteilung), nie die Beträge.
|
|
38
38
|
*/
|
|
39
|
-
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float';
|
|
39
|
+
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float' | 'deposit' | 'deposit_return';
|
|
40
40
|
/** Empfaenger der Trinkgeld-Position; `null` = nicht zugeordnet. */
|
|
41
41
|
recipient?: TipRecipient | null;
|
|
42
42
|
/** Zahlart der Trinkgeld-Position (kann von der des Belegs abweichen). */
|
|
@@ -67,7 +67,31 @@ export interface ReceiptItem {
|
|
|
67
67
|
* Warenposition, die selbst kein Zusatz ist (`invalid_add_on_reference`).
|
|
68
68
|
*/
|
|
69
69
|
addOnOf?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Pfand & Leergut: Pfandart (Kennung aus `getKasseSettings` `deposit.depositTypes[].id`); nur an
|
|
72
|
+
* `deposit`- und `deposit_return`-Zeilen. Der Server setzt Pfandzeilen aus den Artikeln und rechnet
|
|
73
|
+
* den Betrag selbst; bei einer ausdruecklichen Zeile des Aufrufers (ohne `articleId`) prueft er sie.
|
|
74
|
+
*/
|
|
75
|
+
depositTypeId?: string;
|
|
76
|
+
/** Index der Warenposition im selben Beleg, zu der die Pfandzeile gehoert (nur `deposit`). */
|
|
77
|
+
depositFor?: number;
|
|
78
|
+
/** Art der Pfandart zum Belegzeitpunkt: Einweg oder Mehrweg. */
|
|
79
|
+
depositKind?: 'single_use' | 'reusable';
|
|
80
|
+
/** Pfand je Stueck in Cent bei einer Pfandzeile; der Zeilenpreis ist Menge mal dieser Betrag. */
|
|
81
|
+
perUnit?: number;
|
|
82
|
+
/** Strichcode des Gebindes (GTIN), falls bekannt. */
|
|
83
|
+
gtin?: string;
|
|
84
|
+
/** Strichcode des Artikels (EAN), falls bekannt. */
|
|
85
|
+
ean?: string;
|
|
86
|
+
/** Das Gebinde wurde im Betrieb selbst befuellt (eigene Abfuellung). */
|
|
87
|
+
ownFilling?: boolean;
|
|
88
|
+
/** Gelernte Leergut-Codes der Zeile (Code -> Menge); nur an `deposit_return`. */
|
|
89
|
+
codes?: Record<string, number>;
|
|
70
90
|
}
|
|
91
|
+
/** Pfandzeile (Pfand zum Verkauf)? Die eine Erkennungsstelle — niemand prueft `kind` selbst. */
|
|
92
|
+
export declare function isDepositItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
93
|
+
/** Leergutzeile (Ruecknahme, negativer Betrag)? */
|
|
94
|
+
export declare function isDepositReturnItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
71
95
|
/** Empfaenger einer Trinkgeld-Position (Kassen-Benutzer, Snapshot des Namens). */
|
|
72
96
|
export interface TipRecipient {
|
|
73
97
|
registerUserId: string;
|
|
@@ -97,7 +121,7 @@ export interface ReceiptItemPayload {
|
|
|
97
121
|
unitPriceCents: number;
|
|
98
122
|
vatRate: number;
|
|
99
123
|
/** Trinkgeld-/Rabatt-/Gutschein-Kennzeichnung, siehe [ReceiptItem.kind]. */
|
|
100
|
-
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float';
|
|
124
|
+
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float' | 'deposit' | 'deposit_return';
|
|
101
125
|
recipient?: TipRecipient | null;
|
|
102
126
|
paymentMethod?: string;
|
|
103
127
|
receivedImmediately?: boolean;
|
|
@@ -107,6 +131,15 @@ export interface ReceiptItemPayload {
|
|
|
107
131
|
articleId?: string;
|
|
108
132
|
/** Hauptposition eines Zusatzes, siehe [ReceiptItem.addOnOf]. */
|
|
109
133
|
addOnOf?: number;
|
|
134
|
+
/** Pfandzeile, siehe [ReceiptItem.depositTypeId] und die folgenden Felder. */
|
|
135
|
+
depositTypeId?: string;
|
|
136
|
+
depositFor?: number;
|
|
137
|
+
depositKind?: 'single_use' | 'reusable';
|
|
138
|
+
perUnit?: number;
|
|
139
|
+
gtin?: string;
|
|
140
|
+
ean?: string;
|
|
141
|
+
ownFilling?: boolean;
|
|
142
|
+
codes?: Record<string, number>;
|
|
110
143
|
}
|
|
111
144
|
/**
|
|
112
145
|
* Nutzlast-Form, die dieses Paket **liest** — v2 und v1 nebeneinander, alles
|
|
@@ -154,6 +187,15 @@ export interface ReceiptItemPayloadRead {
|
|
|
154
187
|
returnDisposition?: string | null;
|
|
155
188
|
/** Hauptposition eines Zusatzes, siehe [ReceiptItem.addOnOf]. */
|
|
156
189
|
addOnOf?: number | null;
|
|
190
|
+
/** Pfandzeile, siehe [ReceiptItem.depositTypeId] und die folgenden Felder. */
|
|
191
|
+
depositTypeId?: string | null;
|
|
192
|
+
depositFor?: number | null;
|
|
193
|
+
depositKind?: string | null;
|
|
194
|
+
perUnit?: number | null;
|
|
195
|
+
gtin?: string | null;
|
|
196
|
+
ean?: string | null;
|
|
197
|
+
ownFilling?: boolean | null;
|
|
198
|
+
codes?: Record<string, number> | null;
|
|
157
199
|
}
|
|
158
200
|
export declare function toReceiptItemPayload(item: ReceiptItem): ReceiptItemPayload;
|
|
159
201
|
/**
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { VatRate } from '../enums/index.js';
|
|
2
2
|
import { readVatRateByRate, requireVatRateByRate } from './enum-payload.js';
|
|
3
3
|
import { isReturnDisposition } from './cancellation.js';
|
|
4
|
+
/** Pfandzeile (Pfand zum Verkauf)? Die eine Erkennungsstelle — niemand prueft `kind` selbst. */
|
|
5
|
+
export function isDepositItem(item) {
|
|
6
|
+
return item != null && item.kind === 'deposit';
|
|
7
|
+
}
|
|
8
|
+
/** Leergutzeile (Ruecknahme, negativer Betrag)? */
|
|
9
|
+
export function isDepositReturnItem(item) {
|
|
10
|
+
return item != null && item.kind === 'deposit_return';
|
|
11
|
+
}
|
|
4
12
|
/** Trinkgeld-Position? Die eine Erkennungsstelle — niemand prueft `kind` selbst. */
|
|
5
13
|
export function isTipItem(item) {
|
|
6
14
|
return item != null && item.kind === 'tip';
|
|
@@ -54,6 +62,28 @@ export function toReceiptItemPayload(item) {
|
|
|
54
62
|
// (createReceipt weist sie als voucher_invalid ab).
|
|
55
63
|
if (item.kind === 'voucher' || item.kind === 'voucher_float')
|
|
56
64
|
nutzlast.kind = item.kind;
|
|
65
|
+
// Pfand & Leergut: Kennzeichen und Felder reisen mit (Cache schreibt gelesene Belege wieder; ein Wunsch an
|
|
66
|
+
// den Server traegt `deposit` nie mit `articleId`, siehe createReceiptParams).
|
|
67
|
+
if (item.kind === 'deposit' || item.kind === 'deposit_return') {
|
|
68
|
+
nutzlast.kind = item.kind;
|
|
69
|
+
if (typeof item.depositTypeId === 'string' && item.depositTypeId !== '')
|
|
70
|
+
nutzlast.depositTypeId = item.depositTypeId;
|
|
71
|
+
if (istIndex(item.depositFor))
|
|
72
|
+
nutzlast.depositFor = item.depositFor;
|
|
73
|
+
if (item.depositKind === 'single_use' || item.depositKind === 'reusable')
|
|
74
|
+
nutzlast.depositKind = item.depositKind;
|
|
75
|
+
if (typeof item.perUnit === 'number' && Number.isFinite(item.perUnit))
|
|
76
|
+
nutzlast.perUnit = item.perUnit;
|
|
77
|
+
if (typeof item.gtin === 'string' && item.gtin !== '')
|
|
78
|
+
nutzlast.gtin = item.gtin;
|
|
79
|
+
if (typeof item.ean === 'string' && item.ean !== '')
|
|
80
|
+
nutzlast.ean = item.ean;
|
|
81
|
+
if (typeof item.ownFilling === 'boolean')
|
|
82
|
+
nutzlast.ownFilling = item.ownFilling;
|
|
83
|
+
const codes = leergutCodes(item.codes);
|
|
84
|
+
if (codes != null)
|
|
85
|
+
nutzlast.codes = codes;
|
|
86
|
+
}
|
|
57
87
|
// Artikel-Verweis reist mit (Erloesgruppen im Bericht); leere Werte nicht.
|
|
58
88
|
if (item.articleId != null && item.articleId !== '')
|
|
59
89
|
nutzlast.articleId = item.articleId;
|
|
@@ -103,7 +133,19 @@ export function fromReceiptItemPayload(payload) {
|
|
|
103
133
|
? { kind: 'discount' }
|
|
104
134
|
: payload.kind === 'voucher' || payload.kind === 'voucher_float'
|
|
105
135
|
? { kind: payload.kind }
|
|
106
|
-
:
|
|
136
|
+
: payload.kind === 'deposit' || payload.kind === 'deposit_return'
|
|
137
|
+
? {
|
|
138
|
+
kind: payload.kind,
|
|
139
|
+
...(typeof payload.depositTypeId === 'string' && payload.depositTypeId !== '' ? { depositTypeId: payload.depositTypeId } : {}),
|
|
140
|
+
...(istIndex(payload.depositFor) ? { depositFor: payload.depositFor } : {}),
|
|
141
|
+
...(payload.depositKind === 'single_use' || payload.depositKind === 'reusable' ? { depositKind: payload.depositKind } : {}),
|
|
142
|
+
...(typeof payload.perUnit === 'number' && Number.isFinite(payload.perUnit) ? { perUnit: payload.perUnit } : {}),
|
|
143
|
+
...(typeof payload.gtin === 'string' && payload.gtin !== '' ? { gtin: payload.gtin } : {}),
|
|
144
|
+
...(typeof payload.ean === 'string' && payload.ean !== '' ? { ean: payload.ean } : {}),
|
|
145
|
+
...(typeof payload.ownFilling === 'boolean' ? { ownFilling: payload.ownFilling } : {}),
|
|
146
|
+
...(leergutCodes(payload.codes) != null ? { codes: leergutCodes(payload.codes) } : {}),
|
|
147
|
+
}
|
|
148
|
+
: {}),
|
|
107
149
|
// Artikel-Verweis erhalten (Storno-Spiegelung schreibt ihn wieder mit).
|
|
108
150
|
...(typeof payload.articleId === 'string' && payload.articleId !== '' ? { articleId: payload.articleId } : {}),
|
|
109
151
|
// Lager: Bezug und Rueckgabe-Wahl einer Storno-Zeile (nur gelesen; ein
|
|
@@ -114,6 +156,17 @@ export function fromReceiptItemPayload(payload) {
|
|
|
114
156
|
...(istIndex(payload.addOnOf) ? { addOnOf: payload.addOnOf } : {}),
|
|
115
157
|
};
|
|
116
158
|
}
|
|
159
|
+
/** Gelernte Codes (Code -> ganze Menge >= 1); ohne brauchbaren Eintrag `undefined`. */
|
|
160
|
+
function leergutCodes(wert) {
|
|
161
|
+
if (wert === null || typeof wert !== 'object' || Array.isArray(wert))
|
|
162
|
+
return undefined;
|
|
163
|
+
const raus = {};
|
|
164
|
+
for (const [code, menge] of Object.entries(wert)) {
|
|
165
|
+
if (code !== '' && Number.isInteger(menge) && menge >= 1)
|
|
166
|
+
raus[code] = menge;
|
|
167
|
+
}
|
|
168
|
+
return Object.keys(raus).length > 0 ? raus : undefined;
|
|
169
|
+
}
|
|
117
170
|
function istIndex(wert) {
|
|
118
171
|
return Number.isInteger(wert) && wert >= 0;
|
|
119
172
|
}
|