@kreiseck/kasseneck-api 1.23.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/client/aufrufe.d.ts +3 -3
  3. package/dist/cjs/client/aufrufe.js +5 -0
  4. package/dist/cjs/client/receipts.d.ts +19 -0
  5. package/dist/cjs/client/receipts.js +28 -0
  6. package/dist/cjs/index.d.ts +1 -1
  7. package/dist/cjs/models/cancellation.d.ts +1 -1
  8. package/dist/cjs/models/cancellation.js +9 -0
  9. package/dist/cjs/models/index.d.ts +1 -1
  10. package/dist/cjs/models/voucher.d.ts +19 -1
  11. package/dist/cjs/models/voucher.js +2 -2
  12. package/dist/cjs/pos/connect-bestand.d.ts +27 -0
  13. package/dist/cjs/pos/connect-bestand.js +40 -0
  14. package/dist/cjs/pos/gutschein.d.ts +10 -0
  15. package/dist/cjs/pos/gutschein.js +7 -0
  16. package/dist/cjs/pos/index.d.ts +3 -2
  17. package/dist/cjs/pos/index.js +7 -2
  18. package/dist/cjs/pos/texte.d.ts +48 -0
  19. package/dist/cjs/pos/texte.js +39 -1
  20. package/dist/cjs/receipt/layout.js +29 -3
  21. package/dist/cjs/stored/vokabular.d.ts +1 -1
  22. package/dist/cjs/stored/vokabular.js +14 -3
  23. package/dist/cjs/version.d.ts +1 -1
  24. package/dist/cjs/version.js +1 -1
  25. package/dist/esm/client/aufrufe.d.ts +3 -3
  26. package/dist/esm/client/aufrufe.js +5 -0
  27. package/dist/esm/client/receipts.d.ts +19 -0
  28. package/dist/esm/client/receipts.js +28 -0
  29. package/dist/esm/index.d.ts +1 -1
  30. package/dist/esm/models/cancellation.d.ts +1 -1
  31. package/dist/esm/models/cancellation.js +9 -0
  32. package/dist/esm/models/index.d.ts +1 -1
  33. package/dist/esm/models/voucher.d.ts +19 -1
  34. package/dist/esm/models/voucher.js +2 -2
  35. package/dist/esm/pos/connect-bestand.d.ts +27 -0
  36. package/dist/esm/pos/connect-bestand.js +37 -0
  37. package/dist/esm/pos/gutschein.d.ts +10 -0
  38. package/dist/esm/pos/gutschein.js +7 -0
  39. package/dist/esm/pos/index.d.ts +3 -2
  40. package/dist/esm/pos/index.js +3 -1
  41. package/dist/esm/pos/texte.d.ts +48 -0
  42. package/dist/esm/pos/texte.js +37 -0
  43. package/dist/esm/receipt/layout.js +29 -3
  44. package/dist/esm/stored/vokabular.d.ts +1 -1
  45. package/dist/esm/stored/vokabular.js +14 -3
  46. package/dist/esm/version.d.ts +1 -1
  47. package/dist/esm/version.js +1 -1
  48. package/fixtures/expected/voucher-return-tip.grid32.txt +32 -0
  49. package/fixtures/expected/voucher-return-tip.grid48.txt +31 -0
  50. package/fixtures/expected/voucher-return-tip.lines.json +292 -0
  51. package/fixtures/expected/voucher-return-tip.sheet32.json +218 -0
  52. package/fixtures/expected/voucher-return-tip.sheet48.json +212 -0
  53. package/fixtures/expected/voucher-return.grid32.txt +29 -0
  54. package/fixtures/expected/voucher-return.grid48.txt +28 -0
  55. package/fixtures/expected/voucher-return.lines.json +237 -0
  56. package/fixtures/expected/voucher-return.sheet32.json +200 -0
  57. package/fixtures/expected/voucher-return.sheet48.json +194 -0
  58. package/fixtures/hobex-hps-codes.json +1 -1
  59. package/fixtures/invoice-api.schema.json +1 -1
  60. package/fixtures/invoice-texts.json +1 -1
  61. package/fixtures/manifest.json +16 -0
  62. package/fixtures/pos-texts.json +41 -1
  63. package/fixtures/receipts/voucher-return-tip.json +83 -0
  64. package/fixtures/receipts/voucher-return.json +65 -0
  65. package/fixtures/surface.json +6 -3
  66. package/fixtures/v3/antworten/belege.json +1 -1
  67. package/fixtures/v3/antworten/belegmail.json +1 -1
  68. package/fixtures/v3/antworten/berichte.json +1 -1
  69. package/fixtures/v3/antworten/kasse-belege.json +1 -1
  70. package/fixtures/v3/antworten/kasse.json +315 -51
  71. package/fixtures/v3/antworten/lager.json +1 -1
  72. package/fixtures/v3/antworten/rechnungen.json +1 -1
  73. package/fixtures/v3/antworten/storno.json +1 -1
  74. package/fixtures/v3/stored/belege.json +1 -1
  75. package/fixtures/v3/stored/kasse.json +59 -18
  76. package/fixtures/v3/stored/rechnungen.json +1 -1
  77. package/fixtures/v3/v3-vokabular.json +143 -24
  78. package/fixtures/v3/zahlbetrag-faelle.json +1 -1
  79. package/package.json +1 -1
