@kreiseck/kasseneck-api 1.10.1 → 1.11.1

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 (152) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/dist/cjs/client/aufrufe.d.ts +5 -5
  3. package/dist/cjs/client/aufrufe.js +22 -2
  4. package/dist/cjs/client/errors.js +2 -0
  5. package/dist/cjs/client/receipts.d.ts +34 -1
  6. package/dist/cjs/client/receipts.js +34 -1
  7. package/dist/cjs/index.d.ts +1 -1
  8. package/dist/cjs/index.js +11 -3
  9. package/dist/cjs/inventory/vertrag.d.ts +1 -1
  10. package/dist/cjs/inventory/vertrag.js +2 -0
  11. package/dist/cjs/invoice/vertrag.d.ts +1 -1
  12. package/dist/cjs/invoice/vertrag.js +2 -0
  13. package/dist/cjs/models/cancellation.d.ts +49 -1
  14. package/dist/cjs/models/cancellation.js +139 -1
  15. package/dist/cjs/models/index.d.ts +2 -2
  16. package/dist/cjs/models/index.js +10 -2
  17. package/dist/cjs/models/payment-errors.d.ts +1 -1
  18. package/dist/cjs/models/payment-errors.js +2 -0
  19. package/dist/cjs/models/receipt-email.d.ts +1 -1
  20. package/dist/cjs/models/receipt-email.js +2 -0
  21. package/dist/cjs/models/receipt-errors.d.ts +1 -1
  22. package/dist/cjs/models/receipt-errors.js +2 -0
  23. package/dist/cjs/models/receipt-item.d.ts +10 -0
  24. package/dist/cjs/models/receipt-item.js +3 -0
  25. package/dist/cjs/models/receipt.d.ts +19 -1
  26. package/dist/cjs/models/receipt.js +28 -4
  27. package/dist/cjs/pos/client.js +10 -0
  28. package/dist/cjs/pos/errors.d.ts +4 -3
  29. package/dist/cjs/pos/errors.js +21 -2
  30. package/dist/cjs/pos/index.d.ts +6 -2
  31. package/dist/cjs/pos/index.js +33 -3
  32. package/dist/cjs/pos/schicht-lesen.d.ts +39 -0
  33. package/dist/cjs/pos/schicht-lesen.js +405 -0
  34. package/dist/cjs/pos/schicht-typen.d.ts +380 -0
  35. package/dist/cjs/pos/schicht-typen.js +59 -0
  36. package/dist/cjs/pos/schicht.d.ts +208 -0
  37. package/dist/cjs/pos/schicht.js +235 -0
  38. package/dist/cjs/pos/settings.d.ts +37 -1
  39. package/dist/cjs/pos/settings.js +43 -3
  40. package/dist/cjs/pos/texte.d.ts +627 -0
  41. package/dist/cjs/pos/texte.js +236 -0
  42. package/dist/cjs/react/index.js +1 -1
  43. package/dist/cjs/receipt/grid.js +2 -2
  44. package/dist/cjs/receipt/layout.d.ts +5 -0
  45. package/dist/cjs/receipt/layout.js +14 -5
  46. package/dist/cjs/receipt/shift-sheet.d.ts +33 -0
  47. package/dist/cjs/receipt/shift-sheet.js +207 -0
  48. package/dist/cjs/register/errors.d.ts +1 -1
  49. package/dist/cjs/register/errors.js +2 -0
  50. package/dist/cjs/stored/draht.d.ts +1 -1
  51. package/dist/cjs/stored/draht.js +4 -3
  52. package/dist/cjs/stored/einstellungen.js +26 -3
  53. package/dist/cjs/stored/vokabular.d.ts +1 -1
  54. package/dist/cjs/stored/vokabular.js +118 -12
  55. package/dist/cjs/version.d.ts +1 -1
  56. package/dist/cjs/version.js +1 -1
  57. package/dist/esm/client/aufrufe.d.ts +5 -5
  58. package/dist/esm/client/aufrufe.js +22 -2
  59. package/dist/esm/client/errors.js +2 -0
  60. package/dist/esm/client/receipts.d.ts +34 -1
  61. package/dist/esm/client/receipts.js +35 -2
  62. package/dist/esm/index.d.ts +1 -1
  63. package/dist/esm/index.js +1 -1
  64. package/dist/esm/inventory/vertrag.d.ts +1 -1
  65. package/dist/esm/inventory/vertrag.js +2 -0
  66. package/dist/esm/invoice/vertrag.d.ts +1 -1
  67. package/dist/esm/invoice/vertrag.js +2 -0
  68. package/dist/esm/models/cancellation.d.ts +49 -1
  69. package/dist/esm/models/cancellation.js +132 -0
  70. package/dist/esm/models/index.d.ts +2 -2
  71. package/dist/esm/models/index.js +2 -2
  72. package/dist/esm/models/payment-errors.d.ts +1 -1
  73. package/dist/esm/models/payment-errors.js +2 -0
  74. package/dist/esm/models/receipt-email.d.ts +1 -1
  75. package/dist/esm/models/receipt-email.js +2 -0
  76. package/dist/esm/models/receipt-errors.d.ts +1 -1
  77. package/dist/esm/models/receipt-errors.js +2 -0
  78. package/dist/esm/models/receipt-item.d.ts +10 -0
  79. package/dist/esm/models/receipt-item.js +3 -0
  80. package/dist/esm/models/receipt.d.ts +19 -1
  81. package/dist/esm/models/receipt.js +27 -4
  82. package/dist/esm/pos/client.js +11 -1
  83. package/dist/esm/pos/errors.d.ts +4 -3
  84. package/dist/esm/pos/errors.js +21 -2
  85. package/dist/esm/pos/index.d.ts +6 -2
  86. package/dist/esm/pos/index.js +7 -2
  87. package/dist/esm/pos/schicht-lesen.d.ts +39 -0
  88. package/dist/esm/pos/schicht-lesen.js +392 -0
  89. package/dist/esm/pos/schicht-typen.d.ts +380 -0
  90. package/dist/esm/pos/schicht-typen.js +56 -0
  91. package/dist/esm/pos/schicht.d.ts +208 -0
  92. package/dist/esm/pos/schicht.js +222 -0
  93. package/dist/esm/pos/settings.d.ts +37 -1
  94. package/dist/esm/pos/settings.js +40 -2
  95. package/dist/esm/pos/texte.d.ts +627 -0
  96. package/dist/esm/pos/texte.js +236 -0
  97. package/dist/esm/react/index.js +1 -1
  98. package/dist/esm/receipt/grid.js +2 -2
  99. package/dist/esm/receipt/layout.d.ts +5 -0
  100. package/dist/esm/receipt/layout.js +15 -6
  101. package/dist/esm/receipt/shift-sheet.d.ts +33 -0
  102. package/dist/esm/receipt/shift-sheet.js +203 -0
  103. package/dist/esm/register/errors.d.ts +1 -1
  104. package/dist/esm/register/errors.js +2 -0
  105. package/dist/esm/stored/draht.d.ts +1 -1
  106. package/dist/esm/stored/draht.js +4 -3
  107. package/dist/esm/stored/einstellungen.js +27 -4
  108. package/dist/esm/stored/vokabular.d.ts +1 -1
  109. package/dist/esm/stored/vokabular.js +118 -12
  110. package/dist/esm/version.d.ts +1 -1
  111. package/dist/esm/version.js +1 -1
  112. package/fixtures/cancellation-tip-cases.json +679 -0
  113. package/fixtures/expected/cash-movement.grid32.txt +15 -0
  114. package/fixtures/expected/cash-movement.grid48.txt +15 -0
  115. package/fixtures/expected/cash-movement.lines.json +171 -0
  116. package/fixtures/expected/shift-close-blind.grid32.txt +28 -0
  117. package/fixtures/expected/shift-close-blind.grid48.txt +27 -0
  118. package/fixtures/expected/shift-close-blind.lines.json +275 -0
  119. package/fixtures/expected/shift-close-put-in.grid32.txt +38 -0
  120. package/fixtures/expected/shift-close-put-in.grid48.txt +35 -0
  121. package/fixtures/expected/shift-close-put-in.lines.json +403 -0
  122. package/fixtures/expected/shift-close-take-out.grid32.txt +38 -0
  123. package/fixtures/expected/shift-close-take-out.grid48.txt +35 -0
  124. package/fixtures/expected/shift-close-take-out.lines.json +403 -0
  125. package/fixtures/expected/shift-close.grid32.txt +37 -0
  126. package/fixtures/expected/shift-close.grid48.txt +35 -0
  127. package/fixtures/expected/shift-close.lines.json +413 -0
  128. package/fixtures/expected/shift-interim.grid32.txt +28 -0
  129. package/fixtures/expected/shift-interim.grid48.txt +27 -0
  130. package/fixtures/expected/shift-interim.lines.json +293 -0
  131. package/fixtures/hobex-hps-codes.json +1 -1
  132. package/fixtures/invoice-api.schema.json +1 -1
  133. package/fixtures/invoice-texts.json +1 -1
  134. package/fixtures/pos-message-cases.json +45 -0
  135. package/fixtures/pos-texts.json +723 -1
  136. package/fixtures/receipt-due-generated.json +1 -1
  137. package/fixtures/shift-cases.json +87 -0
  138. package/fixtures/shift-receipts.json +41 -0
  139. package/fixtures/surface.json +119 -3
  140. package/fixtures/v3/antworten/belege.json +1 -1
  141. package/fixtures/v3/antworten/belegmail.json +1 -1
  142. package/fixtures/v3/antworten/kasse-belege.json +1 -1
  143. package/fixtures/v3/antworten/kasse.json +10874 -4865
  144. package/fixtures/v3/antworten/lager.json +1 -1
  145. package/fixtures/v3/antworten/rechnungen.json +1 -1
  146. package/fixtures/v3/antworten/storno.json +1 -1
  147. package/fixtures/v3/stored/belege.json +18 -6
  148. package/fixtures/v3/stored/kasse.json +4667 -183
  149. package/fixtures/v3/stored/rechnungen.json +1 -1
  150. package/fixtures/v3/v3-vokabular.json +739 -32
  151. package/fixtures/v3/zahlbetrag-faelle.json +1 -1
  152. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,253 @@ 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.11.1
