@kreiseck/kasseneck-api 1.11.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +2 -1
- package/dist/cjs/client/aufrufe.d.ts +4 -4
- package/dist/cjs/client/aufrufe.js +15 -0
- package/dist/cjs/client/receipts.d.ts +5 -0
- package/dist/cjs/client/receipts.js +65 -6
- package/dist/cjs/enums/voucher-action.d.ts +2 -0
- package/dist/cjs/enums/voucher-action.js +2 -0
- package/dist/cjs/enums/voucher-type.d.ts +10 -0
- package/dist/cjs/enums/voucher-type.js +10 -0
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +8 -3
- package/dist/cjs/models/index.d.ts +2 -2
- package/dist/cjs/models/index.js +6 -2
- package/dist/cjs/models/receipt-errors.d.ts +1 -1
- package/dist/cjs/models/receipt-errors.js +2 -0
- package/dist/cjs/models/receipt-item.d.ts +11 -3
- package/dist/cjs/models/receipt-item.js +22 -1
- package/dist/cjs/models/receipt.d.ts +13 -1
- package/dist/cjs/models/receipt.js +18 -2
- package/dist/cjs/models/voucher.d.ts +57 -4
- package/dist/cjs/models/voucher.js +111 -3
- package/dist/cjs/partner/fehler.d.ts +1 -1
- package/dist/cjs/partner/fehler.js +2 -0
- package/dist/cjs/partner/index.d.ts +1 -1
- package/dist/cjs/partner/typen.d.ts +7 -1
- package/dist/cjs/partner/typen.js +3 -0
- package/dist/cjs/pos/client.d.ts +2 -1
- package/dist/cjs/pos/client.js +3 -1
- package/dist/cjs/pos/gutschein.d.ts +90 -0
- package/dist/cjs/pos/gutschein.js +164 -0
- package/dist/cjs/pos/index.d.ts +3 -2
- package/dist/cjs/pos/index.js +13 -2
- package/dist/cjs/pos/settings.d.ts +3 -0
- package/dist/cjs/pos/settings.js +12 -10
- package/dist/cjs/pos/texte.d.ts +229 -0
- package/dist/cjs/pos/texte.js +96 -1
- package/dist/cjs/react/index.js +8 -2
- package/dist/cjs/receipt/due.d.ts +83 -2
- package/dist/cjs/receipt/due.js +202 -36
- package/dist/cjs/receipt/grid.js +13 -1
- package/dist/cjs/receipt/gutschein-plan.d.ts +104 -0
- package/dist/cjs/receipt/gutschein-plan.js +360 -0
- package/dist/cjs/receipt/index.d.ts +1 -1
- package/dist/cjs/receipt/index.js +3 -0
- package/dist/cjs/receipt/layout.js +175 -8
- package/dist/cjs/register/pairing.d.ts +21 -1
- package/dist/cjs/register/pairing.js +17 -0
- package/dist/cjs/stored/bon-layout.d.ts +8 -0
- package/dist/cjs/stored/bon-layout.js +23 -0
- package/dist/cjs/stored/draht.d.ts +3 -1
- package/dist/cjs/stored/draht.js +53 -6
- package/dist/cjs/stored/einstellungen.js +2 -1
- package/dist/cjs/stored/gutscheine.d.ts +3 -0
- package/dist/cjs/stored/gutscheine.js +60 -0
- package/dist/cjs/stored/index.js +2 -17
- package/dist/cjs/stored/vokabular.d.ts +6 -4
- package/dist/cjs/stored/vokabular.js +48 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/aufrufe.d.ts +4 -4
- package/dist/esm/client/aufrufe.js +15 -0
- package/dist/esm/client/receipts.d.ts +5 -0
- package/dist/esm/client/receipts.js +66 -8
- package/dist/esm/enums/voucher-action.d.ts +2 -0
- package/dist/esm/enums/voucher-action.js +2 -0
- package/dist/esm/enums/voucher-type.d.ts +10 -0
- package/dist/esm/enums/voucher-type.js +10 -0
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/esm/models/index.d.ts +2 -2
- package/dist/esm/models/index.js +2 -2
- package/dist/esm/models/receipt-errors.d.ts +1 -1
- package/dist/esm/models/receipt-errors.js +2 -0
- package/dist/esm/models/receipt-item.d.ts +11 -3
- package/dist/esm/models/receipt-item.js +20 -1
- package/dist/esm/models/receipt.d.ts +13 -1
- package/dist/esm/models/receipt.js +18 -2
- package/dist/esm/models/voucher.d.ts +57 -4
- package/dist/esm/models/voucher.js +108 -3
- package/dist/esm/partner/fehler.d.ts +1 -1
- package/dist/esm/partner/fehler.js +2 -0
- package/dist/esm/partner/index.d.ts +1 -1
- package/dist/esm/partner/typen.d.ts +7 -1
- package/dist/esm/partner/typen.js +3 -0
- package/dist/esm/pos/client.d.ts +2 -1
- package/dist/esm/pos/client.js +3 -1
- package/dist/esm/pos/gutschein.d.ts +90 -0
- package/dist/esm/pos/gutschein.js +158 -0
- package/dist/esm/pos/index.d.ts +3 -2
- package/dist/esm/pos/index.js +4 -2
- package/dist/esm/pos/settings.d.ts +3 -0
- package/dist/esm/pos/settings.js +2 -0
- package/dist/esm/pos/texte.d.ts +229 -0
- package/dist/esm/pos/texte.js +94 -0
- package/dist/esm/react/index.js +8 -2
- package/dist/esm/receipt/due.d.ts +83 -2
- package/dist/esm/receipt/due.js +198 -34
- package/dist/esm/receipt/grid.js +13 -1
- package/dist/esm/receipt/gutschein-plan.d.ts +104 -0
- package/dist/esm/receipt/gutschein-plan.js +352 -0
- package/dist/esm/receipt/index.d.ts +1 -1
- package/dist/esm/receipt/index.js +1 -1
- package/dist/esm/receipt/layout.js +175 -8
- package/dist/esm/register/pairing.d.ts +21 -1
- package/dist/esm/register/pairing.js +16 -0
- package/dist/esm/stored/bon-layout.d.ts +8 -0
- package/dist/esm/stored/bon-layout.js +20 -0
- package/dist/esm/stored/draht.d.ts +3 -1
- package/dist/esm/stored/draht.js +52 -6
- package/dist/esm/stored/einstellungen.js +3 -2
- package/dist/esm/stored/gutscheine.d.ts +3 -0
- package/dist/esm/stored/gutscheine.js +56 -0
- package/dist/esm/stored/index.js +2 -17
- package/dist/esm/stored/vokabular.d.ts +6 -4
- package/dist/esm/stored/vokabular.js +48 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/expected/voucher-cancellation.grid32.txt +30 -0
- package/fixtures/expected/voucher-cancellation.grid48.txt +29 -0
- package/fixtures/expected/voucher-cancellation.lines.json +252 -0
- package/fixtures/expected/voucher-cancellation.sheet32.json +206 -0
- package/fixtures/expected/voucher-cancellation.sheet48.json +200 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.grid32.txt +25 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.grid48.txt +25 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.lines.json +259 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.sheet32.json +176 -0
- package/fixtures/expected/voucher-multi-purpose-redeem.sheet48.json +176 -0
- package/fixtures/expected/voucher-multi-purpose-sale.grid32.txt +24 -0
- package/fixtures/expected/voucher-multi-purpose-sale.grid48.txt +23 -0
- package/fixtures/expected/voucher-multi-purpose-sale.lines.json +216 -0
- package/fixtures/expected/voucher-multi-purpose-sale.sheet32.json +170 -0
- package/fixtures/expected/voucher-multi-purpose-sale.sheet48.json +164 -0
- package/fixtures/expected/voucher-payout.grid32.txt +23 -0
- package/fixtures/expected/voucher-payout.grid48.txt +22 -0
- package/fixtures/expected/voucher-payout.lines.json +216 -0
- package/fixtures/expected/voucher-payout.sheet32.json +164 -0
- package/fixtures/expected/voucher-payout.sheet48.json +158 -0
- package/fixtures/expected/voucher-service-redeem.grid32.txt +26 -0
- package/fixtures/expected/voucher-service-redeem.grid48.txt +25 -0
- package/fixtures/expected/voucher-service-redeem.lines.json +261 -0
- package/fixtures/expected/voucher-service-redeem.sheet32.json +182 -0
- package/fixtures/expected/voucher-service-redeem.sheet48.json +176 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.grid32.txt +30 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.grid48.txt +29 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.lines.json +331 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.sheet32.json +206 -0
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.sheet48.json +200 -0
- package/fixtures/expected/voucher-single-purpose-redeem.grid32.txt +25 -0
- package/fixtures/expected/voucher-single-purpose-redeem.grid48.txt +24 -0
- package/fixtures/expected/voucher-single-purpose-redeem.lines.json +246 -0
- package/fixtures/expected/voucher-single-purpose-redeem.sheet32.json +176 -0
- package/fixtures/expected/voucher-single-purpose-redeem.sheet48.json +170 -0
- package/fixtures/expected/voucher-single-purpose-sale.grid32.txt +26 -0
- package/fixtures/expected/voucher-single-purpose-sale.grid48.txt +24 -0
- package/fixtures/expected/voucher-single-purpose-sale.lines.json +225 -0
- package/fixtures/expected/voucher-single-purpose-sale.sheet32.json +182 -0
- package/fixtures/expected/voucher-single-purpose-sale.sheet48.json +170 -0
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +1 -1
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/manifest.json +64 -0
- package/fixtures/pos-texts.json +257 -1
- package/fixtures/receipt-due-generated.json +1 -1
- package/fixtures/receipt-due-voucher-generated.json +494 -0
- package/fixtures/receipts/voucher-cancellation.json +76 -0
- package/fixtures/receipts/voucher-multi-purpose-redeem.json +62 -0
- package/fixtures/receipts/voucher-multi-purpose-sale.json +63 -0
- package/fixtures/receipts/voucher-payout.json +65 -0
- package/fixtures/receipts/voucher-service-redeem.json +82 -0
- package/fixtures/receipts/voucher-single-purpose-redeem-exempt.json +86 -0
- package/fixtures/receipts/voucher-single-purpose-redeem.json +71 -0
- package/fixtures/receipts/voucher-single-purpose-sale.json +88 -0
- package/fixtures/surface.json +35 -5
- package/fixtures/v3/antworten/belege.json +3405 -3
- package/fixtures/v3/antworten/belegmail.json +5 -2
- package/fixtures/v3/antworten/kasse-belege.json +3423 -3
- package/fixtures/v3/antworten/kasse.json +621 -14
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +5 -2
- package/fixtures/v3/antworten/storno.json +214 -3
- package/fixtures/v3/stored/belege.json +5 -2
- package/fixtures/v3/stored/kasse.json +225 -4
- package/fixtures/v3/stored/rechnungen.json +5 -2
- package/fixtures/v3/v3-vokabular.json +1375 -23
- package/fixtures/v3/zahlbetrag-faelle.json +293 -3
- package/package.json +4 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
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 = "733e4385baf4b2aa50605e2ebe5903948ce77b3346aa3bb65c5fd0d450a6898f";
|
|
8
8
|
/** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
|
|
9
9
|
exports.SCHEMAS = {
|
|
10
10
|
"getReceipt": {
|
|
@@ -46,7 +46,22 @@ exports.SCHEMAS = {
|
|
|
46
46
|
"tone": "ton"
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
|
-
}
|
|
49
|
+
},
|
|
50
|
+
"issuedVouchers": [
|
|
51
|
+
{
|
|
52
|
+
"__": "gutscheine",
|
|
53
|
+
"codeSuffix": "codeEnde",
|
|
54
|
+
"faceValueCents": "nennwertCents",
|
|
55
|
+
"quantity": "stueck",
|
|
56
|
+
"validity": {
|
|
57
|
+
"__": "gueltigkeit",
|
|
58
|
+
"pattern": "muster",
|
|
59
|
+
"redeemableUntil": "einloesbarBis",
|
|
60
|
+
"refundableUntil": "rueckzahlbarBis",
|
|
61
|
+
"validUntil": "gueltigBis"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
50
65
|
},
|
|
51
66
|
"werte": {
|
|
52
67
|
"receipt.cancellationReason": {
|
|
@@ -54,6 +69,12 @@ exports.SCHEMAS = {
|
|
|
54
69
|
},
|
|
55
70
|
"layout.lines[].tone": {
|
|
56
71
|
"$catalog": "LAYOUT_TON"
|
|
72
|
+
},
|
|
73
|
+
"issuedVouchers[].type": {
|
|
74
|
+
"$catalog": "GUTSCHEIN_ART"
|
|
75
|
+
},
|
|
76
|
+
"issuedVouchers[].validity.pattern": {
|
|
77
|
+
"$catalog": "GUTSCHEIN_MUSTER"
|
|
57
78
|
}
|
|
58
79
|
}
|
|
59
80
|
},
|
|
@@ -160,6 +181,12 @@ exports.SCHEMAS = {
|
|
|
160
181
|
"terminalVia": "terminalVia",
|
|
161
182
|
"terminalType": "terminalArt",
|
|
162
183
|
"shortcutHints": "tastenMarken"
|
|
184
|
+
},
|
|
185
|
+
"vouchers": {
|
|
186
|
+
"__": "gutscheine",
|
|
187
|
+
"sale": "verkauf",
|
|
188
|
+
"valueVoucherType": "wertArt",
|
|
189
|
+
"vatRateBp": "satzBp"
|
|
163
190
|
}
|
|
164
191
|
},
|
|
165
192
|
"werte": {
|
|
@@ -210,6 +237,10 @@ exports.SCHEMAS = {
|
|
|
210
237
|
},
|
|
211
238
|
"device.terminalType": {
|
|
212
239
|
"$catalog": "KASSE_GERAET_WERTE.terminalType"
|
|
240
|
+
},
|
|
241
|
+
"vouchers.valueVoucherType": {
|
|
242
|
+
"mehrzweck": "multi_purpose",
|
|
243
|
+
"einzweck": "single_purpose"
|
|
213
244
|
}
|
|
214
245
|
}
|
|
215
246
|
},
|
|
@@ -304,6 +335,7 @@ exports.KATALOGE = {
|
|
|
304
335
|
"afa_gebaeude": "building_depreciation",
|
|
305
336
|
"anlagenabgang": "asset_disposal_book_value",
|
|
306
337
|
"instandhaltung_gebaeude": "building_maintenance",
|
|
338
|
+
"bauarbeiten": "construction_work",
|
|
307
339
|
"reise": "travel_expenses",
|
|
308
340
|
"fahrkarten": "travel_tickets",
|
|
309
341
|
"naechtigung_beleg": "lodging_invoice",
|
|
@@ -338,6 +370,8 @@ exports.KATALOGE = {
|
|
|
338
370
|
"geschenke_geschaeftsfreunde": "business_gifts",
|
|
339
371
|
"bewirtung": "hospitality",
|
|
340
372
|
"bewirtung_werbung": "hospitality_advertising",
|
|
373
|
+
"kundschaft_aufmerksamkeit": "customer_courtesy",
|
|
374
|
+
"lebensmittel": "groceries",
|
|
341
375
|
"bewirtung_voll": "hospitality_full",
|
|
342
376
|
"bewirtung_repraesentation": "hospitality_representation",
|
|
343
377
|
"sponsoring": "sponsorship",
|
|
@@ -368,6 +402,7 @@ exports.KATALOGE = {
|
|
|
368
402
|
"arbeitslosen_optin": "voluntary_unemployment_insurance",
|
|
369
403
|
"uebrige_ausgaben": "other_expenses",
|
|
370
404
|
"telefon_internet": "phone_internet",
|
|
405
|
+
"energie": "energy_utilities",
|
|
371
406
|
"buero": "office_supplies",
|
|
372
407
|
"software": "software_subscriptions",
|
|
373
408
|
"fachliteratur": "professional_literature",
|
|
@@ -399,6 +434,17 @@ exports.KATALOGE = {
|
|
|
399
434
|
"ball_kultur": "non_deductible_events",
|
|
400
435
|
"durchlaufend_ausgabe": "pass_through_payment"
|
|
401
436
|
},
|
|
437
|
+
"GUTSCHEIN_ART": {
|
|
438
|
+
"mehrzweck": "multi_purpose",
|
|
439
|
+
"einzweck": "single_purpose",
|
|
440
|
+
"leistung": "service",
|
|
441
|
+
"aktion": "promotion"
|
|
442
|
+
},
|
|
443
|
+
"GUTSCHEIN_MUSTER": {
|
|
444
|
+
"unbefristet": "unlimited",
|
|
445
|
+
"1+3": "1+3",
|
|
446
|
+
"frei": "custom"
|
|
447
|
+
},
|
|
402
448
|
"KASSE_BETRIEB_WERTE.cardProvider": {
|
|
403
449
|
"keiner": "none",
|
|
404
450
|
"extern": "external",
|
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 { PdfOrData, TransportBodyFields, TransportCallOptions } from './transport.js';
|
|
16
|
-
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "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", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "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", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift"];
|
|
16
|
+
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "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", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "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"];
|
|
17
17
|
export type ApiCall = typeof ALL_CALLS[number];
|
|
18
18
|
/**
|
|
19
19
|
* Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
|
|
@@ -21,14 +21,14 @@ export type ApiCall = typeof ALL_CALLS[number];
|
|
|
21
21
|
* (`fixtures/v3/v3-vokabular.json`, `endpoints.public`, umbenannt nach
|
|
22
22
|
* `names`). Ein Test haelt beide Listen deckungsgleich.
|
|
23
23
|
*/
|
|
24
|
-
export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "cancelReceipt", "sendReceiptEmail", "generateFullReceiptId", "downloadReceipt", "getFirstReceiptDate", "getReportV2", "downloadReport", "downloadDailyReport", "getCashregisterReport", "createPaymentLinkStripe", "stripeCaptureIntent", "hobexPayApi", "hobexRefundApi", "hobexGetStatus", "financeWebService", "listMyTipRecipients", "getPartnerInfo", "createPartnerCustomer", "checkPartnerCustomerEmail", "listPartnerCustomers", "getPartnerCustomer", "sendPartnerCustomerFonLink", "createPartnerWebhook", "updatePartnerWebhook", "deletePartnerWebhook", "listPartnerWebhooks", "sendPartnerWebhookTest", "rotatePartnerWebhookSecret", "listPartnerWebhookDeliveries", "requestCustomerSignature", "getCustomerSignatureStatus", "createCustomerCashregister", "activateCashregister", "listCustomerCashregisters", "getCustomerCredentials", "reportCustomerContract", "getPartnerBilling", "getPartnerBillingMonth", "createCustomer", "getCustomer", "updateCustomer", "searchCustomers", "issueInvoice", "cancelInvoice", "createCreditNote", "getInvoice", "listInvoices", "getInvoicePdf", "getInvoiceXml", "getInvoiceSetupStatus", "listBrands", "recordInvoicePayment", "createInvoiceItem", "updateInvoiceItem", "withdrawInvoiceItem", "getInvoiceItem", "listInvoiceItems", "setCustomerMandate", "revokeCustomerMandate", "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"];
|
|
24
|
+
export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "cancelReceipt", "sendReceiptEmail", "generateFullReceiptId", "downloadReceipt", "getFirstReceiptDate", "getReportV2", "downloadReport", "downloadDailyReport", "getCashregisterReport", "createPaymentLinkStripe", "stripeCaptureIntent", "hobexPayApi", "hobexRefundApi", "hobexGetStatus", "financeWebService", "listMyTipRecipients", "getPartnerInfo", "createPartnerCustomer", "checkPartnerCustomerEmail", "listPartnerCustomers", "getPartnerCustomer", "sendPartnerCustomerFonLink", "createPartnerWebhook", "updatePartnerWebhook", "deletePartnerWebhook", "listPartnerWebhooks", "sendPartnerWebhookTest", "rotatePartnerWebhookSecret", "listPartnerWebhookDeliveries", "requestCustomerSignature", "getCustomerSignatureStatus", "createCustomerCashregister", "activateCashregister", "listCustomerCashregisters", "getCustomerCredentials", "reportCustomerContract", "getPartnerBilling", "getPartnerBillingMonth", "createCustomer", "getCustomer", "updateCustomer", "searchCustomers", "issueInvoice", "cancelInvoice", "createCreditNote", "getInvoice", "listInvoices", "getInvoicePdf", "getInvoiceXml", "getInvoiceSetupStatus", "listBrands", "recordInvoicePayment", "createInvoiceItem", "updateInvoiceItem", "withdrawInvoiceItem", "getInvoiceItem", "listInvoiceItems", "setCustomerMandate", "revokeCustomerMandate", "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"];
|
|
25
25
|
/**
|
|
26
26
|
* Die Endpunkte des Kassenwegs (`https://kasse.kasseneck.at/api/v3/<name>`,
|
|
27
27
|
* Web-Kasse: gleicher Ursprung `/api/v3`), in der Reihenfolge von
|
|
28
28
|
* `endpoints.register`. Sechs davon sind zugleich oeffentlich; die Kasse ruft
|
|
29
29
|
* sie trotzdem ueber diesen Weg (ein Dialekt je Client, Nachtrag §5.2).
|
|
30
30
|
*/
|
|
31
|
-
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", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift"];
|
|
31
|
+
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"];
|
|
32
32
|
export type PublicCall = typeof PUBLIC_CALLS[number];
|
|
33
33
|
export type PosCall = typeof POS_CALLS[number];
|
|
34
34
|
/**
|
|
@@ -49,7 +49,7 @@ export type PosCall = typeof POS_CALLS[number];
|
|
|
49
49
|
* [ALL_CALLS], [PUBLIC_CALLS] und [POS_CALLS] steht entweder hier oder in
|
|
50
50
|
* [CALLS_WITHOUT_EFFECT] (Waechter `test/ausgang-einordnung.test.ts`).
|
|
51
51
|
*/
|
|
52
|
-
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", "openMyShift", "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"];
|
|
52
|
+
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", "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
53
|
/** Warum ein Aufruf keine Wirkung hat, die ein Zeitlimit offen lassen koennte. */
|
|
54
54
|
export type CallWithoutEffectReason = 'read' | 'repeatable';
|
|
55
55
|
/**
|
|
@@ -119,12 +119,18 @@ export const ALL_CALLS = [
|
|
|
119
119
|
'closeStocktake',
|
|
120
120
|
'cancelStocktake',
|
|
121
121
|
'getStocktakePdf',
|
|
122
|
+
// Signaturkarte bestellen und Bestellung lesen
|
|
123
|
+
'orderSignatureCard',
|
|
124
|
+
'getSignatureCardOrder',
|
|
122
125
|
// Inventur zaehlen an der Kasse (Lager-Kern Stufe 3, ./pos)
|
|
123
126
|
'listMyStocktakes',
|
|
124
127
|
'listMyStocktakeItems',
|
|
125
128
|
'listMyStocktakeCounts',
|
|
126
129
|
'recordMyStocktakeCount',
|
|
127
130
|
'voidMyStocktakeCount',
|
|
131
|
+
// Gutschein pruefen und Etikett nachdrucken (./pos)
|
|
132
|
+
'checkVoucher',
|
|
133
|
+
'reprintVoucherLabel',
|
|
128
134
|
// Schicht, Kassenstand und Lade-Protokoll an der Kasse (./pos)
|
|
129
135
|
'getMyDrawerState',
|
|
130
136
|
'openMyShift',
|
|
@@ -252,6 +258,8 @@ export const PUBLIC_CALLS = [
|
|
|
252
258
|
'closeStocktake',
|
|
253
259
|
'cancelStocktake',
|
|
254
260
|
'getStocktakePdf',
|
|
261
|
+
'orderSignatureCard',
|
|
262
|
+
'getSignatureCardOrder',
|
|
255
263
|
];
|
|
256
264
|
/**
|
|
257
265
|
* Die Endpunkte des Kassenwegs (`https://kasse.kasseneck.at/api/v3/<name>`,
|
|
@@ -295,6 +303,9 @@ export const POS_CALLS = [
|
|
|
295
303
|
'listMyStocktakeCounts',
|
|
296
304
|
'recordMyStocktakeCount',
|
|
297
305
|
'voidMyStocktakeCount',
|
|
306
|
+
// Gutschein pruefen und Etikett nachdrucken: nur ueber den Kassenweg.
|
|
307
|
+
'checkVoucher',
|
|
308
|
+
'reprintVoucherLabel',
|
|
298
309
|
// Schicht, Kassenstand und Lade-Protokoll: nur ueber den Kassenweg.
|
|
299
310
|
'getMyDrawerState',
|
|
300
311
|
'openMyShift',
|
|
@@ -353,6 +364,7 @@ export const UNKNOWN_OUTCOME_CALLS = [
|
|
|
353
364
|
'issueInvoice',
|
|
354
365
|
'logMyDrawerOpenings',
|
|
355
366
|
'openMyShift',
|
|
367
|
+
'orderSignatureCard',
|
|
356
368
|
'pairRegisterDevice',
|
|
357
369
|
'receiveGoods',
|
|
358
370
|
'recordInvoicePayment',
|
|
@@ -417,6 +429,7 @@ export const UNKNOWN_OUTCOME_CALLS = [
|
|
|
417
429
|
*/
|
|
418
430
|
export const CALLS_WITHOUT_EFFECT = Object.freeze({
|
|
419
431
|
checkPartnerCustomerEmail: 'read',
|
|
432
|
+
checkVoucher: 'read',
|
|
420
433
|
downloadDailyReport: 'read',
|
|
421
434
|
downloadReceipt: 'read',
|
|
422
435
|
downloadReport: 'read',
|
|
@@ -447,6 +460,7 @@ export const CALLS_WITHOUT_EFFECT = Object.freeze({
|
|
|
447
460
|
getReservation: 'read',
|
|
448
461
|
getStock: 'read',
|
|
449
462
|
getStocktake: 'read',
|
|
463
|
+
getSignatureCardOrder: 'read',
|
|
450
464
|
getStocktakePdf: 'read',
|
|
451
465
|
getVariantGroup: 'read',
|
|
452
466
|
hobexGetStatus: 'read',
|
|
@@ -485,6 +499,7 @@ export const CALLS_WITHOUT_EFFECT = Object.freeze({
|
|
|
485
499
|
registerPinLogin: 'repeatable',
|
|
486
500
|
registerUserLogin: 'repeatable',
|
|
487
501
|
renewRegisterSession: 'repeatable',
|
|
502
|
+
reprintVoucherLabel: 'repeatable',
|
|
488
503
|
searchCustomers: 'read',
|
|
489
504
|
});
|
|
490
505
|
const MIT_WIRKUNG = new Set(UNKNOWN_OUTCOME_CALLS);
|
|
@@ -239,6 +239,11 @@ export declare function receiptLayoutFromResult(result: ReceiptWithCompany, opti
|
|
|
239
239
|
* die Hand des Aufrufers, sondern zu einem der benannten Aufrufe darunter.
|
|
240
240
|
*/
|
|
241
241
|
export declare function createReceipt(rufen: InternerTransport, options: CreateReceiptOptions): Promise<Receipt>;
|
|
242
|
+
/**
|
|
243
|
+
* Baut die Nutzlast von `createReceipt` und prueft die Eingabe. Wirft, bevor
|
|
244
|
+
* irgendetwas rausgeht — ein Beleg ist nicht folgenlos wiederholbar.
|
|
245
|
+
*/
|
|
246
|
+
export declare function createReceiptParams(options: CreateReceiptOptions): Record<string, unknown>;
|
|
242
247
|
/** Normalbeleg (Verkauf) nach RKSV. */
|
|
243
248
|
export declare function sellReceipt(transport: InternerTransport, options: SellReceiptOptions): Promise<Receipt>;
|
|
244
249
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReceiptType, KeckPaymentMethod, CreditCardProvider, VoucherAction, VoucherType, } from '../enums/index.js';
|
|
2
|
-
import { fromReceiptCompanyPayload, fromReceiptPayload, toReceiptItemPayload, toVoucherPayload, receiptItemIsValid, voucherIsValid, fromReceiptSummaryPayload, isCancellationReason, isReturnDisposition, RETURN_DISPOSITIONS, isTipRefundSource, TIP_REFUND_SOURCES, RECEIPT_EMAIL_VIAS, readRegistrationInfo, } from '../models/index.js';
|
|
2
|
+
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
3
|
import { parseServerTimeStamp, toViennaWallClock } from '../vienna-time.js';
|
|
4
4
|
import { euroToCents } from '../money.js';
|
|
5
5
|
import { KasseneckValidationError, isKasseneckApiError, signiertGelesen } from './errors.js';
|
|
@@ -50,7 +50,7 @@ async function createReceiptWithCompany(rufen, options) {
|
|
|
50
50
|
* Baut die Nutzlast von `createReceipt` und prueft die Eingabe. Wirft, bevor
|
|
51
51
|
* irgendetwas rausgeht — ein Beleg ist nicht folgenlos wiederholbar.
|
|
52
52
|
*/
|
|
53
|
-
function createReceiptParams(options) {
|
|
53
|
+
export function createReceiptParams(options) {
|
|
54
54
|
const typ = belegtyp(options.receiptType);
|
|
55
55
|
const { items, vouchers } = options;
|
|
56
56
|
// Unter /v3 weist der Server diese Felder ab (payment_method_not_supported);
|
|
@@ -62,10 +62,15 @@ function createReceiptParams(options) {
|
|
|
62
62
|
if (typ.value === ReceiptType.cancellation.value) {
|
|
63
63
|
throw eingabefehler('Ein Storno geht nur ueber cancelReceipt (Bezug, Grund, Restmengen).');
|
|
64
64
|
}
|
|
65
|
+
// Gutschein-Positionen setzt nur der Server; vor jeder anderen Positionspruefung.
|
|
66
|
+
if (items?.some((item) => item.kind === 'voucher' || item.kind === 'voucher_float') ?? false) {
|
|
67
|
+
throw eingabefehler('voucher_invalid: Gutschein-Positionen (kind voucher, voucher_float) setzt nur der Server.');
|
|
68
|
+
}
|
|
65
69
|
if (typ.needsItems) {
|
|
66
70
|
// Ein reiner Gutscheinverkauf ist ein Umsatz ohne Positionen, deshalb
|
|
67
71
|
// zaehlt er hier wie eine Position (wie im Flutter-Vorbild).
|
|
68
|
-
|
|
72
|
+
// (Eine Auszahlung der neuen Form braucht ebenfalls keine Positionen.)
|
|
73
|
+
const hatVerkaufsgutschein = vouchers?.some((v) => v.action === VoucherAction.sell || v.action === VoucherAction.payout) ?? false;
|
|
69
74
|
if ((items == null || items.length === 0) && !hatVerkaufsgutschein) {
|
|
70
75
|
throw eingabefehler(`Positionen sind Pflicht bei receiptType "${typ.value}" und duerfen nicht leer sein.`);
|
|
71
76
|
}
|
|
@@ -78,6 +83,13 @@ function createReceiptParams(options) {
|
|
|
78
83
|
if (!typ.allowsVouchers) {
|
|
79
84
|
throw eingabefehler(`Gutscheine sind nicht erlaubt bei receiptType "${typ.value}".`);
|
|
80
85
|
}
|
|
86
|
+
const serverfeld = vouchers.flatMap(voucherServerFields)[0];
|
|
87
|
+
if (serverfeld != null) {
|
|
88
|
+
throw eingabefehler(`voucher_invalid: Das Feld ${serverfeld} setzt nur der Server.`);
|
|
89
|
+
}
|
|
90
|
+
if (typ.value === ReceiptType.training.value && vouchers.some(isNewFormVoucher)) {
|
|
91
|
+
throw eingabefehler('Gutscheine der neuen Form gibt es nicht auf Schulungsbelegen (receiptType training).');
|
|
92
|
+
}
|
|
81
93
|
if (vouchers.some((voucher) => !voucherIsValid(voucher))) {
|
|
82
94
|
throw eingabefehler('Ungueltiger Gutschein uebergeben.');
|
|
83
95
|
}
|
|
@@ -90,6 +102,11 @@ function createReceiptParams(options) {
|
|
|
90
102
|
if (items != null && items.length > 0) {
|
|
91
103
|
params['items'] = alsNutzlast(items, toReceiptItemPayload);
|
|
92
104
|
}
|
|
105
|
+
else if (items != null && (vouchers?.some(isNewFormVoucher) ?? false)) {
|
|
106
|
+
// Verkauf/Auszahlung der neuen Form ohne Positionen: die leere Liste geht
|
|
107
|
+
// mit, wie der Vertrag es zeigt (Altform ohne Positionen bleibt byte-gleich).
|
|
108
|
+
params['items'] = [];
|
|
109
|
+
}
|
|
93
110
|
const umsatz = typ.value === ReceiptType.standard.value || typ.value === ReceiptType.training.value;
|
|
94
111
|
if (umsatz) {
|
|
95
112
|
// Pflicht unter /v3 (payments_required); eine leere Liste ist erlaubt,
|
|
@@ -97,7 +114,12 @@ function createReceiptParams(options) {
|
|
|
97
114
|
if (options.payments == null) {
|
|
98
115
|
throw eingabefehler('payments fehlt: unter /v3 ist die Zahlungsliste Pflicht (Summe = receiptDueCents).');
|
|
99
116
|
}
|
|
100
|
-
|
|
117
|
+
// Beleg nur aus Gutschein-Auszahlungen (Server gutschein-beleg.istNurAuszahlung):
|
|
118
|
+
// genau eine Barzahlung ueber den negativen Zahlbetrag.
|
|
119
|
+
// Wie der Server erst nach dem Anhaengen des Trinkgelds: eine Trinkgeldzeile ist keine Gutscheinzeile.
|
|
120
|
+
const nurAuszahlung = (vouchers?.length ?? 0) > 0 && vouchers.every((v) => v.action === VoucherAction.payout)
|
|
121
|
+
&& (items?.length ?? 0) === 0 && options.tip == null;
|
|
122
|
+
params['payments'] = gepruefteZahlungen(options.payments, false, 'createReceipt', nurAuszahlung);
|
|
101
123
|
}
|
|
102
124
|
else if (options.payments != null) {
|
|
103
125
|
throw eingabefehler(`payments sind bei receiptType "${typ.value}" nicht erlaubt.`);
|
|
@@ -453,6 +475,26 @@ export function checkVoucherCombinationError(vouchers, items) {
|
|
|
453
475
|
verkaufenPromo++;
|
|
454
476
|
}
|
|
455
477
|
}
|
|
478
|
+
// Neue Form, Regeln wie gutschein-beleg.plane des Servers:
|
|
479
|
+
// - Verkauf und Einloesung nie zusammen, sobald einer davon die neue Form
|
|
480
|
+
// hat (auch gegen die Altform); eine Auszahlung zaehlt hier nicht.
|
|
481
|
+
// - der Aktionsgutschein (promotion) steht allein.
|
|
482
|
+
// - eine Auszahlung nie mit einem Altform-Rabatt (promo).
|
|
483
|
+
// Die Altform-Zaehler unten zaehlen die neue Form bewusst nicht mit.
|
|
484
|
+
const neu = vouchers.filter((v) => isNewFormVoucher(v));
|
|
485
|
+
const verkaufEinloesung = vouchers.filter((v) => v.action === VoucherAction.sell || v.action === VoucherAction.redeem);
|
|
486
|
+
if (verkaufEinloesung.some((v) => v.action === VoucherAction.sell)
|
|
487
|
+
&& verkaufEinloesung.some((v) => v.action === VoucherAction.redeem)
|
|
488
|
+
&& verkaufEinloesung.some((v) => isNewFormVoucher(v))) {
|
|
489
|
+
return 'Ungueltige Daten: Ein Beleg kann Gutscheine der neuen Form nicht zugleich verkaufen und einloesen';
|
|
490
|
+
}
|
|
491
|
+
if (neu.some((v) => v.type === VoucherType.promotion) && vouchers.length > 1) {
|
|
492
|
+
return 'Ungueltige Daten: Ein Aktionsgutschein (type promotion) darf nicht mit anderen Gutscheinen kombiniert werden';
|
|
493
|
+
}
|
|
494
|
+
if (neu.some((v) => v.action === VoucherAction.payout) && vouchers.some((v) => !isNewFormVoucher(v) && v.type === VoucherType.promo)) {
|
|
495
|
+
return 'Ungueltige Daten: Eine Auszahlung (action payout) darf nicht mit einem Gutschein mit type promo kombiniert werden';
|
|
496
|
+
}
|
|
497
|
+
const einloesenNeu = neu.filter((v) => v.action === VoucherAction.redeem).length;
|
|
456
498
|
const einloesenGesamt = einloesenWert + einloesenPromo;
|
|
457
499
|
const verkaufenGesamt = verkaufenWert + verkaufenPromo;
|
|
458
500
|
if (verkaufenPromo > 0) {
|
|
@@ -467,7 +509,7 @@ export function checkVoucherCombinationError(vouchers, items) {
|
|
|
467
509
|
if (einloesenPromo > 0 && verkaufenGesamt > 0) {
|
|
468
510
|
return 'Ungueltige Daten: Mit einem Gutschein mit type promo duerfen nicht andere Gutscheine verkauft werden';
|
|
469
511
|
}
|
|
470
|
-
if (einloesenGesamt > 0 && items.length === 0) {
|
|
512
|
+
if ((einloesenGesamt > 0 || einloesenNeu > 0) && items.length === 0) {
|
|
471
513
|
return 'Ungueltige Daten: Gutscheine mit action redeem benoetigen mindestens ein item';
|
|
472
514
|
}
|
|
473
515
|
return null;
|
|
@@ -601,12 +643,28 @@ const MAX_ZAHLUNGEN = 20;
|
|
|
601
643
|
* (Summe, Anbieter-Pflicht und Trinkgeld prueft der Server). Wirft, bevor
|
|
602
644
|
* etwas hinausgeht.
|
|
603
645
|
*/
|
|
604
|
-
function gepruefteZahlungen(roh, storno, functionName) {
|
|
646
|
+
function gepruefteZahlungen(roh, storno, functionName, auszahlung = false) {
|
|
605
647
|
const fehler = (grund) => new KasseneckValidationError(functionName, grund, 'request');
|
|
606
648
|
if (!Array.isArray(roh))
|
|
607
649
|
throw fehler('payments muss eine Liste sein.');
|
|
608
650
|
if (roh.length > MAX_ZAHLUNGEN)
|
|
609
651
|
throw fehler(`payments: es sind hoechstens ${MAX_ZAHLUNGEN} Eintraege erlaubt.`);
|
|
652
|
+
// Auszahlung eines Gutscheins: der Betrag geht bar hinaus, ohne gegeben und ohne Trinkgeld (Server pruefeZahlungen).
|
|
653
|
+
const negativ = storno || auszahlung;
|
|
654
|
+
if (auszahlung) {
|
|
655
|
+
const e = roh[0];
|
|
656
|
+
if (roh.length !== 1)
|
|
657
|
+
throw fehler('Auszahlung: genau eine Barzahlung angeben.');
|
|
658
|
+
if (e != null && typeof e === 'object') {
|
|
659
|
+
const m = e['method'];
|
|
660
|
+
if ((typeof m === 'object' && m !== null ? m.value : m) !== 'cash')
|
|
661
|
+
throw fehler('Auszahlung: nur in bar moeglich.');
|
|
662
|
+
if (e['tenderedCents'] !== undefined)
|
|
663
|
+
throw fehler('Auszahlung: tenderedCents ist nicht moeglich.');
|
|
664
|
+
if (e['tipCents'] !== undefined)
|
|
665
|
+
throw fehler('Auszahlung: tipCents ist nicht moeglich.');
|
|
666
|
+
}
|
|
667
|
+
}
|
|
610
668
|
return roh.map((eintrag, i) => {
|
|
611
669
|
const nr = i + 1;
|
|
612
670
|
if (eintrag == null || typeof eintrag !== 'object' || Array.isArray(eintrag)) {
|
|
@@ -615,8 +673,8 @@ function gepruefteZahlungen(roh, storno, functionName) {
|
|
|
615
673
|
const z = eintrag;
|
|
616
674
|
const method = gepruefteZahlungsart(z['method']);
|
|
617
675
|
const betrag = z['amountCents'];
|
|
618
|
-
if (typeof betrag !== 'number' || !Number.isInteger(betrag) || (
|
|
619
|
-
throw fehler(`Zahlung ${nr}: amountCents muss eine ganze Zahl ${
|
|
676
|
+
if (typeof betrag !== 'number' || !Number.isInteger(betrag) || (negativ ? betrag >= 0 : betrag <= 0)) {
|
|
677
|
+
throw fehler(`Zahlung ${nr}: amountCents muss eine ganze Zahl ${negativ ? 'kleiner' : 'groesser'} als 0 sein.`);
|
|
620
678
|
}
|
|
621
679
|
const aus = { method, amountCents: betrag };
|
|
622
680
|
if (z['tenderedCents'] !== undefined) {
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export declare const VoucherAction: {
|
|
6
6
|
readonly sell: "sell";
|
|
7
7
|
readonly redeem: "redeem";
|
|
8
|
+
/** Neue Form: Restwert auszahlen (Mehrzweck/Einzweck). */
|
|
9
|
+
readonly payout: "payout";
|
|
8
10
|
};
|
|
9
11
|
export type VoucherActionKey = keyof typeof VoucherAction;
|
|
10
12
|
export type VoucherAction = (typeof VoucherAction)[VoucherActionKey];
|
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
* Gutscheinart — Zwilling von `VoucherType` in kasseneck_api/lib/enums/voucher_type.dart.
|
|
3
3
|
*/
|
|
4
4
|
export declare const VoucherType: {
|
|
5
|
+
/** Altform: Wertgutschein (Wert im Cent, Code frei). */
|
|
5
6
|
readonly value: "value";
|
|
7
|
+
/** Altform: Rabatt-/Promotionsgutschein. */
|
|
6
8
|
readonly promo: "promo";
|
|
9
|
+
/** Neue Form: Mehrzweckgutschein (Zahlungsmittel, Steuer erst bei der Einloesung). */
|
|
10
|
+
readonly multi_purpose: "multi_purpose";
|
|
11
|
+
/** Neue Form: Einzweckgutschein (Steuer schon beim Verkauf, ein Satz). */
|
|
12
|
+
readonly single_purpose: "single_purpose";
|
|
13
|
+
/** Neue Form: Leistungsgutschein (Artikel mal Menge). */
|
|
14
|
+
readonly service: "service";
|
|
15
|
+
/** Neue Form: Aktionsgutschein (Rabatt laut Aktion, nur einloesbar). */
|
|
16
|
+
readonly promotion: "promotion";
|
|
7
17
|
};
|
|
8
18
|
export type VoucherTypeKey = keyof typeof VoucherType;
|
|
9
19
|
export type VoucherType = (typeof VoucherType)[VoucherTypeKey];
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
* Gutscheinart — Zwilling von `VoucherType` in kasseneck_api/lib/enums/voucher_type.dart.
|
|
3
3
|
*/
|
|
4
4
|
export const VoucherType = {
|
|
5
|
+
/** Altform: Wertgutschein (Wert im Cent, Code frei). */
|
|
5
6
|
value: 'value',
|
|
7
|
+
/** Altform: Rabatt-/Promotionsgutschein. */
|
|
6
8
|
promo: 'promo',
|
|
9
|
+
/** Neue Form: Mehrzweckgutschein (Zahlungsmittel, Steuer erst bei der Einloesung). */
|
|
10
|
+
multi_purpose: 'multi_purpose',
|
|
11
|
+
/** Neue Form: Einzweckgutschein (Steuer schon beim Verkauf, ein Satz). */
|
|
12
|
+
single_purpose: 'single_purpose',
|
|
13
|
+
/** Neue Form: Leistungsgutschein (Artikel mal Menge). */
|
|
14
|
+
service: 'service',
|
|
15
|
+
/** Neue Form: Aktionsgutschein (Rabatt laut Aktion, nur einloesbar). */
|
|
16
|
+
promotion: 'promotion',
|
|
7
17
|
};
|
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, type Voucher, 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, 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 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, 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, 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, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, type CashregisterReportPeriod, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
|
|
4
|
-
export { type ReceiptDueTip, type ReceiptDueTipRecipient, type ReceiptDueOptions, type ReceiptDueBuckets, type ReceiptDueBreakdown, type ReceiptDueErrorReason, receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, } from './receipt/due.js';
|
|
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 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, } 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, } 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, toVoucherPayload, fromVoucherPayload, voucherIsValid, 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_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, toVoucherPayload, fromVoucherPayload, voucherIsValid, 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_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, 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, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2, getCashboxStatus, getSignatureStatus, createKasseneckApi, } from './client/index.js';
|
|
4
|
-
export { receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, } from './receipt/due.js';
|
|
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, } 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, } from './pos/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, } from './receipt-item.js';
|
|
2
|
-
export { type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid } from './voucher.js';
|
|
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 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';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, } from './receipt-item.js';
|
|
2
|
-
export { toVoucherPayload, fromVoucherPayload, voucherIsValid } from './voucher.js';
|
|
1
|
+
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, } from './receipt-item.js';
|
|
2
|
+
export { toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields } 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';
|
|
5
5
|
export { fromReceiptPaymentPayload, toReceiptPaymentPayload, } from './receipt-payment.js';
|
|
@@ -16,7 +16,7 @@ import { KasseneckApiError } from '../client/errors.js';
|
|
|
16
16
|
* ...) stehen in [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
|
|
17
17
|
* `KasseneckApiError.code` lesbar.
|
|
18
18
|
*/
|
|
19
|
-
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "final_receipt_expired", "final_receipt_not_allowed", "module_inactive", "not_permitted", "receipt_limit_exceeded", "receipt_not_found", "receipt_outcome_unknown", "receipt_type_invalid", "signature_incomplete", "signature_missing", "signing_failed", "small_business_vat_not_allowed", "tip_invalid", "tip_not_allowed", "tip_recipient_unknown", "validation", "account_not_found", "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"];
|
|
19
|
+
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "final_receipt_expired", "final_receipt_not_allowed", "module_inactive", "not_permitted", "receipt_limit_exceeded", "receipt_not_found", "receipt_outcome_unknown", "receipt_type_invalid", "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"];
|
|
20
20
|
export type ReceiptErrorCode = (typeof RECEIPT_ERROR_CODES)[number];
|
|
21
21
|
export declare function isReceiptErrorCode(value: unknown): value is ReceiptErrorCode;
|
|
22
22
|
/** Der Code eines geworfenen Fehlers, wenn er in [RECEIPT_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -28,6 +28,7 @@ export const RECEIPT_ERROR_CODES = Object.freeze([
|
|
|
28
28
|
'receipt_not_found',
|
|
29
29
|
'receipt_outcome_unknown',
|
|
30
30
|
'receipt_type_invalid',
|
|
31
|
+
'server_error',
|
|
31
32
|
'signature_incomplete',
|
|
32
33
|
'signature_missing',
|
|
33
34
|
'signing_failed',
|
|
@@ -36,6 +37,7 @@ export const RECEIPT_ERROR_CODES = Object.freeze([
|
|
|
36
37
|
'tip_not_allowed',
|
|
37
38
|
'tip_recipient_unknown',
|
|
38
39
|
'validation',
|
|
40
|
+
'voucher_balance_changed',
|
|
39
41
|
// Anmeldung und Rand (errorCodes.auth ohne Partner-Zugang, errorCodes.edge)
|
|
40
42
|
'account_not_found',
|
|
41
43
|
'action_confirmation_required',
|
|
@@ -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';
|
|
39
|
+
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float';
|
|
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). */
|
|
@@ -73,6 +73,14 @@ export interface TipRecipient {
|
|
|
73
73
|
export declare function isTipItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
74
74
|
/** Rabatt-Position? Die eine Erkennungsstelle — niemand prueft `kind` selbst. */
|
|
75
75
|
export declare function isDiscountItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Gutschein-Position (Server, neue Gutscheinform)? `voucher` ist eine
|
|
78
|
+
* Einloesung oder ein Verkauf mit Umsatzsteuer-Wirkung, siehe
|
|
79
|
+
* [isVoucherFloatItem] fuer den durchlaufenden Posten.
|
|
80
|
+
*/
|
|
81
|
+
export declare function isVoucherItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
82
|
+
/** Gutschein-Position als durchlaufender Posten (Mehrzweck: Verkauf, Auszahlung)? */
|
|
83
|
+
export declare function isVoucherFloatItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
76
84
|
/**
|
|
77
85
|
* Nutzlast-Form, die dieses Paket **schreibt** (v2):
|
|
78
86
|
* `{ name, quantity, unitPriceCents, vatRate }`.
|
|
@@ -82,8 +90,8 @@ export interface ReceiptItemPayload {
|
|
|
82
90
|
quantity: number;
|
|
83
91
|
unitPriceCents: number;
|
|
84
92
|
vatRate: number;
|
|
85
|
-
/** Trinkgeld-/Rabatt-Kennzeichnung, siehe [ReceiptItem.kind]. */
|
|
86
|
-
kind?: 'tip' | 'discount';
|
|
93
|
+
/** Trinkgeld-/Rabatt-/Gutschein-Kennzeichnung, siehe [ReceiptItem.kind]. */
|
|
94
|
+
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float';
|
|
87
95
|
recipient?: TipRecipient | null;
|
|
88
96
|
paymentMethod?: string;
|
|
89
97
|
receivedImmediately?: boolean;
|