@@ -16,14 +16,15 @@ export { type NetworkPrinter, type PrintJob, type PrintJobStatus, PRINT_JOB_STAT
16
16
  export { listMyTipRecipients } from './trinkgeld.js';
17
17
  export { depFolderName } from './dep.js';
18
18
  export { type RegisterInspectionInfo, type RegisterInspectionSignature, type InspectionSignatureStatus, type InspectionInfoRow, type InspectionInfoRowKey, type InspectionInfoSection, type InspectionInfoLinesOptions, getRegisterInspectionInfo, inspectionInfoRows, inspectionInfoLines, } from './kasseninfo.js';
19
+ export { type ConnectStateReport, reportConnectState } from './connect-bestand.js';
19
20
  export { STOCK_LOCATION_TYPES, type StockLocationType, type StockLocation, type StockLocationAddress, type StockLevel, type StockValue, type StockList, type ListMyStockOptions, type SetMyCashregisterStockLocationOptions, type CashregisterStockLocation, listMyStockLocations, listMyStock, setMyCashregisterStockLocation, } from './lager.js';
20
21
  export { type ListMyStocktakesOptions, type ListMyStocktakeItemsOptions, type ListMyStocktakeCountsOptions, type RecordMyStocktakeCountOptions, type VoidMyStocktakeCountOptions, listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMyStocktakeCount, voidMyStocktakeCount, parseQuantityMilli, } from './inventur.js';
21
22
  export type { Stocktake, StocktakeItem, StocktakeCount, StocktakeCountResult, StocktakeItemPage, StocktakeCountPage, StocktakeActor, StocktakeProgress, StocktakeReview, StocktakeRecount, StocktakeScope, } from '../inventory/typen.js';
22
23
  export type { StocktakeStatus } from '../inventory/vertrag.js';
23
- export { VOUCHER_KINDS, VOUCHER_STATUSES, checkVoucher, reprintVoucherLabel, VOUCHER_SETTINGS_DEFAULTS, posVoucherSettingsFromWire, VOUCHER_PAYOUTS, VOUCHER_TYPE_KINDS, VOUCHER_AMOUNT_MODES, VOUCHER_TYPE_VALIDITY_PATTERNS, type VoucherKind, type VoucherStatus, type VoucherValidity, type VoucherArticle, type VoucherCheck, type PosVoucherSettings, type VoucherPayout, type VoucherTypeKind, type PosVoucherType, type VoucherLabelTemplate, } from './gutschein.js';
24
+ export { VOUCHER_KINDS, VOUCHER_STATUSES, checkVoucher, reprintVoucherLabel, VOUCHER_SETTINGS_DEFAULTS, posVoucherSettingsFromWire, VOUCHER_PAYOUTS, VOUCHER_TYPE_KINDS, VOUCHER_AMOUNT_MODES, VOUCHER_TYPE_VALIDITY_PATTERNS, type VoucherKind, type VoucherStatus, type VoucherValidity, type VoucherArticle, type VoucherCheck, type PosVoucherSettings, type PosVoucherReturnType, type VoucherPayout, type VoucherTypeKind, type PosVoucherType, type VoucherLabelTemplate, } from './gutschein.js';
24
25
  export { type GetMyDrawerStateOptions, type OpenMyShiftOptions, type RecordMyCashMovementOptions, type DrawerOpeningEntry, type LogMyDrawerOpeningsOptions, type GetMyShiftReportOptions, type TipPayout, type CloseMyShiftOptions, type AfterCountOption, getMyDrawerState, openMyShift, recordMyCashMovement, logMyDrawerOpenings, getMyShiftReport, closeMyShift, sumDenominations, parseCentsAllowZero, newIdempotencyKey, shiftTipLines, durationText, type ShiftTipLine, type ShiftTipLineKey, } from './schicht.js';
25
26
  export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATIONS, OPENING_REASONS, MANUAL_OPENING_REASONS, SHIFT_RECEIPT_KINDS, AFTER_COUNT_TYPES, type AfterCountType, type AfterCount, type EurDenomination, type MovementType, type ManualMovementType, type CashLocation, type OpeningReason, type ManualOpeningReason, type ShiftReceiptKind, type ShiftStatus, type ShiftActorRole, type Denominations, type ShiftActor, type DrawerInfo, type DrawerRights, type NonCashAmount, type ShiftTipTotals, type ShiftTip, type ShiftRunningTotals, type ShiftReconciliation, type Shift, type TipClaim, type DrawerOpening, type DrawerState, type CashMovement, type ShiftReceiptHeader, type ShiftReceiptMovement, type ShiftReceiptTip, type ShiftSummaryReceipt, type CashMovementReceipt, type ShiftReceipt, type OpenShiftResult, type CashMovementResult, type DrawerOpeningsResult, type ShiftReport, type CloseShiftResult, } from './schicht-typen.js';