8
+
9
+ - `receiptSumCents`, `receiptSubSumCents` and the receipt layout count value vouchers with the opposite sign on a cancellation receipt; new helper `receiptValueVoucherSign`. Reason: the backend mirrors value vouchers onto a full cancellation with the same `action` and a positive value, and reverses the flow there (`receiptDueCents` already did). The cancellation of a sale paid partly with a value voucher (22.40, 17.50 by voucher, 4.90 cash) showed "Total -39.90" instead of the -4.90 actually refunded; the cancelled sale of a value voucher showed +30.00 instead of -30.00.
10
+ - On a cancellation receipt a mirrored promotional voucher no longer reduces `receiptSubSumCents`/`receiptSumCents`; the layout shows it as a reference without an amount. Reason: the backend takes the discount back through compensation items (`kind: 'discount'`, "Gutschein-Ausgleich") and applies a promo entry only to a positive bucket total, which a cancellation never has. The cancellation of a 34.30 sale with a 10.00 promotional voucher showed "Total -34.30" instead of the -24.30 refunded.
11
+ - Receipts other than cancellations print the same bytes as in 1.11.0.
12
+
13
+ ## 1.11.0
14
+
15
+ Shifts, cash position and drawer log at the register: `./pos` gains the six
16
+ calls of the register path, the catalogues, three helpers, the texts and the
17
+ receipt layouts for the Z report, the X report and a cash movement. Reason:
18
+ the register knew sales, but not the cash in the drawer. A business with
19
+ several people at one drawer could not hand over, count against an expected
20
+ amount, book a cash drop or a change float, pay out tips or prove why the
21
+ drawer was opened without a sale. The backend now keeps drawers, shifts and
22
+ cash movements (never signed, not a turnover), and the web register and the
23
+ app need it through the package with the same words and the same receipts.
24
+
25
+ Additive at runtime; existing calls send the same bytes as in 1.10.1 (a
26
+ receipt or cancellation without `drawerId` is unchanged). The unions
27
+ `ApiCall`, `PosCall`, `PosErrorCode`, `MessageKey` and `LabelKey` gain
28
+ members, so an exhaustive `switch` with a `never` check needs the new cases.
29
+
30
+ - **Calls** (`./pos`, register path only, `registerUserAuth`):
31
+ `getMyDrawerState(transport, { drawerId?, cashregisterId? })` (no right
32
+ needed; `rights { shift, cashMove, cashView, drawer }`, the open shift,
33
+ `tipClaims`, and with `cashView` `expectedCents`, `suggestedFloatCents`,
34
+ `recentOpenings`), `openMyShift` (`openingFloatCents` with optional
35
+ `denominations`, or `takeOver: true`, exactly one), `recordMyCashMovement`
36
+ (`type`, `amountCents`, optional `location` `bank` | `safe`, `note`, `recipientId`,
37
+ `targetDrawerId`; answers the movement and the receipt data),
38
+ `logMyDrawerOpenings` (1–50 entries, each with its own `idempotencyKey`,
39
+ optionally `drawerId` and the `operator` who opened the drawer while the
40
+ entry was buffered; answers `accepted`, `duplicates` and the effective
41
+ `drawerId`, the main drawer for a decommissioned one), `getMyShiftReport` (shift, movements,
42
+ X report or Z report for a reprint) and `closeMyShift` (answers
43
+ `status: 'recount'`, which is not an error, or `status: 'closed'` with the
44
+ shift, the Z report and `lastShiftOfRegister`; the server counts the
45
+ attempts, at most two, `attempt` is accepted but has no effect).
46
+ - **Blind count**: without the right `cashView` the server sends no expected
47
+ amount, no counted amount, no running totals and no suggestion. The models
48
+ are the wire form field by field: such a field is then absent, never `0`.
49
+ On the receipt data (`ShiftSummaryReceipt`) the same values are `null`.
50
+ - **Without the right `shift`** `getMyDrawerState` still sends the open shift,
51
+ but only its basic data (`id`, `drawerId`, `cashregisterId`, `number`,
52
+ `status`, `openedAt`, `openedBy`); the register sells into it. Every other
53
+ field of `Shift` is therefore optional. Reason: a user without the right
54
+ saw no shift and the register blocked the sale although one was open.
55
+ - **Models**: `DrawerState`, `Shift`, `ShiftRunningTotals` (maps go out as
56
+ lists: `nonCashByMethod: [{ method, cents }]`, `tips: [{ registerUserId,
57
+ name, … }]`), `ShiftReconciliation`, `CashMovement`, `TipClaim`,
58
+ `DrawerOpening`, `ShiftSummaryReceipt` (`kind` `shift_close` |
59
+ `shift_interim`), `CashMovementReceipt` (`kind` `cash_movement`) and the
60
+ results `OpenShiftResult`, `CashMovementResult`, `DrawerOpeningsResult`,
61
+ `ShiftReport`, `CloseShiftResult`. An amount, count or number that is not
62
+ an integer and an unknown `status` or `kind` are response errors.
63
+ - **Idempotency and outcome**: `openMyShift`, `recordMyCashMovement`,
64
+ `logMyDrawerOpenings` and `closeMyShift` are in `UNKNOWN_OUTCOME_CALLS`:
65
+ after `outcome: 'unknown'` resend with the **same** key, the server books
66
+ once. `getMyDrawerState` and `getMyShiftReport` are reads.
67
+ `newIdempotencyKey()` draws a fresh key for a new action (`kasse-` and 32
68
+ hex characters from `crypto.getRandomValues`, the form of the register app).
69
+ - **Error codes**: `shift_mode_off` (`openMyShift` on a drawer without shift
70
+ mode) with the text `shift.mode_off`; the text of `recount_exhausted` asks
71
+ for the amount of the second count (a comment is only needed above the
72
+ threshold, `comment_required`). The lists of request error codes and
73
+ `PAYMENT_CALL_REJECTED_CODES` gain `second_factor_required` and
74
+ `action_confirmation_required`. Reason: the backend /v3 contract contains
75
+ them since keck#657 (confirmation in the Kasseneck app, rejected before the
76
+ handler).
77
+ - **Checked before sending**, nothing else: `drawerId`, `shiftId`, the key
78
+ (also per drawer opening), a non-empty `entries` list and amounts,
79
+ denomination counts and tip payouts as integers. Catalogue, mandatory
80
+ fields per type, balance and claims are left to the server.
81
+ - **Catalogues**: `EUR_DENOMINATIONS` (cents, largest note first),
82
+ `MOVEMENT_TYPES`, `MANUAL_MOVEMENT_TYPES` (the eight the register may send),
83
+ `CASH_LOCATIONS`, `OPENING_REASONS`, `MANUAL_OPENING_REASONS`,
84
+ `SHIFT_RECEIPT_KINDS`, each the contract catalogue in its order.
85
+ - **Helpers**: `sumDenominations(denominations)` (sum in cents, `null` for an
86
+ unknown value or a count that is not an integer from 0 to 100 000, the rule
87
+ of the server) and `parseCentsAllowZero(text)` (typed amount to cents
88
+ without floating point; `0` is valid, comma or point with one or two
89
+ decimals, no thousands separator). Their cases are shared with the Dart twin
90
+ in the new `fixtures/shift-cases.json`.
91
+ - **Receipts**: `shiftReceiptLayout(receipt, { paperSize })` (title
92
+ „Schichtabschluss“ or „Zwischenbericht“ by `kind`) and
93
+ `cashMovementLayout(receipt, { paperSize })` build the usual line model
94
+ (`ReceiptLayout`, grid, sheet, ESC/POS, ePOS). A line whose value is `null` (blind: expected,
95
+ counted, difference, cash sales, counted denominations) is left out, never
96
+ printed as „0,00“. Goldens from the contract answers, so layout and contract
97
+ cannot drift: `fixtures/expected/shift-close.*`, `shift-close-blind.*`,
98
+ `shift-interim.*`, `cash-movement.*` (lines, 32 and 48 character grid),
99
+ sources and checksums in the new `fixtures/shift-receipts.json`. The
100
+ receipt goldens of 1.10.1 are byte for byte unchanged.
101
+ - **Cash position and tip list at the register**: `ShiftRunningTotals.voucherRedeemedCents`
102
+ (redeemed vouchers, not cash; 0 when an older server omits it), the helper
103
+ `durationText(minutes)` („8 Std. 32 Min.“, „1 Tag 3 Std.“; cases in
104
+ `fixtures/shift-cases.json`) and the texts for the new cash position card and
105
+ the tip payout list (`shift.*`, `duration.*`, `tip_payout.*`,
106
+ `cash_movement.pay_in_short|pay_out_short`, `drawer.recent_openings_full`).
107
+ - **Printer warning**: four short labels for the quiet warning line at the print buttons
108
+ (`printer.warn_unreachable`, `printer.warn_none`, `printer.check`, `printer.set_up`).
109
+ - **Change float and take out / put in at shift close**: a drawer can keep a fixed
110
+ change float; after counting, the register takes out the rest or puts money in.
111
+ `DrawerInfo.changeFloatCents` and `DrawerState.suggestedFromShiftNumber` (only
112
+ when sent), `CloseMyShiftOptions.afterCount` (`{ type: 'cash_drop' | 'change_in',
113
+ amountCents }`, catalogue `AFTER_COUNT_TYPES`, only the shape is checked before
114
+ sending), `Shift.afterCount`/`leftInDrawerCents`, `ShiftSummaryReceipt.afterCount`/
115
+ `leftInDrawerCents` (blind `null`) and `afterCountReceipt` on the close result
116
+ (the envelope receipt). New code `after_count_not_permitted` in
117
+ `POS_ERROR_CODES`. `shiftReceiptLayout` prints, after a rule below the count,
118
+ „Entnommen“ (negative) or „Eingelegt“ and „Bleibt in der Kassenlade“ (bold); without
119
+ `afterCount` the Z report is byte-identical. For the bold line,
120
+ `LayoutColumnsLine` gains an optional `bold` (only written when `true`; grid,
121
+ ESC/POS, ePOS, sheet and React follow it, every existing output is unchanged).
122
+ New goldens `shift-close-take-out`, `shift-close-put-in`; texts `drawer.change_float*`,
123
+ `shift.*` for the step „Geld entnehmen“, `shift_receipt.taken_out|put_in|left_in_drawer`,
124
+ `shift.counted|back|done|edit_amount` (row „Gezählt“, „Zurück“, step „Fertig“,
125
+ accessibility label „{title} ändern“), message `shift.change_float_missing`; the
126
+ bold column line is pinned in the byte twin test. Reason: the drawer kept everything after a
127
+ shift, so the next shift started with the whole day's cash.
128
+ - **Texts** (`fixtures/pos-texts.json`): messages `shift.*`,
129
+ `shift.required_other` (shift mode on, no shift open, the signed-in user
130
+ lacks the `shift` right), `cash_movement.*`, `tip_payout.exceeds_claim`, `denominations.invalid`,
131
+ `amount.invalid`, `drawer.not_found`, `drawer.inactive`; labels for the
132
+ screens (`shift.*`, `drawer.reason_*`), one per movement type
133
+ (`cash_movement.type_*`) and the receipt lines (`shift_receipt.*`).
134
+ `ERROR_CODE_RULES` gains a rule for every new code (`shift_not_open`,
135
+ `shift_already_open`, `shift_closed`, `comment_required`,
136
+ `recount_exhausted`, `cash_movement_exceeds_balance`, `note_required`,
137
+ `invalid_movement_type`, `transfer_same_drawer`, `tip_payout_exceeds_claim`,
138
+ `invalid_denominations`, `invalid_amount`, `drawer_not_found`,
139
+ `drawer_inactive`): the register says what to do instead of the backend
140
+ sentence. `validation`, `module_inactive` and `not_permitted` keep the
141
+ readable sentence of the server, as before.
142
+ - **Bank or safe is optional**: `location` on `change_in` and `cash_drop` is
143
+ checked only when given (`bank` | `safe`, otherwise refused before sending);
144
+ the movement receipt prints „Ort“ only when it is set, the label of
145
+ `change_in` is „Wechselgeld“, and no shift receipt prints „Kein
146
+ Registrierkassenbeleg“ (the text `shift.not_a_receipt` is gone). Reason:
147
+ the register no longer asks where the change came from or the drop went,
148
+ the answer had no use for the cash position, and the note at the foot was
149
+ not wanted on the slips.
150
+ - **Tips during the shift**: `DrawerState.tips` lists per employee what
151
+ the running shift earned (`receivedImmediatelyCents`, `retainedCents`),
152
+ what was already paid out from the drawer in this shift (`paidOutCents`)
153
+ and the open claim against the drawer (`openCents`), for every session,
154
+ also without `cashView`. `ShiftTipTotals` gains `paidOutCents`, the new
155
+ `ShiftTip` adds `openCents` (`ShiftReceiptTip` is now this type, the Z and
156
+ X report carry the open claim at closing or now). `recordMyCashMovement`
157
+ with `type: 'tip_payout'` and `recipientId` is unchanged; the server now
158
+ also lets a user with only the right `shift` pay out the own claim (another
159
+ employee's claim still needs `cashMove`). New helper
160
+ `shiftTipLines(tip)`: the lines of one employee as the register shows and
161
+ prints them, „verdient“ (immediate + retained) always, „über Lohn“,
162
+ „schon genommen“ and „offen“ only when not 0, no line at all when
163
+ everything is 0; its cases are in `fixtures/shift-cases.json`. The shift
164
+ receipts use it. Labels `shift_receipt.tip_earned` „verdient“ and
165
+ `shift_receipt.tip_open` „offen“ are new, `shift_receipt.tip_paid_out`
166
+ now reads „schon genommen“, `shift_receipt.tip_immediately` („sofort“) is
167
+ gone. Reason: staff take their tips at any time, not only at the end of
168
+ the shift, and the slip showed lines with 0,00 nobody needed.
169
+ - **Cash tip kept right away**: `TipOptions.keptByEmployee` (sent only when
170
+ `true`; anything but a boolean is refused before sending) marks a staff
171
+ cash tip the employee pockets at the sale. The receipt stays as it was
172
+ (signed, in the DEP); the tip position carries `keptByEmployee: true`
173
+ (`ReceiptItem.keptByEmployee`, read and mirrored on a cancellation). In
174
+ the cash position the amount is not part of the expected cash and counts
175
+ as „schon genommen“ at once (`paidOutCents`, no line of its own); the open
176
+ claim does not grow. The server takes it only for staff tips paid in cash
177
+ and received immediately, otherwise it drops it silently. New optional
178
+ business setting `tipKeptByDefault` (`POS_BUSINESS_OPTIONAL_FIELDS`, sent
179
+ by the server only when stored, missing = off; `posTipKeptByDefault(business)`)
180
+ presets the switch. Labels `checkout.tip_kept` „gleich behalten“ and
181
+ `tip.kept_setting`, message `tip.kept_setting_hint`. Reason: a waitress
182
+ who keeps 2 € of a 22 € cash payment left 20 € in the drawer while the
183
+ expected cash said 22 € — a difference that was none. The hint now says
184
+ „zählt nicht ins Soll der Lade“ (it never left the cash position).
185
+ - **Cancelling with or without the tip**: `cancelReceipt` takes `refundTip`
186
+ (answer to „Trinkgeld auch zurückgeben?“; `false` leaves the staff tip on
187
+ the receipt, without `items` = every remaining quantity except the tip;
188
+ `true` with `items` adds the open tip) and `tipRefundSource` (`drawer` |
189
+ `employee`, `TIP_REFUND_SOURCES`, only for a cash refund: from the drawer,
190
+ or the employee hands it back herself). Without both the payload is the
191
+ same as before (a full cancellation takes the tip along). A wrong value
192
+ or a source with `refundTip: false` is refused before sending. The rules
193
+ both registers ask by: `openStaffTipCents(receipt)` (> 0 = ask the first
194
+ question, also for a partial cancellation), `cancellationItemsForTip`,
195
+ `cancellationCashRefundCents` and `asksTipRefundSource` (second question
196
+ only when the cash of the refund covers the tip and the employee already
197
+ had it); shared cases in `fixtures/cancellation-tip-cases.json`.
198
+ `CANCELLATION_ERROR_CODES` gains `tip_refund_conflict`,
199
+ `invalid_tip_refund_source` and `tip_refund_source_requires_cash`. Labels
200
+ `cancellation.tip_refund_question/yes/no`,
201
+ `cancellation.tip_source_question/drawer/employee`, messages
202
+ `cancellation.tip_refund_missing` and `cancellation.tip_source_missing`.
203
+ Reason: a tip is a voluntary gift to the employee; whether it goes back
204
+ with a cancelled sale, and from whose pocket, is a decision at the
205
+ register, and the drawer, „verdient“, „schon genommen“ and „offen“ must
206
+ follow it. A negative „offen“ (the employee owes the drawer) prints with
207
+ a minus; `shiftTipLines` keeps it like any value other than 0.
208
+ With a value voucher on the receipt there is no „Nein“: `asksRefundTip`
209
+ is false there, the registers show `cancellation.tip_refunded_with_voucher`
210
+ and send `refundTip: true` (the server refuses `false` with
211
+ `tip_keep_not_possible_with_voucher`, added to `CANCELLATION_ERROR_CODES`),
212
+ because only a full cancellation reverses the voucher. `refundTip: true`
213
+ without `tipRefundSource` on a cash refund means: from the drawer. After
214
+ „Nein“ the tip line of the cancellation sheet reads `cancellation.tip_stays`
215
+ „bleibt“.
216
+ - **Tip handed back by the employee**: `ShiftTipTotals.refundedByEmployeeCents`
217
+ („selbst zurückgegeben“, read as 0 when an older backend leaves it out) and
218
+ a line `shift_receipt.tip_refunded_by_employee` in `shiftTipLines` (only
219
+ when not 0). Reason: a cancellation where the employee hands the tip back
220
+ herself showed „schon genommen -2,00“ — correct, but read wrong; now
221
+ „schon genommen“ never goes negative this way, and
222
+ open = earned − taken + handed back.
223
+ - **Tip carried over from earlier shifts**: `ShiftTip.carriedOverCents`
224
+ („aus früheren Schichten“, the drawer's open claim when the shift was
225
+ opened; without an open shift the whole claim; read as 0 when missing) and
226
+ the line `shift_receipt.tip_carried_over` first in `shiftTipLines` (only
227
+ when not 0). Reason: „verdient 9,00 · offen 15,00“ left 6,00 unexplained;
228
+ now open = carried over + earned − retained − taken + handed back, with
229
+ exactly the lines shown.
230
+ - **Device setting** `drawerId` (inner `ladeId`): the drawer of this device.
231
+ Optional like on the wire, without a default (`POS_DEVICE_OPTIONAL_FIELDS`):
232
+ present only when a drawer is assigned, written as an id or `null` (removes
233
+ the assignment). `./stored` reads it the same way.
234
+ - **Receipts and cancellations** take `drawerId` (`sellReceipt`,
235
+ `createReceipt` options, `cancelReceipt`): the drawer whose cash position
236
+ the receipt counts in; an empty id is refused before sending.
237
+ - **Errors**: `POS_ERROR_CODES` gains the codes of the six calls
238
+ (`drawer_not_found`, `drawer_inactive`, `shift_already_open`, `shift_mode_off`,
239
+ `shift_not_open`, `shift_closed`, `comment_required`, `recount_exhausted`,
240
+ `cash_movement_exceeds_balance`, `tip_payout_exceeds_claim`,
241
+ `invalid_amount`, `invalid_denominations`, `invalid_movement_type`,
242
+ `transfer_same_drawer`, `note_required`).
243
+ - **Contract**: `fixtures/v3/` pulled from the backend at the state of shifts
244
+ and cash position; the vocabulary of `./stored` regenerated (`drawerId` in
245
+ the device settings), and `./stored` drops `ladeId`, `schichtId` and
246
+ `ausserhalbSchicht` from a stored receipt like the server does.
247
+ - **Counts**: `POS_CALLS` 33 → 39 (33 register-only names).
248
+ - **Twin check**: the source fingerprints of `kasse-settings-core.js` (optional
249
+ device settings) and of `INTERNE_BELEG_FELDER` in `storno-core.js` in
250
+ `test/fixtures/stored-zwillinge.json` follow the backend; the behaviour
251
+ comparison of `./stored` against the backend is green.
252
+ - **Texts**: 15 labels (`cash_movement.pay_in/pay_out/print`, `drawer.recent_openings`, `drawer.reason_sale/cash_movement/shift_open/shift_close`, `shift.resend/next/print_close/print_again/back_to_register/later`, `time.yesterday`) and 2 messages (`tip_payout.recipient_required`, `shift.pending_hint`) for the cash position and the drawer log, so the registers take every text from the package.
253
+
7
254
  ## 1.10.1
8
255
 
9
256
  - Documentation of `getCashregisterReport`: the daily report is only available for a closed day (yesterday or earlier); today returns `period_not_closed` like the current month. Reason: the backend accepts only closed days since keck#659. No code change in the package.
@@ -13,7 +13,7 @@
13
13
  * umhuellt, muss ihn weiterhin absetzen koennen.
14
14
  */
15
15
  import type { PdfOrData, TransportBodyFields, TransportCallOptions } from './transport.js';
16
- export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount"];
16
+ export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift"];
17
17
  export type ApiCall = typeof ALL_CALLS[number];
18
18
  /**
19
19
  * Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
@@ -28,7 +28,7 @@ export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "can
28
28
  * `endpoints.register`. Sechs davon sind zugleich oeffentlich; die Kasse ruft
29
29
  * sie trotzdem ueber diesen Weg (ein Dialekt je Client, Nachtrag §5.2).
30
30
  */
31
- export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount"];
31
+ export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift"];
32
32
  export type PublicCall = typeof PUBLIC_CALLS[number];
33
33
  export type PosCall = typeof POS_CALLS[number];
34
34
  /**
@@ -49,7 +49,7 @@ export type PosCall = typeof POS_CALLS[number];
49
49
  * [ALL_CALLS], [PUBLIC_CALLS] und [POS_CALLS] steht entweder hier oder in
50
50
  * [CALLS_WITHOUT_EFFECT] (Waechter `test/ausgang-einordnung.test.ts`).
51
51
  */
52
- export declare const UNKNOWN_OUTCOME_CALLS: readonly ["activateCashregister", "addVariant", "cancelInvoice", "cancelReceipt", "cancelStocktake", "changeStockCondition", "closeStocktake", "createArticle", "createCreditNote", "createCustomer", "createCustomerCashregister", "createInvoiceItem", "createPartnerCustomer", "createPartnerWebhook", "createPrintJob", "createReceipt", "createReservation", "createStocktake", "createVariantGroup", "createWebhook", "deactivateArticle", "deletePartnerWebhook", "deleteWebhook", "extendReservation", "financeWebService", "hobexPayApi", "hobexRefundApi", "issueInvoice", "pairRegisterDevice", "receiveGoods", "recordInvoicePayment", "recordMyStocktakeCount", "recordStockLoss", "recordStocktakeCount", "recountStocktake", "releaseReservation", "reportCustomerContract", "requestCustomerSignature", "reverseStockMovement", "reviewStocktake", "revokeCustomerMandate", "rotatePartnerWebhookSecret", "rotateWebhookSecret", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "sendWebhookTest", "setCustomerMandate", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "transferStock", "unpairRegisterDevice", "updateArticle", "updateCustomer", "updateInvoiceItem", "updatePartnerWebhook", "updateVariantGroup", "updateWebhook", "voidMyStocktakeCount", "voidStocktakeCount", "withdrawInvoiceItem"];
52
+ export declare const UNKNOWN_OUTCOME_CALLS: readonly ["activateCashregister", "addVariant", "cancelInvoice", "cancelReceipt", "cancelStocktake", "changeStockCondition", "closeMyShift", "closeStocktake", "createArticle", "createCreditNote", "createCustomer", "createCustomerCashregister", "createInvoiceItem", "createPartnerCustomer", "createPartnerWebhook", "createPrintJob", "createReceipt", "createReservation", "createStocktake", "createVariantGroup", "createWebhook", "deactivateArticle", "deletePartnerWebhook", "deleteWebhook", "extendReservation", "financeWebService", "hobexPayApi", "hobexRefundApi", "issueInvoice", "logMyDrawerOpenings", "openMyShift", "pairRegisterDevice", "receiveGoods", "recordInvoicePayment", "recordMyCashMovement", "recordMyStocktakeCount", "recordStockLoss", "recordStocktakeCount", "recountStocktake", "releaseReservation", "reportCustomerContract", "requestCustomerSignature", "reverseStockMovement", "reviewStocktake", "revokeCustomerMandate", "rotatePartnerWebhookSecret", "rotateWebhookSecret", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "sendWebhookTest", "setCustomerMandate", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "transferStock", "unpairRegisterDevice", "updateArticle", "updateCustomer", "updateInvoiceItem", "updatePartnerWebhook", "updateVariantGroup", "updateWebhook", "voidMyStocktakeCount", "voidStocktakeCount", "withdrawInvoiceItem"];
53
53
  /** Warum ein Aufruf keine Wirkung hat, die ein Zeitlimit offen lassen koennte. */
54
54
  export type CallWithoutEffectReason = 'read' | 'repeatable';
55
55
  /**
@@ -85,10 +85,10 @@ export declare const CALLS_WITHOUT_EFFECT: Readonly<Record<string, CallWithoutEf
85
85
  * absetzt, sagt es mit `hasEffect: true`.
86
86
  */
87
87
  export declare function isUnknownOutcomeCall(name: string): boolean;
88
- /** Einer der 33 Aufrufe des Kassenwegs. */
88
+ /** Einer der 39 Aufrufe des Kassenwegs. */
89
89
  export declare function isPosCall(name: string): boolean;
90
90
  /**
91
- * Nur ueber den Kassenweg erreichbar (27 Namen): unter `api.kasseneck.at/v3`
91
+ * Nur ueber den Kassenweg erreichbar (33 Namen): unter `api.kasseneck.at/v3`
92
92
  * gibt es sie nicht. Der Transport schickt sie darum ohne eigene Basis an
93
93
  * [POS_BASE_URL] statt an die oeffentliche Basis.
94
94
  */
@@ -131,6 +131,13 @@ exports.ALL_CALLS = [
131
131
  'listMyStocktakeCounts',
132
132
  'recordMyStocktakeCount',
133
133
  'voidMyStocktakeCount',
134
+ // Schicht, Kassenstand und Lade-Protokoll an der Kasse (./pos)
135
+ 'getMyDrawerState',
136
+ 'openMyShift',
137
+ 'recordMyCashMovement',
138
+ 'logMyDrawerOpenings',
139
+ 'getMyShiftReport',
140
+ 'closeMyShift',
134
141
  ];
135
142
  /**
136
143
  * Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
@@ -294,6 +301,13 @@ exports.POS_CALLS = [
294
301
  'listMyStocktakeCounts',
295
302
  'recordMyStocktakeCount',
296
303
  'voidMyStocktakeCount',
304
+ // Schicht, Kassenstand und Lade-Protokoll: nur ueber den Kassenweg.
305
+ 'getMyDrawerState',
306
+ 'openMyShift',
307
+ 'recordMyCashMovement',
308
+ 'logMyDrawerOpenings',
309
+ 'getMyShiftReport',
310
+ 'closeMyShift',
297
311
  ];
298
312
  /**
299
313
  * Die Aufrufe **mit Wirkung**, alphabetisch: sie legen etwas an, aendern oder
@@ -320,6 +334,7 @@ exports.UNKNOWN_OUTCOME_CALLS = [
320
334
  'cancelReceipt',
321
335
  'cancelStocktake',
322
336
  'changeStockCondition',
337
+ 'closeMyShift',
323
338
  'closeStocktake',
324
339
  'createArticle',
325
340
  'createCreditNote',
@@ -342,9 +357,12 @@ exports.UNKNOWN_OUTCOME_CALLS = [
342
357
  'hobexPayApi',
343
358
  'hobexRefundApi',
344
359
  'issueInvoice',
360
+ 'logMyDrawerOpenings',
361
+ 'openMyShift',
345
362
  'pairRegisterDevice',
346
363
  'receiveGoods',
347
364
  'recordInvoicePayment',
365
+ 'recordMyCashMovement',
348
366
  'recordMyStocktakeCount',
349
367
  'recordStockLoss',
350
368
  'recordStocktakeCount',
@@ -423,6 +441,8 @@ exports.CALLS_WITHOUT_EFFECT = Object.freeze({
423
441
  getInvoiceSetupStatus: 'read',
424
442
  getInvoiceXml: 'read',
425
443
  getKasseSettings: 'read',
444
+ getMyDrawerState: 'read',
445
+ getMyShiftReport: 'read',
426
446
  getPartnerBilling: 'read',
427
447
  getPartnerBillingMonth: 'read',
428
448
  getPartnerCustomer: 'read',
@@ -487,12 +507,12 @@ function isUnknownOutcomeCall(name) {
487
507
  const OEFFENTLICH = new Set(exports.PUBLIC_CALLS);
488
508
  const KASSENWEG = new Set(exports.POS_CALLS);
489
509
  const NUR_KASSE = new Set(exports.POS_CALLS.filter((name) => !OEFFENTLICH.has(name)));
490
- /** Einer der 33 Aufrufe des Kassenwegs. */
510
+ /** Einer der 39 Aufrufe des Kassenwegs. */
491
511
  function isPosCall(name) {
492
512
  return KASSENWEG.has(name);
493
513
  }
494
514
  /**
495
- * Nur ueber den Kassenweg erreichbar (27 Namen): unter `api.kasseneck.at/v3`
515
+ * Nur ueber den Kassenweg erreichbar (33 Namen): unter `api.kasseneck.at/v3`
496
516
  * gibt es sie nicht. Der Transport schickt sie darum ohne eigene Basis an
497
517
  * [POS_BASE_URL] statt an die oeffentliche Basis.
498
518
  */
@@ -284,6 +284,8 @@ exports.PAYMENT_CALL_REJECTED_CODES = Object.freeze([
284
284
  'app_check_invalid',
285
285
  'unauthorized',
286
286
  'password_change_required', // Pflichtwechsel des Passworts offen: vor dem Handler abgewiesen
287
+ 'second_factor_required', // Anmeldung wartet auf die Bestaetigung in der Kasseneck-App: vor dem Handler abgewiesen
288
+ 'action_confirmation_required', // Aenderung wartet auf die Bestaetigung in der Kasseneck-App: vor dem Handler abgewiesen
287
289
  'mfa_required',
288
290
  'user_verification_failed',
289
291
  'admin_required',
@@ -1,5 +1,5 @@
1
1
  import { ReceiptType, type ReceiptTypeKey, KeckPaymentMethod, type KeckPaymentMethodKey } from '../enums/index.js';
2
- import { type Receipt, type ReceiptCompany, type ReceiptItem, type Voucher, type ReceiptSummary, type ReportMonth, type CancellationItem, type CancellationOf, type CancellationReason, type ReturnDisposition, type ReceiptPaymentInput, type RegistrationInfo, type ReceiptEmailVia } from '../models/index.js';
2
+ import { type Receipt, type ReceiptCompany, type ReceiptItem, type Voucher, type ReceiptSummary, type ReportMonth, type CancellationItem, type CancellationOf, type CancellationReason, type TipRefundSource, type ReturnDisposition, type ReceiptPaymentInput, type RegistrationInfo, type ReceiptEmailVia } from '../models/index.js';
3
3
  import type { InternerTransport } from './aufrufe.js';
4
4
  import { type ReceiptLayout } from '../receipt/layout.js';
5
5
  import type { PosPaperSize } from '../printing/escpos.js';
@@ -49,6 +49,12 @@ export interface ReceiptCommonOptions {
49
49
  * anteilig je Steuersatz). Nur auf `standard` und `training`.
50
50
  */
51
51
  tip?: number | TipOptions;
52
+ /**
53
+ * Lade, in deren Kassenstand der Beleg zaehlt (Schichtbetrieb, Geraete-
54
+ * Einstellung `drawerId`). Ohne Angabe gilt die Lade des Geraets bzw. die
55
+ * Hauptlade der Kasse. Leer oder kein Text: wirft vor dem Senden.
56
+ */
57
+ drawerId?: string;
52
58
  }
53
59
  /** Trinkgeld mit eigener Zahlart und/oder Empfaengern (Kassen-Benutzer-IDs, Summe = cents). */
54
60
  export interface TipOptions {
@@ -73,6 +79,15 @@ export interface TipOptions {
73
79
  * (ohne angemeldeten Kassen-Benutzer) gilt die Einschraenkung nicht.
74
80
  */
75
81
  receivedImmediately?: boolean;
82
+ /**
83
+ * Bar-Trinkgeld „gleich behalten“: die Mitarbeiterin steckt das Trinkgeld
84
+ * beim Verkauf gleich ein. Der Beleg bleibt, wie er ist (signiert, im DEP);
85
+ * nur im Kassenstand zaehlt der Betrag nicht ins Bar-Soll und gilt sofort als
86
+ * „schon genommen“. Nur `true` geht hinaus. Der Server nimmt es nur bei
87
+ * Mitarbeiter-Trinkgeld, bar und sofort erhalten; sonst faellt es still weg.
88
+ * Vorbelegung des Schalters: [posTipKeptByDefault] der Kassen-Einstellungen.
89
+ */
90
+ keptByEmployee?: boolean;
76
91
  }
77
92
  export interface TipRecipientShare {
78
93
  registerUserId: string;
@@ -135,6 +150,24 @@ export type CancelReceiptOptions = {
135
150
  * Kassenweg (Kanal `app`, `registerUserAuth`).
136
151
  */
137
152
  payments?: ReceiptPaymentInput[];
153
+ /** Lade, in deren Kassenstand der Storno zaehlt; wie bei [ReceiptCommonOptions.drawerId]. */
154
+ drawerId?: string;
155
+ /**
156
+ * Antwort auf „Trinkgeld auch zurueckgeben?“ (Schichten-Spec, Nachtrag 5). `false`: ohne das
157
+ * Mitarbeiter-Trinkgeld (ohne `items` = alle Restmengen ausser dem Trinkgeld); `true` mit `items`:
158
+ * das noch offene Trinkgeld kommt dazu. Fehlt = wie bisher (ein Vollstorno nimmt es mit). Die
159
+ * Positionen dazu rechnet [cancellationItemsForTip]. An einem Beleg mit Wertgutschein gibt es
160
+ * `false` nicht (`tip_keep_not_possible_with_voucher`, siehe [asksRefundTip]).
161
+ */
162
+ refundTip?: boolean;
163
+ /**
164
+ * Antwort auf „Woher kommt das Trinkgeld zurueck?“, nur bei Barrueckgabe ([asksTipRefundSource]):
165
+ * `drawer` aus der Lade, `employee` gibt die Mitarbeiterin direkt. Nicht zusammen mit
166
+ * `refundTip: false`. Der Server weist eine Quelle ohne Bargeld-Deckung ab
167
+ * (`tip_refund_source_requires_cash`). `refundTip: true` ohne Quelle heisst bei Barrueckgabe:
168
+ * aus der Lade (kein „gibt die Mitarbeiterin direkt“).
169
+ */
170
+ tipRefundSource?: TipRefundSource;
138
171
  } & ({
139
172
  receipt: Receipt;
140
173
  cashregisterId?: string;
@@ -136,8 +136,18 @@ function createReceiptParams(options) {
136
136
  if (options.legalMessage != null) {
137
137
  params['legalMessage'] = options.legalMessage.join('\n');
138
138
  }
139
+ if (options.drawerId !== undefined) {
140
+ params['drawerId'] = ladeKennung('createReceipt', options.drawerId);
141
+ }
139
142
  return params;
140
143
  }
144
+ /** Die Lade eines Belegs: ein nicht leerer Text, sonst wirft der Aufruf vor dem Senden. */
145
+ function ladeKennung(name, wert) {
146
+ if (typeof wert !== 'string' || wert.trim() === '') {
147
+ throw new errors_js_1.KasseneckValidationError(name, 'drawerId muss eine Kennung sein (oder weglassen)', 'request');
148
+ }
149
+ return wert;
150
+ }
141
151
  /** Felder des alten Einzel-Zahlungswegs; unter /v3 abgewiesen. */
142
152
  const ALTE_ZAHLFELDER = ['paymentMethod', 'paymentMethodFromServer', 'creditCardProvider', 'cardPaymentId', 'cardPaymentData'];
143
153
  /** Normalbeleg (Verkauf) nach RKSV. */
@@ -191,6 +201,15 @@ async function cancelReceipt(transport, options) {
191
201
  if (options.note !== undefined && options.note.length > NOTE_MAX) {
192
202
  throw new errors_js_1.KasseneckValidationError('cancelReceipt', `Anmerkung ist zu lang (hoechstens ${NOTE_MAX} Zeichen)`, 'request');
193
203
  }
204
+ if (options.refundTip !== undefined && typeof options.refundTip !== 'boolean') {
205
+ throw new errors_js_1.KasseneckValidationError('cancelReceipt', 'refundTip muss true oder false sein (oder weglassen)', 'request');
206
+ }
207
+ if (options.tipRefundSource !== undefined && !(0, index_js_2.isTipRefundSource)(options.tipRefundSource)) {
208
+ throw new errors_js_1.KasseneckValidationError('cancelReceipt', `tipRefundSource: erlaubt sind ${index_js_2.TIP_REFUND_SOURCES.join(', ')}`, 'request');
209
+ }
210
+ if (options.tipRefundSource !== undefined && options.refundTip === false) {
211
+ throw new errors_js_1.KasseneckValidationError('cancelReceipt', 'tipRefundSource nur, wenn das Trinkgeld zurueckgeht (refundTip nicht false)', 'request');
212
+ }
194
213
  const altfeld = ALTE_ZAHLFELDER.find((feld) => options[feld] != null);
195
214
  if (altfeld != null) {
196
215
  throw new errors_js_1.KasseneckValidationError('cancelReceipt', `${altfeld} gibt es unter /v3 nicht mehr: Rueckzahlungen gehen als payments hinaus.`, 'request');
@@ -213,6 +232,12 @@ async function cancelReceipt(transport, options) {
213
232
  params.note = options.note;
214
233
  if (zahlungen !== undefined)
215
234
  params.payments = zahlungen;
235
+ if (options.drawerId !== undefined)
236
+ params.drawerId = ladeKennung('cancelReceipt', options.drawerId);
237
+ if (options.refundTip !== undefined)
238
+ params.refundTip = options.refundTip;
239
+ if (options.tipRefundSource !== undefined)
240
+ params.tipRefundSource = options.tipRefundSource;
216
241
  const daten = await transport('cancelReceipt', params);
217
242
  return (0, errors_js_1.signiertGelesen)('cancelReceipt', () => stornoAusHuelle(daten));
218
243
  }
@@ -533,6 +558,14 @@ function gepruefterTip(tip) {
533
558
  }
534
559
  nutzlast['receivedImmediately'] = tip.receivedImmediately;
535
560
  }
561
+ if (tip.keptByEmployee != null) {
562
+ if (typeof tip.keptByEmployee !== 'boolean') {
563
+ throw eingabefehler('Trinkgeld: keptByEmployee muss true oder false sein.');
564
+ }
565
+ // `false` ist dasselbe wie weglassen: die Nutzlast bleibt wie bisher.
566
+ if (tip.keptByEmployee)
567
+ nutzlast['keptByEmployee'] = true;
568
+ }
536
569
  if (tip.recipients != null) {
537
570
  if (!Array.isArray(tip.recipients) || tip.recipients.length === 0) {
538
571
  throw eingabefehler('Trinkgeld: recipients darf nicht leer sein.');
@@ -557,7 +590,7 @@ function gepruefterTip(tip) {
557
590
  }
558
591
  return nutzlast;
559
592
  }
560
- const TIP_FELDER = ['cents', 'paymentMethod', 'recipients', 'receivedImmediately'];
593
+ const TIP_FELDER = ['cents', 'paymentMethod', 'recipients', 'receivedImmediately', 'keptByEmployee'];
561
594
  /**
562
595
  * Zahlungsart des Aufrufers pruefen — unbekannt wirft, bevor etwas rausgeht.
563
596
  * `mixed` wirft ebenfalls: den Wert vergibt nur der Server (Beleg mit
@@ -1,5 +1,5 @@
1
1
  export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
2
- export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
2
+ export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
3
3
  export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type TransportCallOptions, type KasseneckTransport, type KasseneckBinaryTransport, type KasseneckPdfOrDataTransport, type PdfOrData, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, createPdfOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, type CashregisterReportPeriod, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
4
4
  export { type ReceiptDueTip, type ReceiptDueTipRecipient, type ReceiptDueOptions, type ReceiptDueBuckets, type ReceiptDueBreakdown, type ReceiptDueErrorReason, receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, } from './receipt/due.js';
5
5
  export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
package/dist/cjs/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.receiptFieldErrors = exports.isReceiptError = exports.receiptErrorCode = exports.isReceiptErrorCode = exports.RECEIPT_ERROR_CODES = exports.receiptEmailFieldErrors = exports.isReceiptEmailError = exports.receiptEmailErrorCode = exports.isReceiptEmailErrorCode = exports.RECEIPT_EMAIL_VIAS = exports.RECEIPT_EMAIL_SEND_ERROR_CODES = exports.RECEIPT_EMAIL_ERROR_CODES = exports.paymentFieldErrors = exports.isPaymentError = exports.paymentErrorCode = exports.isPaymentErrorCode = exports.PAYMENT_ERROR_CODES = exports.toReceiptPaymentPayload = exports.fromReceiptPaymentPayload = exports.cancellationFieldErrors = exports.isCancellationError = exports.cancellationErrorCode = exports.isCancellationErrorCode = exports.isReturnDisposition = exports.isCancellationReason = exports.CANCELLATION_RESERVATION_MS = exports.CANCELLATION_ERROR_CODES = exports.CANCELLATION_STATUSES = exports.CANCELLATION_REASONS = exports.RETURN_DISPOSITIONS = exports.receiptSumCents = exports.receiptSubSumCents = exports.fromReceiptPayload = exports.toReceiptPayload = exports.voucherIsValid = exports.fromVoucherPayload = exports.toVoucherPayload = exports.isTipItem = exports.negateReceiptItem = exports.receiptItemIsValid = exports.receiptItemTotalCents = exports.fromReceiptItemPayload = exports.toReceiptItemPayload = exports.StripeLinkMode = exports.VoucherAction = exports.VoucherType = exports.CreditCardProvider = exports.KeckPaymentMethod = exports.VatRate = exports.ReceiptType = void 0;
4
- exports.getReceipt = exports.zeroReceipt = exports.cancelReceipt = exports.receiptLayoutFromResult = exports.cardRefundReference = exports.paymentsExpectedCents = exports.sellReceiptWithCompany = exports.sellReceipt = exports.isOutcomeUnknown = exports.isKasseneckValidationError = exports.isKasseneckNetworkError = exports.isKasseneckHttpError = exports.isKasseneckAuthError = exports.isKasseneckApiError = exports.CLIENT_ERROR_CODES = exports.KasseneckValidationError = exports.KasseneckNetworkError = exports.KasseneckHttpError = exports.KasseneckAuthError = exports.KasseneckApiError = exports.createPdfOrDataTransport = exports.createBinaryTransport = exports.createTransport = exports.UNKNOWN_OUTCOME_CALLS = exports.POS_CALLS = exports.PUBLIC_CALLS = exports.ALL_CALLS = exports.DEFAULT_TIMEOUT_MS = exports.POS_BASE_URL = exports.DEFAULT_BASE_URL = exports.registerUserAuth = exports.apiKeyAuth = exports.hobexReceiptNeedsSignature = exports.hobexReceiptToCardPaymentData = exports.fromHobexReceiptPayload = exports.toHobexReceiptPayload = exports.fromStripeUrlSessionPayload = exports.toStripeUrlSessionPayload = exports.reportMonthReadable = exports.reportMonthKey = exports.nextReportMonth = exports.previousReportMonth = exports.reportMonthFromDate = exports.isZeroKind = exports.ZERO_KINDS = exports.fromReceiptSummaryPayload = exports.fromCashregisterPayload = exports.receiptCompanyTaxInfo = exports.fromReceiptCompanyPayload = exports.remainingQuantities = void 0;
5
- exports.stockViewOf = exports.receiptsScopeOf = exports.cancelScopeOf = exports.distributeDiscount = exports.setMyRegisterDeviceSettings = exports.setMyPosSettings = exports.getPosSettings = exports.listMyArticles = exports.listMyArticleGroups = exports.fromPosArticlePayload = exports.fromArticleGroupPayload = exports.mergePosSettings = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.toViennaWallClock = exports.parseServerTimeStamp = exports.isReceiptDueError = exports.RECEIPT_DUE_ERROR_REASONS = exports.ReceiptDueError = exports.receiptDueBreakdown = exports.receiptDueCents = exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.getReportV2 = exports.getCashregisterReport = exports.downloadMonthlyReport = exports.downloadDailyReport = exports.sendReceiptEmail = exports.checkVoucherCombinationError = exports.listMyCashregisters = exports.listMyReceipts = exports.getFirstReceiptDate = exports.generateFullReceiptId = exports.getReceiptWithCompany = void 0;
3
+ exports.isReceiptError = exports.receiptErrorCode = exports.isReceiptErrorCode = exports.RECEIPT_ERROR_CODES = exports.receiptEmailFieldErrors = exports.isReceiptEmailError = exports.receiptEmailErrorCode = exports.isReceiptEmailErrorCode = exports.RECEIPT_EMAIL_VIAS = exports.RECEIPT_EMAIL_SEND_ERROR_CODES = exports.RECEIPT_EMAIL_ERROR_CODES = exports.paymentFieldErrors = exports.isPaymentError = exports.paymentErrorCode = exports.isPaymentErrorCode = exports.PAYMENT_ERROR_CODES = exports.toReceiptPaymentPayload = exports.fromReceiptPaymentPayload = exports.cancellationFieldErrors = exports.isCancellationError = exports.cancellationErrorCode = exports.isCancellationErrorCode = exports.isReturnDisposition = exports.isCancellationReason = exports.CANCELLATION_RESERVATION_MS = exports.CANCELLATION_ERROR_CODES = exports.CANCELLATION_STATUSES = exports.CANCELLATION_REASONS = exports.RETURN_DISPOSITIONS = exports.receiptValueVoucherSign = exports.receiptSumCents = exports.receiptSubSumCents = exports.fromReceiptPayload = exports.toReceiptPayload = exports.voucherIsValid = exports.fromVoucherPayload = exports.toVoucherPayload = exports.isTipItem = exports.negateReceiptItem = exports.receiptItemIsValid = exports.receiptItemTotalCents = exports.fromReceiptItemPayload = exports.toReceiptItemPayload = exports.StripeLinkMode = exports.VoucherAction = exports.VoucherType = exports.CreditCardProvider = exports.KeckPaymentMethod = exports.VatRate = exports.ReceiptType = void 0;
4
+ exports.isOutcomeUnknown = exports.isKasseneckValidationError = exports.isKasseneckNetworkError = exports.isKasseneckHttpError = exports.isKasseneckAuthError = exports.isKasseneckApiError = exports.CLIENT_ERROR_CODES = exports.KasseneckValidationError = exports.KasseneckNetworkError = exports.KasseneckHttpError = exports.KasseneckAuthError = exports.KasseneckApiError = exports.createPdfOrDataTransport = exports.createBinaryTransport = exports.createTransport = exports.UNKNOWN_OUTCOME_CALLS = exports.POS_CALLS = exports.PUBLIC_CALLS = exports.ALL_CALLS = exports.DEFAULT_TIMEOUT_MS = exports.POS_BASE_URL = exports.DEFAULT_BASE_URL = exports.registerUserAuth = exports.apiKeyAuth = exports.hobexReceiptNeedsSignature = exports.hobexReceiptToCardPaymentData = exports.fromHobexReceiptPayload = exports.toHobexReceiptPayload = exports.fromStripeUrlSessionPayload = exports.toStripeUrlSessionPayload = exports.reportMonthReadable = exports.reportMonthKey = exports.nextReportMonth = exports.previousReportMonth = exports.reportMonthFromDate = exports.isZeroKind = exports.ZERO_KINDS = exports.fromReceiptSummaryPayload = exports.fromCashregisterPayload = exports.receiptCompanyTaxInfo = exports.fromReceiptCompanyPayload = exports.asksRefundTip = exports.asksTipRefundSource = exports.cancellationCashRefundCents = exports.cancellationItemsForTip = exports.openStaffTipCents = exports.isTipRefundSource = exports.TIP_REFUND_SOURCES = exports.remainingQuantities = exports.receiptFieldErrors = void 0;
5
+ exports.stockViewOf = exports.receiptsScopeOf = exports.cancelScopeOf = exports.distributeDiscount = exports.setMyRegisterDeviceSettings = exports.setMyPosSettings = exports.getPosSettings = exports.listMyArticles = exports.listMyArticleGroups = exports.fromPosArticlePayload = exports.fromArticleGroupPayload = exports.mergePosSettings = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.toViennaWallClock = exports.parseServerTimeStamp = exports.isReceiptDueError = exports.RECEIPT_DUE_ERROR_REASONS = exports.ReceiptDueError = exports.receiptDueBreakdown = exports.receiptDueCents = exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.getReportV2 = exports.getCashregisterReport = exports.downloadMonthlyReport = exports.downloadDailyReport = exports.sendReceiptEmail = exports.checkVoucherCombinationError = exports.listMyCashregisters = exports.listMyReceipts = exports.getFirstReceiptDate = exports.generateFullReceiptId = exports.getReceiptWithCompany = exports.getReceipt = exports.zeroReceipt = exports.cancelReceipt = exports.receiptLayoutFromResult = exports.cardRefundReference = exports.paymentsExpectedCents = exports.sellReceiptWithCompany = exports.sellReceipt = void 0;
6
6
  var index_js_1 = require("./enums/index.js");
7
7
  Object.defineProperty(exports, "ReceiptType", { enumerable: true, get: function () { return index_js_1.ReceiptType; } });
8
8
  Object.defineProperty(exports, "VatRate", { enumerable: true, get: function () { return index_js_1.VatRate; } });
@@ -25,6 +25,7 @@ Object.defineProperty(exports, "toReceiptPayload", { enumerable: true, get: func
25
25
  Object.defineProperty(exports, "fromReceiptPayload", { enumerable: true, get: function () { return index_js_2.fromReceiptPayload; } });
26
26
  Object.defineProperty(exports, "receiptSubSumCents", { enumerable: true, get: function () { return index_js_2.receiptSubSumCents; } });
27
27
  Object.defineProperty(exports, "receiptSumCents", { enumerable: true, get: function () { return index_js_2.receiptSumCents; } });
28
+ Object.defineProperty(exports, "receiptValueVoucherSign", { enumerable: true, get: function () { return index_js_2.receiptValueVoucherSign; } });
28
29
  Object.defineProperty(exports, "RETURN_DISPOSITIONS", { enumerable: true, get: function () { return index_js_2.RETURN_DISPOSITIONS; } });
29
30
  Object.defineProperty(exports, "CANCELLATION_REASONS", { enumerable: true, get: function () { return index_js_2.CANCELLATION_REASONS; } });
30
31
  Object.defineProperty(exports, "CANCELLATION_STATUSES", { enumerable: true, get: function () { return index_js_2.CANCELLATION_STATUSES; } });
@@ -56,6 +57,13 @@ Object.defineProperty(exports, "receiptErrorCode", { enumerable: true, get: func
56
57
  Object.defineProperty(exports, "isReceiptError", { enumerable: true, get: function () { return index_js_2.isReceiptError; } });
57
58
  Object.defineProperty(exports, "receiptFieldErrors", { enumerable: true, get: function () { return index_js_2.receiptFieldErrors; } });
58
59
  Object.defineProperty(exports, "remainingQuantities", { enumerable: true, get: function () { return index_js_2.remainingQuantities; } });
60
+ Object.defineProperty(exports, "TIP_REFUND_SOURCES", { enumerable: true, get: function () { return index_js_2.TIP_REFUND_SOURCES; } });
61
+ Object.defineProperty(exports, "isTipRefundSource", { enumerable: true, get: function () { return index_js_2.isTipRefundSource; } });
62
+ Object.defineProperty(exports, "openStaffTipCents", { enumerable: true, get: function () { return index_js_2.openStaffTipCents; } });
63
+ Object.defineProperty(exports, "cancellationItemsForTip", { enumerable: true, get: function () { return index_js_2.cancellationItemsForTip; } });
64
+ Object.defineProperty(exports, "cancellationCashRefundCents", { enumerable: true, get: function () { return index_js_2.cancellationCashRefundCents; } });
65
+ Object.defineProperty(exports, "asksTipRefundSource", { enumerable: true, get: function () { return index_js_2.asksTipRefundSource; } });
66
+ Object.defineProperty(exports, "asksRefundTip", { enumerable: true, get: function () { return index_js_2.asksRefundTip; } });
59
67
  Object.defineProperty(exports, "fromReceiptCompanyPayload", { enumerable: true, get: function () { return index_js_2.fromReceiptCompanyPayload; } });
60
68
  Object.defineProperty(exports, "receiptCompanyTaxInfo", { enumerable: true, get: function () { return index_js_2.receiptCompanyTaxInfo; } });
61
69
  Object.defineProperty(exports, "fromCashregisterPayload", { enumerable: true, get: function () { return index_js_2.fromCashregisterPayload; } });
@@ -126,7 +126,7 @@ export type InventoryErrorCode = (typeof INVENTORY_ERROR_CODES)[number];
126
126
  * `route_missing` (Code des Pakets). Dieselbe Ableitung wie bei der
127
127
  * Rechnungs-API.
128
128
  */
129
- export declare const INVENTORY_REQUEST_ERROR_CODES: readonly ["account_not_found", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing"];
129
+ export declare const INVENTORY_REQUEST_ERROR_CODES: readonly ["account_not_found", "action_confirmation_required", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing"];
130
130
  export type InventoryRequestErrorCode = (typeof INVENTORY_REQUEST_ERROR_CODES)[number];
131
131
  /**
132
132
  * Hinweise einer Buchung (`warnings[].code`, `warningCodes.inventory`). Sie sind