@kreiseck/kasseneck-api 1.23.0 → 1.25.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 +20 -0
- package/dist/cjs/client/aufrufe.d.ts +3 -3
- package/dist/cjs/client/aufrufe.js +5 -0
- package/dist/cjs/client/receipts.d.ts +19 -0
- package/dist/cjs/client/receipts.js +28 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/models/cancellation.d.ts +1 -1
- package/dist/cjs/models/cancellation.js +9 -0
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/voucher.d.ts +19 -1
- package/dist/cjs/models/voucher.js +2 -2
- package/dist/cjs/pos/connect-bestand.d.ts +27 -0
- package/dist/cjs/pos/connect-bestand.js +40 -0
- package/dist/cjs/pos/gutschein.d.ts +10 -0
- package/dist/cjs/pos/gutschein.js +7 -0
- package/dist/cjs/pos/index.d.ts +3 -2
- package/dist/cjs/pos/index.js +7 -2
- package/dist/cjs/pos/texte.d.ts +48 -0
- package/dist/cjs/pos/texte.js +39 -1
- package/dist/cjs/receipt/layout.js +29 -3
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +14 -3
- 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 +5 -0
- package/dist/esm/client/receipts.d.ts +19 -0
- package/dist/esm/client/receipts.js +28 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/models/cancellation.d.ts +1 -1
- package/dist/esm/models/cancellation.js +9 -0
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/voucher.d.ts +19 -1
- package/dist/esm/models/voucher.js +2 -2
- package/dist/esm/pos/connect-bestand.d.ts +27 -0
- package/dist/esm/pos/connect-bestand.js +37 -0
- package/dist/esm/pos/gutschein.d.ts +10 -0
- package/dist/esm/pos/gutschein.js +7 -0
- package/dist/esm/pos/index.d.ts +3 -2
- package/dist/esm/pos/index.js +3 -1
- package/dist/esm/pos/texte.d.ts +48 -0
- package/dist/esm/pos/texte.js +37 -0
- package/dist/esm/receipt/layout.js +29 -3
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +14 -3
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/expected/voucher-return-tip.grid32.txt +32 -0
- package/fixtures/expected/voucher-return-tip.grid48.txt +31 -0
- package/fixtures/expected/voucher-return-tip.lines.json +292 -0
- package/fixtures/expected/voucher-return-tip.sheet32.json +218 -0
- package/fixtures/expected/voucher-return-tip.sheet48.json +212 -0
- package/fixtures/expected/voucher-return.grid32.txt +29 -0
- package/fixtures/expected/voucher-return.grid48.txt +28 -0
- package/fixtures/expected/voucher-return.lines.json +237 -0
- package/fixtures/expected/voucher-return.sheet32.json +200 -0
- package/fixtures/expected/voucher-return.sheet48.json +194 -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 +41 -1
- package/fixtures/receipts/voucher-return-tip.json +83 -0
- package/fixtures/receipts/voucher-return.json +65 -0
- package/fixtures/surface.json +6 -3
- package/fixtures/v3/antworten/belege.json +1 -1
- package/fixtures/v3/antworten/belegmail.json +1 -1
- package/fixtures/v3/antworten/berichte.json +1 -1
- package/fixtures/v3/antworten/kasse-belege.json +1 -1
- package/fixtures/v3/antworten/kasse.json +315 -51
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +1 -1
- package/fixtures/v3/antworten/storno.json +1 -1
- package/fixtures/v3/stored/belege.json +1 -1
- package/fixtures/v3/stored/kasse.json +59 -18
- package/fixtures/v3/stored/rechnungen.json +1 -1
- package/fixtures/v3/v3-vokabular.json +143 -24
- package/fixtures/v3/zahlbetrag-faelle.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ Was vor 0.7.0 geschah, steht in der Commit-Historie (`git log`); ab hier wird
|
|
|
4
4
|
es hier geführt. Ein Eintrag nennt die Änderung **und ihren Grund** —
|
|
5
5
|
nur der Grund überlebt den nächsten Umbau.
|
|
6
6
|
|
|
7
|
+
## 1.25.0 - 2026-11-03
|
|
8
|
+
|
|
9
|
+
Return as voucher on cancellation (backend November 2026): instead of money, the customer gets a new multi-purpose voucher of the account's return type; the cancellation receipt stays the same as a cash cancellation. Additive; without `refundAs` requests and answers stay byte for byte as before.
|
|
10
|
+
|
|
11
|
+
- **`cancelReceipt` gains `refundAs?: 'voucher'` and `idempotencyKey?: string`.** `refundAs` needs a key (1 to 120 characters, checked before sending) and never goes together with `payments` (the server builds the refund itself; an employee tip goes back in cash). Only on the register path with a register user; the register shows the choice only when `getKasseSettings` carries `vouchers.returnType`. Reason: without a key a retried partial cancellation could create a second receipt and a second voucher.
|
|
12
|
+
- **`CancelReceiptResult.issuedVouchers?: ReturnIssuedVoucher[]`** and **`replayed?: true`**: the new voucher with its plain code exactly once (`fromReturn: true`); a retry with the same key returns the same receipt, the voucher without `code` and with `reprintRequired: true`. New type `ReturnIssuedVoucher`; `IssuedVoucher` gains `fromReturn?: true`.
|
|
13
|
+
- **`PosVoucherSettings.returnType?: PosVoucherReturnType`** (`{ typeId, typeName }`, read from `getKasseSettings` `vouchers.returnType`): present only when the return as voucher is possible (switch on, a fitting type); a malformed block leaves it out. The register shows „Als Gutschein“ only with it.
|
|
14
|
+
- **`Voucher.fromReturn`** (read only, a server field): the entry of the new voucher on the cancellation receipt (`action: redeem`, multi-purpose).
|
|
15
|
+
- **Receipt layout:** a cancellation with such an entry shows „Gesamt: -24,90 €“ like a cash cancellation and below it „Gutschein ····-2D9A -24,90 €“ instead of the payment method; a cash tip refund follows as „Barzahlung -2,00 €“. No „Zwischensumme“, no „Rest am Gutschein“. Golden receipts `voucher-return` and `voucher-return-tip` (lines, grid 32/48, sheet, print digests); all other goldens unchanged. Reason: the old rendering read like a redemption („Gutschein 24,90 €“, „Gesamt: 0,00 €“).
|
|
16
|
+
- **`CANCELLATION_ERROR_CODES`** gains `refund_as_invalid`, `refund_as_conflict`, `refund_as_voucher_not_available`, `refund_as_voucher_reason`, `refund_as_voucher_with_voucher`, `refund_as_voucher_no_type`, `refund_as_voucher_amount`, `idempotency_key_required` (after the tip codes, as in the contract).
|
|
17
|
+
- **Texts:** `cancellation.as_voucher` „Als Gutschein“, `cancellation.voucher_confirm` „{amount} als Gutschein zurückgeben“, six messages for a refusal (`cancellation.voucher_*`), mapped by code in `CANCELLATION_PAYMENT_ERROR_MESSAGES` (the invalid-input codes and `idempotency_conflict` map to `cancellation.input_rejected`).
|
|
18
|
+
- Contract `v3` re-fetched from the backend (refund codes in `errorCodes.cancellation`, `getKasseSettings` `vouchers.returnType`, vocabulary `refundAs`, `issuedVouchers`, `fromReturn`, `returnTypeId`, `return_issue`); `./stored` vocabulary regenerated.
|
|
19
|
+
|
|
20
|
+
## 1.24.0 - 2026-11-02
|
|
21
|
+
|
|
22
|
+
Kasseneck Connect inventory: the register reports which Connect version runs at which register device, so Kasseneck can see who still runs an old Connect before setting a minimum version. Additive.
|
|
23
|
+
|
|
24
|
+
- **`POS_CALLS` gains `reportConnectState`** (now 49; only on the register path), classified as unknown outcome on a timeout like `logReceiptOutputs`. `reportConnectState(transport, report)` (`./pos`) sends exactly `deviceId`, `version`, `os`, `osVersion`, `arch`, `features`, `httpsTrusted` and `bluetooth` (`ConnectStateReport`); `osVersion`, `arch`, `httpsTrusted` and `bluetooth` may be `null`, `features` may be empty (older Connect versions know none of them). The form is checked before sending (`KasseneckValidationError`, `scope: 'request'`; an unknown field is rejected, so nothing that names the computer or a person slips in); what the server does not accept it rejects with `invalid_connect_report`. Answer: nothing. Reason: Connect itself never talks to Kasseneck; the register knows account and device and reads Connect's status anyway.
|
|
25
|
+
- **`getKasseSettings`** (`/v3`) now carries `connect { minimumVersion, deadline }` (both `null` without a requirement); read by the register to show the update hint. Contract v3 fetched again from the backend.
|
|
26
|
+
|
|
7
27
|
## 1.23.0 - 2026-10-31
|
|
8
28
|
|
|
9
29
|
The tab *Prüfung* at the register (*Kassennachschau*, stage 2b): the register info for the inspector on screen and as a printout, the words of the tab (register info, zero receipt, DEP) and two DEP sentences without legal wording. Additive.
|
|
@@ -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", "logReceiptOutputs", "getRegisterInspectionInfo"];
|
|
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", "logReceiptOutputs", "getRegisterInspectionInfo", "reportConnectState"];
|
|
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", "logReceiptOutputs", "createDepExport", "getDepExport", "getDepExportFile", "createDepHandoverLink", "revokeDepHandoverLink", "getRegisterInspectionInfo"];
|
|
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", "logReceiptOutputs", "createDepExport", "getDepExport", "getDepExportFile", "createDepHandoverLink", "revokeDepHandoverLink", "getRegisterInspectionInfo", "reportConnectState"];
|
|
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", "hobexPayApi", "hobexRefundApi", "issueInvoice", "logMyDrawerOpenings", "logReceiptOutputs", "openMyShift", "orderSignatureCard", "pairRegisterDevice", "receiveGoods", "recordInvoicePayment", "recordMyCashMovement", "recordMyStocktakeCount", "recordStockLoss", "recordStocktakeCount", "recountStocktake", "releaseReservation", "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", "hobexPayApi", "hobexRefundApi", "issueInvoice", "logMyDrawerOpenings", "logReceiptOutputs", "openMyShift", "orderSignatureCard", "pairRegisterDevice", "receiveGoods", "recordInvoicePayment", "recordMyCashMovement", "recordMyStocktakeCount", "recordStockLoss", "recordStocktakeCount", "recountStocktake", "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
|
/**
|
|
@@ -154,6 +154,8 @@ exports.ALL_CALLS = [
|
|
|
154
154
|
'logReceiptOutputs',
|
|
155
155
|
// Kasseninfo fuer die Pruefung (Kassennachschau, Stufe 2b, ./pos): nur ueber den Kassenweg.
|
|
156
156
|
'getRegisterInspectionInfo',
|
|
157
|
+
// Connect-Bestand (./pos): welche Connect-Version an welchem Kassengeraet laeuft; nur ueber den Kassenweg.
|
|
158
|
+
'reportConnectState',
|
|
157
159
|
];
|
|
158
160
|
/**
|
|
159
161
|
* Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
|
|
@@ -348,6 +350,8 @@ exports.POS_CALLS = [
|
|
|
348
350
|
'revokeDepHandoverLink',
|
|
349
351
|
// Kasseninfo fuer die Pruefung (Stufe 2b): nur ueber den Kassenweg, jeder Kassen-Benutzer.
|
|
350
352
|
'getRegisterInspectionInfo',
|
|
353
|
+
// Connect-Bestand: nur ueber den Kassenweg, jeder Kassen-Benutzer.
|
|
354
|
+
'reportConnectState',
|
|
351
355
|
];
|
|
352
356
|
/**
|
|
353
357
|
* Die Aufrufe **mit Wirkung**, alphabetisch: sie legen etwas an, aendern oder
|
|
@@ -410,6 +414,7 @@ exports.UNKNOWN_OUTCOME_CALLS = [
|
|
|
410
414
|
'recordStocktakeCount',
|
|
411
415
|
'recountStocktake',
|
|
412
416
|
'releaseReservation',
|
|
417
|
+
'reportConnectState',
|
|
413
418
|
'reportCustomerContract',
|
|
414
419
|
'requestCustomerSignature',
|
|
415
420
|
'reverseStockMovement',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReceiptType, type ReceiptTypeKey, KeckPaymentMethod, type KeckPaymentMethodKey } from '../enums/index.js';
|
|
2
|
+
import { type ReturnIssuedVoucher } from '../models/voucher.js';
|
|
2
3
|
import type { ManualReceipt } from '../models/manual-receipt.js';
|
|
3
4
|
import { type Receipt, type ReceiptCompany, type ReceiptItem, type Voucher, type ReceiptSummary, type ReportMonth, type CancellationItem, type CancellationOf, type CancellationReason, type TipRefundSource, type ReturnDisposition, type ReceiptPaymentInput, type RegistrationInfo, type ReceiptEmailVia } from '../models/index.js';
|
|
4
5
|
import { type ReceiptOutput, type ReceiptOutputEntryErrorCode, type ReceiptOutputLogKind, type ReceiptOutputResult } from '../models/receipt-output.js';
|
|
@@ -200,6 +201,20 @@ export type CancelReceiptOptions = {
|
|
|
200
201
|
* aus der Lade (kein „gibt die Mitarbeiterin direkt“).
|
|
201
202
|
*/
|
|
202
203
|
tipRefundSource?: TipRefundSource;
|
|
204
|
+
/**
|
|
205
|
+
* Rueckgabe als Gutschein (Server 2026-11): `voucher` -- statt Geld bekommt der Kunde einen neuen
|
|
206
|
+
* Mehrzweck-Gutschein der Rueckgabe-Sorte (`getKasseSettings` `vouchers.returnType`). Nur ueber den
|
|
207
|
+
* Kassenweg mit Kassen-Benutzer, nur ohne `payments` (der Server baut die Rueckzahlung selbst; ein
|
|
208
|
+
* Mitarbeiter-Trinkgeld geht bar zurueck). Braucht [idempotencyKey]. Den Klartext-Code liefert
|
|
209
|
+
* [CancelReceiptResult.issuedVouchers] genau einmal.
|
|
210
|
+
*/
|
|
211
|
+
refundAs?: 'voucher';
|
|
212
|
+
/**
|
|
213
|
+
* Schluessel der Wiederholung (1 bis 120 Zeichen), Pflicht mit [refundAs]: die Kasse erzeugt ihn beim
|
|
214
|
+
* Oeffnen der Bestaetigung und schickt ihn bei jedem erneuten Senden mit. Gleicher Schluessel, gleicher
|
|
215
|
+
* Inhalt = derselbe Beleg (`replayed`), nie ein zweiter Gutschein; anderer Inhalt = `idempotency_conflict`.
|
|
216
|
+
*/
|
|
217
|
+
idempotencyKey?: string;
|
|
203
218
|
} & ({
|
|
204
219
|
receipt: Receipt;
|
|
205
220
|
cashregisterId?: string;
|
|
@@ -214,6 +229,10 @@ export interface CancelReceiptResult {
|
|
|
214
229
|
receipt: Receipt;
|
|
215
230
|
cancellationOf: CancellationOf;
|
|
216
231
|
remaining: number[];
|
|
232
|
+
/** Nur mit `refundAs: 'voucher'`: der ausgegebene Gutschein (Klartext-Code nur beim ersten Mal). */
|
|
233
|
+
issuedVouchers?: ReturnIssuedVoucher[];
|
|
234
|
+
/** Nur bei einer Wiederholung mit demselben `idempotencyKey`: `true`, es entstand kein neuer Beleg. */
|
|
235
|
+
replayed?: true;
|
|
217
236
|
}
|
|
218
237
|
/**
|
|
219
238
|
* Beleg **und** die Firmen-/Druckdaten derselben Antwort — das Ergebnis der
|
|
@@ -315,6 +315,18 @@ async function cancelReceipt(transport, options) {
|
|
|
315
315
|
if (options.tipRefundSource !== undefined && options.refundTip === false) {
|
|
316
316
|
throw new errors_js_1.KasseneckValidationError('cancelReceipt', 'tipRefundSource nur, wenn das Trinkgeld zurueckgeht (refundTip nicht false)', 'request');
|
|
317
317
|
}
|
|
318
|
+
if (options.refundAs !== undefined) {
|
|
319
|
+
if (options.refundAs !== 'voucher')
|
|
320
|
+
throw new errors_js_1.KasseneckValidationError('cancelReceipt', 'refundAs: erlaubt ist nur voucher (oder weglassen)', 'request');
|
|
321
|
+
if (options.payments != null)
|
|
322
|
+
throw new errors_js_1.KasseneckValidationError('cancelReceipt', 'refundAs und payments gehen nicht zusammen: die Rueckzahlung baut der Server', 'request');
|
|
323
|
+
}
|
|
324
|
+
if (options.refundAs !== undefined || options.idempotencyKey !== undefined) {
|
|
325
|
+
const k = options.idempotencyKey;
|
|
326
|
+
if (typeof k !== 'string' || k.trim() === '' || k.length > BELEG_SCHLUESSEL_MAX) {
|
|
327
|
+
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `idempotencyKey muss ein Text mit 1 bis ${BELEG_SCHLUESSEL_MAX} Zeichen sein (Pflicht mit refundAs)`, 'request');
|
|
328
|
+
}
|
|
329
|
+
}
|
|
318
330
|
const altfeld = ALTE_ZAHLFELDER.find((feld) => options[feld] != null);
|
|
319
331
|
if (altfeld != null) {
|
|
320
332
|
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `${altfeld} gibt es unter /v3 nicht mehr: Rueckzahlungen gehen als payments hinaus.`, 'request');
|
|
@@ -343,6 +355,10 @@ async function cancelReceipt(transport, options) {
|
|
|
343
355
|
params.refundTip = options.refundTip;
|
|
344
356
|
if (options.tipRefundSource !== undefined)
|
|
345
357
|
params.tipRefundSource = options.tipRefundSource;
|
|
358
|
+
if (options.refundAs !== undefined)
|
|
359
|
+
params.refundAs = options.refundAs;
|
|
360
|
+
if (options.idempotencyKey !== undefined)
|
|
361
|
+
params.idempotencyKey = options.idempotencyKey;
|
|
346
362
|
const daten = await transport('cancelReceipt', params);
|
|
347
363
|
return (0, errors_js_1.signiertGelesen)('cancelReceipt', () => stornoAusHuelle(daten));
|
|
348
364
|
}
|
|
@@ -365,6 +381,7 @@ function stornoAusHuelle(daten) {
|
|
|
365
381
|
...(typeof bezug.timeStamp === 'string' && bezug.timeStamp !== '' ? { timeStamp: bezug.timeStamp } : {}),
|
|
366
382
|
},
|
|
367
383
|
remaining: huelle.remaining,
|
|
384
|
+
...rueckgabeGutscheine(daten),
|
|
368
385
|
};
|
|
369
386
|
}
|
|
370
387
|
/** Nullbeleg (RKSV-Pruefbeleg) — ohne Positionen und ohne Zahlungsart. */
|
|
@@ -1061,3 +1078,14 @@ function paymentsExpectedCents(error) {
|
|
|
1061
1078
|
const wert = error.details['expectedCents'];
|
|
1062
1079
|
return Number.isSafeInteger(wert) ? wert : undefined;
|
|
1063
1080
|
}
|
|
1081
|
+
/** `issuedVouchers` und `replayed` einer Storno-Antwort; nur was dasteht (ohne refundAs: nichts). */
|
|
1082
|
+
function rueckgabeGutscheine(daten) {
|
|
1083
|
+
const d = daten;
|
|
1084
|
+
const liste = Array.isArray(d.issuedVouchers)
|
|
1085
|
+
? d.issuedVouchers.filter((v) => v !== null && typeof v === 'object' && typeof v.id === 'string')
|
|
1086
|
+
: null;
|
|
1087
|
+
return {
|
|
1088
|
+
...(liste !== null ? { issuedVouchers: liste } : {}),
|
|
1089
|
+
...(d.replayed === true ? { replayed: true } : {}),
|
|
1090
|
+
};
|
|
1091
|
+
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
|
|
2
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, type Voucher, type VoucherArticle, type IssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS, type ReceiptOutputLogKind, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputResult, RECEIPT_OUTPUT_ENTRIES_MAX, type ReceiptOutput, type ReceiptOutputActor, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, type ReceiptOutputEntryErrorCode, RECEIPT_OUTPUT_ERROR_CODES, type ReceiptOutputErrorCode, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, type ReceiptOutputFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type 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, 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';
|
|
@@ -54,7 +54,7 @@ export declare function isReturnDisposition(value: unknown): value is ReturnDisp
|
|
|
54
54
|
* [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
|
|
55
55
|
* `KasseneckApiError.code` lesbar.
|
|
56
56
|
*/
|
|
57
|
-
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", "tip_refund_conflict", "invalid_tip_refund_source", "tip_refund_source_requires_cash", "tip_keep_not_possible_with_voucher", "account_not_found", "action_confirmation_required", "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", "second_factor_required", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
|
|
57
|
+
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", "tip_refund_conflict", "invalid_tip_refund_source", "tip_refund_source_requires_cash", "tip_keep_not_possible_with_voucher", "refund_as_invalid", "refund_as_conflict", "refund_as_voucher_not_available", "refund_as_voucher_reason", "refund_as_voucher_with_voucher", "refund_as_voucher_no_type", "refund_as_voucher_amount", "idempotency_key_required", "account_not_found", "action_confirmation_required", "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", "second_factor_required", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
|
|
58
58
|
export type CancellationErrorCode = (typeof CANCELLATION_ERROR_CODES)[number];
|
|
59
59
|
export declare function isCancellationErrorCode(value: unknown): value is CancellationErrorCode;
|
|
60
60
|
/** Der Code eines geworfenen Fehlers, wenn er in [CANCELLATION_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -97,6 +97,15 @@ exports.CANCELLATION_ERROR_CODES = Object.freeze([
|
|
|
97
97
|
'invalid_tip_refund_source', // tipRefundSource nicht drawer oder employee
|
|
98
98
|
'tip_refund_source_requires_cash', // eine Quelle nur, wenn das Bargeld des Stornos das Trinkgeld deckt
|
|
99
99
|
'tip_keep_not_possible_with_voucher', // refundTip false an einem Beleg mit Wertgutschein (das Trinkgeld geht mit)
|
|
100
|
+
// Rueckgabe als Gutschein (refundAs voucher, Server 2026-11)
|
|
101
|
+
'refund_as_invalid', // refundAs ist nicht voucher
|
|
102
|
+
'refund_as_conflict', // refundAs zusammen mit payments
|
|
103
|
+
'refund_as_voucher_not_available', // ohne Kassen-Benutzer oder Gutscheinverkauf an der Kasse aus
|
|
104
|
+
'refund_as_voucher_reason', // Grund passt nicht (nur customer_cancelled, other)
|
|
105
|
+
'refund_as_voucher_with_voucher', // am Original haengt ein Gutschein mit Code
|
|
106
|
+
'refund_as_voucher_no_type', // keine passende Rueckgabe-Sorte eingestellt
|
|
107
|
+
'refund_as_voucher_amount', // Betrag ohne Trinkgeld ausserhalb 1,00 bis 10.000,00 Euro
|
|
108
|
+
'idempotency_key_required', // refundAs ohne idempotencyKey
|
|
100
109
|
// Anmeldung und Rand (errorCodes.auth ohne Partner-Zugang, errorCodes.edge)
|
|
101
110
|
'account_not_found',
|
|
102
111
|
'action_confirmation_required',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, } from './receipt-item.js';
|
|
2
|
-
export { type Voucher, type VoucherArticle, type IssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields } from './voucher.js';
|
|
2
|
+
export { type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields } 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';
|
|
5
5
|
export { type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, } from './receipt-payment.js';
|
|
@@ -52,6 +52,11 @@ export interface Voucher {
|
|
|
52
52
|
article?: VoucherArticle;
|
|
53
53
|
balanceAfterCents?: number;
|
|
54
54
|
remainingQuantityAfter?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Rueckgabe als Gutschein: der Eintrag am Storno-Beleg ist die Ausgabe eines neuen Mehrzweck-
|
|
57
|
+
* Gutscheins statt einer Rueckzahlung (`action: redeem`). Am Bon Zahlweg statt Einloesung.
|
|
58
|
+
*/
|
|
59
|
+
fromReturn?: boolean;
|
|
55
60
|
taxedWith?: string;
|
|
56
61
|
exempt?: boolean;
|
|
57
62
|
zeroRateBucket?: boolean;
|
|
@@ -74,6 +79,8 @@ export interface IssuedVoucher {
|
|
|
74
79
|
/** Verkauf ueber eine Sorte: ihre Kennung und ihr Name; sonst fehlen die Felder. */
|
|
75
80
|
typeId?: string;
|
|
76
81
|
typeName?: string;
|
|
82
|
+
/** Rueckgabe als Gutschein (`cancelReceipt` mit `refundAs: 'voucher'`): `true`; fehlt beim Verkauf. */
|
|
83
|
+
fromReturn?: true;
|
|
77
84
|
validity?: {
|
|
78
85
|
pattern: string;
|
|
79
86
|
/** Sorte „N Jahre“: die Zahl N (Muster `1+3` fuer jedes N, die Daten gelten); fehlt sonst. */
|
|
@@ -83,6 +90,17 @@ export interface IssuedVoucher {
|
|
|
83
90
|
validUntil: string | null;
|
|
84
91
|
};
|
|
85
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Gutschein aus einer Rueckgabe in der Antwort von `cancelReceipt` (`data.issuedVouchers[]`). Beim ersten
|
|
95
|
+
* Mal wie [IssuedVoucher] mit Klartext-Code; bei einer Wiederholung mit demselben `idempotencyKey` ohne
|
|
96
|
+
* `code`, dafuer `reprintRequired: true` (der Zettel kommt dann ueber den Nachdruck).
|
|
97
|
+
*/
|
|
98
|
+
export type ReturnIssuedVoucher = Omit<IssuedVoucher, 'code' | 'type' | 'index'> & {
|
|
99
|
+
code?: string;
|
|
100
|
+
type?: string;
|
|
101
|
+
index?: number;
|
|
102
|
+
reprintRequired?: true;
|
|
103
|
+
};
|
|
86
104
|
/** Artikel eines Leistungsgutscheins, wie der Server ihn am Beleg festhaelt. */
|
|
87
105
|
export interface VoucherArticle {
|
|
88
106
|
id: string;
|
|
@@ -138,7 +156,7 @@ export declare function istWertVerkauf(voucher: Pick<Voucher, 'type' | 'action'
|
|
|
138
156
|
* Felder, die nur der Server setzt; an einem Wunsch sind sie `voucher_invalid`.
|
|
139
157
|
* Sortenname und Auszahlung friert der Server beim Verkauf ein (Stufe 4b).
|
|
140
158
|
*/
|
|
141
|
-
export declare const GUTSCHEIN_SERVERFELDER: readonly ["voucherId", "codeSuffix", "zeroRateBucket", "voucherType", "typeName", "payout"];
|
|
159
|
+
export declare const GUTSCHEIN_SERVERFELDER: readonly ["voucherId", "codeSuffix", "zeroRateBucket", "voucherType", "typeName", "payout", "fromReturn"];
|
|
142
160
|
/** Welche Serverfelder tragt der Gutschein (leere Liste = keines)? */
|
|
143
161
|
export declare function voucherServerFields(voucher: Voucher): string[];
|
|
144
162
|
export declare function toVoucherPayload(voucher: Voucher): VoucherPayload;
|
|
@@ -42,14 +42,14 @@ function istWertVerkauf(voucher) {
|
|
|
42
42
|
* Felder, die nur der Server setzt; an einem Wunsch sind sie `voucher_invalid`.
|
|
43
43
|
* Sortenname und Auszahlung friert der Server beim Verkauf ein (Stufe 4b).
|
|
44
44
|
*/
|
|
45
|
-
exports.GUTSCHEIN_SERVERFELDER = ['voucherId', 'codeSuffix', 'zeroRateBucket', 'voucherType', 'typeName', 'payout'];
|
|
45
|
+
exports.GUTSCHEIN_SERVERFELDER = ['voucherId', 'codeSuffix', 'zeroRateBucket', 'voucherType', 'typeName', 'payout', 'fromReturn'];
|
|
46
46
|
/** Welche Serverfelder tragt der Gutschein (leere Liste = keines)? */
|
|
47
47
|
function voucherServerFields(voucher) {
|
|
48
48
|
return exports.GUTSCHEIN_SERVERFELDER.filter((feld) => voucher[feld] != null);
|
|
49
49
|
}
|
|
50
50
|
const NEUE_FELDER = [
|
|
51
51
|
'amountCents', 'articleId', 'quantity', 'positions', 'reason', 'typeId', 'typeName', 'payout', 'voucherType', 'voucherId', 'codeSuffix',
|
|
52
|
-
'vatRateBp', 'article', 'balanceAfterCents', 'remainingQuantityAfter', 'taxedWith', 'exempt', 'zeroRateBucket',
|
|
52
|
+
'vatRateBp', 'article', 'balanceAfterCents', 'remainingQuantityAfter', 'taxedWith', 'exempt', 'zeroRateBucket', 'fromReturn',
|
|
53
53
|
];
|
|
54
54
|
function toVoucherPayload(voucher) {
|
|
55
55
|
const action = (0, enum_payload_js_1.requireEnumKey)(index_js_1.VoucherAction, voucher.action, 'Gutschein-Aktion');
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { InternerTransport } from '../client/aufrufe.js';
|
|
2
|
+
/**
|
|
3
|
+
* Was die Kasse ueber Kasseneck Connect an Kasseneck meldet (Bestand: welche Connect-Version an welchem
|
|
4
|
+
* Kassengeraet laeuft). Nur Angaben, die die Kasse von Connect liest – nie IP, Rechner- oder Benutzername.
|
|
5
|
+
* Aeltere Connect-Versionen kennen `osVersion`, `arch` und `features` nicht: dann `null` bzw. `[]`.
|
|
6
|
+
*/
|
|
7
|
+
export interface ConnectStateReport {
|
|
8
|
+
/** Kassengeraet, an dem Connect laeuft. */
|
|
9
|
+
deviceId: string;
|
|
10
|
+
/** Connect-Version, z. B. `1.4.0`. */
|
|
11
|
+
version: string;
|
|
12
|
+
/** `macos`, `windows` oder `linux`. */
|
|
13
|
+
os: string;
|
|
14
|
+
osVersion: string | null;
|
|
15
|
+
arch: string | null;
|
|
16
|
+
/** Faehigkeiten aus `GET /v1/status` (`bluetooth`, `https`, `update` …). */
|
|
17
|
+
features: string[];
|
|
18
|
+
/** Ob HTTPS vertraut ist (`tls.trusted`), `null` ohne HTTPS. */
|
|
19
|
+
httpsTrusted: boolean | null;
|
|
20
|
+
/** Bluetooth-Stand (`poweredOn`, `poweredOff`, `unauthorized` …), `null` ohne Bluetooth. */
|
|
21
|
+
bluetooth: string | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Meldet den Stand von Kasseneck Connect an diesem Kassengeraet (`reportConnectState`, nur Kassenweg).
|
|
25
|
+
* Geprueft wird nur die Form; was der Server nicht annimmt, lehnt er mit `invalid_connect_report` ab.
|
|
26
|
+
*/
|
|
27
|
+
export declare function reportConnectState(transport: InternerTransport, report: ConnectStateReport): Promise<void>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reportConnectState = reportConnectState;
|
|
4
|
+
const errors_js_1 = require("../client/errors.js");
|
|
5
|
+
const FELDER = ['deviceId', 'version', 'os', 'osVersion', 'arch', 'features', 'httpsTrusted', 'bluetooth'];
|
|
6
|
+
/**
|
|
7
|
+
* Meldet den Stand von Kasseneck Connect an diesem Kassengeraet (`reportConnectState`, nur Kassenweg).
|
|
8
|
+
* Geprueft wird nur die Form; was der Server nicht annimmt, lehnt er mit `invalid_connect_report` ab.
|
|
9
|
+
*/
|
|
10
|
+
async function reportConnectState(transport, report) {
|
|
11
|
+
const name = 'reportConnectState';
|
|
12
|
+
const anfrage = (grund) => new errors_js_1.KasseneckValidationError(name, grund, 'request');
|
|
13
|
+
if (report === null || typeof report !== 'object' || Array.isArray(report))
|
|
14
|
+
throw anfrage('Anfrage muss ein Objekt sein');
|
|
15
|
+
const fremd = Object.keys(report).find((k) => !FELDER.includes(k));
|
|
16
|
+
if (fremd != null)
|
|
17
|
+
throw anfrage(`unbekanntes Feld "${fremd}"`);
|
|
18
|
+
const text = (v) => typeof v === 'string' && v.length > 0;
|
|
19
|
+
const textOderNull = (v) => v === null || typeof v === 'string';
|
|
20
|
+
if (!text(report.deviceId))
|
|
21
|
+
throw anfrage('deviceId fehlt');
|
|
22
|
+
if (!text(report.version))
|
|
23
|
+
throw anfrage('version fehlt');
|
|
24
|
+
if (!text(report.os))
|
|
25
|
+
throw anfrage('os fehlt');
|
|
26
|
+
if (!textOderNull(report.osVersion))
|
|
27
|
+
throw anfrage('osVersion muss Text oder null sein');
|
|
28
|
+
if (!textOderNull(report.arch))
|
|
29
|
+
throw anfrage('arch muss Text oder null sein');
|
|
30
|
+
if (!Array.isArray(report.features) || !report.features.every((f) => typeof f === 'string'))
|
|
31
|
+
throw anfrage('features muss eine Liste von Texten sein');
|
|
32
|
+
if (!(report.httpsTrusted === null || typeof report.httpsTrusted === 'boolean'))
|
|
33
|
+
throw anfrage('httpsTrusted muss true, false oder null sein');
|
|
34
|
+
if (!textOderNull(report.bluetooth))
|
|
35
|
+
throw anfrage('bluetooth muss Text oder null sein');
|
|
36
|
+
await transport(name, {
|
|
37
|
+
deviceId: report.deviceId, version: report.version, os: report.os, osVersion: report.osVersion, arch: report.arch,
|
|
38
|
+
features: [...report.features], httpsTrusted: report.httpsTrusted, bluetooth: report.bluetooth,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -153,6 +153,16 @@ export interface PosVoucherSettings {
|
|
|
153
153
|
serviceArticles?: boolean;
|
|
154
154
|
/** Standardvorlage des Etiketts (Leistungsgutschein, Notausgang); `null` ohne brauchbare Vorlage. */
|
|
155
155
|
labelDefault?: VoucherLabelTemplate | null;
|
|
156
|
+
/**
|
|
157
|
+
* Sorte fuer Rueckgaben (Server 2026-11): nur gesetzt, wenn die Rueckgabe als Gutschein geht (Schalter,
|
|
158
|
+
* passende Sorte). Fehlt sie, zeigt die Kasse „Als Gutschein“ nicht.
|
|
159
|
+
*/
|
|
160
|
+
returnType?: PosVoucherReturnType;
|
|
161
|
+
}
|
|
162
|
+
/** Sorte fuer Rueckgaben (`vouchers.returnType`): Kennung und Name. */
|
|
163
|
+
export interface PosVoucherReturnType {
|
|
164
|
+
typeId: string;
|
|
165
|
+
typeName: string;
|
|
156
166
|
}
|
|
157
167
|
/** Ohne Block `vouchers` (alter Server, Konto ohne Schalter): Verkaufen ist aus. */
|
|
158
168
|
export declare const VOUCHER_SETTINGS_DEFAULTS: Readonly<PosVoucherSettings>;
|
|
@@ -82,8 +82,15 @@ function posVoucherSettingsFromWire(block) {
|
|
|
82
82
|
types,
|
|
83
83
|
serviceArticles: leistung,
|
|
84
84
|
labelDefault: vorlageVomDraht(b['labelDefault']),
|
|
85
|
+
...rueckgabeSorteVomDraht(b['returnType']),
|
|
85
86
|
};
|
|
86
87
|
}
|
|
88
|
+
/** `vouchers.returnType`, nur stimmig (Kennung wie eine Sorte, Name als Text); sonst fehlt es. */
|
|
89
|
+
function rueckgabeSorteVomDraht(roh) {
|
|
90
|
+
if (!istObjekt(roh) || typeof roh['typeId'] !== 'string' || !SORTE_ID.test(roh['typeId']) || typeof roh['typeName'] !== 'string')
|
|
91
|
+
return {};
|
|
92
|
+
return { returnType: { typeId: roh['typeId'], typeName: roh['typeName'] } };
|
|
93
|
+
}
|
|
87
94
|
/** Kennung wie am Server (gutschein-core.ID_MUSTER): reservierte `__…__` gibt es nie als Sorte. */
|
|
88
95
|
const SORTE_ID = /^(?!__.*__$)[A-Za-z0-9_-]{1,128}$/;
|
|
89
96
|
/** Grenzen des Servers (gutschein-core.pruefeSorte): Fixbetrag 1,00 bis 10.000,00 €, Gueltigkeit 1 bis 30 Jahre. */
|
package/dist/cjs/pos/index.d.ts
CHANGED
|
@@ -16,14 +16,15 @@ export { type NetworkPrinter, type PrintJob, type PrintJobStatus, PRINT_JOB_STAT
|
|
|
16
16
|
export { listMyTipRecipients } from './trinkgeld.js';
|
|
17
17
|
export { depFolderName } from './dep.js';
|
|
18
18
|
export { type RegisterInspectionInfo, type RegisterInspectionSignature, type InspectionSignatureStatus, type InspectionInfoRow, type InspectionInfoRowKey, type InspectionInfoSection, type InspectionInfoLinesOptions, getRegisterInspectionInfo, inspectionInfoRows, inspectionInfoLines, } from './kasseninfo.js';
|
|
19
|
+
export { type ConnectStateReport, reportConnectState } from './connect-bestand.js';
|
|
19
20
|
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';
|
|
20
21
|
export { type ListMyStocktakesOptions, type ListMyStocktakeItemsOptions, type ListMyStocktakeCountsOptions, type RecordMyStocktakeCountOptions, type VoidMyStocktakeCountOptions, listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMyStocktakeCount, voidMyStocktakeCount, parseQuantityMilli, } from './inventur.js';
|
|
21
22
|
export type { Stocktake, StocktakeItem, StocktakeCount, StocktakeCountResult, StocktakeItemPage, StocktakeCountPage, StocktakeActor, StocktakeProgress, StocktakeReview, StocktakeRecount, StocktakeScope, } from '../inventory/typen.js';
|
|
22
23
|
export type { StocktakeStatus } from '../inventory/vertrag.js';
|
|
23
|
-
export { VOUCHER_KINDS, VOUCHER_STATUSES, checkVoucher, reprintVoucherLabel, VOUCHER_SETTINGS_DEFAULTS, posVoucherSettingsFromWire, VOUCHER_PAYOUTS, VOUCHER_TYPE_KINDS, VOUCHER_AMOUNT_MODES, VOUCHER_TYPE_VALIDITY_PATTERNS, type VoucherKind, type VoucherStatus, type VoucherValidity, type VoucherArticle, type VoucherCheck, type PosVoucherSettings, type VoucherPayout, type VoucherTypeKind, type PosVoucherType, type VoucherLabelTemplate, } from './gutschein.js';
|
|
24
|
+
export { VOUCHER_KINDS, VOUCHER_STATUSES, checkVoucher, reprintVoucherLabel, VOUCHER_SETTINGS_DEFAULTS, posVoucherSettingsFromWire, VOUCHER_PAYOUTS, VOUCHER_TYPE_KINDS, VOUCHER_AMOUNT_MODES, VOUCHER_TYPE_VALIDITY_PATTERNS, type VoucherKind, type VoucherStatus, type VoucherValidity, type VoucherArticle, type VoucherCheck, type PosVoucherSettings, type PosVoucherReturnType, type VoucherPayout, type VoucherTypeKind, type PosVoucherType, type VoucherLabelTemplate, } from './gutschein.js';
|
|
24
25
|
export { type GetMyDrawerStateOptions, type OpenMyShiftOptions, type RecordMyCashMovementOptions, type DrawerOpeningEntry, type LogMyDrawerOpeningsOptions, type GetMyShiftReportOptions, type TipPayout, type CloseMyShiftOptions, type AfterCountOption, getMyDrawerState, openMyShift, recordMyCashMovement, logMyDrawerOpenings, getMyShiftReport, closeMyShift, sumDenominations, parseCentsAllowZero, newIdempotencyKey, shiftTipLines, durationText, type ShiftTipLine, type ShiftTipLineKey, } from './schicht.js';
|
|
25
26
|
export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATIONS, OPENING_REASONS, MANUAL_OPENING_REASONS, SHIFT_RECEIPT_KINDS, AFTER_COUNT_TYPES, type AfterCountType, type AfterCount, type EurDenomination, type MovementType, type ManualMovementType, type CashLocation, type OpeningReason, type ManualOpeningReason, type ShiftReceiptKind, type ShiftStatus, type ShiftActorRole, type Denominations, type ShiftActor, type DrawerInfo, type DrawerRights, type NonCashAmount, type ShiftTipTotals, type ShiftTip, type ShiftRunningTotals, type ShiftReconciliation, type Shift, type TipClaim, type DrawerOpening, type DrawerState, type CashMovement, type ShiftReceiptHeader, type ShiftReceiptMovement, type ShiftReceiptTip, type ShiftSummaryReceipt, type CashMovementReceipt, type ShiftReceipt, type OpenShiftResult, type CashMovementResult, type DrawerOpeningsResult, type ShiftReport, type CloseShiftResult, } from './schicht-typen.js';
|
|
26
27
|
export { type ShiftReceiptLayoutOptions, shiftReceiptLayout, cashMovementLayout } from '../receipt/shift-sheet.js';
|
|
27
28
|
export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputKind, type ReceiptOutputResult } from '../models/receipt-output.js';
|
|
28
29
|
export { RETURN_DISPOSITIONS, isReturnDisposition, type ReturnDisposition } from '../models/cancellation.js';
|
|
29
|
-
export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
|
|
30
|
+
export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
|
package/dist/cjs/pos/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.quantityRuleForUnit = exports.QUANTITY_RULES = exports.listMyArticles = exports.listMyArticleGroups = exports.fromPosArticlePayload = exports.fromArticleGroupPayload = exports.DONE_SCREEN_SECONDS = exports.WATERMARK_SCALE = exports.LOGO_SCALE = exports.WATERMARK_STRENGTH = exports.WATERMARK_SIDE = exports.DISCOUNT = exports.AUTO_LOGOUT_MINUTES = exports.TILE_STYLE = exports.SETTINGS_FONT_SIZE = exports.LOGO_SIZE = exports.QR_MODE = exports.DRAWER_AUTO_OPEN = exports.CUT = exports.CODE_PAGE = exports.PAPER_SIZE = exports.TERMINAL_TYPE = exports.TERMINAL_VIA = exports.PRINTER_TYPE = exports.TILE_HEIGHT = exports.CATEGORY_POSITION = exports.LAYOUT = exports.RECEIPT_OUTPUT = exports.CARD_PROVIDER = exports.CHECKOUT_MODE = exports.TIP_MODE = exports.QUANTITY = exports.WATERMARK = exports.FONT_SIZE = exports.THEME = exports.posShortcutConflict = exports.POS_SHORTCUT_SHARED_PAIRS = exports.posSettingsChanges = exports.unknownPosSettingValues = exports.sanitizePosSettings = exports.mergePosSettings = exports.POS_DEVICE_VALUES = exports.POS_BUSINESS_VALUES = exports.posTipKeptByDefault = exports.POS_BUSINESS_OPTIONAL_FIELDS = exports.POS_DEVICE_OPTIONAL_FIELDS = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.POS_SHORTCUT_DEFAULTS = exports.POS_SHORTCUT_ACTIONS = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.receiptOutputLabel = exports.RETURN_DISPOSITION_LABELS = exports.labelText = exports.LABELS = exports.voucherErrorMessage = exports.VOUCHER_ERROR_MESSAGES = exports.cancellationPaymentErrorMessage = exports.CANCELLATION_PAYMENT_ERROR_MESSAGES = exports.receiptEmailErrorMessage = exports.RECEIPT_EMAIL_ERROR_MESSAGES = exports.messageAppliesTo = exports.messageText = exports.messageOutcome = exports.findErrorRule = exports.CALLS_WITH_EFFECT = exports.ERROR_OUTCOME_RULES = exports.ERROR_CODE_RULES = exports.ERROR_RULES = exports.MESSAGES = exports.isReturnDisposition = exports.RETURN_DISPOSITIONS = exports.RECEIPT_OUTPUT_RESULTS = exports.RECEIPT_OUTPUT_KINDS = exports.cashMovementLayout = exports.shiftReceiptLayout = exports.AFTER_COUNT_TYPES = exports.SHIFT_RECEIPT_KINDS = exports.MANUAL_OPENING_REASONS = exports.OPENING_REASONS = exports.CASH_LOCATIONS = exports.MANUAL_MOVEMENT_TYPES = exports.MOVEMENT_TYPES = exports.EUR_DENOMINATIONS = exports.durationText = exports.shiftTipLines = exports.newIdempotencyKey = exports.parseCentsAllowZero = exports.sumDenominations = exports.closeMyShift = exports.getMyShiftReport = exports.logMyDrawerOpenings = exports.recordMyCashMovement = void 0;
|
|
4
|
+
exports.getMyDrawerState = exports.VOUCHER_TYPE_VALIDITY_PATTERNS = exports.VOUCHER_AMOUNT_MODES = exports.VOUCHER_TYPE_KINDS = exports.VOUCHER_PAYOUTS = exports.posVoucherSettingsFromWire = exports.VOUCHER_SETTINGS_DEFAULTS = exports.reprintVoucherLabel = exports.checkVoucher = exports.VOUCHER_STATUSES = exports.VOUCHER_KINDS = exports.parseQuantityMilli = exports.voidMyStocktakeCount = exports.recordMyStocktakeCount = exports.listMyStocktakeCounts = exports.listMyStocktakeItems = exports.listMyStocktakes = exports.setMyCashregisterStockLocation = exports.listMyStock = exports.listMyStockLocations = exports.STOCK_LOCATION_TYPES = exports.reportConnectState = exports.inspectionInfoLines = exports.inspectionInfoRows = exports.getRegisterInspectionInfo = exports.depFolderName = exports.listMyTipRecipients = exports.getPrintJob = exports.createPrintJob = exports.listMyPrinters = exports.isPrintJobFinished = exports.PRINT_JOB_SOURCES = exports.PRINT_JOB_STATUSES = exports.voucherPermsOf = exports.stockViewOf = exports.receiptsScopeOf = exports.cancelScopeOf = exports.distributeDiscount = exports.posFieldErrors = exports.isPosError = exports.posErrorCode = exports.isPosErrorCode = exports.POS_ERROR_CODES = exports.posSettingsFromWire = exports.setMyPosLogo = exports.setMyRegisterDeviceSettings = exports.setMyPosSettings = exports.getPosSettings = exports.allowedQuantity = exports.quantityDefaults = void 0;
|
|
5
|
+
exports.receiptOutputLabel = exports.RETURN_DISPOSITION_LABELS = exports.labelText = exports.LABELS = exports.voucherErrorMessage = exports.VOUCHER_ERROR_MESSAGES = exports.cancellationErrorMessage = exports.CANCELLATION_VOUCHER_ERROR_MESSAGES = exports.cancellationPaymentErrorMessage = exports.CANCELLATION_PAYMENT_ERROR_MESSAGES = exports.receiptEmailErrorMessage = exports.RECEIPT_EMAIL_ERROR_MESSAGES = exports.messageAppliesTo = exports.messageText = exports.messageOutcome = exports.findErrorRule = exports.CALLS_WITH_EFFECT = exports.ERROR_OUTCOME_RULES = exports.ERROR_CODE_RULES = exports.ERROR_RULES = exports.MESSAGES = exports.isReturnDisposition = exports.RETURN_DISPOSITIONS = exports.RECEIPT_OUTPUT_RESULTS = exports.RECEIPT_OUTPUT_KINDS = exports.cashMovementLayout = exports.shiftReceiptLayout = exports.AFTER_COUNT_TYPES = exports.SHIFT_RECEIPT_KINDS = exports.MANUAL_OPENING_REASONS = exports.OPENING_REASONS = exports.CASH_LOCATIONS = exports.MANUAL_MOVEMENT_TYPES = exports.MOVEMENT_TYPES = exports.EUR_DENOMINATIONS = exports.durationText = exports.shiftTipLines = exports.newIdempotencyKey = exports.parseCentsAllowZero = exports.sumDenominations = exports.closeMyShift = exports.getMyShiftReport = exports.logMyDrawerOpenings = exports.recordMyCashMovement = exports.openMyShift = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* Kachel-Kasse: Einstellungen, Artikelgruppen/Artikel fuer Kacheln,
|
|
8
8
|
* Rabattverteilung, Drucker, Trinkgeld-Empfaenger, Lager (Standorte, Bestand,
|
|
@@ -104,6 +104,9 @@ var kasseninfo_js_1 = require("./kasseninfo.js");
|
|
|
104
104
|
Object.defineProperty(exports, "getRegisterInspectionInfo", { enumerable: true, get: function () { return kasseninfo_js_1.getRegisterInspectionInfo; } });
|
|
105
105
|
Object.defineProperty(exports, "inspectionInfoRows", { enumerable: true, get: function () { return kasseninfo_js_1.inspectionInfoRows; } });
|
|
106
106
|
Object.defineProperty(exports, "inspectionInfoLines", { enumerable: true, get: function () { return kasseninfo_js_1.inspectionInfoLines; } });
|
|
107
|
+
// Connect-Bestand: die Kasse meldet Version und System von Kasseneck Connect.
|
|
108
|
+
var connect_bestand_js_1 = require("./connect-bestand.js");
|
|
109
|
+
Object.defineProperty(exports, "reportConnectState", { enumerable: true, get: function () { return connect_bestand_js_1.reportConnectState; } });
|
|
107
110
|
var lager_js_1 = require("./lager.js");
|
|
108
111
|
Object.defineProperty(exports, "STOCK_LOCATION_TYPES", { enumerable: true, get: function () { return lager_js_1.STOCK_LOCATION_TYPES; } });
|
|
109
112
|
Object.defineProperty(exports, "listMyStockLocations", { enumerable: true, get: function () { return lager_js_1.listMyStockLocations; } });
|
|
@@ -176,6 +179,8 @@ Object.defineProperty(exports, "RECEIPT_EMAIL_ERROR_MESSAGES", { enumerable: tru
|
|
|
176
179
|
Object.defineProperty(exports, "receiptEmailErrorMessage", { enumerable: true, get: function () { return texte_js_1.receiptEmailErrorMessage; } });
|
|
177
180
|
Object.defineProperty(exports, "CANCELLATION_PAYMENT_ERROR_MESSAGES", { enumerable: true, get: function () { return texte_js_1.CANCELLATION_PAYMENT_ERROR_MESSAGES; } });
|
|
178
181
|
Object.defineProperty(exports, "cancellationPaymentErrorMessage", { enumerable: true, get: function () { return texte_js_1.cancellationPaymentErrorMessage; } });
|
|
182
|
+
Object.defineProperty(exports, "CANCELLATION_VOUCHER_ERROR_MESSAGES", { enumerable: true, get: function () { return texte_js_1.CANCELLATION_VOUCHER_ERROR_MESSAGES; } });
|
|
183
|
+
Object.defineProperty(exports, "cancellationErrorMessage", { enumerable: true, get: function () { return texte_js_1.cancellationErrorMessage; } });
|
|
179
184
|
Object.defineProperty(exports, "VOUCHER_ERROR_MESSAGES", { enumerable: true, get: function () { return texte_js_1.VOUCHER_ERROR_MESSAGES; } });
|
|
180
185
|
Object.defineProperty(exports, "voucherErrorMessage", { enumerable: true, get: function () { return texte_js_1.voucherErrorMessage; } });
|
|
181
186
|
Object.defineProperty(exports, "LABELS", { enumerable: true, get: function () { return texte_js_1.LABELS; } });
|
package/dist/cjs/pos/texte.d.ts
CHANGED
|
@@ -319,6 +319,24 @@ declare const MELDUNGEN_ROH: {
|
|
|
319
319
|
readonly 'cancellation.tip_refunded_with_voucher': {
|
|
320
320
|
readonly text: "Beleg mit Gutschein: Das Trinkgeld wird mitstorniert.";
|
|
321
321
|
};
|
|
322
|
+
readonly 'cancellation.voucher_not_available': {
|
|
323
|
+
readonly text: "Als Gutschein geht hier nicht – bitte wie bezahlt zurückgeben.";
|
|
324
|
+
};
|
|
325
|
+
readonly 'cancellation.voucher_reason': {
|
|
326
|
+
readonly text: "Als Gutschein nur bei „Kunde hat storniert“ oder „Sonstiges“.";
|
|
327
|
+
};
|
|
328
|
+
readonly 'cancellation.voucher_with_voucher': {
|
|
329
|
+
readonly text: "Dieser Beleg hat einen Gutschein – bitte wie bezahlt zurückgeben.";
|
|
330
|
+
};
|
|
331
|
+
readonly 'cancellation.voucher_no_type': {
|
|
332
|
+
readonly text: "Keine Gutschein-Sorte für Rückgaben eingestellt – bitte wie bezahlt zurückgeben.";
|
|
333
|
+
};
|
|
334
|
+
readonly 'cancellation.voucher_amount': {
|
|
335
|
+
readonly text: "Dieser Betrag geht nicht als Gutschein – bitte wie bezahlt zurückgeben.";
|
|
336
|
+
};
|
|
337
|
+
readonly 'cancellation.voucher_type_changed': {
|
|
338
|
+
readonly text: "Die Gutschein-Sorte für Rückgaben hat sich geändert – bitte erneut versuchen.";
|
|
339
|
+
};
|
|
322
340
|
readonly 'voucher_error.not_found': {
|
|
323
341
|
readonly text: "Diesen Gutschein gibt es in diesem Betrieb nicht.";
|
|
324
342
|
};
|
|
@@ -1109,6 +1127,29 @@ export type CancellationPaymentMessageCode = keyof typeof CANCELLATION_PAYMENT_E
|
|
|
1109
1127
|
* `cancellation.failed` auf – wie bei `receiptEmailErrorMessage`.
|
|
1110
1128
|
*/
|
|
1111
1129
|
export declare function cancellationPaymentErrorMessage(code: string | undefined | null): MessageKey;
|
|
1130
|
+
/**
|
|
1131
|
+
* Storno mit Rueckgabe als Gutschein (`refundAs: 'voucher'`, 1.25.0): welcher `code` welchen Satz bekommt.
|
|
1132
|
+
* Eigene Tabelle neben CANCELLATION_PAYMENT_ERROR_MESSAGES (die bleibt der Stand der 0.x-Linie); die Codes
|
|
1133
|
+
* fuer abgelehnte Eingaben und `idempotency_conflict` teilen sich `cancellation.input_rejected`.
|
|
1134
|
+
*/
|
|
1135
|
+
export declare const CANCELLATION_VOUCHER_ERROR_MESSAGES: {
|
|
1136
|
+
readonly refund_as_voucher_not_available: "cancellation.voucher_not_available";
|
|
1137
|
+
readonly refund_as_voucher_reason: "cancellation.voucher_reason";
|
|
1138
|
+
readonly refund_as_voucher_with_voucher: "cancellation.voucher_with_voucher";
|
|
1139
|
+
readonly refund_as_voucher_no_type: "cancellation.voucher_no_type";
|
|
1140
|
+
readonly refund_as_voucher_amount: "cancellation.voucher_amount";
|
|
1141
|
+
readonly voucher_type_not_found: "cancellation.voucher_type_changed";
|
|
1142
|
+
readonly voucher_amount_mismatch: "cancellation.voucher_type_changed";
|
|
1143
|
+
readonly refund_as_invalid: "cancellation.input_rejected";
|
|
1144
|
+
readonly refund_as_conflict: "cancellation.input_rejected";
|
|
1145
|
+
readonly idempotency_key_required: "cancellation.input_rejected";
|
|
1146
|
+
readonly idempotency_conflict: "cancellation.input_rejected";
|
|
1147
|
+
};
|
|
1148
|
+
/**
|
|
1149
|
+
* Der Satz zu einem `code` eines Stornos: zuerst die Rueckgabe als Gutschein, dann die Storno-Zahlungen,
|
|
1150
|
+
* sonst `cancellation.failed`. Fuer die Kassen der eine Weg beim Storno.
|
|
1151
|
+
*/
|
|
1152
|
+
export declare function cancellationErrorMessage(code: string | undefined | null): MessageKey;
|
|
1112
1153
|
/**
|
|
1113
1154
|
* Gutschein-Fehler (`/v3`): welcher `code` des Backends welchen Satz bekommt.
|
|
1114
1155
|
* Wie RECEIPT_EMAIL_ERROR_MESSAGES: beide Kassen entscheiden am Code. Ein
|
|
@@ -1387,6 +1428,13 @@ declare const BESCHRIFTUNGEN_ROH: {
|
|
|
1387
1428
|
readonly 'cancellation.all_cash': {
|
|
1388
1429
|
readonly text: "Alles bar";
|
|
1389
1430
|
};
|
|
1431
|
+
readonly 'cancellation.as_voucher': {
|
|
1432
|
+
readonly text: "Als Gutschein";
|
|
1433
|
+
};
|
|
1434
|
+
readonly 'cancellation.voucher_confirm': {
|
|
1435
|
+
readonly text: "{amount} als Gutschein zurückgeben";
|
|
1436
|
+
readonly placeholders: readonly ["amount"];
|
|
1437
|
+
};
|
|
1390
1438
|
readonly 'cancellation.payment_remainder': {
|
|
1391
1439
|
readonly text: "Rest {amount}";
|
|
1392
1440
|
readonly placeholders: readonly ["amount"];
|