@kreiseck/kasseneck-api 1.25.0 → 1.26.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/pos/artikel.d.ts +22 -0
- package/dist/cjs/pos/artikel.js +16 -0
- package/dist/cjs/pos/index.d.ts +2 -1
- package/dist/cjs/pos/index.js +18 -2
- package/dist/cjs/pos/kachel-referenz.d.ts +55 -0
- package/dist/cjs/pos/kachel-referenz.js +107 -0
- package/dist/cjs/pos/texte.d.ts +46 -0
- package/dist/cjs/pos/texte.js +18 -0
- package/dist/cjs/stored/draht.js +4 -0
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +21 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/pos/artikel.d.ts +22 -0
- package/dist/esm/pos/artikel.js +14 -0
- package/dist/esm/pos/index.d.ts +2 -1
- package/dist/esm/pos/index.js +2 -1
- package/dist/esm/pos/kachel-referenz.d.ts +55 -0
- package/dist/esm/pos/kachel-referenz.js +98 -0
- package/dist/esm/pos/texte.d.ts +46 -0
- package/dist/esm/pos/texte.js +18 -0
- package/dist/esm/stored/draht.js +4 -0
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +21 -3
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- 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 +62 -1
- package/fixtures/reference-cases.json +238 -0
- package/fixtures/surface.json +5 -1
- 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 +25 -5
- package/fixtures/v3/zahlbetrag-faelle.json +1 -1
- 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.26.0 - 2026-11-04
|
|
8
|
+
|
|
9
|
+
Tile with amount and reference: a tile can ask, when tapped, for the amount and/or a reference (fee note, order number). Additive; articles without the new fields read as before.
|
|
10
|
+
|
|
11
|
+
- **`PosArticle.askPrice`** (wire `askPrice`, stored `preisFragen`) and **`PosArticle.reference`** (`PosReference`: `mode` `optional|required`, `label`, `hint`, `pattern`, `patternStrict`; stored `referenz`). The reader always sets both (`false`/`null`); a malformed `reference` reads as `null`. Reason: a law office takes cash for fee notes; the receipt line „Honorarnote 2026/0123“ refers to the invoice without the client's name.
|
|
12
|
+
- **Helpers** `checkReference` (`ok`/`empty`/`warning`/`error` plus the cleaned value: no control characters (no NFC, so JS and Dart agree), whitespace collapsed, at most 40 characters), `isValidReferencePattern` (whole-input match; lookbehind, named groups, backreferences and inline flags are refused so JS and Dart agree), `isDigitsOnlyPattern` (numeric keyboard), `referenceLineName`, `isBookableArticle` (without a price only with `askPrice`), `tilePrompts`, `REFERENCE_PATTERN_TEMPLATES`. Contract cases `fixtures/reference-cases.json`, the same as the backend (`referenz-faelle.json`) and the Dart package.
|
|
13
|
+
- **Texts:** `reference.missing` „Bitte „{name}“ eingeben.“, `reference.format_invalid`, `reference.format_warning`; labels `tile_prompt.amount`, `tile_prompt.quantity`, `tile_prompt.apply`, `tile_prompt.apply_anyway`.
|
|
14
|
+
- `./stored`: `fromStoredArticle` reads `preisFragen`/`referenz`. Contract `v3` re-fetched from the backend (`askPrice`, `reference`, catalog `REFERENZ_STUFE`).
|
|
15
|
+
|
|
16
|
+
## 1.25.1 - 2026-11-04
|
|
17
|
+
|
|
18
|
+
Texts for the cancellation sheet; no API change.
|
|
19
|
+
|
|
20
|
+
- **Refund line under „wie bezahlt“:** `cancellation.refund_cash` „{amount} bar“, `cancellation.refund_card` „{amount} auf die Karte“ (every method with a card), `cancellation.refund_other` „{amount} per {method}“, joined with „ · “ into `cancellation.refund_line` „{refunds} zurückgeben“ or, when only the server knows the exact amount, `cancellation.refund_line_estimated` „voraussichtlich {refunds} zurückgeben“. Reason: the cashier sees before confirming where the money goes, in one line; web register and app build it the same way.
|
|
21
|
+
- **`cancellation.voucher_tip_cash`** „{amount} Trinkgeld bar zurückgeben“: with „Als Gutschein“ the employee tip goes back in cash, never onto the voucher; the register now says so below the voucher line.
|
|
22
|
+
|
|
7
23
|
## 1.25.0 - 2026-11-03
|
|
8
24
|
|
|
9
25
|
Return as voucher on cancellation (backend November 2026): instead of money, the customer gets a new multi-purpose voucher of the account's return type; the cancellation receipt stays the same as a cash cancellation. Additive; without `refundAs` requests and answers stay byte for byte as before.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InternerTransport } from '../client/aufrufe.js';
|
|
2
|
+
import { type PosReference } from './kachel-referenz.js';
|
|
2
3
|
/**
|
|
3
4
|
* Artikelgruppen (Kategorien der Kachel-Kasse) und Artikel in der Form, die
|
|
4
5
|
* die Kacheln brauchen, Backend: `article-endpoints.js`
|
|
@@ -96,7 +97,26 @@ export interface PosArticle {
|
|
|
96
97
|
* ausdrueckliches `true` gilt.
|
|
97
98
|
*/
|
|
98
99
|
serviceVoucher?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Kasse fragt beim Antippen den Betrag (Kachel mit Betrag und Referenz,
|
|
102
|
+
* 1.26.0); ein vorhandener Preis ist Vorschlag. Optional wie
|
|
103
|
+
* `serviceVoucher`, der Leser setzt es immer: nur ein ausdrueckliches `true` gilt.
|
|
104
|
+
*/
|
|
105
|
+
askPrice?: boolean;
|
|
106
|
+
/** Kasse fragt beim Antippen eine Referenz ab; null = aus. Der Leser setzt es immer. */
|
|
107
|
+
reference?: PosReference | null;
|
|
99
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Kann die Kachel gebucht werden? Mit festem Preis immer, ohne Preis nur mit
|
|
111
|
+
* `askPrice` (der Betrag kommt aus dem Eingabeblatt).
|
|
112
|
+
*/
|
|
113
|
+
export declare function isBookableArticle(a: Pick<PosArticle, 'unitPriceCents' | 'askPrice'>): boolean;
|
|
114
|
+
/** Fragt die Kachel beim Antippen etwas ab (Betrag, Referenz oder Menge)? */
|
|
115
|
+
export declare function tilePrompts(a: Pick<PosArticle, 'askPrice' | 'reference' | 'unit' | 'quantityRule' | 'askQuantity'>): {
|
|
116
|
+
amount: boolean;
|
|
117
|
+
reference: boolean;
|
|
118
|
+
quantity: boolean;
|
|
119
|
+
};
|
|
100
120
|
/** Deckelt eine gewuenschte Menge an der Hoechstmenge des Artikels (null = keine Grenze). */
|
|
101
121
|
export declare function allowedQuantity(a: Pick<PosArticle, 'maxQuantity'>, wanted: number): number;
|
|
102
122
|
/** Ein Artikel am Draht `/api/v3` (`listMyArticles`), soweit dieses Paket ihn liest. */
|
|
@@ -122,6 +142,8 @@ export interface PosArticlePayload {
|
|
|
122
142
|
internalCode?: string | null;
|
|
123
143
|
stockTracked?: boolean | null;
|
|
124
144
|
serviceVoucher?: boolean | null;
|
|
145
|
+
askPrice?: boolean | null;
|
|
146
|
+
reference?: unknown;
|
|
125
147
|
}
|
|
126
148
|
export declare function fromPosArticlePayload(p: PosArticlePayload): PosArticle;
|
|
127
149
|
/**
|
package/dist/cjs/pos/artikel.js
CHANGED
|
@@ -4,12 +4,15 @@ exports.QUANTITY_RULES = void 0;
|
|
|
4
4
|
exports.fromArticleGroupPayload = fromArticleGroupPayload;
|
|
5
5
|
exports.quantityRuleForUnit = quantityRuleForUnit;
|
|
6
6
|
exports.quantityDefaults = quantityDefaults;
|
|
7
|
+
exports.isBookableArticle = isBookableArticle;
|
|
8
|
+
exports.tilePrompts = tilePrompts;
|
|
7
9
|
exports.allowedQuantity = allowedQuantity;
|
|
8
10
|
exports.fromPosArticlePayload = fromPosArticlePayload;
|
|
9
11
|
exports.liste = liste;
|
|
10
12
|
exports.listMyArticleGroups = listMyArticleGroups;
|
|
11
13
|
exports.listMyArticles = listMyArticles;
|
|
12
14
|
const errors_js_1 = require("../client/errors.js");
|
|
15
|
+
const kachel_referenz_js_1 = require("./kachel-referenz.js");
|
|
13
16
|
function fromArticleGroupPayload(p) {
|
|
14
17
|
return {
|
|
15
18
|
id: p.id ?? '',
|
|
@@ -52,6 +55,17 @@ function quantityDefaults(a) {
|
|
|
52
55
|
decimals: (a.quantityRule ?? v.rule) === 'decimal' ? Math.max(1, v.decimals || 2) : 0,
|
|
53
56
|
};
|
|
54
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Kann die Kachel gebucht werden? Mit festem Preis immer, ohne Preis nur mit
|
|
60
|
+
* `askPrice` (der Betrag kommt aus dem Eingabeblatt).
|
|
61
|
+
*/
|
|
62
|
+
function isBookableArticle(a) {
|
|
63
|
+
return a.askPrice === true || (typeof a.unitPriceCents === 'number' && Number.isInteger(a.unitPriceCents) && a.unitPriceCents >= 0);
|
|
64
|
+
}
|
|
65
|
+
/** Fragt die Kachel beim Antippen etwas ab (Betrag, Referenz oder Menge)? */
|
|
66
|
+
function tilePrompts(a) {
|
|
67
|
+
return { amount: a.askPrice === true, reference: a.reference != null, quantity: quantityDefaults(a).ask };
|
|
68
|
+
}
|
|
55
69
|
/** Deckelt eine gewuenschte Menge an der Hoechstmenge des Artikels (null = keine Grenze). */
|
|
56
70
|
function allowedQuantity(a, wanted) {
|
|
57
71
|
return a.maxQuantity != null && a.maxQuantity > 0 ? Math.min(wanted, a.maxQuantity) : wanted;
|
|
@@ -83,6 +97,8 @@ function fromPosArticlePayload(p) {
|
|
|
83
97
|
internalCode: textOderNull(p.internalCode),
|
|
84
98
|
stockTracked: typeof p.stockTracked === 'boolean' ? p.stockTracked : null,
|
|
85
99
|
serviceVoucher: p.serviceVoucher === true,
|
|
100
|
+
askPrice: p.askPrice === true,
|
|
101
|
+
reference: (0, kachel_referenz_js_1.fromReferencePayload)(p.reference),
|
|
86
102
|
};
|
|
87
103
|
}
|
|
88
104
|
/**
|
package/dist/cjs/pos/index.d.ts
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
|
|
8
8
|
*/
|
|
9
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';
|
|
10
|
-
export { type ArticleGroup, type ArticleGroupPayload, fromArticleGroupPayload, type PosArticle, type PosArticlePayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, QUANTITY_RULES, type QuantityRule, type QuantityDefaults, quantityRuleForUnit, quantityDefaults, allowedQuantity, } from './artikel.js';
|
|
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
|
+
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';
|
|
11
12
|
export { getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, setMyPosLogo, posSettingsFromWire, type SetMyPosLogoOptions, } from './client.js';
|
|
12
13
|
export { POS_ERROR_CODES, type PosErrorCode, isPosErrorCode, posErrorCode, isPosError, type PosFieldError, posFieldErrors, } from './errors.js';
|
|
13
14
|
export { distributeDiscount } from '../receipt/discount.js';
|
package/dist/cjs/pos/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.quantityRuleForUnit = exports.QUANTITY_RULES = exports.listMyArticles = exports.listMyArticleGroups = exports.fromPosArticlePayload = exports.fromArticleGroupPayload = exports.DONE_SCREEN_SECONDS = exports.WATERMARK_SCALE = exports.LOGO_SCALE = exports.WATERMARK_STRENGTH = exports.WATERMARK_SIDE = exports.DISCOUNT = exports.AUTO_LOGOUT_MINUTES = exports.TILE_STYLE = exports.SETTINGS_FONT_SIZE = exports.LOGO_SIZE = exports.QR_MODE = exports.DRAWER_AUTO_OPEN = exports.CUT = exports.CODE_PAGE = exports.PAPER_SIZE = exports.TERMINAL_TYPE = exports.TERMINAL_VIA = exports.PRINTER_TYPE = exports.TILE_HEIGHT = exports.CATEGORY_POSITION = exports.LAYOUT = exports.RECEIPT_OUTPUT = exports.CARD_PROVIDER = exports.CHECKOUT_MODE = exports.TIP_MODE = exports.QUANTITY = exports.WATERMARK = exports.FONT_SIZE = exports.THEME = exports.posShortcutConflict = exports.POS_SHORTCUT_SHARED_PAIRS = exports.posSettingsChanges = exports.unknownPosSettingValues = exports.sanitizePosSettings = exports.mergePosSettings = exports.POS_DEVICE_VALUES = exports.POS_BUSINESS_VALUES = exports.posTipKeptByDefault = exports.POS_BUSINESS_OPTIONAL_FIELDS = exports.POS_DEVICE_OPTIONAL_FIELDS = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.POS_SHORTCUT_DEFAULTS = exports.POS_SHORTCUT_ACTIONS = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
4
|
+
exports.listMyStocktakeCounts = exports.listMyStocktakeItems = exports.listMyStocktakes = exports.setMyCashregisterStockLocation = exports.listMyStock = exports.listMyStockLocations = exports.STOCK_LOCATION_TYPES = exports.reportConnectState = exports.inspectionInfoLines = exports.inspectionInfoRows = exports.getRegisterInspectionInfo = exports.depFolderName = exports.listMyTipRecipients = exports.getPrintJob = exports.createPrintJob = exports.listMyPrinters = exports.isPrintJobFinished = exports.PRINT_JOB_SOURCES = exports.PRINT_JOB_STATUSES = exports.voucherPermsOf = exports.stockViewOf = exports.receiptsScopeOf = exports.cancelScopeOf = exports.distributeDiscount = exports.posFieldErrors = exports.isPosError = exports.posErrorCode = exports.isPosErrorCode = exports.POS_ERROR_CODES = exports.posSettingsFromWire = exports.setMyPosLogo = exports.setMyRegisterDeviceSettings = exports.setMyPosSettings = exports.getPosSettings = exports.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 = void 0;
|
|
5
|
+
exports.CANCELLATION_PAYMENT_ERROR_MESSAGES = exports.receiptEmailErrorMessage = exports.RECEIPT_EMAIL_ERROR_MESSAGES = exports.messageAppliesTo = exports.messageText = exports.messageOutcome = exports.findErrorRule = exports.CALLS_WITH_EFFECT = exports.ERROR_OUTCOME_RULES = exports.ERROR_CODE_RULES = exports.ERROR_RULES = exports.MESSAGES = exports.isReturnDisposition = exports.RETURN_DISPOSITIONS = exports.RECEIPT_OUTPUT_RESULTS = exports.RECEIPT_OUTPUT_KINDS = exports.cashMovementLayout = exports.shiftReceiptLayout = exports.AFTER_COUNT_TYPES = exports.SHIFT_RECEIPT_KINDS = exports.MANUAL_OPENING_REASONS = exports.OPENING_REASONS = exports.CASH_LOCATIONS = exports.MANUAL_MOVEMENT_TYPES = exports.MOVEMENT_TYPES = exports.EUR_DENOMINATIONS = exports.durationText = exports.shiftTipLines = exports.newIdempotencyKey = exports.parseCentsAllowZero = exports.sumDenominations = exports.closeMyShift = exports.getMyShiftReport = exports.logMyDrawerOpenings = exports.recordMyCashMovement = exports.openMyShift = 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 = void 0;
|
|
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 = void 0;
|
|
6
7
|
/**
|
|
7
8
|
* Kachel-Kasse: Einstellungen, Artikelgruppen/Artikel fuer Kacheln,
|
|
8
9
|
* Rabattverteilung, Drucker, Trinkgeld-Empfaenger, Lager (Standorte, Bestand,
|
|
@@ -66,6 +67,21 @@ Object.defineProperty(exports, "QUANTITY_RULES", { enumerable: true, get: functi
|
|
|
66
67
|
Object.defineProperty(exports, "quantityRuleForUnit", { enumerable: true, get: function () { return artikel_js_1.quantityRuleForUnit; } });
|
|
67
68
|
Object.defineProperty(exports, "quantityDefaults", { enumerable: true, get: function () { return artikel_js_1.quantityDefaults; } });
|
|
68
69
|
Object.defineProperty(exports, "allowedQuantity", { enumerable: true, get: function () { return artikel_js_1.allowedQuantity; } });
|
|
70
|
+
Object.defineProperty(exports, "isBookableArticle", { enumerable: true, get: function () { return artikel_js_1.isBookableArticle; } });
|
|
71
|
+
Object.defineProperty(exports, "tilePrompts", { enumerable: true, get: function () { return artikel_js_1.tilePrompts; } });
|
|
72
|
+
var kachel_referenz_js_1 = require("./kachel-referenz.js");
|
|
73
|
+
Object.defineProperty(exports, "REFERENCE_MODES", { enumerable: true, get: function () { return kachel_referenz_js_1.REFERENCE_MODES; } });
|
|
74
|
+
Object.defineProperty(exports, "REFERENCE_INPUT_MAX", { enumerable: true, get: function () { return kachel_referenz_js_1.REFERENCE_INPUT_MAX; } });
|
|
75
|
+
Object.defineProperty(exports, "REFERENCE_LABEL_MAX", { enumerable: true, get: function () { return kachel_referenz_js_1.REFERENCE_LABEL_MAX; } });
|
|
76
|
+
Object.defineProperty(exports, "REFERENCE_HINT_MAX", { enumerable: true, get: function () { return kachel_referenz_js_1.REFERENCE_HINT_MAX; } });
|
|
77
|
+
Object.defineProperty(exports, "REFERENCE_PATTERN_MAX", { enumerable: true, get: function () { return kachel_referenz_js_1.REFERENCE_PATTERN_MAX; } });
|
|
78
|
+
Object.defineProperty(exports, "REFERENCE_PATTERN_TEMPLATES", { enumerable: true, get: function () { return kachel_referenz_js_1.REFERENCE_PATTERN_TEMPLATES; } });
|
|
79
|
+
Object.defineProperty(exports, "cleanReferenceText", { enumerable: true, get: function () { return kachel_referenz_js_1.cleanReferenceText; } });
|
|
80
|
+
Object.defineProperty(exports, "isValidReferencePattern", { enumerable: true, get: function () { return kachel_referenz_js_1.isValidReferencePattern; } });
|
|
81
|
+
Object.defineProperty(exports, "isDigitsOnlyPattern", { enumerable: true, get: function () { return kachel_referenz_js_1.isDigitsOnlyPattern; } });
|
|
82
|
+
Object.defineProperty(exports, "checkReference", { enumerable: true, get: function () { return kachel_referenz_js_1.checkReference; } });
|
|
83
|
+
Object.defineProperty(exports, "referenceLineName", { enumerable: true, get: function () { return kachel_referenz_js_1.referenceLineName; } });
|
|
84
|
+
Object.defineProperty(exports, "fromReferencePayload", { enumerable: true, get: function () { return kachel_referenz_js_1.fromReferencePayload; } });
|
|
69
85
|
var client_js_1 = require("./client.js");
|
|
70
86
|
Object.defineProperty(exports, "getPosSettings", { enumerable: true, get: function () { return client_js_1.getPosSettings; } });
|
|
71
87
|
Object.defineProperty(exports, "setMyPosSettings", { enumerable: true, get: function () { return client_js_1.setMyPosSettings; } });
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kachel mit Betrag und Referenz: eine Kachel fragt beim Antippen den Betrag
|
|
3
|
+
* (`askPrice`) und/oder eine Referenz (Honorarnote, Auftragsnummer) ab.
|
|
4
|
+
* Dieselben Regeln rechnen das Backend (`kachel-referenz-core.js`) und das
|
|
5
|
+
* Dart-Paket; der Vertrag sind die Pruefaelle `fixtures/reference-cases.json`.
|
|
6
|
+
*/
|
|
7
|
+
/** `optional` = darf leer bleiben, `required` = Pflicht. */
|
|
8
|
+
export declare const REFERENCE_MODES: readonly ["optional", "required"];
|
|
9
|
+
export type ReferenceMode = typeof REFERENCE_MODES[number];
|
|
10
|
+
/** Einstellung am Artikel (Draht `reference`). */
|
|
11
|
+
export interface PosReference {
|
|
12
|
+
mode: ReferenceMode;
|
|
13
|
+
/** Titel des Eingabefelds („Honorarnote Nr.“); steht nie am Beleg. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Platzhalter/Hilfetext („z. B. 2026/0123“); null = keiner. */
|
|
16
|
+
hint: string | null;
|
|
17
|
+
/** Regulaerer Ausdruck fuer die ganze Eingabe (ohne ^/$); null = keiner. */
|
|
18
|
+
pattern: string | null;
|
|
19
|
+
/** true = falsches Format sperrt, false = nur Warnung. */
|
|
20
|
+
patternStrict: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Hoechstlaenge der Eingabe an der Kasse. */
|
|
23
|
+
export declare const REFERENCE_INPUT_MAX = 40;
|
|
24
|
+
export declare const REFERENCE_LABEL_MAX = 30;
|
|
25
|
+
export declare const REFERENCE_HINT_MAX = 60;
|
|
26
|
+
export declare const REFERENCE_PATTERN_MAX = 200;
|
|
27
|
+
/** Vorlagen fuer das Musterfeld im Panel. */
|
|
28
|
+
export declare const REFERENCE_PATTERN_TEMPLATES: readonly {
|
|
29
|
+
key: 'digits' | 'year_number' | 'letters_digits';
|
|
30
|
+
pattern: string;
|
|
31
|
+
}[];
|
|
32
|
+
/**
|
|
33
|
+
* Eingabe an der Kasse: ohne Steuer- und Formatzeichen, Leerraum
|
|
34
|
+
* zusammengezogen und getrimmt. Bewusst ohne NFC, damit Web und Dart gleich
|
|
35
|
+
* rechnen (Dart kennt keine Unicode-Normalisierung).
|
|
36
|
+
*/
|
|
37
|
+
export declare function cleanReferenceText(text: string): string;
|
|
38
|
+
/** Ist das Muster erlaubt (kompilierbar, ohne gesperrte Konstrukte)? */
|
|
39
|
+
export declare function isValidReferencePattern(pattern: string | null | undefined): boolean;
|
|
40
|
+
/** Reines Ziffernmuster -> die Kasse zeigt die Zifferntastatur. */
|
|
41
|
+
export declare function isDigitsOnlyPattern(pattern: string | null | undefined): boolean;
|
|
42
|
+
export type ReferenceCheckResult = 'ok' | 'empty' | 'warning' | 'error';
|
|
43
|
+
/**
|
|
44
|
+
* Prueft die Eingabe an der Kasse. `empty` und `error` sperren das Uebernehmen,
|
|
45
|
+
* `warning` zeigt den Hinweis und laesst uebernehmen. Ein ungueltiges Muster
|
|
46
|
+
* (Altbestand, fremder Client) gilt wie keines.
|
|
47
|
+
*/
|
|
48
|
+
export declare function checkReference(input: string | null | undefined, reference: Pick<PosReference, 'mode' | 'pattern' | 'patternStrict'> | null | undefined): {
|
|
49
|
+
result: ReferenceCheckResult;
|
|
50
|
+
value: string;
|
|
51
|
+
};
|
|
52
|
+
/** Positionsname am Beleg: Artikelname + Leerzeichen + Referenz (leer = nur der Name). */
|
|
53
|
+
export declare function referenceLineName(articleName: string, value: string | null | undefined): string;
|
|
54
|
+
/** Liest `reference` vom Draht; alles Unbrauchbare -> null. */
|
|
55
|
+
export declare function fromReferencePayload(p: unknown): PosReference | null;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Kachel mit Betrag und Referenz: eine Kachel fragt beim Antippen den Betrag
|
|
4
|
+
* (`askPrice`) und/oder eine Referenz (Honorarnote, Auftragsnummer) ab.
|
|
5
|
+
* Dieselben Regeln rechnen das Backend (`kachel-referenz-core.js`) und das
|
|
6
|
+
* Dart-Paket; der Vertrag sind die Pruefaelle `fixtures/reference-cases.json`.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.REFERENCE_PATTERN_TEMPLATES = exports.REFERENCE_PATTERN_MAX = exports.REFERENCE_HINT_MAX = exports.REFERENCE_LABEL_MAX = exports.REFERENCE_INPUT_MAX = exports.REFERENCE_MODES = void 0;
|
|
10
|
+
exports.cleanReferenceText = cleanReferenceText;
|
|
11
|
+
exports.isValidReferencePattern = isValidReferencePattern;
|
|
12
|
+
exports.isDigitsOnlyPattern = isDigitsOnlyPattern;
|
|
13
|
+
exports.checkReference = checkReference;
|
|
14
|
+
exports.referenceLineName = referenceLineName;
|
|
15
|
+
exports.fromReferencePayload = fromReferencePayload;
|
|
16
|
+
/** `optional` = darf leer bleiben, `required` = Pflicht. */
|
|
17
|
+
exports.REFERENCE_MODES = ['optional', 'required'];
|
|
18
|
+
/** Hoechstlaenge der Eingabe an der Kasse. */
|
|
19
|
+
exports.REFERENCE_INPUT_MAX = 40;
|
|
20
|
+
exports.REFERENCE_LABEL_MAX = 30;
|
|
21
|
+
exports.REFERENCE_HINT_MAX = 60;
|
|
22
|
+
exports.REFERENCE_PATTERN_MAX = 200;
|
|
23
|
+
/** Vorlagen fuer das Musterfeld im Panel. */
|
|
24
|
+
exports.REFERENCE_PATTERN_TEMPLATES = [
|
|
25
|
+
{ key: 'digits', pattern: '\\d+' },
|
|
26
|
+
{ key: 'year_number', pattern: '\\d{4}/\\d{1,6}' },
|
|
27
|
+
{ key: 'letters_digits', pattern: '[A-Za-z]{1,4}-?\\d{1,8}' },
|
|
28
|
+
];
|
|
29
|
+
// Steuer- und unsichtbare Formatzeichen.
|
|
30
|
+
// eslint-disable-next-line no-control-regex
|
|
31
|
+
const STEUERZEICHEN = /[\u0000-\u001f\u007f-\u009f\u200b-\u200f\u2028\u2029\u202a-\u202e\u2060-\u2064\ufeff]/g;
|
|
32
|
+
/**
|
|
33
|
+
* Eingabe an der Kasse: ohne Steuer- und Formatzeichen, Leerraum
|
|
34
|
+
* zusammengezogen und getrimmt. Bewusst ohne NFC, damit Web und Dart gleich
|
|
35
|
+
* rechnen (Dart kennt keine Unicode-Normalisierung).
|
|
36
|
+
*/
|
|
37
|
+
function cleanReferenceText(text) {
|
|
38
|
+
return text.replace(STEUERZEICHEN, '').replace(/\s+/g, ' ').trim();
|
|
39
|
+
}
|
|
40
|
+
// Konstrukte, die JS und Dart nicht garantiert gleich auswerten.
|
|
41
|
+
const GESPERRT = [/\(\?<[=!]/, /\(\?<[A-Za-z]/, /\\[1-9]/, /\\k</, /\(\?[a-zA-Z]/];
|
|
42
|
+
/** Ist das Muster erlaubt (kompilierbar, ohne gesperrte Konstrukte)? */
|
|
43
|
+
function isValidReferencePattern(pattern) {
|
|
44
|
+
if (typeof pattern !== 'string' || pattern.length < 1 || pattern.length > exports.REFERENCE_PATTERN_MAX)
|
|
45
|
+
return false;
|
|
46
|
+
if (GESPERRT.some((r) => r.test(pattern)))
|
|
47
|
+
return false;
|
|
48
|
+
try {
|
|
49
|
+
new RegExp(`^(?:${pattern})$`);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Reines Ziffernmuster -> die Kasse zeigt die Zifferntastatur. */
|
|
57
|
+
function isDigitsOnlyPattern(pattern) {
|
|
58
|
+
if (typeof pattern !== 'string' || pattern === '' || !isValidReferencePattern(pattern))
|
|
59
|
+
return false;
|
|
60
|
+
const rest = pattern
|
|
61
|
+
.replace(/\\d/g, '')
|
|
62
|
+
.replace(/\[0-9\]/g, '')
|
|
63
|
+
.replace(/\{\d+(,\d*)?\}/g, '')
|
|
64
|
+
.replace(/\(\?:/g, '')
|
|
65
|
+
.replace(/[()|?*+^$]/g, '');
|
|
66
|
+
return rest === '';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Prueft die Eingabe an der Kasse. `empty` und `error` sperren das Uebernehmen,
|
|
70
|
+
* `warning` zeigt den Hinweis und laesst uebernehmen. Ein ungueltiges Muster
|
|
71
|
+
* (Altbestand, fremder Client) gilt wie keines.
|
|
72
|
+
*/
|
|
73
|
+
function checkReference(input, reference) {
|
|
74
|
+
const value = cleanReferenceText(input ?? '').slice(0, exports.REFERENCE_INPUT_MAX);
|
|
75
|
+
if (!reference)
|
|
76
|
+
return { result: 'ok', value };
|
|
77
|
+
if (value === '')
|
|
78
|
+
return { result: reference.mode === 'required' ? 'empty' : 'ok', value };
|
|
79
|
+
if (reference.pattern && isValidReferencePattern(reference.pattern)) {
|
|
80
|
+
if (!new RegExp(`^(?:${reference.pattern})$`).test(value)) {
|
|
81
|
+
return { result: reference.patternStrict ? 'error' : 'warning', value };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return { result: 'ok', value };
|
|
85
|
+
}
|
|
86
|
+
/** Positionsname am Beleg: Artikelname + Leerzeichen + Referenz (leer = nur der Name). */
|
|
87
|
+
function referenceLineName(articleName, value) {
|
|
88
|
+
return value ? `${articleName} ${value}` : articleName;
|
|
89
|
+
}
|
|
90
|
+
/** Liest `reference` vom Draht; alles Unbrauchbare -> null. */
|
|
91
|
+
function fromReferencePayload(p) {
|
|
92
|
+
if (!p || typeof p !== 'object' || Array.isArray(p))
|
|
93
|
+
return null;
|
|
94
|
+
const r = p;
|
|
95
|
+
if (r.mode !== 'optional' && r.mode !== 'required')
|
|
96
|
+
return null;
|
|
97
|
+
if (typeof r.label !== 'string' || r.label === '')
|
|
98
|
+
return null;
|
|
99
|
+
const pattern = typeof r.pattern === 'string' && r.pattern !== '' ? r.pattern : null;
|
|
100
|
+
return {
|
|
101
|
+
mode: r.mode,
|
|
102
|
+
label: r.label,
|
|
103
|
+
hint: typeof r.hint === 'string' && r.hint !== '' ? r.hint : null,
|
|
104
|
+
pattern,
|
|
105
|
+
patternStrict: pattern !== null && r.patternStrict === true,
|
|
106
|
+
};
|
|
107
|
+
}
|
package/dist/cjs/pos/texte.d.ts
CHANGED
|
@@ -119,6 +119,16 @@ declare const MELDUNGEN_ROH: {
|
|
|
119
119
|
readonly 'item.description_missing': {
|
|
120
120
|
readonly text: "Bitte eine Bezeichnung eingeben – sie steht am Beleg.";
|
|
121
121
|
};
|
|
122
|
+
readonly 'reference.missing': {
|
|
123
|
+
readonly text: "Bitte „{name}“ eingeben.";
|
|
124
|
+
readonly placeholders: readonly ["name"];
|
|
125
|
+
};
|
|
126
|
+
readonly 'reference.format_invalid': {
|
|
127
|
+
readonly text: "Das Format passt nicht.";
|
|
128
|
+
};
|
|
129
|
+
readonly 'reference.format_warning': {
|
|
130
|
+
readonly text: "Das Format passt nicht. Trotzdem übernehmen?";
|
|
131
|
+
};
|
|
122
132
|
readonly 'discount.percent_invalid': {
|
|
123
133
|
readonly text: "Bitte einen Prozentwert zwischen 0,1 und 100 eingeben.";
|
|
124
134
|
};
|
|
@@ -1439,6 +1449,30 @@ declare const BESCHRIFTUNGEN_ROH: {
|
|
|
1439
1449
|
readonly text: "Rest {amount}";
|
|
1440
1450
|
readonly placeholders: readonly ["amount"];
|
|
1441
1451
|
};
|
|
1452
|
+
readonly 'cancellation.refund_cash': {
|
|
1453
|
+
readonly text: "{amount} bar";
|
|
1454
|
+
readonly placeholders: readonly ["amount"];
|
|
1455
|
+
};
|
|
1456
|
+
readonly 'cancellation.refund_card': {
|
|
1457
|
+
readonly text: "{amount} auf die Karte";
|
|
1458
|
+
readonly placeholders: readonly ["amount"];
|
|
1459
|
+
};
|
|
1460
|
+
readonly 'cancellation.refund_other': {
|
|
1461
|
+
readonly text: "{amount} per {method}";
|
|
1462
|
+
readonly placeholders: readonly ["amount", "method"];
|
|
1463
|
+
};
|
|
1464
|
+
readonly 'cancellation.refund_line': {
|
|
1465
|
+
readonly text: "{refunds} zurückgeben";
|
|
1466
|
+
readonly placeholders: readonly ["refunds"];
|
|
1467
|
+
};
|
|
1468
|
+
readonly 'cancellation.refund_line_estimated': {
|
|
1469
|
+
readonly text: "voraussichtlich {refunds} zurückgeben";
|
|
1470
|
+
readonly placeholders: readonly ["refunds"];
|
|
1471
|
+
};
|
|
1472
|
+
readonly 'cancellation.voucher_tip_cash': {
|
|
1473
|
+
readonly text: "{amount} Trinkgeld bar zurückgeben";
|
|
1474
|
+
readonly placeholders: readonly ["amount"];
|
|
1475
|
+
};
|
|
1442
1476
|
readonly 'cancellation.difference': {
|
|
1443
1477
|
readonly text: "Differenz";
|
|
1444
1478
|
};
|
|
@@ -2038,6 +2072,18 @@ declare const BESCHRIFTUNGEN_ROH: {
|
|
|
2038
2072
|
readonly 'voucher.add': {
|
|
2039
2073
|
readonly text: "Hinzufügen";
|
|
2040
2074
|
};
|
|
2075
|
+
readonly 'tile_prompt.amount': {
|
|
2076
|
+
readonly text: "Betrag";
|
|
2077
|
+
};
|
|
2078
|
+
readonly 'tile_prompt.quantity': {
|
|
2079
|
+
readonly text: "Menge";
|
|
2080
|
+
};
|
|
2081
|
+
readonly 'tile_prompt.apply': {
|
|
2082
|
+
readonly text: "Übernehmen";
|
|
2083
|
+
};
|
|
2084
|
+
readonly 'tile_prompt.apply_anyway': {
|
|
2085
|
+
readonly text: "Trotzdem übernehmen";
|
|
2086
|
+
};
|
|
2041
2087
|
readonly 'voucher.tab': {
|
|
2042
2088
|
readonly text: "Gutscheine";
|
|
2043
2089
|
};
|
package/dist/cjs/pos/texte.js
CHANGED
|
@@ -82,6 +82,10 @@ const MELDUNGEN_ROH = {
|
|
|
82
82
|
'articles.vat_rate_unknown': { text: '„{name}“ hat einen Steuersatz, den die Kasse nicht kennt.', placeholders: ['name'] },
|
|
83
83
|
'item.amount_missing': { text: 'Bitte einen Betrag eingeben.' },
|
|
84
84
|
'item.description_missing': { text: 'Bitte eine Bezeichnung eingeben – sie steht am Beleg.' },
|
|
85
|
+
// Kachel mit Betrag und Referenz (1.26.0): Eingabeblatt beim Antippen.
|
|
86
|
+
'reference.missing': { text: 'Bitte „{name}“ eingeben.', placeholders: ['name'] },
|
|
87
|
+
'reference.format_invalid': { text: 'Das Format passt nicht.' },
|
|
88
|
+
'reference.format_warning': { text: 'Das Format passt nicht. Trotzdem übernehmen?' },
|
|
85
89
|
'discount.percent_invalid': { text: 'Bitte einen Prozentwert zwischen 0,1 und 100 eingeben.' },
|
|
86
90
|
// --- Kassieren -----------------------------------------------------------
|
|
87
91
|
// Der Grund ueber dem Knopf, solange der Beleg nicht abgeschlossen werden kann.
|
|
@@ -817,6 +821,15 @@ const BESCHRIFTUNGEN_ROH = {
|
|
|
817
821
|
'cancellation.as_voucher': { text: 'Als Gutschein' },
|
|
818
822
|
'cancellation.voucher_confirm': { text: '{amount} als Gutschein zurückgeben', placeholders: ['amount'] },
|
|
819
823
|
'cancellation.payment_remainder': { text: 'Rest {amount}', placeholders: ['amount'] },
|
|
824
|
+
// Die Zeile unter „wie bezahlt“: wohin das Geld zurückgeht, Teile mit „ · “ verbunden
|
|
825
|
+
// („20,00 € auf die Karte · 4,90 € bar zurückgeben“). Karte = jede Zahlart mit Karte.
|
|
826
|
+
'cancellation.refund_cash': { text: '{amount} bar', placeholders: ['amount'] },
|
|
827
|
+
'cancellation.refund_card': { text: '{amount} auf die Karte', placeholders: ['amount'] },
|
|
828
|
+
'cancellation.refund_other': { text: '{amount} per {method}', placeholders: ['amount', 'method'] },
|
|
829
|
+
'cancellation.refund_line': { text: '{refunds} zurückgeben', placeholders: ['refunds'] },
|
|
830
|
+
'cancellation.refund_line_estimated': { text: 'voraussichtlich {refunds} zurückgeben', placeholders: ['refunds'] },
|
|
831
|
+
// Als Gutschein: das Mitarbeiter-Trinkgeld geht bar zurück, nie auf den Gutschein.
|
|
832
|
+
'cancellation.voucher_tip_cash': { text: '{amount} Trinkgeld bar zurückgeben', placeholders: ['amount'] },
|
|
820
833
|
'cancellation.difference': { text: 'Differenz' },
|
|
821
834
|
// --- Storno mit oder ohne Trinkgeld (Schichten-Spec, Nachtrag 5) -----------
|
|
822
835
|
// Erste Frage bei offenem Mitarbeiter-Trinkgeld, zweite nur bei Ja und Barrueckgabe.
|
|
@@ -1042,6 +1055,11 @@ const BESCHRIFTUNGEN_ROH = {
|
|
|
1042
1055
|
'voucher.code_done': { text: 'Fertig' },
|
|
1043
1056
|
'voucher.article': { text: 'Artikel' },
|
|
1044
1057
|
'voucher.add': { text: 'Hinzufügen' },
|
|
1058
|
+
// Kachel mit Betrag und Referenz (1.26.0): Felder und Knoepfe des Eingabeblatts.
|
|
1059
|
+
'tile_prompt.amount': { text: 'Betrag' },
|
|
1060
|
+
'tile_prompt.quantity': { text: 'Menge' },
|
|
1061
|
+
'tile_prompt.apply': { text: 'Übernehmen' },
|
|
1062
|
+
'tile_prompt.apply_anyway': { text: 'Trotzdem übernehmen' },
|
|
1045
1063
|
// Gutschein-Sorten als Kacheln im Reiter „Gutscheine“ (Stufe 4b, 1.17.0): Kachel je Sorte mit Betrag
|
|
1046
1064
|
// oder „Betrag eingeben“, darunter klein die Art; dazu die feste Kachel „Leistungsgutschein“.
|
|
1047
1065
|
'voucher.tab': { text: 'Gutscheine' },
|
package/dist/cjs/stored/draht.js
CHANGED
|
@@ -313,5 +313,9 @@ function _storedArticleToWire(id, doc, functionName = 'fromStoredArticle') {
|
|
|
313
313
|
const kachel = regel(regel(schema.data.articles).unter.tile).unter;
|
|
314
314
|
raus.tile = nurBekannte(raus.tile, new Set(Object.keys(kachel)));
|
|
315
315
|
}
|
|
316
|
+
if ((0, exports.istObjekt)(raus.reference)) {
|
|
317
|
+
const referenz = regel(regel(schema.data.articles).unter.reference).unter;
|
|
318
|
+
raus.reference = nurBekannte(raus.reference, new Set(Object.keys(referenz)), { mode: katalog('articles[].reference.mode') });
|
|
319
|
+
}
|
|
316
320
|
return raus;
|
|
317
321
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
|
|
2
|
-
export declare const VOKABULAR_QUELLE = "
|
|
2
|
+
export declare const VOKABULAR_QUELLE = "a17db090c6fb519a9fb0c707461a1da228f4c6ce8e6a6e23cc6e20e2702baf0f";
|
|
3
3
|
/** Schema-Notation des Vertrags: Blatt 'aussen': 'innen', Objekt { __: 'innen', ... }, Liste [ { __: 'innen', ... } ]. */
|
|
4
4
|
export type SchemaEintrag = string | SchemaObjekt | readonly [SchemaObjekt];
|
|
5
5
|
export interface SchemaObjekt {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.KATALOGE = exports.ARTIKEL_FELDER = exports.SCHEMAS = exports.VOKABULAR_QUELLE = void 0;
|
|
6
6
|
/** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
|
|
7
|
-
exports.VOKABULAR_QUELLE = "
|
|
7
|
+
exports.VOKABULAR_QUELLE = "a17db090c6fb519a9fb0c707461a1da228f4c6ce8e6a6e23cc6e20e2702baf0f";
|
|
8
8
|
/** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
|
|
9
9
|
exports.SCHEMAS = {
|
|
10
10
|
"getReceipt": {
|
|
@@ -381,7 +381,16 @@ exports.SCHEMAS = {
|
|
|
381
381
|
"sort": "sort"
|
|
382
382
|
},
|
|
383
383
|
"stockLocationIds": "standorte",
|
|
384
|
-
"minStockByLocation": "mindestJeStandort"
|
|
384
|
+
"minStockByLocation": "mindestJeStandort",
|
|
385
|
+
"askPrice": "preisFragen",
|
|
386
|
+
"reference": {
|
|
387
|
+
"__": "referenz",
|
|
388
|
+
"mode": "stufe",
|
|
389
|
+
"label": "bezeichnung",
|
|
390
|
+
"hint": "hinweis",
|
|
391
|
+
"pattern": "muster",
|
|
392
|
+
"patternStrict": "musterStreng"
|
|
393
|
+
}
|
|
385
394
|
}
|
|
386
395
|
]
|
|
387
396
|
},
|
|
@@ -391,6 +400,9 @@ exports.SCHEMAS = {
|
|
|
391
400
|
},
|
|
392
401
|
"articles[].e1aGroup": {
|
|
393
402
|
"$catalog": "E1A_GRUPPE"
|
|
403
|
+
},
|
|
404
|
+
"articles[].reference.mode": {
|
|
405
|
+
"$catalog": "REFERENZ_STUFE"
|
|
394
406
|
}
|
|
395
407
|
}
|
|
396
408
|
}
|
|
@@ -421,7 +433,9 @@ exports.ARTIKEL_FELDER = [
|
|
|
421
433
|
"groupId",
|
|
422
434
|
"tile",
|
|
423
435
|
"stockLocationIds",
|
|
424
|
-
"minStockByLocation"
|
|
436
|
+
"minStockByLocation",
|
|
437
|
+
"askPrice",
|
|
438
|
+
"reference"
|
|
425
439
|
];
|
|
426
440
|
/** Wertkataloge innen (deutsch) -> aussen (englisch). */
|
|
427
441
|
exports.KATALOGE = {
|
|
@@ -692,6 +706,10 @@ exports.KATALOGE = {
|
|
|
692
706
|
"stueck": "piece",
|
|
693
707
|
"dezimal": "decimal"
|
|
694
708
|
},
|
|
709
|
+
"REFERENZ_STUFE": {
|
|
710
|
+
"fragen": "optional",
|
|
711
|
+
"pflicht": "required"
|
|
712
|
+
},
|
|
695
713
|
"STORNO_GRUND": {
|
|
696
714
|
"fehleingabe": "input_error",
|
|
697
715
|
"kunde_storniert": "customer_cancelled",
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InternerTransport } from '../client/aufrufe.js';
|
|
2
|
+
import { type PosReference } from './kachel-referenz.js';
|
|
2
3
|
/**
|
|
3
4
|
* Artikelgruppen (Kategorien der Kachel-Kasse) und Artikel in der Form, die
|
|
4
5
|
* die Kacheln brauchen, Backend: `article-endpoints.js`
|
|
@@ -96,7 +97,26 @@ export interface PosArticle {
|
|
|
96
97
|
* ausdrueckliches `true` gilt.
|
|
97
98
|
*/
|
|
98
99
|
serviceVoucher?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Kasse fragt beim Antippen den Betrag (Kachel mit Betrag und Referenz,
|
|
102
|
+
* 1.26.0); ein vorhandener Preis ist Vorschlag. Optional wie
|
|
103
|
+
* `serviceVoucher`, der Leser setzt es immer: nur ein ausdrueckliches `true` gilt.
|
|
104
|
+
*/
|
|
105
|
+
askPrice?: boolean;
|
|
106
|
+
/** Kasse fragt beim Antippen eine Referenz ab; null = aus. Der Leser setzt es immer. */
|
|
107
|
+
reference?: PosReference | null;
|
|
99
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Kann die Kachel gebucht werden? Mit festem Preis immer, ohne Preis nur mit
|
|
111
|
+
* `askPrice` (der Betrag kommt aus dem Eingabeblatt).
|
|
112
|
+
*/
|
|
113
|
+
export declare function isBookableArticle(a: Pick<PosArticle, 'unitPriceCents' | 'askPrice'>): boolean;
|
|
114
|
+
/** Fragt die Kachel beim Antippen etwas ab (Betrag, Referenz oder Menge)? */
|
|
115
|
+
export declare function tilePrompts(a: Pick<PosArticle, 'askPrice' | 'reference' | 'unit' | 'quantityRule' | 'askQuantity'>): {
|
|
116
|
+
amount: boolean;
|
|
117
|
+
reference: boolean;
|
|
118
|
+
quantity: boolean;
|
|
119
|
+
};
|
|
100
120
|
/** Deckelt eine gewuenschte Menge an der Hoechstmenge des Artikels (null = keine Grenze). */
|
|
101
121
|
export declare function allowedQuantity(a: Pick<PosArticle, 'maxQuantity'>, wanted: number): number;
|
|
102
122
|
/** Ein Artikel am Draht `/api/v3` (`listMyArticles`), soweit dieses Paket ihn liest. */
|
|
@@ -122,6 +142,8 @@ export interface PosArticlePayload {
|
|
|
122
142
|
internalCode?: string | null;
|
|
123
143
|
stockTracked?: boolean | null;
|
|
124
144
|
serviceVoucher?: boolean | null;
|
|
145
|
+
askPrice?: boolean | null;
|
|
146
|
+
reference?: unknown;
|
|
125
147
|
}
|
|
126
148
|
export declare function fromPosArticlePayload(p: PosArticlePayload): PosArticle;
|
|
127
149
|
/**
|
package/dist/esm/pos/artikel.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KasseneckValidationError } from '../client/errors.js';
|
|
2
|
+
import { fromReferencePayload } from './kachel-referenz.js';
|
|
2
3
|
export function fromArticleGroupPayload(p) {
|
|
3
4
|
return {
|
|
4
5
|
id: p.id ?? '',
|
|
@@ -41,6 +42,17 @@ export function quantityDefaults(a) {
|
|
|
41
42
|
decimals: (a.quantityRule ?? v.rule) === 'decimal' ? Math.max(1, v.decimals || 2) : 0,
|
|
42
43
|
};
|
|
43
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Kann die Kachel gebucht werden? Mit festem Preis immer, ohne Preis nur mit
|
|
47
|
+
* `askPrice` (der Betrag kommt aus dem Eingabeblatt).
|
|
48
|
+
*/
|
|
49
|
+
export function isBookableArticle(a) {
|
|
50
|
+
return a.askPrice === true || (typeof a.unitPriceCents === 'number' && Number.isInteger(a.unitPriceCents) && a.unitPriceCents >= 0);
|
|
51
|
+
}
|
|
52
|
+
/** Fragt die Kachel beim Antippen etwas ab (Betrag, Referenz oder Menge)? */
|
|
53
|
+
export function tilePrompts(a) {
|
|
54
|
+
return { amount: a.askPrice === true, reference: a.reference != null, quantity: quantityDefaults(a).ask };
|
|
55
|
+
}
|
|
44
56
|
/** Deckelt eine gewuenschte Menge an der Hoechstmenge des Artikels (null = keine Grenze). */
|
|
45
57
|
export function allowedQuantity(a, wanted) {
|
|
46
58
|
return a.maxQuantity != null && a.maxQuantity > 0 ? Math.min(wanted, a.maxQuantity) : wanted;
|
|
@@ -72,6 +84,8 @@ export function fromPosArticlePayload(p) {
|
|
|
72
84
|
internalCode: textOderNull(p.internalCode),
|
|
73
85
|
stockTracked: typeof p.stockTracked === 'boolean' ? p.stockTracked : null,
|
|
74
86
|
serviceVoucher: p.serviceVoucher === true,
|
|
87
|
+
askPrice: p.askPrice === true,
|
|
88
|
+
reference: fromReferencePayload(p.reference),
|
|
75
89
|
};
|
|
76
90
|
}
|
|
77
91
|
/**
|
package/dist/esm/pos/index.d.ts
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
|
|
8
8
|
*/
|
|
9
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';
|
|
10
|
-
export { type ArticleGroup, type ArticleGroupPayload, fromArticleGroupPayload, type PosArticle, type PosArticlePayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, QUANTITY_RULES, type QuantityRule, type QuantityDefaults, quantityRuleForUnit, quantityDefaults, allowedQuantity, } from './artikel.js';
|
|
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
|
+
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';
|
|
11
12
|
export { getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, setMyPosLogo, posSettingsFromWire, type SetMyPosLogoOptions, } from './client.js';
|
|
12
13
|
export { POS_ERROR_CODES, type PosErrorCode, isPosErrorCode, posErrorCode, isPosError, type PosFieldError, posFieldErrors, } from './errors.js';
|
|
13
14
|
export { distributeDiscount } from '../receipt/discount.js';
|