@kreiseck/kasseneck-api 1.30.0 → 1.31.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 +17 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +7 -5
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/index.js +4 -2
- package/dist/cjs/models/voucher.d.ts +18 -0
- package/dist/cjs/models/voucher.js +32 -1
- package/dist/cjs/pos/artikel.d.ts +12 -0
- package/dist/cjs/pos/artikel.js +2 -0
- package/dist/cjs/pos/client.js +11 -0
- package/dist/cjs/pos/errors.d.ts +1 -1
- package/dist/cjs/pos/errors.js +1 -0
- package/dist/cjs/pos/fremdgutschein-artikel.d.ts +66 -0
- package/dist/cjs/pos/fremdgutschein-artikel.js +74 -0
- package/dist/cjs/pos/index.d.ts +6 -3
- package/dist/cjs/pos/index.js +42 -4
- package/dist/cjs/pos/rabatt-vorlagen.d.ts +79 -0
- package/dist/cjs/pos/rabatt-vorlagen.js +156 -0
- package/dist/cjs/pos/schicht-lesen.js +8 -0
- package/dist/cjs/pos/schicht-typen.d.ts +15 -0
- package/dist/cjs/pos/settings.d.ts +69 -3
- package/dist/cjs/pos/settings.js +72 -5
- package/dist/cjs/pos/texte.d.ts +215 -0
- package/dist/cjs/pos/texte.js +124 -1
- package/dist/cjs/pos/zusaetze.d.ts +3 -3
- package/dist/cjs/pos/zusaetze.js +4 -2
- package/dist/cjs/receipt/shift-sheet.js +8 -0
- package/dist/cjs/stored/draht.js +1 -0
- package/dist/cjs/stored/einstellungen.js +50 -2
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +38 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/esm/models/voucher.d.ts +18 -0
- package/dist/esm/models/voucher.js +30 -0
- package/dist/esm/pos/artikel.d.ts +12 -0
- package/dist/esm/pos/artikel.js +2 -0
- package/dist/esm/pos/client.js +12 -1
- package/dist/esm/pos/errors.d.ts +1 -1
- package/dist/esm/pos/errors.js +1 -0
- package/dist/esm/pos/fremdgutschein-artikel.d.ts +66 -0
- package/dist/esm/pos/fremdgutschein-artikel.js +67 -0
- package/dist/esm/pos/index.d.ts +6 -3
- package/dist/esm/pos/index.js +7 -3
- package/dist/esm/pos/rabatt-vorlagen.d.ts +79 -0
- package/dist/esm/pos/rabatt-vorlagen.js +148 -0
- package/dist/esm/pos/schicht-lesen.js +8 -0
- package/dist/esm/pos/schicht-typen.d.ts +15 -0
- package/dist/esm/pos/settings.d.ts +69 -3
- package/dist/esm/pos/settings.js +67 -4
- package/dist/esm/pos/texte.d.ts +215 -0
- package/dist/esm/pos/texte.js +122 -0
- package/dist/esm/pos/zusaetze.d.ts +3 -3
- package/dist/esm/pos/zusaetze.js +4 -2
- package/dist/esm/receipt/shift-sheet.js +8 -0
- package/dist/esm/stored/draht.js +1 -0
- package/dist/esm/stored/einstellungen.js +52 -4
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +38 -4
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/add-on-cases.json +6 -4
- package/fixtures/discount-preset-cases.json +1074 -0
- package/fixtures/external-voucher-article-cases.json +311 -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 +205 -1
- package/fixtures/receipt-due-voucher-generated.json +1 -1
- package/fixtures/renames-1.0.json +18 -0
- package/fixtures/surface.json +49 -4
- package/fixtures/v3/antworten/belege.json +1 -1
- package/fixtures/v3/antworten/belegmail.json +1 -1
- package/fixtures/v3/antworten/berichte.json +1 -1
- package/fixtures/v3/antworten/kasse-belege.json +1 -1
- package/fixtures/v3/antworten/kasse.json +2 -2
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +1 -1
- package/fixtures/v3/antworten/storno.json +1 -1
- package/fixtures/v3/stored/belege.json +1 -1
- package/fixtures/v3/stored/kasse.json +2 -2
- package/fixtures/v3/stored/rechnungen.json +1 -1
- package/fixtures/v3/v3-vokabular.json +95 -9
- package/fixtures/v3/zahlbetrag-faelle.json +1 -1
- package/package.json +1 -1
package/dist/cjs/pos/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
3
|
+
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_KEPT_MODE = 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.POS_BUSINESS_OPTIONAL_LISTS = exports.DISCOUNT_PRESET_KIND = exports.tipKeptFor = exports.posTipKeptMode = exports.posCustomDiscountAllowed = 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.getPosSettings = exports.OWN_VOUCHER_CODE_SHAPES = exports.ownVoucherCodeShape = exports.externalVoucherTileBlock = exports.checkExternalVoucherArticle = exports.checkExternalVoucherValue = exports.isArticleExternalVoucher = exports.EXTERNAL_VOUCHER_ARTICLE_REASONS = exports.ARTICLE_EXTERNAL_VOUCHER_VAT_RATES = exports.ARTICLE_EXTERNAL_VOUCHER_INVALID = exports.ARTICLE_EXTERNAL_VOUCHER_TYPES = 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 = exports.LOGO_SCALE = exports.WATERMARK_STRENGTH = exports.WATERMARK_SIDE = exports.DISCOUNT = exports.AUTO_LOGOUT_MINUTES = exports.TILE_STYLE = void 0;
|
|
5
|
+
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.DISCOUNT_PRESET_MESSAGES = exports.DISCOUNT_PRESET_AMOUNT_CENTS = exports.DISCOUNT_PRESET_PERCENT_BP = exports.DISCOUNT_PRESET_NAME_MAX = exports.DISCOUNT_PRESETS_MAX = exports.INVALID_DISCOUNT_PRESET = exports.discountBlockLines = exports.checkDiscountPresets = exports.discountChipsFromPresets = exports.discountPresetChipText = exports.posDiscountPresets = exports.listMyTipRecipients = exports.getPrintJob = exports.createPrintJob = exports.listMyPrinters = exports.isPrintJobFinished = exports.PRINT_JOB_SOURCES = exports.PRINT_JOB_STATUSES = exports.voucherPermsOf = exports.stockViewOf = exports.receiptsScopeOf = exports.cancelScopeOf = exports.distributeDiscount = exports.posFieldErrors = exports.isPosError = exports.posErrorCode = exports.isPosErrorCode = exports.POS_ERROR_CODES = exports.posSettingsFromWire = exports.setMyPosLogo = exports.setMyRegisterDeviceSettings = exports.setMyPosSettings = void 0;
|
|
6
|
+
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 = 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.EXTERNAL_VOUCHERS = exports.VOUCHER_TYPE_VALIDITY_PATTERNS = exports.VOUCHER_AMOUNT_MODES = exports.VOUCHER_TYPE_KINDS = exports.VOUCHER_PAYOUTS = exports.posVoucherSettingsFromWire = exports.VOUCHER_SETTINGS_DEFAULTS = exports.reprintVoucherLabel = void 0;
|
|
7
|
+
exports.roundUpSuggestions = exports.receiptOutputLabel = exports.RETURN_DISPOSITION_LABELS = exports.labelText = exports.LABELS = exports.TIP_KEPT_MODE_LABELS = exports.EXTERNAL_VOUCHER_KIND_LABELS = exports.EXTERNAL_VOUCHERS_LABELS = exports.externalVoucherArticleErrorMessage = exports.EXTERNAL_VOUCHER_ARTICLE_MESSAGES = exports.EXTERNAL_VOUCHER_TILE_MESSAGES = exports.voucherErrorMessage = exports.VOUCHER_ERROR_MESSAGES = exports.cancellationErrorMessage = void 0;
|
|
7
8
|
/**
|
|
8
9
|
* Kachel-Kasse: Einstellungen, Artikelgruppen/Artikel fuer Kacheln,
|
|
9
10
|
* Rabattverteilung, Drucker, Trinkgeld-Empfaenger, Lager (Standorte, Bestand,
|
|
@@ -22,6 +23,11 @@ Object.defineProperty(exports, "POS_BUSINESS_OPTIONAL_FIELDS", { enumerable: tru
|
|
|
22
23
|
Object.defineProperty(exports, "POS_BUSINESS_OPTIONAL_CHOICES", { enumerable: true, get: function () { return settings_js_1.POS_BUSINESS_OPTIONAL_CHOICES; } });
|
|
23
24
|
Object.defineProperty(exports, "POS_DEVICE_OPTIONAL_CHOICES", { enumerable: true, get: function () { return settings_js_1.POS_DEVICE_OPTIONAL_CHOICES; } });
|
|
24
25
|
Object.defineProperty(exports, "posTipKeptByDefault", { enumerable: true, get: function () { return settings_js_1.posTipKeptByDefault; } });
|
|
26
|
+
Object.defineProperty(exports, "posCustomDiscountAllowed", { enumerable: true, get: function () { return settings_js_1.posCustomDiscountAllowed; } });
|
|
27
|
+
Object.defineProperty(exports, "posTipKeptMode", { enumerable: true, get: function () { return settings_js_1.posTipKeptMode; } });
|
|
28
|
+
Object.defineProperty(exports, "tipKeptFor", { enumerable: true, get: function () { return settings_js_1.tipKeptFor; } });
|
|
29
|
+
Object.defineProperty(exports, "DISCOUNT_PRESET_KIND", { enumerable: true, get: function () { return settings_js_1.DISCOUNT_PRESET_KIND; } });
|
|
30
|
+
Object.defineProperty(exports, "POS_BUSINESS_OPTIONAL_LISTS", { enumerable: true, get: function () { return settings_js_1.POS_BUSINESS_OPTIONAL_LISTS; } });
|
|
25
31
|
Object.defineProperty(exports, "posTipKinds", { enumerable: true, get: function () { return settings_js_1.posTipKinds; } });
|
|
26
32
|
Object.defineProperty(exports, "posTipStart", { enumerable: true, get: function () { return settings_js_1.posTipStart; } });
|
|
27
33
|
Object.defineProperty(exports, "posCartWidth", { enumerable: true, get: function () { return settings_js_1.posCartWidth; } });
|
|
@@ -41,6 +47,7 @@ Object.defineProperty(exports, "QUANTITY", { enumerable: true, get: function ()
|
|
|
41
47
|
Object.defineProperty(exports, "TIP_MODE", { enumerable: true, get: function () { return settings_js_1.TIP_MODE; } });
|
|
42
48
|
Object.defineProperty(exports, "TIP_KINDS", { enumerable: true, get: function () { return settings_js_1.TIP_KINDS; } });
|
|
43
49
|
Object.defineProperty(exports, "TIP_START", { enumerable: true, get: function () { return settings_js_1.TIP_START; } });
|
|
50
|
+
Object.defineProperty(exports, "TIP_KEPT_MODE", { enumerable: true, get: function () { return settings_js_1.TIP_KEPT_MODE; } });
|
|
44
51
|
Object.defineProperty(exports, "CART_WIDTH", { enumerable: true, get: function () { return settings_js_1.CART_WIDTH; } });
|
|
45
52
|
Object.defineProperty(exports, "CHECKOUT_MODE", { enumerable: true, get: function () { return settings_js_1.CHECKOUT_MODE; } });
|
|
46
53
|
Object.defineProperty(exports, "CARD_PROVIDER", { enumerable: true, get: function () { return settings_js_1.CARD_PROVIDER; } });
|
|
@@ -100,6 +107,19 @@ Object.defineProperty(exports, "addOnsOfItem", { enumerable: true, get: function
|
|
|
100
107
|
Object.defineProperty(exports, "addOnRemap", { enumerable: true, get: function () { return zusaetze_js_1.addOnRemap; } });
|
|
101
108
|
Object.defineProperty(exports, "addOnDisplayOrder", { enumerable: true, get: function () { return zusaetze_js_1.addOnDisplayOrder; } });
|
|
102
109
|
Object.defineProperty(exports, "orderAddOnLines", { enumerable: true, get: function () { return zusaetze_js_1.orderAddOnLines; } });
|
|
110
|
+
var fremdgutschein_artikel_js_1 = require("./fremdgutschein-artikel.js");
|
|
111
|
+
Object.defineProperty(exports, "ARTICLE_EXTERNAL_VOUCHER_TYPES", { enumerable: true, get: function () { return fremdgutschein_artikel_js_1.ARTICLE_EXTERNAL_VOUCHER_TYPES; } });
|
|
112
|
+
Object.defineProperty(exports, "ARTICLE_EXTERNAL_VOUCHER_INVALID", { enumerable: true, get: function () { return fremdgutschein_artikel_js_1.ARTICLE_EXTERNAL_VOUCHER_INVALID; } });
|
|
113
|
+
Object.defineProperty(exports, "ARTICLE_EXTERNAL_VOUCHER_VAT_RATES", { enumerable: true, get: function () { return fremdgutschein_artikel_js_1.ARTICLE_EXTERNAL_VOUCHER_VAT_RATES; } });
|
|
114
|
+
Object.defineProperty(exports, "EXTERNAL_VOUCHER_ARTICLE_REASONS", { enumerable: true, get: function () { return fremdgutschein_artikel_js_1.EXTERNAL_VOUCHER_ARTICLE_REASONS; } });
|
|
115
|
+
Object.defineProperty(exports, "isArticleExternalVoucher", { enumerable: true, get: function () { return fremdgutschein_artikel_js_1.isArticleExternalVoucher; } });
|
|
116
|
+
Object.defineProperty(exports, "checkExternalVoucherValue", { enumerable: true, get: function () { return fremdgutschein_artikel_js_1.checkExternalVoucherValue; } });
|
|
117
|
+
Object.defineProperty(exports, "checkExternalVoucherArticle", { enumerable: true, get: function () { return fremdgutschein_artikel_js_1.checkExternalVoucherArticle; } });
|
|
118
|
+
Object.defineProperty(exports, "externalVoucherTileBlock", { enumerable: true, get: function () { return fremdgutschein_artikel_js_1.externalVoucherTileBlock; } });
|
|
119
|
+
// Form-Erkennung eigener Codes im Gutschein-Feld (Nachfrage statt Abweisung); dieselbe Funktion wie an der Wurzel.
|
|
120
|
+
var voucher_js_1 = require("../models/voucher.js");
|
|
121
|
+
Object.defineProperty(exports, "ownVoucherCodeShape", { enumerable: true, get: function () { return voucher_js_1.ownVoucherCodeShape; } });
|
|
122
|
+
Object.defineProperty(exports, "OWN_VOUCHER_CODE_SHAPES", { enumerable: true, get: function () { return voucher_js_1.OWN_VOUCHER_CODE_SHAPES; } });
|
|
103
123
|
var client_js_1 = require("./client.js");
|
|
104
124
|
Object.defineProperty(exports, "getPosSettings", { enumerable: true, get: function () { return client_js_1.getPosSettings; } });
|
|
105
125
|
Object.defineProperty(exports, "setMyPosSettings", { enumerable: true, get: function () { return client_js_1.setMyPosSettings; } });
|
|
@@ -130,6 +150,18 @@ Object.defineProperty(exports, "createPrintJob", { enumerable: true, get: functi
|
|
|
130
150
|
Object.defineProperty(exports, "getPrintJob", { enumerable: true, get: function () { return drucker_js_1.getPrintJob; } });
|
|
131
151
|
var trinkgeld_js_1 = require("./trinkgeld.js");
|
|
132
152
|
Object.defineProperty(exports, "listMyTipRecipients", { enumerable: true, get: function () { return trinkgeld_js_1.listMyTipRecipients; } });
|
|
153
|
+
var rabatt_vorlagen_js_1 = require("./rabatt-vorlagen.js");
|
|
154
|
+
Object.defineProperty(exports, "posDiscountPresets", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.posDiscountPresets; } });
|
|
155
|
+
Object.defineProperty(exports, "discountPresetChipText", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.discountPresetChipText; } });
|
|
156
|
+
Object.defineProperty(exports, "discountChipsFromPresets", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.discountChipsFromPresets; } });
|
|
157
|
+
Object.defineProperty(exports, "checkDiscountPresets", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.checkDiscountPresets; } });
|
|
158
|
+
Object.defineProperty(exports, "discountBlockLines", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.discountBlockLines; } });
|
|
159
|
+
Object.defineProperty(exports, "INVALID_DISCOUNT_PRESET", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.INVALID_DISCOUNT_PRESET; } });
|
|
160
|
+
Object.defineProperty(exports, "DISCOUNT_PRESETS_MAX", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.DISCOUNT_PRESETS_MAX; } });
|
|
161
|
+
Object.defineProperty(exports, "DISCOUNT_PRESET_NAME_MAX", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.DISCOUNT_PRESET_NAME_MAX; } });
|
|
162
|
+
Object.defineProperty(exports, "DISCOUNT_PRESET_PERCENT_BP", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.DISCOUNT_PRESET_PERCENT_BP; } });
|
|
163
|
+
Object.defineProperty(exports, "DISCOUNT_PRESET_AMOUNT_CENTS", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.DISCOUNT_PRESET_AMOUNT_CENTS; } });
|
|
164
|
+
Object.defineProperty(exports, "DISCOUNT_PRESET_MESSAGES", { enumerable: true, get: function () { return rabatt_vorlagen_js_1.DISCOUNT_PRESET_MESSAGES; } });
|
|
133
165
|
// Prüfung (DEP) an der Kasse: Ordner auf dem USB-Stick (gleich in Web-Kasse und Kassen-App).
|
|
134
166
|
var dep_js_1 = require("./dep.js");
|
|
135
167
|
Object.defineProperty(exports, "depFolderName", { enumerable: true, get: function () { return dep_js_1.depFolderName; } });
|
|
@@ -221,6 +253,12 @@ Object.defineProperty(exports, "CANCELLATION_VOUCHER_ERROR_MESSAGES", { enumerab
|
|
|
221
253
|
Object.defineProperty(exports, "cancellationErrorMessage", { enumerable: true, get: function () { return texte_js_1.cancellationErrorMessage; } });
|
|
222
254
|
Object.defineProperty(exports, "VOUCHER_ERROR_MESSAGES", { enumerable: true, get: function () { return texte_js_1.VOUCHER_ERROR_MESSAGES; } });
|
|
223
255
|
Object.defineProperty(exports, "voucherErrorMessage", { enumerable: true, get: function () { return texte_js_1.voucherErrorMessage; } });
|
|
256
|
+
Object.defineProperty(exports, "EXTERNAL_VOUCHER_TILE_MESSAGES", { enumerable: true, get: function () { return texte_js_1.EXTERNAL_VOUCHER_TILE_MESSAGES; } });
|
|
257
|
+
Object.defineProperty(exports, "EXTERNAL_VOUCHER_ARTICLE_MESSAGES", { enumerable: true, get: function () { return texte_js_1.EXTERNAL_VOUCHER_ARTICLE_MESSAGES; } });
|
|
258
|
+
Object.defineProperty(exports, "externalVoucherArticleErrorMessage", { enumerable: true, get: function () { return texte_js_1.externalVoucherArticleErrorMessage; } });
|
|
259
|
+
Object.defineProperty(exports, "EXTERNAL_VOUCHERS_LABELS", { enumerable: true, get: function () { return texte_js_1.EXTERNAL_VOUCHERS_LABELS; } });
|
|
260
|
+
Object.defineProperty(exports, "EXTERNAL_VOUCHER_KIND_LABELS", { enumerable: true, get: function () { return texte_js_1.EXTERNAL_VOUCHER_KIND_LABELS; } });
|
|
261
|
+
Object.defineProperty(exports, "TIP_KEPT_MODE_LABELS", { enumerable: true, get: function () { return texte_js_1.TIP_KEPT_MODE_LABELS; } });
|
|
224
262
|
Object.defineProperty(exports, "LABELS", { enumerable: true, get: function () { return texte_js_1.LABELS; } });
|
|
225
263
|
Object.defineProperty(exports, "labelText", { enumerable: true, get: function () { return texte_js_1.labelText; } });
|
|
226
264
|
Object.defineProperty(exports, "RETURN_DISPOSITION_LABELS", { enumerable: true, get: function () { return texte_js_1.RETURN_DISPOSITION_LABELS; } });
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { PosBusinessSettings, PosDiscountPreset } from './settings.js';
|
|
2
|
+
/** Fehlercode, den der Server bei einer ungueltigen Vorlage sendet. */
|
|
3
|
+
export declare const INVALID_DISCOUNT_PRESET = "invalid_discount_preset";
|
|
4
|
+
/** Hoechstzahl der Vorlagen. */
|
|
5
|
+
export declare const DISCOUNT_PRESETS_MAX = 5;
|
|
6
|
+
/** Laenge des Namens in Zeichen (nach dem Trimmen). */
|
|
7
|
+
export declare const DISCOUNT_PRESET_NAME_MAX = 24;
|
|
8
|
+
/** Prozent in Basispunkten: 0,1 % bis 100 % in Schritten von 0,1 %. */
|
|
9
|
+
export declare const DISCOUNT_PRESET_PERCENT_BP: Readonly<{
|
|
10
|
+
min: 10;
|
|
11
|
+
max: 10000;
|
|
12
|
+
step: 10;
|
|
13
|
+
}>;
|
|
14
|
+
/** Betrag in Cent: 0,01 € bis 1.000.000,00 €. */
|
|
15
|
+
export declare const DISCOUNT_PRESET_AMOUNT_CENTS: Readonly<{
|
|
16
|
+
min: 1;
|
|
17
|
+
max: 100000000;
|
|
18
|
+
}>;
|
|
19
|
+
/** Wirksame Vorlagen: die gespeicherten (auch leer), sonst die Prozent-Chips als namenlose Prozent-Vorlagen. */
|
|
20
|
+
export declare function posDiscountPresets(business: Readonly<Pick<Partial<PosBusinessSettings>, 'discountPresets' | 'discountChips'>> | null | undefined): PosDiscountPreset[];
|
|
21
|
+
/**
|
|
22
|
+
* Die Prozent-Chips, die der Server aus den Vorlagen nach `discountChips` spiegelt (fuer aeltere Kassen):
|
|
23
|
+
* Prozent-Vorlagen in ihrer Reihenfolge, gleiche Werte nur einmal, Betrag-Vorlagen fallen weg.
|
|
24
|
+
*/
|
|
25
|
+
export declare function discountChipsFromPresets(presets: readonly PosDiscountPreset[] | null | undefined): number[];
|
|
26
|
+
/** Text auf dem Chip: `Mitarbeiter-Rabatt 20 %`, `Stammkunde 5,00 €`; ohne Namen nur der Wert (`10 %`). */
|
|
27
|
+
export declare function discountPresetChipText(preset: Readonly<PosDiscountPreset>): string;
|
|
28
|
+
/** Warum eine Vorlage abgelehnt wird; je Grund ein Satz im Katalog ([DISCOUNT_PRESET_MESSAGES]). */
|
|
29
|
+
export type DiscountPresetReason = 'list' | 'entry' | 'name' | 'duplicate' | 'kind' | 'percent' | 'amount' | 'unknown_field';
|
|
30
|
+
/** Grund -> Satz (Katalog `discount_preset.*`). */
|
|
31
|
+
export declare const DISCOUNT_PRESET_MESSAGES: {
|
|
32
|
+
readonly list: "discount_preset.list";
|
|
33
|
+
readonly entry: "discount_preset.entry";
|
|
34
|
+
readonly name: "discount_preset.name";
|
|
35
|
+
readonly duplicate: "discount_preset.duplicate";
|
|
36
|
+
readonly kind: "discount_preset.kind";
|
|
37
|
+
readonly percent: "discount_preset.percent";
|
|
38
|
+
readonly amount: "discount_preset.amount";
|
|
39
|
+
readonly unknown_field: "discount_preset.unknown_field";
|
|
40
|
+
};
|
|
41
|
+
/** Ein Fehler der Pruefung: `index` die Vorlage (`null` = die Liste), `field` das Feld (`null` = die ganze Vorlage). */
|
|
42
|
+
export interface DiscountPresetError {
|
|
43
|
+
index: number | null;
|
|
44
|
+
field: string | null;
|
|
45
|
+
reason: DiscountPresetReason;
|
|
46
|
+
message: string;
|
|
47
|
+
}
|
|
48
|
+
export type DiscountPresetsCheck = {
|
|
49
|
+
ok: true;
|
|
50
|
+
value: PosDiscountPreset[];
|
|
51
|
+
} | {
|
|
52
|
+
ok: false;
|
|
53
|
+
code: typeof INVALID_DISCOUNT_PRESET;
|
|
54
|
+
errors: DiscountPresetError[];
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Prueft die Liste der Vorlagen vor dem Schreiben, mit denselben Regeln wie der Server: hoechstens 5, Name 1 bis 24
|
|
58
|
+
* Zeichen nach dem Trimmen ohne Steuerzeichen, eindeutig ohne Ruecksicht auf Gross und Klein, Art `percent`/`amount`
|
|
59
|
+
* mit genau dem passenden Wertfeld (Prozent 0,1 bis 100 in Schritten von 0,1, Betrag 0,01 bis 1.000.000 €).
|
|
60
|
+
* `value` ist die normalisierte Liste (Name getrimmt). Der Server antwortet bei einem Fehler mit
|
|
61
|
+
* [INVALID_DISCOUNT_PRESET].
|
|
62
|
+
*/
|
|
63
|
+
export declare function checkDiscountPresets(list: unknown): DiscountPresetsCheck;
|
|
64
|
+
/** Eine Zeile des Rabatte-Blocks auf Z- und X-Bon: `label` und der Betrag als Abzug (negativ). */
|
|
65
|
+
export interface DiscountBlockLine {
|
|
66
|
+
label: string;
|
|
67
|
+
cents: number;
|
|
68
|
+
}
|
|
69
|
+
/** Ein Rabatt je Name aus dem Laufstand bzw. den Bon-Daten: `cents` gewaehrt (positiv), `count` Belege. */
|
|
70
|
+
export interface DiscountTotal {
|
|
71
|
+
name: string;
|
|
72
|
+
cents: number;
|
|
73
|
+
count: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Zeilen des Rabatte-Blocks auf Z-Bon und Zwischenbericht: je Name `<Name> (n×)` mit dem Abzug, ab zwei Eintraegen
|
|
77
|
+
* zusaetzlich `Rabatte gesamt`. Ein leerer Name heisst „Rabatt“. Ein voll stornierter Name (Betrag 0) entfaellt wie in der Liste des Servers. Ohne Rabatte leer (kein Block).
|
|
78
|
+
*/
|
|
79
|
+
export declare function discountBlockLines(discounts: readonly DiscountTotal[] | null | undefined): DiscountBlockLine[];
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DISCOUNT_PRESET_MESSAGES = exports.DISCOUNT_PRESET_AMOUNT_CENTS = exports.DISCOUNT_PRESET_PERCENT_BP = exports.DISCOUNT_PRESET_NAME_MAX = exports.DISCOUNT_PRESETS_MAX = exports.INVALID_DISCOUNT_PRESET = void 0;
|
|
4
|
+
exports.posDiscountPresets = posDiscountPresets;
|
|
5
|
+
exports.discountChipsFromPresets = discountChipsFromPresets;
|
|
6
|
+
exports.discountPresetChipText = discountPresetChipText;
|
|
7
|
+
exports.checkDiscountPresets = checkDiscountPresets;
|
|
8
|
+
exports.discountBlockLines = discountBlockLines;
|
|
9
|
+
const texte_js_1 = require("./texte.js");
|
|
10
|
+
const settings_js_1 = require("./settings.js");
|
|
11
|
+
/*
|
|
12
|
+
* Rabatt-Vorlagen der Kasse (benannte Rabatt-Chips): wirksame Liste, Chip-Text, Spiegelung nach `discountChips`,
|
|
13
|
+
* Pruefung und Bon-Block. Zwilling von functions-kasse/rabatt-vorlagen-core.js; der Vertrag sind die Pruefaelle
|
|
14
|
+
* fixtures/discount-preset-cases.json (byte-gleich mit dem Backend).
|
|
15
|
+
*/
|
|
16
|
+
/** Fehlercode, den der Server bei einer ungueltigen Vorlage sendet. */
|
|
17
|
+
exports.INVALID_DISCOUNT_PRESET = 'invalid_discount_preset';
|
|
18
|
+
/** Hoechstzahl der Vorlagen. */
|
|
19
|
+
exports.DISCOUNT_PRESETS_MAX = 5;
|
|
20
|
+
/** Laenge des Namens in Zeichen (nach dem Trimmen). */
|
|
21
|
+
exports.DISCOUNT_PRESET_NAME_MAX = 24;
|
|
22
|
+
/** Prozent in Basispunkten: 0,1 % bis 100 % in Schritten von 0,1 %. */
|
|
23
|
+
exports.DISCOUNT_PRESET_PERCENT_BP = Object.freeze({ min: 10, max: 10000, step: 10 });
|
|
24
|
+
/** Betrag in Cent: 0,01 € bis 1.000.000,00 €. */
|
|
25
|
+
exports.DISCOUNT_PRESET_AMOUNT_CENTS = Object.freeze({ min: 1, max: 100000000 });
|
|
26
|
+
/** Wirksame Vorlagen: die gespeicherten (auch leer), sonst die Prozent-Chips als namenlose Prozent-Vorlagen. */
|
|
27
|
+
function posDiscountPresets(business) {
|
|
28
|
+
const vorlagen = business?.discountPresets;
|
|
29
|
+
if (Array.isArray(vorlagen))
|
|
30
|
+
return vorlagen.map((v) => ({ ...v }));
|
|
31
|
+
const raus = [];
|
|
32
|
+
const chips = business?.discountChips;
|
|
33
|
+
for (const p of Array.isArray(chips) ? chips : []) {
|
|
34
|
+
const bp = typeof p === 'number' ? Math.round(p * 100) : NaN;
|
|
35
|
+
if (Number.isFinite(bp) && bp >= exports.DISCOUNT_PRESET_PERCENT_BP.min && bp <= exports.DISCOUNT_PRESET_PERCENT_BP.max) {
|
|
36
|
+
raus.push({ name: '', kind: 'percent', percentBp: bp });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return raus;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Die Prozent-Chips, die der Server aus den Vorlagen nach `discountChips` spiegelt (fuer aeltere Kassen):
|
|
43
|
+
* Prozent-Vorlagen in ihrer Reihenfolge, gleiche Werte nur einmal, Betrag-Vorlagen fallen weg.
|
|
44
|
+
*/
|
|
45
|
+
function discountChipsFromPresets(presets) {
|
|
46
|
+
const raus = [];
|
|
47
|
+
for (const v of presets ?? []) {
|
|
48
|
+
if (!v || v.kind !== 'percent' || !Number.isInteger(v.percentBp))
|
|
49
|
+
continue;
|
|
50
|
+
const p = v.percentBp / 100;
|
|
51
|
+
if (!raus.includes(p))
|
|
52
|
+
raus.push(p);
|
|
53
|
+
}
|
|
54
|
+
return raus;
|
|
55
|
+
}
|
|
56
|
+
/** Prozent aus Basispunkten als Text mit Komma, ohne ueberfluessige Stellen: `1000` -> `10`, `1050` -> `10,5`. */
|
|
57
|
+
function prozentText(bp) {
|
|
58
|
+
const ganz = Math.trunc(bp / 100);
|
|
59
|
+
const rest = String(bp % 100).padStart(2, '0').replace(/0+$/, '');
|
|
60
|
+
return rest === '' ? String(ganz) : `${ganz},${rest}`;
|
|
61
|
+
}
|
|
62
|
+
/** Euro aus Cent mit Tausenderpunkt: `123456` -> `1.234,56 €`. */
|
|
63
|
+
function euroText(cents) {
|
|
64
|
+
const ganz = String(Math.trunc(cents / 100)).replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
|
65
|
+
return `${ganz},${String(cents % 100).padStart(2, '0')} €`;
|
|
66
|
+
}
|
|
67
|
+
/** Text auf dem Chip: `Mitarbeiter-Rabatt 20 %`, `Stammkunde 5,00 €`; ohne Namen nur der Wert (`10 %`). */
|
|
68
|
+
function discountPresetChipText(preset) {
|
|
69
|
+
const wert = preset.kind === 'amount' ? euroText(preset.amountCents ?? 0) : `${prozentText(preset.percentBp ?? 0)} %`;
|
|
70
|
+
return preset.name ? `${preset.name} ${wert}` : wert;
|
|
71
|
+
}
|
|
72
|
+
/** Grund -> Satz (Katalog `discount_preset.*`). */
|
|
73
|
+
exports.DISCOUNT_PRESET_MESSAGES = {
|
|
74
|
+
list: 'discount_preset.list',
|
|
75
|
+
entry: 'discount_preset.entry',
|
|
76
|
+
name: 'discount_preset.name',
|
|
77
|
+
duplicate: 'discount_preset.duplicate',
|
|
78
|
+
kind: 'discount_preset.kind',
|
|
79
|
+
percent: 'discount_preset.percent',
|
|
80
|
+
amount: 'discount_preset.amount',
|
|
81
|
+
unknown_field: 'discount_preset.unknown_field',
|
|
82
|
+
};
|
|
83
|
+
// Steuer- und Formatzeichen (Zeilenumbruch, Null, Zero-Width, Richtungswechsel): nie in einem Bon-Text.
|
|
84
|
+
const STEUERZEICHEN = /[\p{Cc}\p{Cf}\u2028\u2029]/u;
|
|
85
|
+
const WERTFELD = { percent: 'percentBp', amount: 'amountCents' };
|
|
86
|
+
const istObjekt = (x) => x !== null && typeof x === 'object' && !Array.isArray(x);
|
|
87
|
+
function fehler(index, field, reason) {
|
|
88
|
+
return { index, field, reason, message: (0, texte_js_1.messageText)(exports.DISCOUNT_PRESET_MESSAGES[reason]) };
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Prueft die Liste der Vorlagen vor dem Schreiben, mit denselben Regeln wie der Server: hoechstens 5, Name 1 bis 24
|
|
92
|
+
* Zeichen nach dem Trimmen ohne Steuerzeichen, eindeutig ohne Ruecksicht auf Gross und Klein, Art `percent`/`amount`
|
|
93
|
+
* mit genau dem passenden Wertfeld (Prozent 0,1 bis 100 in Schritten von 0,1, Betrag 0,01 bis 1.000.000 €).
|
|
94
|
+
* `value` ist die normalisierte Liste (Name getrimmt). Der Server antwortet bei einem Fehler mit
|
|
95
|
+
* [INVALID_DISCOUNT_PRESET].
|
|
96
|
+
*/
|
|
97
|
+
function checkDiscountPresets(list) {
|
|
98
|
+
if (!Array.isArray(list) || list.length > exports.DISCOUNT_PRESETS_MAX) {
|
|
99
|
+
return { ok: false, code: exports.INVALID_DISCOUNT_PRESET, errors: [fehler(null, null, 'list')] };
|
|
100
|
+
}
|
|
101
|
+
const errors = [];
|
|
102
|
+
const value = [];
|
|
103
|
+
const namen = new Set();
|
|
104
|
+
list.forEach((v, index) => {
|
|
105
|
+
if (!istObjekt(v)) {
|
|
106
|
+
errors.push(fehler(index, null, 'entry'));
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const vorher = errors.length;
|
|
110
|
+
const name = typeof v.name === 'string' ? v.name.trim() : null;
|
|
111
|
+
if (name === null || name.length < 1 || [...name].length > exports.DISCOUNT_PRESET_NAME_MAX || STEUERZEICHEN.test(name))
|
|
112
|
+
errors.push(fehler(index, 'name', 'name'));
|
|
113
|
+
else if (namen.has(name.toLocaleLowerCase('de')))
|
|
114
|
+
errors.push(fehler(index, 'name', 'duplicate'));
|
|
115
|
+
else
|
|
116
|
+
namen.add(name.toLocaleLowerCase('de'));
|
|
117
|
+
const kind = settings_js_1.DISCOUNT_PRESET_KIND.includes(v.kind) ? v.kind : null;
|
|
118
|
+
if (!kind)
|
|
119
|
+
errors.push(fehler(index, 'kind', 'kind'));
|
|
120
|
+
for (const k of Object.keys(v)) {
|
|
121
|
+
if (k === 'name' || k === 'kind')
|
|
122
|
+
continue;
|
|
123
|
+
if (k !== 'percentBp' && k !== 'amountCents')
|
|
124
|
+
errors.push(fehler(index, k, 'unknown_field'));
|
|
125
|
+
else if (kind && WERTFELD[kind] !== k)
|
|
126
|
+
errors.push(fehler(index, k, 'unknown_field'));
|
|
127
|
+
}
|
|
128
|
+
if (kind === 'percent') {
|
|
129
|
+
const p = v.percentBp;
|
|
130
|
+
const g = exports.DISCOUNT_PRESET_PERCENT_BP;
|
|
131
|
+
if (!Number.isInteger(p) || p < g.min || p > g.max || p % g.step !== 0)
|
|
132
|
+
errors.push(fehler(index, 'percentBp', 'percent'));
|
|
133
|
+
}
|
|
134
|
+
if (kind === 'amount') {
|
|
135
|
+
const c = v.amountCents;
|
|
136
|
+
const g = exports.DISCOUNT_PRESET_AMOUNT_CENTS;
|
|
137
|
+
if (!Number.isInteger(c) || c < g.min || c > g.max)
|
|
138
|
+
errors.push(fehler(index, 'amountCents', 'amount'));
|
|
139
|
+
}
|
|
140
|
+
if (errors.length === vorher && kind) {
|
|
141
|
+
value.push({ name: name, kind, [WERTFELD[kind]]: v[WERTFELD[kind]] });
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
return errors.length ? { ok: false, code: exports.INVALID_DISCOUNT_PRESET, errors } : { ok: true, value };
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Zeilen des Rabatte-Blocks auf Z-Bon und Zwischenbericht: je Name `<Name> (n×)` mit dem Abzug, ab zwei Eintraegen
|
|
148
|
+
* zusaetzlich `Rabatte gesamt`. Ein leerer Name heisst „Rabatt“. Ein voll stornierter Name (Betrag 0) entfaellt wie in der Liste des Servers. Ohne Rabatte leer (kein Block).
|
|
149
|
+
*/
|
|
150
|
+
function discountBlockLines(discounts) {
|
|
151
|
+
const liste = (discounts ?? []).filter((r) => r && Number.isSafeInteger(r.cents) && Number.isSafeInteger(r.count) && r.cents !== 0);
|
|
152
|
+
const zeilen = liste.map((r) => ({ label: (0, texte_js_1.labelText)('shift_receipt.discount_line', { name: r.name || (0, texte_js_1.labelText)('shift_receipt.discount_unnamed'), count: r.count }), cents: -r.cents }));
|
|
153
|
+
if (zeilen.length > 1)
|
|
154
|
+
zeilen.push({ label: (0, texte_js_1.labelText)('shift_receipt.discounts_total'), cents: -liste.reduce((x, r) => x + r.cents, 0) });
|
|
155
|
+
return zeilen;
|
|
156
|
+
}
|
|
@@ -149,8 +149,14 @@ function laufstand(ort, w) {
|
|
|
149
149
|
raus.ownerTips = liste(ort, o, 'ownerTips', inhaberTrinkgeld);
|
|
150
150
|
if (o.unassignedTipCents !== undefined && o.unassignedTipCents !== null)
|
|
151
151
|
raus.unassignedTipCents = ganzzahl(ort, o, 'unassignedTipCents');
|
|
152
|
+
if (o.discounts !== undefined && o.discounts !== null)
|
|
153
|
+
raus.discounts = liste(ort, o, 'discounts', rabatt);
|
|
152
154
|
return raus;
|
|
153
155
|
}
|
|
156
|
+
function rabatt(ort, w) {
|
|
157
|
+
const o = pflichtObjekt(ort, w);
|
|
158
|
+
return { name: typeof o.name === 'string' ? o.name : '', cents: ganzzahl(ort, o, 'cents'), count: ganzzahl(ort, o, 'count') };
|
|
159
|
+
}
|
|
154
160
|
function inhaberTrinkgeld(ort, w) {
|
|
155
161
|
const o = pflichtObjekt(ort, w);
|
|
156
162
|
return { registerUserId: kennung(ort, o, 'registerUserId'), name: text(o.name), cents: ganzzahl(ort, o, 'cents') };
|
|
@@ -373,6 +379,8 @@ function schichtBon(ort, w) {
|
|
|
373
379
|
// Ablauf der Kasse: nur, wenn der Server sie sendet (die Bons davor tragen sie nicht).
|
|
374
380
|
wennWert(r, o, 'openingCounted', () => wahr(ort, o, 'openingCounted'));
|
|
375
381
|
wennWert(r, o, 'interimDifferenceCents', () => ganzzahl(ort, o, 'interimDifferenceCents'));
|
|
382
|
+
// Nur Anzeige: gewaehrte Rabatte je Name; der Server sendet sie erst ab dem ersten Rabatt.
|
|
383
|
+
wennWert(r, o, 'discounts', () => liste(ort, o, 'discounts', rabatt));
|
|
376
384
|
wennWert(r, o, 'differenceParts', () => liste(ort, o, 'differenceParts', differenzTeil));
|
|
377
385
|
wennDa(r, o, 'countedBeforePayoutCents', () => ganzzahlOderNull(ort, o, 'countedBeforePayoutCents'));
|
|
378
386
|
wennDa(r, o, 'countedBeforePayoutDenominations', () => stueckelung(ort, o, 'countedBeforePayoutDenominations'));
|
|
@@ -158,6 +158,19 @@ export interface ShiftRunningTotals {
|
|
|
158
158
|
ownerTips?: ShiftOwnerTip[];
|
|
159
159
|
/** Trinkgeld ohne angemeldeten Empfänger in Cent (nur Anzeige, 1.28.0); fehlt = 0. */
|
|
160
160
|
unassignedTipCents?: number;
|
|
161
|
+
/**
|
|
162
|
+
* Gewaehrte Rabatte je Name (nur Anzeige, nie im Soll): `cents` gewaehrt (positiv), `count` Belege mit diesem
|
|
163
|
+
* Namen, ein Storno nimmt beides zurueck. Der Server sendet es erst ab dem ersten Rabatt (fehlt = keiner);
|
|
164
|
+
* auf dem Z-Bon steht es als Block ([discountBlockLines]).
|
|
165
|
+
*/
|
|
166
|
+
discounts?: ShiftDiscount[];
|
|
167
|
+
}
|
|
168
|
+
/** Ein Eintrag von [ShiftRunningTotals.discounts] bzw. [ShiftSummaryReceipt.discounts]. */
|
|
169
|
+
export interface ShiftDiscount {
|
|
170
|
+
/** Name der Rabattzeile am Beleg (`''` = unbenannt, „Rabatt“). */
|
|
171
|
+
name: string;
|
|
172
|
+
cents: number;
|
|
173
|
+
count: number;
|
|
161
174
|
}
|
|
162
175
|
/** Ein Eintrag von [ShiftRunningTotals.ownerTips]: Trinkgeld, das als Umsatz erfasst ist. */
|
|
163
176
|
export interface ShiftOwnerTip {
|
|
@@ -390,6 +403,8 @@ export interface ShiftSummaryReceipt extends ShiftReceiptHeader {
|
|
|
390
403
|
differenceCents: number | null;
|
|
391
404
|
comment: string | null;
|
|
392
405
|
openingsWithoutSale: number;
|
|
406
|
+
/** Gewaehrte Rabatte je Name; fehlt, wenn es keine gab (der Bon bleibt dann wie bisher). */
|
|
407
|
+
discounts?: ShiftDiscount[];
|
|
393
408
|
/** Entnommen bzw. eingelegt nach dem Zaehlen; fehlt, wenn kein Geld bewegt wurde. */
|
|
394
409
|
afterCount?: AfterCount;
|
|
395
410
|
/**
|
|
@@ -31,6 +31,29 @@ export declare const TIP_KINDS: readonly ["percent", "round_up", "total"];
|
|
|
31
31
|
export type PosTipKind = typeof TIP_KINDS[number];
|
|
32
32
|
/** Die zuerst offene Trinkgeld-Art (`business.tipStart`): dieselben Werte wie [TIP_KINDS]. */
|
|
33
33
|
export declare const TIP_START: readonly ["percent", "round_up", "total"];
|
|
34
|
+
/**
|
|
35
|
+
* Bar-Trinkgeld gleich behalten (`business.tipKeptMode`): `ask` = Schalter an der Kasse, vorbelegt mit
|
|
36
|
+
* `tipKeptByDefault`; `always`/`never` = kein Schalter, die Kasse setzt die Wahl selbst. Entscheidung ueber [tipKeptFor].
|
|
37
|
+
*/
|
|
38
|
+
export declare const TIP_KEPT_MODE: readonly ["ask", "always", "never"];
|
|
39
|
+
export type PosTipKeptMode = typeof TIP_KEPT_MODE[number];
|
|
40
|
+
/**
|
|
41
|
+
* Art einer Rabatt-Vorlage (`business.discountPresets[].kind`): Prozent oder fester Betrag
|
|
42
|
+
* (gespeichert `art`: `prozent | betrag`).
|
|
43
|
+
*/
|
|
44
|
+
export declare const DISCOUNT_PRESET_KIND: readonly ["percent", "amount"];
|
|
45
|
+
export type PosDiscountPresetKind = typeof DISCOUNT_PRESET_KIND[number];
|
|
46
|
+
/**
|
|
47
|
+
* Benannte Rabatt-Chips der Kasse: `kind` `percent` traegt `percentBp` (Basispunkte, 10 % = 1000), `amount` traegt
|
|
48
|
+
* `amountCents` (Cent). Der Name steht auf dem Chip und als Text der Rabattzeile am Beleg; ohne Namen (`''`) bleibt
|
|
49
|
+
* die Zeile „Rabatt“. Pruefen vor dem Schreiben: [checkDiscountPresets].
|
|
50
|
+
*/
|
|
51
|
+
export interface PosDiscountPreset {
|
|
52
|
+
name: string;
|
|
53
|
+
kind: PosDiscountPresetKind;
|
|
54
|
+
percentBp?: number;
|
|
55
|
+
amountCents?: number;
|
|
56
|
+
}
|
|
34
57
|
/** Breite der rechten Spalte (Korb) an diesem Geraet (`device.cartWidth`); in der schmalen Ansicht ohne Wirkung. */
|
|
35
58
|
export declare const CART_WIDTH: readonly ["narrow", "medium", "wide"];
|
|
36
59
|
export type PosCartWidth = typeof CART_WIDTH[number];
|
|
@@ -209,6 +232,25 @@ export interface PosBusinessSettings {
|
|
|
209
232
|
* Lesen ueber [posTipKeptByDefault]. Siehe [POS_BUSINESS_OPTIONAL_FIELDS].
|
|
210
233
|
*/
|
|
211
234
|
tipKeptByDefault?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Ob die Kasse beim Bar-Trinkgeld fragt (`ask`) oder es immer (`always`) bzw. nie (`never`) gleich behalten
|
|
237
|
+
* wird. Optional: der Server sendet das Feld nur, wenn es gespeichert ist; fehlt es (oder ist es unbekannt),
|
|
238
|
+
* gilt `ask`. Lesen ueber [posTipKeptMode], entscheiden ueber [tipKeptFor].
|
|
239
|
+
*/
|
|
240
|
+
tipKeptMode?: PosOpen<PosTipKeptMode>;
|
|
241
|
+
/**
|
|
242
|
+
* Benannte Rabatt-Chips (Prozent oder Betrag, hoechstens 5). Optional: der Server sendet das Feld nur, wenn es
|
|
243
|
+
* gespeichert ist; dann sind die Vorlagen die Quelle der Chips und `discountChips` spiegelt ihre Prozentwerte fuer
|
|
244
|
+
* aeltere Kassen. Fehlt es, gilt `discountChips`. Lesen ueber [posDiscountPresets]; eine Vorlage mit unbekannter
|
|
245
|
+
* Art verwirft der Leser.
|
|
246
|
+
*/
|
|
247
|
+
discountPresets?: PosDiscountPreset[];
|
|
248
|
+
/**
|
|
249
|
+
* Eigener Rabatt an der Kasse: `true` = neben den Rabatt-Chips das freie Feld (Betrag oder Prozent), `false` = nur
|
|
250
|
+
* die Chips. Optional: der Server sendet das Feld nur, wenn es gespeichert ist; fehlt es, gilt `true` (wie bisher).
|
|
251
|
+
* Lesen ueber [posCustomDiscountAllowed]. Siehe [POS_BUSINESS_OPTIONAL_FIELDS].
|
|
252
|
+
*/
|
|
253
|
+
customDiscountAllowed?: boolean;
|
|
212
254
|
/**
|
|
213
255
|
* Angebotene Trinkgeld-Arten (nichtleere Teilmenge von [TIP_KINDS], Reihenfolge wie
|
|
214
256
|
* gespeichert). Optional: der Server sendet das Feld nur, wenn es gespeichert ist; fehlt es,
|
|
@@ -312,14 +354,22 @@ export declare function _optionalerWert(wert: unknown, schreiben: boolean): bool
|
|
|
312
354
|
* [mergePosSettings] uebernimmt sie nur als Wahrheitswert; der Schreibweg
|
|
313
355
|
* nimmt nur `true`/`false`.
|
|
314
356
|
*/
|
|
315
|
-
export declare const POS_BUSINESS_OPTIONAL_FIELDS: readonly ["tipKeptByDefault"];
|
|
357
|
+
export declare const POS_BUSINESS_OPTIONAL_FIELDS: readonly ["tipKeptByDefault", "customDiscountAllowed"];
|
|
316
358
|
/**
|
|
317
359
|
* Optionale Betriebs-Einstellungen mit Wertemenge (Backend `BETRIEB_OPTIONAL`, Katalog
|
|
318
|
-
* `KASSE_BETRIEB_WERTE.tipKinds[]` und `.
|
|
360
|
+
* `KASSE_BETRIEB_WERTE.tipKinds[]`, `.tipStart` und `.tipKeptMode`): ohne Standardwert, der Server sendet sie nur,
|
|
319
361
|
* wenn sie gespeichert sind. [mergePosSettings] uebernimmt sie, wenn sie die Form haben
|
|
320
362
|
* (`tipKinds` eine nichtleere Liste von Texten, `tipStart` ein Text); den Wert prueft der Schreibweg.
|
|
321
363
|
*/
|
|
322
|
-
export declare const POS_BUSINESS_OPTIONAL_CHOICES: readonly ["tipKinds", "tipStart"];
|
|
364
|
+
export declare const POS_BUSINESS_OPTIONAL_CHOICES: readonly ["tipKinds", "tipStart", "tipKeptMode"];
|
|
365
|
+
/**
|
|
366
|
+
* Optionale Betriebs-Listen aus Objekten (Backend `BETRIEB_OPTIONAL.rabattVorlagen`): ohne Standardwert, der Server
|
|
367
|
+
* sendet sie nur, wenn sie gespeichert sind (auch als leere Liste). Der Leser uebernimmt die Eintraege, die die Form
|
|
368
|
+
* einer Vorlage haben ([_vorlagenLesen]); eine Vorlage mit unbekannter Art faellt weg.
|
|
369
|
+
*/
|
|
370
|
+
export declare const POS_BUSINESS_OPTIONAL_LISTS: readonly ["discountPresets"];
|
|
371
|
+
/** Die lesbaren Vorlagen einer Liste vom Draht oder aus dem Speicher; keine Liste -> `null` (Feld fehlt). */
|
|
372
|
+
export declare function _vorlagenLesen(wert: unknown): PosDiscountPreset[] | null;
|
|
323
373
|
/** Optionale Geraete-Einstellungen mit Wertemenge (Backend `GERAET_OPTIONAL`, Katalog `KASSE_GERAET_WERTE.cartWidth`). */
|
|
324
374
|
export declare const POS_DEVICE_OPTIONAL_CHOICES: readonly ["cartWidth"];
|
|
325
375
|
/** Hat der Wert die Form eines optionalen Wahlfeldes? Texte, die der Server neu einfuehren koennte, bleiben (kein Altwert 0.x). */
|
|
@@ -332,6 +382,22 @@ export declare function posTipStart(business: Readonly<Partial<PosBusinessSettin
|
|
|
332
382
|
export declare function posCartWidth(device: Readonly<Partial<PosDeviceSettings>> | null | undefined): PosOpen<PosCartWidth>;
|
|
333
383
|
/** Bar-Trinkgeld „gleich behalten“ vorbelegt? Fehlt die Einstellung, gilt aus. */
|
|
334
384
|
export declare function posTipKeptByDefault(business: Readonly<Partial<PosBusinessSettings>> | null | undefined): boolean;
|
|
385
|
+
/** Darf an der Kasse ein eigener Rabatt (Betrag oder Prozent) eingetippt werden? Fehlt die Einstellung, gilt ja. */
|
|
386
|
+
export declare function posCustomDiscountAllowed(business: Readonly<Partial<PosBusinessSettings>> | null | undefined): boolean;
|
|
387
|
+
/** Wirksame Stufe „Trinkgeld gleich behalten“: die gespeicherte, wenn sie bekannt ist, sonst `ask`. */
|
|
388
|
+
export declare function posTipKeptMode(business: Readonly<Partial<PosBusinessSettings>> | null | undefined): PosTipKeptMode;
|
|
389
|
+
/** Ergebnis von [tipKeptFor]: zeigt die Kasse den Schalter, und wird das Bar-Trinkgeld gleich behalten? */
|
|
390
|
+
export interface TipKeptDecision {
|
|
391
|
+
showSwitch: boolean;
|
|
392
|
+
kept: boolean;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Die eine Regel fuer Web-Kasse und Kassen-App beim Bar-Trinkgeld: `ask` zeigt den Schalter, gewaehlt ist
|
|
396
|
+
* `wanted` (die Wahl am Schalter, ein Wahrheitswert), sonst die Vorbelegung `tipKeptByDefault`; `always` bzw. `never` zeigen
|
|
397
|
+
* keinen Schalter und behalten gleich bzw. lassen offen, eine Schalterwahl zaehlt dann nicht. `kept` geht als
|
|
398
|
+
* `tip.direkt` an den Beleg (der Server erzwingt die Stufe dort nicht).
|
|
399
|
+
*/
|
|
400
|
+
export declare function tipKeptFor(business: Readonly<Partial<PosBusinessSettings>> | null | undefined, wanted?: boolean | null): TipKeptDecision;
|
|
335
401
|
/**
|
|
336
402
|
* Die Wertemenge je Feld, soweit das Feld eine hat: dagegen prueft der
|
|
337
403
|
* Schreibweg vor dem Senden (ein deutscher Wert wie `'nacht'` geht so gar
|