@kreiseck/kasseneck-api 1.27.0 → 1.28.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 +16 -0
- package/dist/cjs/client/aufrufe.d.ts +3 -3
- package/dist/cjs/client/aufrufe.js +3 -0
- package/dist/cjs/pos/aufrunden.d.ts +6 -0
- package/dist/cjs/pos/aufrunden.js +59 -0
- package/dist/cjs/pos/client.js +12 -1
- package/dist/cjs/pos/index.d.ts +4 -3
- package/dist/cjs/pos/index.js +17 -4
- package/dist/cjs/pos/schicht-lesen.d.ts +2 -1
- package/dist/cjs/pos/schicht-lesen.js +48 -1
- package/dist/cjs/pos/schicht-typen.d.ts +106 -3
- package/dist/cjs/pos/schicht-typen.js +14 -4
- package/dist/cjs/pos/schicht.d.ts +28 -2
- package/dist/cjs/pos/schicht.js +19 -0
- package/dist/cjs/pos/settings.d.ts +39 -0
- package/dist/cjs/pos/settings.js +65 -4
- package/dist/cjs/pos/texte.d.ts +292 -0
- package/dist/cjs/pos/texte.js +108 -0
- package/dist/cjs/receipt/shift-sheet.js +29 -0
- package/dist/cjs/stored/einstellungen.js +31 -4
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +29 -2
- 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 +3 -0
- package/dist/esm/pos/aufrunden.d.ts +6 -0
- package/dist/esm/pos/aufrunden.js +56 -0
- package/dist/esm/pos/client.js +13 -2
- package/dist/esm/pos/index.d.ts +4 -3
- package/dist/esm/pos/index.js +5 -4
- package/dist/esm/pos/schicht-lesen.d.ts +2 -1
- package/dist/esm/pos/schicht-lesen.js +47 -1
- package/dist/esm/pos/schicht-typen.d.ts +106 -3
- package/dist/esm/pos/schicht-typen.js +13 -3
- package/dist/esm/pos/schicht.d.ts +28 -2
- package/dist/esm/pos/schicht.js +19 -1
- package/dist/esm/pos/settings.d.ts +39 -0
- package/dist/esm/pos/settings.js +60 -3
- package/dist/esm/pos/texte.d.ts +292 -0
- package/dist/esm/pos/texte.js +108 -0
- package/dist/esm/receipt/shift-sheet.js +29 -0
- package/dist/esm/stored/einstellungen.js +32 -5
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +29 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/duplicate-cases.json +6 -0
- package/fixtures/expected/duplicate.shift-close.hex +28 -27
- package/fixtures/expected/shift-close-blind.grid32.txt +1 -0
- package/fixtures/expected/shift-close-blind.grid48.txt +1 -0
- package/fixtures/expected/shift-close-blind.lines.json +6 -0
- package/fixtures/expected/shift-close-put-in.grid32.txt +1 -0
- package/fixtures/expected/shift-close-put-in.grid48.txt +1 -0
- package/fixtures/expected/shift-close-put-in.lines.json +6 -0
- package/fixtures/expected/shift-close-take-out.grid32.txt +1 -0
- package/fixtures/expected/shift-close-take-out.grid48.txt +1 -0
- package/fixtures/expected/shift-close-take-out.lines.json +6 -0
- package/fixtures/expected/shift-close.grid32.txt +1 -0
- package/fixtures/expected/shift-close.grid48.txt +1 -0
- package/fixtures/expected/shift-close.lines.json +6 -0
- package/fixtures/expected/shift-interim.grid32.txt +1 -0
- package/fixtures/expected/shift-interim.grid48.txt +1 -0
- package/fixtures/expected/shift-interim.lines.json +6 -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/pos-texts.json +337 -1
- package/fixtures/renames-1.0.json +30 -0
- package/fixtures/shift-ablauf-cases.json +182 -0
- package/fixtures/shift-receipts.json +15 -15
- package/fixtures/surface.json +41 -2
- package/fixtures/tip-round-up-cases.json +27 -0
- package/fixtures/v3/antworten/belege.json +2 -2
- package/fixtures/v3/antworten/belegmail.json +2 -2
- package/fixtures/v3/antworten/berichte.json +2 -2
- package/fixtures/v3/antworten/kasse-belege.json +2 -2
- package/fixtures/v3/antworten/kasse.json +504 -4
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +2 -2
- package/fixtures/v3/antworten/storno.json +2 -2
- package/fixtures/v3/stored/belege.json +2 -2
- package/fixtures/v3/stored/kasse.json +520 -12
- package/fixtures/v3/stored/rechnungen.json +2 -2
- package/fixtures/v3/v3-vokabular.json +131 -9
- package/fixtures/v3/zahlbetrag-faelle.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ 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.28.0 - 2026-11-06
|
|
8
|
+
|
|
9
|
+
Shift flow of the till: start a shift, count in between, close in steps, tip kinds, column width. Additive; every field below is sent by the server only when it applies, a reader without them behaves as before (all existing goldens unchanged).
|
|
10
|
+
|
|
11
|
+
- **`recordMyShiftCount`** (`/api/v3`, till path, in `POS_CALLS`): an interim count without closing the shift. Request `shiftId`, `countedCents`, optional `denominations`/`comment`, `idempotencyKey` (same key = same answer, no second entry); answer `count { expectedCents, countedCents, differenceCents }`. Listed among the calls with effect (`UNKNOWN_OUTCOME_CALLS`).
|
|
12
|
+
- **`CloseMyShiftOptions.countedBeforePayout`**: the count is the drawer **before** the tip payouts of the same request. The shift then carries `countedBeforePayoutCents`; `countedCents` stays the content after the payout. Reason: the cashier counts first and pays out afterwards; the raw count belongs on the Z receipt.
|
|
13
|
+
- **`DrawerState.lastShift`** (`{ number, closedAt, closedByName }`, `null` = none) for the card „Letzte Schicht“; **`Shift`**: `openingCounted`, `expectedParts` (`opening | cash_sales | cash_tips | cancellations | cash_in | cash_out | interim_difference`, sum = expected), `cashTipsInDrawerCents`, `interimCounts`, `interimDifferenceCents`, `differenceParts` (`interim | closing`, with time), `countedBeforePayoutCents`. Movement type `interim_difference` (set by the server) in `MOVEMENT_TYPES`.
|
|
14
|
+
- **Z receipt** (`shiftReceiptLayout`): new lines only when the data carries them — „Zwischenzählung“ in the cash block (difference of the interim counts ≠ 0), „Gezählt“ with its denominations before „Ist“ (count before payout), „davon Zwischenzählung HH:mm“ / „davon Abschluss“ after „Differenz“, and „Anfang übernommen, nicht gezählt“ when `openingCounted` is `false`. Receipts without these fields print byte for byte as before.
|
|
15
|
+
- **Settings:** `business.tipKinds` (`percent | round_up | total`, a non-empty subset, as stored) and `business.tipStart`, `device.cartWidth` (`narrow | medium | wide`). All three are optional like `tipKeptByDefault` (the server sends them only when stored); effective values through `posTipKinds`, `posTipStart`, `posCartWidth` (all three kinds, start `percent`, `narrow`). Lists `TIP_KINDS`, `TIP_START`, `CART_WIDTH`, `POS_BUSINESS_OPTIONAL_CHOICES`, `POS_DEVICE_OPTIONAL_CHOICES`.
|
|
16
|
+
- **Texts:** 61 new labels and 4 new messages for the flow (start, band, count, close steps, breakdown, tip payout, tip kinds, column width, Z receipt lines). `shift.close_title` and `shift.running_since` keep their wording; the numbered variants are `shift.close_title_numbered` and `shift.running_since_drawer`. `tip.remainder_is_tip` is „Rest ist Trinkgeld“.
|
|
17
|
+
- Z receipts with a start taken over without counting now carry `openingCounted: false` in the contract, so they print the line „Anfang übernommen, nicht gezählt“ (the other Z receipt lines are unchanged). Goldens of the shift receipts (`shift-close*`, `shift-interim`, duplicate `shift-close`, print digests, twin digests of the Z receipt with take-out) are drawn anew for that one line.
|
|
18
|
+
- **Texts, addendum:** 15 more labels for the flow (`shift.state_closing`, `shift.state_interim`, `shift.tips_paid_out`, `shift.difference_none`, `shift.start_new`, `shift.drawer_from_to`, `shift.running_since_by`, `shift.z_receipt_printed`, `shift.count_now`, `shift.interim_entry`, `drawer.open`, `time.today_at`, `tip.summary_percent`, `settings.tip_kinds`, `settings.tip_start`). The band titles carry no full stop, like `shift.state_closed`.
|
|
19
|
+
- **Texts, inspection page:** labels `zero_receipt.done_title` „Nullbeleg erstellt“, `zero_receipt.back` „Zurück zur Prüfung“, `dep.export` „DEP exportieren“, `dep.period_question` „Welcher Zeitraum?“, `common.close` „Schließen“, `shift.band_cash` „Zum Verkaufen auf die Kacheln tippen.“ (band over the greyed tiles while the cash state stands in the side column), message `shift.finish_step_first` „Erst den Schritt rechts abschließen oder abbrechen.“ (header ways locked during an interim count or a close), labels `tip.revenue_title` „Als Umsatz erfasst“, `tip.revenue_badge` „Umsatz“, `tip.unassigned` „Nicht zugeordnet“ and messages `tip.revenue_hint`, `tip.unassigned_hint` (same words as the customer area). The till shows a zero receipt like a sale receipt and prints it right away (no question about the register info any more); the DEP asks for the period only after „DEP exportieren“. `inspection.print_question`, `inspection.print_yes` and `inspection.print_no` stay for older apps.
|
|
20
|
+
- **`ShiftRunningTotals.ownerTips`** (`ShiftOwnerTip { registerUserId, name, cents }`) and **`unassignedTipCents`**: tips to register users with taxable tips (owner) and tips without a recipient, display only — they count as revenue, never as a claim, never in „offen“, the expected amount is unchanged. Read as sent: the server sends them only when there is something, absent means none.
|
|
21
|
+
- Contract `v3` re-fetched from the backend (`recordMyShiftCount`, catalogs `SCHICHT_SOLL_TEIL`, `KASSE_BETRIEB_WERTE.tipKinds[]`/`tipStart`, `KASSE_GERAET_WERTE.cartWidth`).
|
|
22
|
+
|
|
7
23
|
## 1.27.0 - 2026-11-05
|
|
8
24
|
|
|
9
25
|
Add-on tiles: tapping a main service opens a sheet with its add-ons (nail art, repair per nail, hand massage …); each add-on becomes its own receipt line pointing at its main line. Additive; articles, groups and receipts without the new fields read, print and send exactly as before (all existing goldens unchanged).
|
|
@@ -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", "reportConnectState"];
|
|
16
|
+
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createDepExport", "createDepHandoverLink", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getDepExport", "getDepExportFile", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listReceipts", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "revokeDepHandoverLink", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "orderSignatureCard", "getSignatureCardOrder", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "getRegisterInspectionInfo", "reportConnectState"];
|
|
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", "reportConnectState"];
|
|
32
|
+
export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "recordMyShiftCount", "logReceiptOutputs", "createDepExport", "getDepExport", "getDepExportFile", "createDepHandoverLink", "revokeDepHandoverLink", "getRegisterInspectionInfo", "reportConnectState"];
|
|
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", "reportConnectState", "reportCustomerContract", "requestCustomerSignature", "reverseStockMovement", "reviewStocktake", "revokeCustomerMandate", "rotatePartnerWebhookSecret", "rotateWebhookSecret", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "sendWebhookTest", "setCustomerMandate", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "transferStock", "unpairRegisterDevice", "updateArticle", "updateCustomer", "updateInvoiceItem", "updatePartnerWebhook", "updateVariantGroup", "updateWebhook", "voidMyStocktakeCount", "voidStocktakeCount", "withdrawInvoiceItem"];
|
|
53
|
+
export declare const UNKNOWN_OUTCOME_CALLS: readonly ["activateCashregister", "addVariant", "cancelInvoice", "cancelReceipt", "cancelStocktake", "changeStockCondition", "closeMyShift", "closeStocktake", "createArticle", "createCreditNote", "createCustomer", "createCustomerCashregister", "createInvoiceItem", "createPartnerCustomer", "createPartnerWebhook", "createPrintJob", "createReceipt", "createReservation", "createStocktake", "createVariantGroup", "createWebhook", "deactivateArticle", "deletePartnerWebhook", "deleteWebhook", "extendReservation", "financeWebService", "hobexPayApi", "hobexRefundApi", "issueInvoice", "logMyDrawerOpenings", "logReceiptOutputs", "openMyShift", "orderSignatureCard", "pairRegisterDevice", "receiveGoods", "recordInvoicePayment", "recordMyCashMovement", "recordMyShiftCount", "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
|
/**
|
|
@@ -150,6 +150,7 @@ exports.ALL_CALLS = [
|
|
|
150
150
|
'logMyDrawerOpenings',
|
|
151
151
|
'getMyShiftReport',
|
|
152
152
|
'closeMyShift',
|
|
153
|
+
'recordMyShiftCount',
|
|
153
154
|
// Ausgaben eines Belegs (Drucke, Teilen) melden: nur ueber den Kassenweg.
|
|
154
155
|
'logReceiptOutputs',
|
|
155
156
|
// Kasseninfo fuer die Pruefung (Kassennachschau, Stufe 2b, ./pos): nur ueber den Kassenweg.
|
|
@@ -340,6 +341,7 @@ exports.POS_CALLS = [
|
|
|
340
341
|
'logMyDrawerOpenings',
|
|
341
342
|
'getMyShiftReport',
|
|
342
343
|
'closeMyShift',
|
|
344
|
+
'recordMyShiftCount',
|
|
343
345
|
// Ausgaben eines Belegs melden: nur ueber den Kassenweg.
|
|
344
346
|
'logReceiptOutputs',
|
|
345
347
|
// DEP fuer die Kassennachschau (Stufe 2): zugleich oeffentlich; an der Kasse nur fuer den Chef (manager_only).
|
|
@@ -409,6 +411,7 @@ exports.UNKNOWN_OUTCOME_CALLS = [
|
|
|
409
411
|
'receiveGoods',
|
|
410
412
|
'recordInvoicePayment',
|
|
411
413
|
'recordMyCashMovement',
|
|
414
|
+
'recordMyShiftCount',
|
|
412
415
|
'recordMyStocktakeCount',
|
|
413
416
|
'recordStockLoss',
|
|
414
417
|
'recordStocktakeCount',
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aufrunden-Vorschlaege fuer Trinkgeld: genau drei aufsteigende Gesamtbetraege
|
|
3
|
+
* in Cent ueber dem Bezugsbetrag. Nur Ganzzahlen; die Pruefaelle stehen in
|
|
4
|
+
* `fixtures/tip-round-up-cases.json` (gleich im Dart-Zwilling).
|
|
5
|
+
*/
|
|
6
|
+
export declare function roundUpSuggestions(amountCents: number): number[];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Aufrunden-Vorschlaege fuer Trinkgeld: genau drei aufsteigende Gesamtbetraege
|
|
4
|
+
* in Cent ueber dem Bezugsbetrag. Nur Ganzzahlen; die Pruefaelle stehen in
|
|
5
|
+
* `fixtures/tip-round-up-cases.json` (gleich im Dart-Zwilling).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.roundUpSuggestions = roundUpSuggestions;
|
|
9
|
+
function steps(t) {
|
|
10
|
+
if (t < 1500)
|
|
11
|
+
return [50, 100];
|
|
12
|
+
if (t < 5000)
|
|
13
|
+
return [100, 500];
|
|
14
|
+
if (t < 20000)
|
|
15
|
+
return [500, 1000];
|
|
16
|
+
return [1000, 5000];
|
|
17
|
+
}
|
|
18
|
+
const ceilDiv = (a, b) => Math.floor((a + b - 1) / b);
|
|
19
|
+
function roundUpSuggestions(amountCents) {
|
|
20
|
+
if (!Number.isInteger(amountCents) || amountCents <= 0)
|
|
21
|
+
return [];
|
|
22
|
+
const t = amountCents;
|
|
23
|
+
const [small, large] = steps(t);
|
|
24
|
+
const lo = Math.max(ceilDiv(t * 102, 100), t + 20);
|
|
25
|
+
const hi = Math.floor((t * (t < 1000 ? 125 : 120)) / 100);
|
|
26
|
+
const set = new Set();
|
|
27
|
+
for (const s of [small, large])
|
|
28
|
+
for (let m = ceilDiv(lo, s) * s; m <= hi; m += s)
|
|
29
|
+
set.add(m);
|
|
30
|
+
const candidates = [...set].sort((a, b) => a - b);
|
|
31
|
+
const chosen = new Set();
|
|
32
|
+
if (candidates.length > 0) {
|
|
33
|
+
const firstRound = candidates.find((k) => k % large === 0);
|
|
34
|
+
chosen.add(firstRound !== undefined && (firstRound - t) * 100 <= t * 10 ? firstRound : candidates[0]);
|
|
35
|
+
}
|
|
36
|
+
for (const target of [110, 115]) {
|
|
37
|
+
const free = candidates.filter((k) => !chosen.has(k));
|
|
38
|
+
if (free.length === 0)
|
|
39
|
+
break;
|
|
40
|
+
const dist = (k) => Math.abs(k * 100 - t * target);
|
|
41
|
+
const round = free.find((k) => k % large === 0 && dist(k) <= t * 3);
|
|
42
|
+
if (round !== undefined) {
|
|
43
|
+
chosen.add(round);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
let best = free[0];
|
|
47
|
+
for (const k of free)
|
|
48
|
+
if (dist(k) < dist(best))
|
|
49
|
+
best = k;
|
|
50
|
+
chosen.add(best);
|
|
51
|
+
}
|
|
52
|
+
let next = chosen.size > 0 ? Math.max(...chosen) : ceilDiv(lo, small) * small - small;
|
|
53
|
+
while (chosen.size < 3) {
|
|
54
|
+
next = (Math.floor(next / small) + 1) * small;
|
|
55
|
+
if (next >= lo)
|
|
56
|
+
chosen.add(next);
|
|
57
|
+
}
|
|
58
|
+
return [...chosen].sort((a, b) => a - b);
|
|
59
|
+
}
|
package/dist/cjs/pos/client.js
CHANGED
|
@@ -151,10 +151,21 @@ function pruefeTeil(name, teil, block, standard, werte) {
|
|
|
151
151
|
throw new errors_js_1.KasseneckValidationError(name, `${teil}.${schluessel}: true oder false erwartet`, 'request');
|
|
152
152
|
continue;
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
const wahl = teil === 'business' ? settings_js_1.POS_BUSINESS_OPTIONAL_CHOICES : settings_js_1.POS_DEVICE_OPTIONAL_CHOICES;
|
|
155
|
+
if (!Object.prototype.hasOwnProperty.call(standard, schluessel) && !wahl.includes(schluessel)) {
|
|
155
156
|
throw new errors_js_1.KasseneckValidationError(name, `${teil}.${schluessel}: unbekanntes Feld`, 'request');
|
|
156
157
|
}
|
|
157
158
|
const erlaubt = Object.prototype.hasOwnProperty.call(werte, schluessel) ? werte[schluessel] : undefined;
|
|
159
|
+
if (schluessel === 'tipKinds' && !Array.isArray(wert)) {
|
|
160
|
+
throw new errors_js_1.KasseneckValidationError(name, `${teil}.${schluessel}: eine Liste von Trinkgeld-Arten erwartet`, 'request');
|
|
161
|
+
}
|
|
162
|
+
// Eine Liste (tipKinds): nichtleer, jeder Eintrag aus der Wertemenge, ohne Dubletten.
|
|
163
|
+
if (erlaubt && Array.isArray(wert)) {
|
|
164
|
+
if (wert.length === 0 || new Set(wert).size !== wert.length || !wert.every((e) => erlaubt.includes(e))) {
|
|
165
|
+
throw new errors_js_1.KasseneckValidationError(name, `${teil}.${schluessel}: ungueltiger Wert (erlaubt: ${erlaubt.join(', ')}, jede Art hoechstens einmal)`, 'request');
|
|
166
|
+
}
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
158
169
|
if (erlaubt && !erlaubt.includes(wert)) {
|
|
159
170
|
// Kein Altwert: dann ein Wert, den der Server kennt und dieses Paket
|
|
160
171
|
// nicht. Er kam beim Lesen herein; wer den ganzen Block zurueckschickt,
|
package/dist/cjs/pos/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* die Backend-Functions (die Rewrites-Waechter der Web-App leiten daraus ab)
|
|
7
7
|
* und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
|
|
8
8
|
*/
|
|
9
|
-
export { type PosTheme, type PosFontSize, type PosWatermark, type PosQuantity, type PosTipMode, type PosCheckoutMode, type PosCardProvider, type PosReceiptOutput, type PosShortcutAction, type PosShortcutMap, POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, type PosLayout, type PosCategoryPosition, type PosTileHeight, type PosPrinterType, type PosTerminalVia, type PosTerminalType, type PosPaperSize, type PosCodePage, type PosCut, type PosDrawerAutoOpen, type PosQrMode, type PosLogoSize, type PosSettingsFontSize, type PosTileStyle, type PosAutoLogoutMinutes, type PosDiscount, type PosWatermarkSide, type PosWatermarkStrength, type PosLogoScale, type PosWatermarkScale, type PosDoneScreenSeconds, type PosToggleMap, type PosBusinessSettings, type PosDeviceSettings, type PosSettings, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, posTipKeptByDefault, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, type PosOpen, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict, THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
|
|
9
|
+
export { type PosTheme, type PosFontSize, type PosWatermark, type PosQuantity, type PosTipMode, type PosCheckoutMode, type PosCardProvider, type PosReceiptOutput, type PosShortcutAction, type PosShortcutMap, POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, type PosLayout, type PosCategoryPosition, type PosTileHeight, type PosPrinterType, type PosTerminalVia, type PosTerminalType, type PosPaperSize, type PosCodePage, type PosCut, type PosDrawerAutoOpen, type PosQrMode, type PosLogoSize, type PosSettingsFontSize, type PosTileStyle, type PosAutoLogoutMinutes, type PosDiscount, type PosWatermarkSide, type PosWatermarkStrength, type PosLogoScale, type PosWatermarkScale, type PosDoneScreenSeconds, type PosToggleMap, type PosBusinessSettings, type PosDeviceSettings, type PosSettings, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, type PosOpen, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict, THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, CART_WIDTH, type PosTipKind, type PosCartWidth, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
|
|
10
10
|
export { type ArticleGroup, type ArticleGroupPayload, fromArticleGroupPayload, type PosArticle, type PosArticlePayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, QUANTITY_RULES, type QuantityRule, type QuantityDefaults, quantityRuleForUnit, quantityDefaults, allowedQuantity, isBookableArticle, tilePrompts, } from './artikel.js';
|
|
11
11
|
export { REFERENCE_MODES, type ReferenceMode, type PosReference, REFERENCE_INPUT_MAX, REFERENCE_LABEL_MAX, REFERENCE_HINT_MAX, REFERENCE_PATTERN_MAX, REFERENCE_PATTERN_TEMPLATES, cleanReferenceText, isValidReferencePattern, isDigitsOnlyPattern, type ReferenceCheckResult, checkReference, referenceLineName, fromReferencePayload, } from './kachel-referenz.js';
|
|
12
12
|
export { ADD_ONS_MAX, ADD_ON_BLOCK_REASONS, type AddOnBlockReason, isSelectableAddOn, addOnsFor, addOnReferencesValid, addOnsOfItem, addOnRemap, addOnDisplayOrder, orderAddOnLines, } from './zusaetze.js';
|
|
@@ -24,9 +24,10 @@ export { type ListMyStocktakesOptions, type ListMyStocktakeItemsOptions, type Li
|
|
|
24
24
|
export type { Stocktake, StocktakeItem, StocktakeCount, StocktakeCountResult, StocktakeItemPage, StocktakeCountPage, StocktakeActor, StocktakeProgress, StocktakeReview, StocktakeRecount, StocktakeScope, } from '../inventory/typen.js';
|
|
25
25
|
export type { StocktakeStatus } from '../inventory/vertrag.js';
|
|
26
26
|
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';
|
|
27
|
-
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';
|
|
28
|
-
export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATIONS, OPENING_REASONS, MANUAL_OPENING_REASONS, SHIFT_RECEIPT_KINDS, AFTER_COUNT_TYPES, type AfterCountType, type AfterCount, 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';
|
|
27
|
+
export { type GetMyDrawerStateOptions, type OpenMyShiftOptions, type RecordMyCashMovementOptions, type DrawerOpeningEntry, type LogMyDrawerOpeningsOptions, type GetMyShiftReportOptions, type TipPayout, type CloseMyShiftOptions, type AfterCountOption, type RecordMyShiftCountOptions, getMyDrawerState, openMyShift, recordMyCashMovement, logMyDrawerOpenings, getMyShiftReport, closeMyShift, recordMyShiftCount, sumDenominations, parseCentsAllowZero, newIdempotencyKey, shiftTipLines, durationText, type ShiftTipLine, type ShiftTipLineKey, } from './schicht.js';
|
|
28
|
+
export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATIONS, OPENING_REASONS, MANUAL_OPENING_REASONS, SHIFT_RECEIPT_KINDS, AFTER_COUNT_TYPES, type AfterCountType, type AfterCount, EXPECTED_PART_KEYS, DIFFERENCE_PART_TYPES, type ExpectedPartKey, type ShiftExpectedPart, type DifferencePartType, type ShiftDifferencePart, type LastShift, type ShiftCountResult, type EurDenomination, type MovementType, type ManualMovementType, type CashLocation, type OpeningReason, type ManualOpeningReason, type ShiftReceiptKind, type ShiftStatus, type ShiftActorRole, type Denominations, type ShiftActor, type DrawerInfo, type DrawerRights, type NonCashAmount, type ShiftTipTotals, type ShiftTip, type ShiftOwnerTip, type ShiftRunningTotals, type ShiftReconciliation, type Shift, type TipClaim, type DrawerOpening, type DrawerState, type CashMovement, type ShiftReceiptHeader, type ShiftReceiptMovement, type ShiftReceiptTip, type ShiftSummaryReceipt, type CashMovementReceipt, type ShiftReceipt, type OpenShiftResult, type CashMovementResult, type DrawerOpeningsResult, type ShiftReport, type CloseShiftResult, } from './schicht-typen.js';
|
|
29
29
|
export { type ShiftReceiptLayoutOptions, shiftReceiptLayout, cashMovementLayout } from '../receipt/shift-sheet.js';
|
|
30
30
|
export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputKind, type ReceiptOutputResult } from '../models/receipt-output.js';
|
|
31
31
|
export { RETURN_DISPOSITIONS, isReturnDisposition, type ReturnDisposition } from '../models/cancellation.js';
|
|
32
32
|
export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
|
|
33
|
+
export { roundUpSuggestions } from './aufrunden.js';
|
package/dist/cjs/pos/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
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 = void 0;
|
|
3
|
+
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.CART_WIDTH = exports.TIP_START = exports.TIP_KINDS = 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.posCartWidth = exports.posTipStart = exports.posTipKinds = exports.posTipKeptByDefault = exports.POS_DEVICE_OPTIONAL_CHOICES = exports.POS_BUSINESS_OPTIONAL_CHOICES = 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.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.orderAddOnLines = exports.addOnDisplayOrder = exports.addOnRemap = exports.addOnsOfItem = exports.addOnReferencesValid = exports.addOnsFor = exports.isSelectableAddOn = exports.ADD_ON_BLOCK_REASONS = exports.ADD_ONS_MAX = exports.fromReferencePayload = exports.referenceLineName = exports.checkReference = exports.isDigitsOnlyPattern = exports.isValidReferencePattern = exports.cleanReferenceText = exports.REFERENCE_PATTERN_TEMPLATES = exports.REFERENCE_PATTERN_MAX = exports.REFERENCE_HINT_MAX = exports.REFERENCE_LABEL_MAX = exports.REFERENCE_INPUT_MAX = exports.REFERENCE_MODES = exports.tilePrompts = exports.isBookableArticle = exports.allowedQuantity = exports.quantityDefaults = exports.quantityRuleForUnit = exports.QUANTITY_RULES = exports.listMyArticles = exports.listMyArticleGroups = exports.fromPosArticlePayload = exports.fromArticleGroupPayload = exports.DONE_SCREEN_SECONDS = exports.WATERMARK_SCALE = void 0;
|
|
5
|
+
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.recordMyShiftCount = exports.closeMyShift = exports.getMyShiftReport = exports.logMyDrawerOpenings = exports.recordMyCashMovement = exports.openMyShift = 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 = void 0;
|
|
6
|
+
exports.roundUpSuggestions = 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.DIFFERENCE_PART_TYPES = exports.EXPECTED_PART_KEYS = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Kachel-Kasse: Einstellungen, Artikelgruppen/Artikel fuer Kacheln,
|
|
9
9
|
* Rabattverteilung, Drucker, Trinkgeld-Empfaenger, Lager (Standorte, Bestand,
|
|
@@ -19,7 +19,12 @@ Object.defineProperty(exports, "POS_BUSINESS_DEFAULTS", { enumerable: true, get:
|
|
|
19
19
|
Object.defineProperty(exports, "POS_DEVICE_DEFAULTS", { enumerable: true, get: function () { return settings_js_1.POS_DEVICE_DEFAULTS; } });
|
|
20
20
|
Object.defineProperty(exports, "POS_DEVICE_OPTIONAL_FIELDS", { enumerable: true, get: function () { return settings_js_1.POS_DEVICE_OPTIONAL_FIELDS; } });
|
|
21
21
|
Object.defineProperty(exports, "POS_BUSINESS_OPTIONAL_FIELDS", { enumerable: true, get: function () { return settings_js_1.POS_BUSINESS_OPTIONAL_FIELDS; } });
|
|
22
|
+
Object.defineProperty(exports, "POS_BUSINESS_OPTIONAL_CHOICES", { enumerable: true, get: function () { return settings_js_1.POS_BUSINESS_OPTIONAL_CHOICES; } });
|
|
23
|
+
Object.defineProperty(exports, "POS_DEVICE_OPTIONAL_CHOICES", { enumerable: true, get: function () { return settings_js_1.POS_DEVICE_OPTIONAL_CHOICES; } });
|
|
22
24
|
Object.defineProperty(exports, "posTipKeptByDefault", { enumerable: true, get: function () { return settings_js_1.posTipKeptByDefault; } });
|
|
25
|
+
Object.defineProperty(exports, "posTipKinds", { enumerable: true, get: function () { return settings_js_1.posTipKinds; } });
|
|
26
|
+
Object.defineProperty(exports, "posTipStart", { enumerable: true, get: function () { return settings_js_1.posTipStart; } });
|
|
27
|
+
Object.defineProperty(exports, "posCartWidth", { enumerable: true, get: function () { return settings_js_1.posCartWidth; } });
|
|
23
28
|
Object.defineProperty(exports, "POS_BUSINESS_VALUES", { enumerable: true, get: function () { return settings_js_1.POS_BUSINESS_VALUES; } });
|
|
24
29
|
Object.defineProperty(exports, "POS_DEVICE_VALUES", { enumerable: true, get: function () { return settings_js_1.POS_DEVICE_VALUES; } });
|
|
25
30
|
Object.defineProperty(exports, "mergePosSettings", { enumerable: true, get: function () { return settings_js_1.mergePosSettings; } });
|
|
@@ -34,6 +39,9 @@ Object.defineProperty(exports, "FONT_SIZE", { enumerable: true, get: function ()
|
|
|
34
39
|
Object.defineProperty(exports, "WATERMARK", { enumerable: true, get: function () { return settings_js_1.WATERMARK; } });
|
|
35
40
|
Object.defineProperty(exports, "QUANTITY", { enumerable: true, get: function () { return settings_js_1.QUANTITY; } });
|
|
36
41
|
Object.defineProperty(exports, "TIP_MODE", { enumerable: true, get: function () { return settings_js_1.TIP_MODE; } });
|
|
42
|
+
Object.defineProperty(exports, "TIP_KINDS", { enumerable: true, get: function () { return settings_js_1.TIP_KINDS; } });
|
|
43
|
+
Object.defineProperty(exports, "TIP_START", { enumerable: true, get: function () { return settings_js_1.TIP_START; } });
|
|
44
|
+
Object.defineProperty(exports, "CART_WIDTH", { enumerable: true, get: function () { return settings_js_1.CART_WIDTH; } });
|
|
37
45
|
Object.defineProperty(exports, "CHECKOUT_MODE", { enumerable: true, get: function () { return settings_js_1.CHECKOUT_MODE; } });
|
|
38
46
|
Object.defineProperty(exports, "CARD_PROVIDER", { enumerable: true, get: function () { return settings_js_1.CARD_PROVIDER; } });
|
|
39
47
|
Object.defineProperty(exports, "RECEIPT_OUTPUT", { enumerable: true, get: function () { return settings_js_1.RECEIPT_OUTPUT; } });
|
|
@@ -165,6 +173,7 @@ Object.defineProperty(exports, "recordMyCashMovement", { enumerable: true, get:
|
|
|
165
173
|
Object.defineProperty(exports, "logMyDrawerOpenings", { enumerable: true, get: function () { return schicht_js_1.logMyDrawerOpenings; } });
|
|
166
174
|
Object.defineProperty(exports, "getMyShiftReport", { enumerable: true, get: function () { return schicht_js_1.getMyShiftReport; } });
|
|
167
175
|
Object.defineProperty(exports, "closeMyShift", { enumerable: true, get: function () { return schicht_js_1.closeMyShift; } });
|
|
176
|
+
Object.defineProperty(exports, "recordMyShiftCount", { enumerable: true, get: function () { return schicht_js_1.recordMyShiftCount; } });
|
|
168
177
|
Object.defineProperty(exports, "sumDenominations", { enumerable: true, get: function () { return schicht_js_1.sumDenominations; } });
|
|
169
178
|
Object.defineProperty(exports, "parseCentsAllowZero", { enumerable: true, get: function () { return schicht_js_1.parseCentsAllowZero; } });
|
|
170
179
|
Object.defineProperty(exports, "newIdempotencyKey", { enumerable: true, get: function () { return schicht_js_1.newIdempotencyKey; } });
|
|
@@ -179,6 +188,8 @@ Object.defineProperty(exports, "OPENING_REASONS", { enumerable: true, get: funct
|
|
|
179
188
|
Object.defineProperty(exports, "MANUAL_OPENING_REASONS", { enumerable: true, get: function () { return schicht_typen_js_1.MANUAL_OPENING_REASONS; } });
|
|
180
189
|
Object.defineProperty(exports, "SHIFT_RECEIPT_KINDS", { enumerable: true, get: function () { return schicht_typen_js_1.SHIFT_RECEIPT_KINDS; } });
|
|
181
190
|
Object.defineProperty(exports, "AFTER_COUNT_TYPES", { enumerable: true, get: function () { return schicht_typen_js_1.AFTER_COUNT_TYPES; } });
|
|
191
|
+
Object.defineProperty(exports, "EXPECTED_PART_KEYS", { enumerable: true, get: function () { return schicht_typen_js_1.EXPECTED_PART_KEYS; } });
|
|
192
|
+
Object.defineProperty(exports, "DIFFERENCE_PART_TYPES", { enumerable: true, get: function () { return schicht_typen_js_1.DIFFERENCE_PART_TYPES; } });
|
|
182
193
|
var shift_sheet_js_1 = require("../receipt/shift-sheet.js");
|
|
183
194
|
Object.defineProperty(exports, "shiftReceiptLayout", { enumerable: true, get: function () { return shift_sheet_js_1.shiftReceiptLayout; } });
|
|
184
195
|
Object.defineProperty(exports, "cashMovementLayout", { enumerable: true, get: function () { return shift_sheet_js_1.cashMovementLayout; } });
|
|
@@ -213,3 +224,5 @@ Object.defineProperty(exports, "LABELS", { enumerable: true, get: function () {
|
|
|
213
224
|
Object.defineProperty(exports, "labelText", { enumerable: true, get: function () { return texte_js_1.labelText; } });
|
|
214
225
|
Object.defineProperty(exports, "RETURN_DISPOSITION_LABELS", { enumerable: true, get: function () { return texte_js_1.RETURN_DISPOSITION_LABELS; } });
|
|
215
226
|
Object.defineProperty(exports, "receiptOutputLabel", { enumerable: true, get: function () { return texte_js_1.receiptOutputLabel; } });
|
|
227
|
+
var aufrunden_js_1 = require("./aufrunden.js");
|
|
228
|
+
Object.defineProperty(exports, "roundUpSuggestions", { enumerable: true, get: function () { return aufrunden_js_1.roundUpSuggestions; } });
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* stehen im Modell genau dann, wenn der Server sie sendet.
|
|
13
13
|
*/
|
|
14
14
|
import { type ValidationScope } from '../client/errors.js';
|
|
15
|
-
import type { CashMovement, CashMovementReceipt, CashMovementResult, DrawerOpeningsResult, OpenShiftResult, ShiftReport, CloseShiftResult, DrawerState, Shift, ShiftSummaryReceipt } from './schicht-typen.js';
|
|
15
|
+
import type { CashMovement, CashMovementReceipt, CashMovementResult, DrawerOpeningsResult, OpenShiftResult, ShiftReport, CloseShiftResult, ShiftCountResult, DrawerState, Shift, ShiftSummaryReceipt } from './schicht-typen.js';
|
|
16
16
|
type Roh = Record<string, unknown>;
|
|
17
17
|
/** Wer liest (fuer die Meldung) und wo im Rumpf. */
|
|
18
18
|
export interface Ort {
|
|
@@ -33,6 +33,7 @@ export declare function schichtBon(ort: Ort, w: unknown): ShiftSummaryReceipt;
|
|
|
33
33
|
export declare function bewegungsBon(ort: Ort, w: unknown): CashMovementReceipt;
|
|
34
34
|
export declare function abschluss(ort: Ort, w: unknown): CloseShiftResult;
|
|
35
35
|
export declare function geoeffnet(ort: Ort, w: unknown): OpenShiftResult;
|
|
36
|
+
export declare function gezaehlt(ort: Ort, w: unknown): ShiftCountResult;
|
|
36
37
|
export declare function gebucht(ort: Ort, w: unknown): CashMovementResult;
|
|
37
38
|
export declare function gemeldet(ort: Ort, w: unknown): DrawerOpeningsResult;
|
|
38
39
|
export declare function bericht(ort: Ort, w: unknown): ShiftReport;
|
|
@@ -21,6 +21,7 @@ exports.schichtBon = schichtBon;
|
|
|
21
21
|
exports.bewegungsBon = bewegungsBon;
|
|
22
22
|
exports.abschluss = abschluss;
|
|
23
23
|
exports.geoeffnet = geoeffnet;
|
|
24
|
+
exports.gezaehlt = gezaehlt;
|
|
24
25
|
exports.gebucht = gebucht;
|
|
25
26
|
exports.gemeldet = gemeldet;
|
|
26
27
|
exports.bericht = bericht;
|
|
@@ -130,7 +131,7 @@ function trinkgeldMitOffen(ort, w) {
|
|
|
130
131
|
}
|
|
131
132
|
function laufstand(ort, w) {
|
|
132
133
|
const o = pflichtObjekt(ort, w);
|
|
133
|
-
|
|
134
|
+
const raus = {
|
|
134
135
|
cashSalesCents: ganzzahl(ort, o, 'cashSalesCents'),
|
|
135
136
|
cashCancellationsCents: ganzzahl(ort, o, 'cashCancellationsCents'),
|
|
136
137
|
nonCashByMethod: liste(ort, o, 'nonCashByMethod', unbar),
|
|
@@ -143,6 +144,16 @@ function laufstand(ort, w) {
|
|
|
143
144
|
tips: liste(ort, o, 'tips', trinkgeld),
|
|
144
145
|
openingsWithoutSale: ganzzahl(ort, o, 'openingsWithoutSale'),
|
|
145
146
|
};
|
|
147
|
+
// Nur Anzeige (1.28.0); der Server sendet beides nur, wenn es etwas gibt -- gelesen wie gesendet.
|
|
148
|
+
if (o.ownerTips !== undefined && o.ownerTips !== null)
|
|
149
|
+
raus.ownerTips = liste(ort, o, 'ownerTips', inhaberTrinkgeld);
|
|
150
|
+
if (o.unassignedTipCents !== undefined && o.unassignedTipCents !== null)
|
|
151
|
+
raus.unassignedTipCents = ganzzahl(ort, o, 'unassignedTipCents');
|
|
152
|
+
return raus;
|
|
153
|
+
}
|
|
154
|
+
function inhaberTrinkgeld(ort, w) {
|
|
155
|
+
const o = pflichtObjekt(ort, w);
|
|
156
|
+
return { registerUserId: kennung(ort, o, 'registerUserId'), name: text(o.name), cents: ganzzahl(ort, o, 'cents') };
|
|
146
157
|
}
|
|
147
158
|
/** Entnehmen oder Einlegen nach dem Zaehlen; die Art bleibt offen fuer kuenftige Werte (Text). */
|
|
148
159
|
function nachZaehlung(ort, w) {
|
|
@@ -165,6 +176,14 @@ function abgleich(ort, w) {
|
|
|
165
176
|
}
|
|
166
177
|
return { matches: wahr(ort, o, 'matches'), deviations };
|
|
167
178
|
}
|
|
179
|
+
function sollTeil(ort, w) {
|
|
180
|
+
const o = pflichtObjekt(ort, w);
|
|
181
|
+
return { key: kennung(ort, o, 'key'), cents: ganzzahl(ort, o, 'cents') };
|
|
182
|
+
}
|
|
183
|
+
function differenzTeil(ort, w) {
|
|
184
|
+
const o = pflichtObjekt(ort, w);
|
|
185
|
+
return { type: kennung(ort, o, 'type'), cents: ganzzahl(ort, o, 'cents'), at: text(o.at) };
|
|
186
|
+
}
|
|
168
187
|
/** Eine Schicht; was nur mit `cashView` kommt, steht nur, wenn gesendet. */
|
|
169
188
|
function schicht(ort, w) {
|
|
170
189
|
const o = pflichtObjekt(ort, w);
|
|
@@ -200,6 +219,14 @@ function schicht(ort, w) {
|
|
|
200
219
|
// Nur wenn beim Abschluss Geld entnommen oder eingelegt wurde.
|
|
201
220
|
wennWert(r, o, 'afterCount', () => nachZaehlung(unter(ort, 'afterCount'), o.afterCount));
|
|
202
221
|
wennWert(r, o, 'leftInDrawerCents', () => ganzzahl(ort, o, 'leftInDrawerCents'));
|
|
222
|
+
// Ablauf der Kasse: nur, wenn der Server sie sendet.
|
|
223
|
+
wennWert(r, o, 'openingCounted', () => wahr(ort, o, 'openingCounted'));
|
|
224
|
+
wennWert(r, o, 'expectedParts', () => liste(ort, o, 'expectedParts', sollTeil));
|
|
225
|
+
wennWert(r, o, 'cashTipsInDrawerCents', () => ganzzahl(ort, o, 'cashTipsInDrawerCents'));
|
|
226
|
+
wennWert(r, o, 'interimCounts', () => ganzzahl(ort, o, 'interimCounts'));
|
|
227
|
+
wennWert(r, o, 'interimDifferenceCents', () => ganzzahl(ort, o, 'interimDifferenceCents'));
|
|
228
|
+
wennWert(r, o, 'differenceParts', () => liste(ort, o, 'differenceParts', differenzTeil));
|
|
229
|
+
wennWert(r, o, 'countedBeforePayoutCents', () => ganzzahl(ort, o, 'countedBeforePayoutCents'));
|
|
203
230
|
return raus;
|
|
204
231
|
}
|
|
205
232
|
function schichtOderNull(ort, w) {
|
|
@@ -220,6 +247,12 @@ function oeffnung(ort, w) {
|
|
|
220
247
|
ok: wahr(ort, o, 'ok'),
|
|
221
248
|
};
|
|
222
249
|
}
|
|
250
|
+
function letzteSchicht(ort, w) {
|
|
251
|
+
if (w === null)
|
|
252
|
+
return null;
|
|
253
|
+
const o = pflichtObjekt(ort, w);
|
|
254
|
+
return { number: ganzzahl(ort, o, 'number'), closedAt: kennung(ort, o, 'closedAt'), closedByName: text(o.closedByName) };
|
|
255
|
+
}
|
|
223
256
|
function ladeStand(ort, w) {
|
|
224
257
|
const o = pflichtObjekt(ort, w);
|
|
225
258
|
const lade = pflichtObjekt(unter(ort, 'drawer'), o.drawer);
|
|
@@ -249,6 +282,8 @@ function ladeStand(ort, w) {
|
|
|
249
282
|
wennDa(r, o, 'expectedCents', () => ganzzahlOderNull(ort, o, 'expectedCents'));
|
|
250
283
|
wennDa(r, o, 'recentOpenings', () => liste(ort, o, 'recentOpenings', oeffnung));
|
|
251
284
|
wennWert(r, o, 'suggestedFromShiftNumber', () => ganzzahl(ort, o, 'suggestedFromShiftNumber'));
|
|
285
|
+
// Letzte Schicht der Lade: `null` ist eine Aussage („keine“), darum bleibt es stehen.
|
|
286
|
+
wennDa(r, o, 'lastShift', () => (o.lastShift === undefined ? null : letzteSchicht(unter(ort, 'lastShift'), o.lastShift)));
|
|
252
287
|
// Wechselgeld der Lade: nur wenn eingestellt.
|
|
253
288
|
wennWert(raus.drawer, lade, 'changeFloatCents', () => ganzzahl(ladeOrt, lade, 'changeFloatCents'));
|
|
254
289
|
return raus;
|
|
@@ -335,6 +370,12 @@ function schichtBon(ort, w) {
|
|
|
335
370
|
const r = raus;
|
|
336
371
|
wennWert(r, o, 'afterCount', () => nachZaehlung(unter(ort, 'afterCount'), o.afterCount));
|
|
337
372
|
wennDa(r, o, 'leftInDrawerCents', () => ganzzahlOderNull(ort, o, 'leftInDrawerCents'));
|
|
373
|
+
// Ablauf der Kasse: nur, wenn der Server sie sendet (die Bons davor tragen sie nicht).
|
|
374
|
+
wennWert(r, o, 'openingCounted', () => wahr(ort, o, 'openingCounted'));
|
|
375
|
+
wennWert(r, o, 'interimDifferenceCents', () => ganzzahl(ort, o, 'interimDifferenceCents'));
|
|
376
|
+
wennWert(r, o, 'differenceParts', () => liste(ort, o, 'differenceParts', differenzTeil));
|
|
377
|
+
wennDa(r, o, 'countedBeforePayoutCents', () => ganzzahlOderNull(ort, o, 'countedBeforePayoutCents'));
|
|
378
|
+
wennDa(r, o, 'countedBeforePayoutDenominations', () => stueckelung(ort, o, 'countedBeforePayoutDenominations'));
|
|
338
379
|
return raus;
|
|
339
380
|
}
|
|
340
381
|
/** Bon-Daten einer Kassenbewegung; eine andere Art ist ein Fehler. */
|
|
@@ -387,6 +428,12 @@ function geoeffnet(ort, w) {
|
|
|
387
428
|
wennDa(raus, o, 'handoverDifferenceCents', () => ganzzahlOderNull(ort, o, 'handoverDifferenceCents'));
|
|
388
429
|
return raus;
|
|
389
430
|
}
|
|
431
|
+
function gezaehlt(ort, w) {
|
|
432
|
+
const o = pflichtObjekt(ort, w);
|
|
433
|
+
const z = pflichtObjekt(unter(ort, 'count'), o.count);
|
|
434
|
+
const zOrt = unter(ort, 'count');
|
|
435
|
+
return { count: { expectedCents: ganzzahl(zOrt, z, 'expectedCents'), countedCents: ganzzahl(zOrt, z, 'countedCents'), differenceCents: ganzzahl(zOrt, z, 'differenceCents') } };
|
|
436
|
+
}
|
|
390
437
|
function gebucht(ort, w) {
|
|
391
438
|
const o = pflichtObjekt(ort, w);
|
|
392
439
|
return { movement: bewegung(unter(ort, 'movement'), o.movement), receipt: bewegungsBon(unter(ort, 'receipt'), o.receipt) };
|
|
@@ -19,10 +19,10 @@ export type EurDenomination = (typeof EUR_DENOMINATIONS)[number];
|
|
|
19
19
|
/**
|
|
20
20
|
* Alle Arten einer Kassenbewegung (Katalog `KASSEN_BEWEGUNG_ART`). Die ersten
|
|
21
21
|
* acht sendet die Kasse ([MANUAL_MOVEMENT_TYPES]); `transfer_in` (Gegenseite
|
|
22
|
-
* einer Umbuchung), `expense`, `count_difference
|
|
23
|
-
* vergibt nur der Server.
|
|
22
|
+
* einer Umbuchung), `expense`, `count_difference`, `handover_difference` und
|
|
23
|
+
* `interim_difference` (Differenz einer Zwischenzaehlung) vergibt nur der Server.
|
|
24
24
|
*/
|
|
25
|
-
export declare const MOVEMENT_TYPES: readonly ["change_in", "cash_drop", "owner_deposit", "owner_withdrawal", "tip_payout", "other_in", "other_out", "transfer_out", "transfer_in", "expense", "count_difference", "handover_difference"];
|
|
25
|
+
export declare const MOVEMENT_TYPES: readonly ["change_in", "cash_drop", "owner_deposit", "owner_withdrawal", "tip_payout", "other_in", "other_out", "transfer_out", "transfer_in", "expense", "count_difference", "handover_difference", "interim_difference"];
|
|
26
26
|
export type MovementType = (typeof MOVEMENT_TYPES)[number];
|
|
27
27
|
/**
|
|
28
28
|
* Was die Kasse von Hand buchen darf. Pflichtangaben je Art (sonst lehnt der
|
|
@@ -150,6 +150,20 @@ export interface ShiftRunningTotals {
|
|
|
150
150
|
/** Nach Name sortiert. */
|
|
151
151
|
tips: ShiftTipTotals[];
|
|
152
152
|
openingsWithoutSale: number;
|
|
153
|
+
/**
|
|
154
|
+
* Trinkgeld an Kassen-Benutzer mit „Trinkgeld steuerpflichtig“ (Inhaber): zählt als Umsatz des Betriebs,
|
|
155
|
+
* nie als Anspruch, nie in „offen“ (nur Anzeige, 1.28.0). Nach Name sortiert; der Server sendet es nur,
|
|
156
|
+
* wenn es etwas gibt (fehlt = keines).
|
|
157
|
+
*/
|
|
158
|
+
ownerTips?: ShiftOwnerTip[];
|
|
159
|
+
/** Trinkgeld ohne angemeldeten Empfänger in Cent (nur Anzeige, 1.28.0); fehlt = 0. */
|
|
160
|
+
unassignedTipCents?: number;
|
|
161
|
+
}
|
|
162
|
+
/** Ein Eintrag von [ShiftRunningTotals.ownerTips]: Trinkgeld, das als Umsatz erfasst ist. */
|
|
163
|
+
export interface ShiftOwnerTip {
|
|
164
|
+
registerUserId: string;
|
|
165
|
+
name: string | null;
|
|
166
|
+
cents: number;
|
|
153
167
|
}
|
|
154
168
|
/** Nachrechnung des Laufstands beim Abschluss: stimmt er, oder welche Felder weichen ab. */
|
|
155
169
|
export interface ShiftReconciliation {
|
|
@@ -160,6 +174,29 @@ export interface ShiftReconciliation {
|
|
|
160
174
|
recomputed: unknown;
|
|
161
175
|
}> | null;
|
|
162
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Wie sich das Soll in der Lade zusammensetzt (`Shift.expectedParts`, Karte „So setzt sich das zusammen“):
|
|
179
|
+
* Anfang, Barverkaeufe, Trinkgeld bar, Storno bar, Einzahlungen, Ausgaben aus der Lade und die
|
|
180
|
+
* Summe der Zwischenzaehlungs-Differenzen. Die Summe der Teile ist das Soll.
|
|
181
|
+
*/
|
|
182
|
+
export declare const EXPECTED_PART_KEYS: readonly ["opening", "cash_sales", "cash_tips", "cancellations", "cash_in", "cash_out", "interim_difference"];
|
|
183
|
+
export type ExpectedPartKey = (typeof EXPECTED_PART_KEYS)[number];
|
|
184
|
+
/** Ein Teil des Solls in Cent (Vorzeichen wie gebucht, Ausgaben negativ). */
|
|
185
|
+
export interface ShiftExpectedPart {
|
|
186
|
+
/** Offen fuer einen kuenftigen Teil des Servers; bekannt sind [EXPECTED_PART_KEYS]. */
|
|
187
|
+
key: ExpectedPartKey | (string & {});
|
|
188
|
+
cents: number;
|
|
189
|
+
}
|
|
190
|
+
/** Teile der Gesamtdifferenz einer geschlossenen Schicht mit Zwischenzaehlung: `interim` je Zaehlung, `closing` der Abschluss. */
|
|
191
|
+
export declare const DIFFERENCE_PART_TYPES: readonly ["interim", "closing"];
|
|
192
|
+
export type DifferencePartType = (typeof DIFFERENCE_PART_TYPES)[number];
|
|
193
|
+
export interface ShiftDifferencePart {
|
|
194
|
+
/** Offen fuer einen kuenftigen Wert; bekannt sind [DIFFERENCE_PART_TYPES]. */
|
|
195
|
+
type: DifferencePartType | (string & {});
|
|
196
|
+
cents: number;
|
|
197
|
+
/** Zeitpunkt der Zaehlung (ISO 8601, UTC); beim Abschluss kann er fehlen. */
|
|
198
|
+
at: string | null;
|
|
199
|
+
}
|
|
163
200
|
export interface Shift {
|
|
164
201
|
id: string;
|
|
165
202
|
drawerId: string;
|
|
@@ -183,12 +220,38 @@ export interface Shift {
|
|
|
183
220
|
suggestedFloatCents?: number | null;
|
|
184
221
|
runningTotals?: ShiftRunningTotals;
|
|
185
222
|
expectedCents?: number | null;
|
|
223
|
+
/**
|
|
224
|
+
* Gesamtdifferenz der Schicht. Mit Zwischenzaehlungen ist sie NICHT `countedCents − expectedCents`:
|
|
225
|
+
* jede Zwischenzaehlung verschiebt das Soll um ihre Differenz, gespeichert wird die Summe aus den
|
|
226
|
+
* Zwischen-Teilen und dem Abschluss-Teil (`differenceParts`). Ohne Zwischenzaehlung gilt Ist − Soll.
|
|
227
|
+
*/
|
|
186
228
|
differenceCents?: number | null;
|
|
187
229
|
reconciliation?: ShiftReconciliation | null;
|
|
188
230
|
/** Entnommen bzw. eingelegt nach dem Zaehlen. */
|
|
189
231
|
afterCount?: AfterCount;
|
|
190
232
|
/** Was danach in der Lade bleibt (Ist ∓ Betrag); fehlt blind (ohne `cashView`). */
|
|
191
233
|
leftInDrawerCents?: number;
|
|
234
|
+
/**
|
|
235
|
+
* Wurde der Anfang gezaehlt? `false` heisst: der Bestand wurde ohne Zaehlen uebernommen.
|
|
236
|
+
* Steht an offenen und geschlossenen Schichten und auf den Z-Bon-Daten (`ShiftSummaryReceipt.openingCounted`);
|
|
237
|
+
* fehlt das Feld (aeltere Server), gilt es als unbekannt, nicht als gezaehlt.
|
|
238
|
+
*/
|
|
239
|
+
openingCounted?: boolean;
|
|
240
|
+
/** Das Soll in Teilen (Summe = `expectedCents`); nur an der offenen Schicht mit `cashView`. */
|
|
241
|
+
expectedParts?: ShiftExpectedPart[];
|
|
242
|
+
/** Bar-Trinkgeld, das in der Lade liegt (Teil des Solls); nur an der offenen Schicht mit `cashView`. */
|
|
243
|
+
cashTipsInDrawerCents?: number;
|
|
244
|
+
/** Zahl der Zwischenzaehlungen dieser Schicht; nur an der offenen Schicht mit `cashView`. */
|
|
245
|
+
interimCounts?: number;
|
|
246
|
+
/** Summe der Differenzen der Zwischenzaehlungen in Cent; fehlt, wenn der Server sie nicht sendet. */
|
|
247
|
+
interimDifferenceCents?: number;
|
|
248
|
+
/** Teile der Gesamtdifferenz; nur an geschlossenen Schichten mit Zwischenzaehlung. */
|
|
249
|
+
differenceParts?: ShiftDifferencePart[];
|
|
250
|
+
/**
|
|
251
|
+
* Rohwert der Zaehlung vor der Trinkgeld-Auszahlung; nur wenn mit `countedBeforePayout`
|
|
252
|
+
* geschlossen wurde. `countedCents` bleibt dann der Stand nach der Auszahlung.
|
|
253
|
+
*/
|
|
254
|
+
countedBeforePayoutCents?: number;
|
|
192
255
|
}
|
|
193
256
|
/** Offener Trinkgeld-Anspruch eines Mitarbeiters (auszahlbar beim Abschluss oder per `tip_payout`). */
|
|
194
257
|
export interface TipClaim {
|
|
@@ -236,6 +299,18 @@ export interface DrawerState {
|
|
|
236
299
|
* mit einem Betrag „Bleibt in der Kassenlade“ schloss.
|
|
237
300
|
*/
|
|
238
301
|
suggestedFromShiftNumber?: number;
|
|
302
|
+
/**
|
|
303
|
+
* Die zuletzt geschlossene Schicht dieser Lade (Karte „Letzte Schicht“ am Schichtbeginn);
|
|
304
|
+
* `null`, wenn es keine gibt, fehlt ohne Recht `shift`.
|
|
305
|
+
*/
|
|
306
|
+
lastShift?: LastShift | null;
|
|
307
|
+
}
|
|
308
|
+
/** Die zuletzt geschlossene Schicht einer Lade. */
|
|
309
|
+
export interface LastShift {
|
|
310
|
+
number: number;
|
|
311
|
+
closedAt: string;
|
|
312
|
+
/** Wer sie schloss; `null`, wenn kein Name bekannt ist. */
|
|
313
|
+
closedByName: string | null;
|
|
239
314
|
}
|
|
240
315
|
export interface CashMovement {
|
|
241
316
|
id: string;
|
|
@@ -308,6 +383,10 @@ export interface ShiftSummaryReceipt extends ShiftReceiptHeader {
|
|
|
308
383
|
/** Beim X-Bon immer `null`. */
|
|
309
384
|
countedCents: number | null;
|
|
310
385
|
countedDenominations: Denominations | null;
|
|
386
|
+
/**
|
|
387
|
+
* Gesamtdifferenz; mit Zwischenzaehlungen nicht `countedCents − expectedCents`, sondern die Summe der
|
|
388
|
+
* Zwischen-Teile und des Abschluss-Teils (`differenceParts`), wie an `Shift.differenceCents`.
|
|
389
|
+
*/
|
|
311
390
|
differenceCents: number | null;
|
|
312
391
|
comment: string | null;
|
|
313
392
|
openingsWithoutSale: number;
|
|
@@ -318,6 +397,22 @@ export interface ShiftSummaryReceipt extends ShiftReceiptHeader {
|
|
|
318
397
|
* (mit „Entnommen“ ergaebe es sonst das Ist).
|
|
319
398
|
*/
|
|
320
399
|
leftInDrawerCents?: number | null;
|
|
400
|
+
/**
|
|
401
|
+
* Wurde der Anfang gezaehlt? Nur mit `false` druckt der Bon „Anfang uebernommen, nicht
|
|
402
|
+
* gezaehlt“; fehlt das Feld (der Server sendet es auf dem Bon nicht), bleibt die Zeile weg.
|
|
403
|
+
*/
|
|
404
|
+
openingCounted?: boolean;
|
|
405
|
+
/** Summe der Zwischenzaehlungs-Differenzen; fehlt, wenn sie 0 ist oder blind. */
|
|
406
|
+
interimDifferenceCents?: number;
|
|
407
|
+
/** Teile der Gesamtdifferenz (Zwischenzaehlungen und Abschluss); fehlt ohne Zwischenzaehlung und blind. */
|
|
408
|
+
differenceParts?: ShiftDifferencePart[];
|
|
409
|
+
/**
|
|
410
|
+
* Die Zaehlung vor der Trinkgeld-Auszahlung (Rohwert); nur wenn so geschlossen wurde, blind `null`.
|
|
411
|
+
* `countedCents` ist dann der Stand nach der Auszahlung.
|
|
412
|
+
*/
|
|
413
|
+
countedBeforePayoutCents?: number | null;
|
|
414
|
+
/** Stueckelung zu `countedBeforePayoutCents`; blind `null`. */
|
|
415
|
+
countedBeforePayoutDenominations?: Denominations | null;
|
|
321
416
|
}
|
|
322
417
|
/** Bon-Daten einer Kassenbewegung. */
|
|
323
418
|
export interface CashMovementReceipt extends ShiftReceiptHeader {
|
|
@@ -343,6 +438,14 @@ export interface OpenShiftResult {
|
|
|
343
438
|
/** Unterschied zum uebergebenen Bestand beim Zaehlen; nur mit `cashView`. */
|
|
344
439
|
handoverDifferenceCents?: number | null;
|
|
345
440
|
}
|
|
441
|
+
/** Antwort von `recordMyShiftCount`: Soll, Zaehlung und Differenz dieser Zwischenzaehlung (Cent). */
|
|
442
|
+
export interface ShiftCountResult {
|
|
443
|
+
count: {
|
|
444
|
+
expectedCents: number;
|
|
445
|
+
countedCents: number;
|
|
446
|
+
differenceCents: number;
|
|
447
|
+
};
|
|
448
|
+
}
|
|
346
449
|
export interface CashMovementResult {
|
|
347
450
|
movement: CashMovement;
|
|
348
451
|
receipt: CashMovementReceipt;
|