26
27
  export { type ShiftReceiptLayoutOptions, shiftReceiptLayout, cashMovementLayout } from '../receipt/shift-sheet.js';
27
28
  export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputKind, type ReceiptOutputResult } from '../models/receipt-output.js';
28
29
  export { RETURN_DISPOSITIONS, isReturnDisposition, type ReturnDisposition } from '../models/cancellation.js';
29
- export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
30
+ export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
@@ -22,6 +22,8 @@ export { listMyTipRecipients } from './trinkgeld.js';
22
22
  export { depFolderName } from './dep.js';
23
23
  // Prüfung an der Kasse: Kasseninfo für den Prüfer, am Bildschirm und als Ausdruck (gleich im Dart-Zwilling).
24
24
  export { getRegisterInspectionInfo, inspectionInfoRows, inspectionInfoLines, } from './kasseninfo.js';
25
+ // Connect-Bestand: die Kasse meldet Version und System von Kasseneck Connect.
26
+ export { reportConnectState } from './connect-bestand.js';
25
27
  export { STOCK_LOCATION_TYPES, listMyStockLocations, listMyStock, setMyCashregisterStockLocation, } from './lager.js';
26
28
  export { listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMyStocktakeCount, voidMyStocktakeCount, parseQuantityMilli, } from './inventur.js';
27
29
  // Gutschein pruefen und Etikett nachdrucken an der Kasse; Gutschein-Sorten (Stufe 4b, 1.17.0).
@@ -35,4 +37,4 @@ export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS } from '../models/receipt-
35
37
  // Rueckgabe-Wahl beim Storno (Kassen-Dialog); dieselbe Liste wie an der Wurzel.
36
38
  export { RETURN_DISPOSITIONS, isReturnDisposition } from '../models/cancellation.js';
37
39
  // Was die Kasse selbst sagt: ein Katalog fuer Browser-Kasse und App.
38
- export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, } from './texte.js';
40
+ export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, } from './texte.js';
@@ -319,6 +319,24 @@ declare const MELDUNGEN_ROH: {
319
319
  readonly 'cancellation.tip_refunded_with_voucher': {
320
320
  readonly text: "Beleg mit Gutschein: Das Trinkgeld wird mitstorniert.";
321
321
  };
322
+ readonly 'cancellation.voucher_not_available': {
323
+ readonly text: "Als Gutschein geht hier nicht – bitte wie bezahlt zurückgeben.";
324
+ };
325
+ readonly 'cancellation.voucher_reason': {
326
+ readonly text: "Als Gutschein nur bei „Kunde hat storniert“ oder „Sonstiges“.";
327
+ };
328
+ readonly 'cancellation.voucher_with_voucher': {
329
+ readonly text: "Dieser Beleg hat einen Gutschein – bitte wie bezahlt zurückgeben.";
330
+ };
331
+ readonly 'cancellation.voucher_no_type': {
332
+ readonly text: "Keine Gutschein-Sorte für Rückgaben eingestellt – bitte wie bezahlt zurückgeben.";
333
+ };
334
+ readonly 'cancellation.voucher_amount': {
335
+ readonly text: "Dieser Betrag geht nicht als Gutschein – bitte wie bezahlt zurückgeben.";
336
+ };
337
+ readonly 'cancellation.voucher_type_changed': {
338
+ readonly text: "Die Gutschein-Sorte für Rückgaben hat sich geändert – bitte erneut versuchen.";
339
+ };
322
340
  readonly 'voucher_error.not_found': {
323
341
  readonly text: "Diesen Gutschein gibt es in diesem Betrieb nicht.";
324
342
  };
@@ -1109,6 +1127,29 @@ export type CancellationPaymentMessageCode = keyof typeof CANCELLATION_PAYMENT_E
1109
1127
  * `cancellation.failed` auf – wie bei `receiptEmailErrorMessage`.
1110
1128
  */
1111
1129
  export declare function cancellationPaymentErrorMessage(code: string | undefined | null): MessageKey;
1130
+ /**
1131
+ * Storno mit Rueckgabe als Gutschein (`refundAs: 'voucher'`, 1.25.0): welcher `code` welchen Satz bekommt.
1132
+ * Eigene Tabelle neben CANCELLATION_PAYMENT_ERROR_MESSAGES (die bleibt der Stand der 0.x-Linie); die Codes
1133
+ * fuer abgelehnte Eingaben und `idempotency_conflict` teilen sich `cancellation.input_rejected`.
1134
+ */
1135
+ export declare const CANCELLATION_VOUCHER_ERROR_MESSAGES: {
1136
+ readonly refund_as_voucher_not_available: "cancellation.voucher_not_available";
1137
+ readonly refund_as_voucher_reason: "cancellation.voucher_reason";
1138
+ readonly refund_as_voucher_with_voucher: "cancellation.voucher_with_voucher";
1139
+ readonly refund_as_voucher_no_type: "cancellation.voucher_no_type";
1140
+ readonly refund_as_voucher_amount: "cancellation.voucher_amount";
1141
+ readonly voucher_type_not_found: "cancellation.voucher_type_changed";
1142
+ readonly voucher_amount_mismatch: "cancellation.voucher_type_changed";
1143
+ readonly refund_as_invalid: "cancellation.input_rejected";
1144
+ readonly refund_as_conflict: "cancellation.input_rejected";
1145
+ readonly idempotency_key_required: "cancellation.input_rejected";
1146
+ readonly idempotency_conflict: "cancellation.input_rejected";
1147
+ };
1148
+ /**
1149
+ * Der Satz zu einem `code` eines Stornos: zuerst die Rueckgabe als Gutschein, dann die Storno-Zahlungen,
1150
+ * sonst `cancellation.failed`. Fuer die Kassen der eine Weg beim Storno.
1151
+ */
1152
+ export declare function cancellationErrorMessage(code: string | undefined | null): MessageKey;
1112
1153
  /**
1113
1154
  * Gutschein-Fehler (`/v3`): welcher `code` des Backends welchen Satz bekommt.
1114
1155
  * Wie RECEIPT_EMAIL_ERROR_MESSAGES: beide Kassen entscheiden am Code. Ein
@@ -1387,6 +1428,13 @@ declare const BESCHRIFTUNGEN_ROH: {
1387
1428
  readonly 'cancellation.all_cash': {
1388
1429
  readonly text: "Alles bar";
1389
1430
  };
1431
+ readonly 'cancellation.as_voucher': {
1432
+ readonly text: "Als Gutschein";
1433
+ };
1434
+ readonly 'cancellation.voucher_confirm': {
1435
+ readonly text: "{amount} als Gutschein zurückgeben";
1436
+ readonly placeholders: readonly ["amount"];
1437
+ };
1390
1438
  readonly 'cancellation.payment_remainder': {
1391
1439
  readonly text: "Rest {amount}";
1392
1440
  readonly placeholders: readonly ["amount"];
@@ -177,6 +177,14 @@ const MELDUNGEN_ROH = {
177
177
  'cancellation.tip_source_missing': { text: 'Bitte wählen: Woher kommt das Trinkgeld zurück?' },
178
178
  // Beleg mit Wertgutschein: keine Frage, das Trinkgeld geht mit (Ruling R59, asksRefundTip).
179
179
  'cancellation.tip_refunded_with_voucher': { text: 'Beleg mit Gutschein: Das Trinkgeld wird mitstorniert.' },
180
+ // Rueckgabe als Gutschein (refundAs voucher): die Kasse zeigt „Als Gutschein“ nur, wenn es geht; diese
181
+ // Saetze sind fuer den seltenen Fall, dass der Server trotzdem ablehnt.
182
+ 'cancellation.voucher_not_available': { text: 'Als Gutschein geht hier nicht – bitte wie bezahlt zurückgeben.' },
183
+ 'cancellation.voucher_reason': { text: 'Als Gutschein nur bei „Kunde hat storniert“ oder „Sonstiges“.' },
184
+ 'cancellation.voucher_with_voucher': { text: 'Dieser Beleg hat einen Gutschein – bitte wie bezahlt zurückgeben.' },
185
+ 'cancellation.voucher_no_type': { text: 'Keine Gutschein-Sorte für Rückgaben eingestellt – bitte wie bezahlt zurückgeben.' },
186
+ 'cancellation.voucher_amount': { text: 'Dieser Betrag geht nicht als Gutschein – bitte wie bezahlt zurückgeben.' },
187
+ 'cancellation.voucher_type_changed': { text: 'Die Gutschein-Sorte für Rückgaben hat sich geändert – bitte erneut versuchen.' },
180
188
  // --- Gutscheine: Fehlersätze (Zuordnung in VOUCHER_ERROR_MESSAGES) ---------
181
189
  'voucher_error.not_found': { text: 'Diesen Gutschein gibt es in diesem Betrieb nicht.' },
182
190
  'voucher_error.invalid': { text: 'Dieser Gutschein ist nicht gültig.' },
@@ -621,6 +629,32 @@ export function cancellationPaymentErrorMessage(code) {
621
629
  const fehler = CANCELLATION_PAYMENT_ERROR_MESSAGES;
622
630
  return (code !== undefined && code !== null && fehler[code]) || 'cancellation.failed';
623
631
  }
632
+ /**
633
+ * Storno mit Rueckgabe als Gutschein (`refundAs: 'voucher'`, 1.25.0): welcher `code` welchen Satz bekommt.
634
+ * Eigene Tabelle neben CANCELLATION_PAYMENT_ERROR_MESSAGES (die bleibt der Stand der 0.x-Linie); die Codes
635
+ * fuer abgelehnte Eingaben und `idempotency_conflict` teilen sich `cancellation.input_rejected`.
636
+ */
637
+ export const CANCELLATION_VOUCHER_ERROR_MESSAGES = {
638
+ refund_as_voucher_not_available: 'cancellation.voucher_not_available',
639
+ refund_as_voucher_reason: 'cancellation.voucher_reason',
640
+ refund_as_voucher_with_voucher: 'cancellation.voucher_with_voucher',
641
+ refund_as_voucher_no_type: 'cancellation.voucher_no_type',
642
+ refund_as_voucher_amount: 'cancellation.voucher_amount',
643
+ voucher_type_not_found: 'cancellation.voucher_type_changed',
644
+ voucher_amount_mismatch: 'cancellation.voucher_type_changed',
645
+ refund_as_invalid: 'cancellation.input_rejected',
646
+ refund_as_conflict: 'cancellation.input_rejected',
647
+ idempotency_key_required: 'cancellation.input_rejected',
648
+ idempotency_conflict: 'cancellation.input_rejected',
649
+ };
650
+ /**
651
+ * Der Satz zu einem `code` eines Stornos: zuerst die Rueckgabe als Gutschein, dann die Storno-Zahlungen,
652
+ * sonst `cancellation.failed`. Fuer die Kassen der eine Weg beim Storno.
653
+ */
654
+ export function cancellationErrorMessage(code) {
655
+ const gutschein = CANCELLATION_VOUCHER_ERROR_MESSAGES;
656
+ return (code !== undefined && code !== null && gutschein[code]) || cancellationPaymentErrorMessage(code);
657
+ }
624
658
  /**
625
659
  * Gutschein-Fehler (`/v3`): welcher `code` des Backends welchen Satz bekommt.
626
660
  * Wie RECEIPT_EMAIL_ERROR_MESSAGES: beide Kassen entscheiden am Code. Ein
@@ -766,6 +800,9 @@ const BESCHRIFTUNGEN_ROH = {
766
800
  'cancellation.as_paid': { text: 'wie bezahlt' },
767
801
  'cancellation.cash': { text: 'bar' },
768
802
  'cancellation.all_cash': { text: 'Alles bar' },
803
+ // Rueckgabe als Gutschein: dritte Wahl in „Wie zurückgeben?“ und die Bestaetigung.
804
+ 'cancellation.as_voucher': { text: 'Als Gutschein' },
805
+ 'cancellation.voucher_confirm': { text: '{amount} als Gutschein zurückgeben', placeholders: ['amount'] },
769
806
  'cancellation.payment_remainder': { text: 'Rest {amount}', placeholders: ['amount'] },
770
807
  'cancellation.difference': { text: 'Differenz' },
771
808
  // --- Storno mit oder ohne Trinkgeld (Schichten-Spec, Nachtrag 5) -----------
@@ -468,6 +468,27 @@ function zahlungsZeilen(receipt) {
468
468
  }
469
469
  return zeilen;
470
470
  }
471
+ /** Eintrag einer Rueckgabe als Gutschein: nur am Storno-Beleg, Mehrzweck (`value`), `redeem` mit `fromReturn`. */
472
+ function istRueckgabeGutschein(voucher) {
473
+ return voucher.fromReturn === true && voucher.action === VoucherAction.redeem && voucher.type === VoucherType.value;
474
+ }
475
+ /**
476
+ * Zahlwege einer Rueckgabe als Gutschein, je mit Betrag (8:4): zuerst jeder neue Gutschein
477
+ * „Gutschein ····-XXXX“ | „-24,90 €“, dann jede Zahlung ausser 0 Cent (Mitarbeiter-Trinkgeld bar zurueck)
478
+ * „Barzahlung“ | „-2,00 €“.
479
+ */
480
+ function rueckgabeZahlungsZeilen(receipt, rueckgaben) {
481
+ const zeilen = rueckgaben.map((v) => {
482
+ const endung = gutscheinEndung(v);
483
+ return paarZeile(endung != null ? `Gutschein ····-${endung}` : 'Gutschein', `${formatCents(-(v.valueCents ?? 0))} €`, 8, 4);
484
+ });
485
+ for (const zahlung of receipt.payments ?? []) {
486
+ if (zahlung.amountCents === 0)
487
+ continue;
488
+ zeilen.push(paarZeile(zahlungsartText(zahlung.method), `${formatCents(zahlung.amountCents)} €`, 8, 4));
489
+ }
490
+ return zeilen;
491
+ }
471
492
  // -------------------------------------------------------- Kleinunternehmer
472
493
  /**
473
494
  * Hinweis auf die Steuerbefreiung, den ein Kleinunternehmerbeleg tragen muss —
@@ -1254,12 +1275,17 @@ export function buildReceiptLayout(receipt, company, options = {}) {
1254
1275
  }
1255
1276
  lines.push({ kind: 'rule', char: '-' });
1256
1277
  // --- Summen
1257
- const summeCents = receiptSumCents(receipt);
1278
+ // Rueckgabe als Gutschein (Storno, `fromReturn`): der neue Gutschein ist der Zahlweg der Rueckgabe, keine
1279
+ // Einloesung. „Gesamt“ zeigt wie beim Bar-Storno den Betrag der Waren, darunter „Gutschein ····-XXXX“ mit
1280
+ // dem Minus statt „Barzahlung“ (Spec 2026-11-02, A.5).
1281
+ const rueckgaben = receipt.vouchers.filter(istRueckgabeGutschein);
1282
+ const rueckgabeCents = rueckgaben.reduce((summe, v) => summe + (v.valueCents ?? 0), 0);
1283
+ const summeCents = receiptSumCents(receipt) - rueckgabeCents;
1258
1284
  const zwischensummeCents = receiptSubSumCents(receipt);
1259
1285
  if (summeCents !== zwischensummeCents) {
1260
1286
  lines.push(paarZeile('Zwischensumme', `${formatCents(zwischensummeCents)} €`));
1261
1287
  for (const voucher of receipt.vouchers) {
1262
- if (voucher.type !== VoucherType.value || voucher.zeroRateBucket === true)
1288
+ if (voucher.type !== VoucherType.value || voucher.zeroRateBucket === true || istRueckgabeGutschein(voucher))
1263
1289
  continue;
1264
1290
  if (voucher.action !== VoucherAction.redeem && voucher.action !== VoucherAction.payout)
1265
1291
  continue;
@@ -1280,7 +1306,7 @@ export function buildReceiptLayout(receipt, company, options = {}) {
1280
1306
  lines.push({ kind: 'rule', char: '-' });
1281
1307
  }
1282
1308
  lines.push(paarZeile('Gesamt:', `${formatCents(summeCents)} €`));
1283
- lines.push(...zahlungsZeilen(receipt));
1309
+ lines.push(...(rueckgaben.length > 0 ? rueckgabeZahlungsZeilen(receipt, rueckgaben) : zahlungsZeilen(receipt)));
1284
1310
  lines.push({ kind: 'space', lines: 1 });
1285
1311
  // --- Rechtshinweise und Ausfallhinweis
1286
1312
  const hinweise = company.isSmallBusiness
@@ -1,5 +1,5 @@
1
1
  /** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
2
- export declare const VOKABULAR_QUELLE = "efbf6b21460bb07cf926b0ff35837e47d67c4f4b440a7a7cf536f949869b5816";
2
+ export declare const VOKABULAR_QUELLE = "44d12486b6108ca8c040230f317438b21c7761477fa1a9a7d6a65b28a5444e32";
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 {
@@ -1,7 +1,7 @@
1
1
  // Erzeugt von scripts/stored-vokabular.mjs aus fixtures/v3/v3-vokabular.json.
2
2
  // Nicht von Hand aendern: test/stored.test.ts vergleicht mit dem Vertrag.
3
3
  /** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
4
- export const VOKABULAR_QUELLE = "efbf6b21460bb07cf926b0ff35837e47d67c4f4b440a7a7cf536f949869b5816";
4
+ export const VOKABULAR_QUELLE = "44d12486b6108ca8c040230f317438b21c7761477fa1a9a7d6a65b28a5444e32";
5
5
  /** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
6
6
  export const SCHEMAS = {
7
7
  "getReceipt": {
@@ -70,7 +70,8 @@ export const SCHEMAS = {
70
70
  "redeemableUntil": "einloesbarBis",
71
71
  "refundableUntil": "rueckzahlbarBis",
72
72
  "validUntil": "gueltigBis"
73
- }
73
+ },
74
+ "fromReturn": "rueckgabe"
74
75
  }
75
76
  ],
76
77
  "outputs": [
@@ -282,7 +283,17 @@ export const SCHEMAS = {
282
283
  "soldCount": "verkauft"
283
284
  }
284
285
  ],
285
- "serviceArticles": "leistungsArtikel"
286
+ "serviceArticles": "leistungsArtikel",
287
+ "returnType": {
288
+ "__": "rueckgabe",
289
+ "typeId": "sorteId",
290
+ "typeName": "sorteName"
291
+ }
292
+ },
293
+ "connect": {
294
+ "__": "connect",
295
+ "minimumVersion": "mindestversion",
296
+ "deadline": "frist"
286
297
  }
287
298
  },
288
299
  "werte": {
@@ -4,4 +4,4 @@
4
4
  * Client-Version, Nachtrag §6). Ein Test haelt sie gleich mit `package.json`;
5
5
  * beim Anheben der Version beide Stellen aendern.
6
6
  */
7
- export declare const PACKAGE_VERSION = "1.23.0";
7
+ export declare const PACKAGE_VERSION = "1.25.0";
@@ -4,4 +4,4 @@
4
4
  * Client-Version, Nachtrag §6). Ein Test haelt sie gleich mit `package.json`;
5
5
  * beim Anheben der Version beide Stellen aendern.
6
6
  */
7
- export const PACKAGE_VERSION = '1.23.0';
7
+ export const PACKAGE_VERSION = '1.25.0';
@@ -0,0 +1,32 @@
1
+ Melisse Nails e.U.
2
+ Melissenweg 7
3
+ 1070 Wien
4
+ ATU12345675
5
+ +43 1 2345678
6
+
7
+ ================================
8
+ STORNOBELEG
9
+ ================================
10
+ Stornobuchung zu Beleg
11
+ AT0-KASSE1-70
12
+ vom 19.10.2026, 10:15 Uhr
13
+ Grund: Kunde hat storniert
14
+
15
+ Datum: 19.10.2026 10:15:30
16
+ Kassen-ID: KASSE1
17
+ Beleg-ID: AT0-KASSE1-79
18
+
19
+ 1 x Haarschnitt -20,00 A
20
+ Trinkgeld Personal -2,00 D
21
+
22
+ MwSt% MwSt Netto Brutto
23
+ A 20% -3,33 -16,67 -20,00
24
+ D 0% 0,00 -2,00 -2,00
25
+ --------------------------------
26
+ Gesamt: -22,00 €
27
+ Gutschein ····-2D9A -20,00 €
28
+ Barzahlung -2,00 €
29
+
30
+ [QR-Code]
31
+
32
+ Danke für Ihren Besuch
@@ -0,0 +1,31 @@
1
+ Melisse Nails e.U.
2
+ Melissenweg 7
3
+ 1070 Wien
4
+ ATU12345675
5
+ +43 1 2345678
6
+
7
+ ================================================
8
+ STORNOBELEG
9
+ ================================================
10
+ Stornobuchung zu Beleg AT0-KASSE1-70
11
+ vom 19.10.2026, 10:15 Uhr
12
+ Grund: Kunde hat storniert
13
+
14
+ Datum: 19.10.2026 10:15:30
15
+ Kassen-ID: KASSE1
16
+ Beleg-ID: AT0-KASSE1-79
17
+
18
+ 1 x Haarschnitt -20,00 A
19
+ Trinkgeld Personal -2,00 D
20
+
21
+ MwSt% MwSt Netto Brutto
22
+ A 20% -3,33 -16,67 -20,00
23
+ D 0% 0,00 -2,00 -2,00
24
+ ------------------------------------------------
25
+ Gesamt: -22,00 €
26
+ Gutschein ····-2D9A -20,00 €
27
+ Barzahlung -2,00 €
28
+
29
+ [QR-Code]
30
+
31
+ Danke für Ihren Besuch
@@ -0,0 +1,292 @@
1
+ {
2
+ "lines": [
3
+ {
4
+ "kind": "text",
5
+ "text": "Melisse Nails e.U.",
6
+ "align": "center",
7
+ "bold": true
8
+ },
9
+ {
10
+ "kind": "text",
11
+ "text": "Melissenweg 7",
12
+ "align": "center",
13
+ "bold": false
14
+ },
15
+ {
16
+ "kind": "text",
17
+ "text": "1070 Wien",
18
+ "align": "center",
19
+ "bold": false
20
+ },
21
+ {
22
+ "kind": "text",
23
+ "text": "ATU12345675",
24
+ "align": "center",
25
+ "bold": false
26
+ },
27
+ {
28
+ "kind": "text",
29
+ "text": "+43 1 2345678",
30
+ "align": "center",
31
+ "bold": false
32
+ },
33
+ {
34
+ "kind": "space",
35
+ "lines": 1
36
+ },
37
+ {
38
+ "kind": "banner",
39
+ "text": "STORNOBELEG",
40
+ "tone": "receipt_type"
41
+ },
42
+ {
43
+ "kind": "text",
44
+ "text": "Stornobuchung zu Beleg AT0-KASSE1-70",
45
+ "align": "center",
46
+ "bold": false
47
+ },
48
+ {
49
+ "kind": "text",
50
+ "text": "vom 19.10.2026, 10:15 Uhr",
51
+ "align": "center",
52
+ "bold": false
53
+ },
54
+ {
55
+ "kind": "text",
56
+ "text": "Grund: Kunde hat storniert",
57
+ "align": "center",
58
+ "bold": false
59
+ },
60
+ {
61
+ "kind": "space",
62
+ "lines": 1
63
+ },
64
+ {
65
+ "kind": "columns",
66
+ "columns": [
67
+ {
68
+ "text": "Datum:",
69
+ "width": 4,
70
+ "align": "left"
71
+ },
72
+ {
73
+ "text": "19.10.2026 10:15:30",
74
+ "width": 8,
75
+ "align": "right"
76
+ }
77
+ ]
78
+ },
79
+ {
80
+ "kind": "columns",
81
+ "columns": [
82
+ {
83
+ "text": "Kassen-ID:",
84
+ "width": 6,
85
+ "align": "left"
86
+ },
87
+ {
88
+ "text": "KASSE1",
89
+ "width": 6,
90
+ "align": "right"
91
+ }
92
+ ]
93
+ },
94
+ {
95
+ "kind": "columns",
96
+ "columns": [
97
+ {
98
+ "text": "Beleg-ID:",
99
+ "width": 6,
100
+ "align": "left"
101
+ },
102
+ {
103
+ "text": "AT0-KASSE1-79",
104
+ "width": 6,
105
+ "align": "right"
106
+ }
107
+ ]
108
+ },
109
+ {
110
+ "kind": "space",
111
+ "lines": 1
112
+ },
113
+ {
114
+ "kind": "columns",
115
+ "columns": [
116
+ {
117
+ "text": "1 x Haarschnitt",
118
+ "width": 7,
119
+ "align": "left"
120
+ },
121
+ {
122
+ "text": "-20,00 A",
123
+ "width": 5,
124
+ "align": "right"
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "kind": "columns",
130
+ "columns": [
131
+ {
132
+ "text": "Trinkgeld Personal",
133
+ "width": 8,
134
+ "align": "left"
135
+ },
136
+ {
137
+ "text": "-2,00 D",
138
+ "width": 4,
139
+ "align": "right"
140
+ }
141
+ ]
142
+ },
143
+ {
144
+ "kind": "space",
145
+ "lines": 1
146
+ },
147
+ {
148
+ "kind": "columns",
149
+ "columns": [
150
+ {
151
+ "text": "MwSt%",
152
+ "width": 3,
153
+ "align": "left"
154
+ },
155
+ {
156
+ "text": "MwSt",
157
+ "width": 4,
158
+ "align": "left"
159
+ },
160
+ {
161
+ "text": "Netto",
162
+ "width": 3,
163
+ "align": "left"
164
+ },
165
+ {
166
+ "text": "Brutto",
167
+ "width": 2,
168
+ "align": "right"
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ "kind": "columns",
174
+ "columns": [
175
+ {
176
+ "text": "A 20%",
177
+ "width": 3,
178
+ "align": "left"
179
+ },
180
+ {
181
+ "text": "-3,33",
182
+ "width": 4,
183
+ "align": "left"
184
+ },
185
+ {
186
+ "text": "-16,67",
187
+ "width": 3,
188
+ "align": "left"
189
+ },
190
+ {
191
+ "text": "-20,00",
192
+ "width": 2,
193
+ "align": "right"
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "kind": "columns",
199
+ "columns": [
200
+ {
201
+ "text": "D 0%",
202
+ "width": 3,
203
+ "align": "left"
204
+ },
205
+ {
206
+ "text": "0,00",
207
+ "width": 4,
208
+ "align": "left"
209
+ },
210
+ {
211
+ "text": "-2,00",
212
+ "width": 3,
213
+ "align": "left"
214
+ },
215
+ {
216
+ "text": "-2,00",
217
+ "width": 2,
218
+ "align": "right"
219
+ }
220
+ ]
221
+ },
222
+ {
223
+ "kind": "rule",
224
+ "char": "-"
225
+ },
226
+ {
227
+ "kind": "columns",
228
+ "columns": [
229
+ {
230
+ "text": "Gesamt:",
231
+ "width": 6,
232
+ "align": "left"
233
+ },
234
+ {
235
+ "text": "-22,00 €",
236
+ "width": 6,
237
+ "align": "right"
238
+ }
239
+ ]
240
+ },
241
+ {
242
+ "kind": "columns",
243
+ "columns": [
244
+ {
245
+ "text": "Gutschein ····-2D9A",
246
+ "width": 8,
247
+ "align": "left"
248
+ },
249
+ {
250
+ "text": "-20,00 €",
251
+ "width": 4,
252
+ "align": "right"
253
+ }
254
+ ]
255
+ },
256
+ {
257
+ "kind": "columns",
258
+ "columns": [
259
+ {
260
+ "text": "Barzahlung",
261
+ "width": 8,
262
+ "align": "left"
263
+ },
264
+ {
265
+ "text": "-2,00 €",
266
+ "width": 4,
267
+ "align": "right"
268
+ }
269
+ ]
270
+ },
271
+ {
272
+ "kind": "space",
273
+ "lines": 1
274
+ },
275
+ {
276
+ "kind": "qr",
277
+ "data": "_R1-AT1_KASSE1_AT0-KASSE1-79_2026-10-19T10:15:30_-20,00_0,00_0,00_-2,00_0,00_UMSATZ_VORGAENGER_5A1C3E07_SIGNATUR"
278
+ },
279
+ {
280
+ "kind": "space",
281
+ "lines": 1
282
+ },
283
+ {
284
+ "kind": "text",
285
+ "text": "Danke für Ihren Besuch",
286
+ "align": "center",
287
+ "bold": false
288
+ }
289
+ ],
290
+ "paperSize": "mm80",
291
+ "ruleset": 2
292
+ }