@kreiseck/kasseneck-api 1.10.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +241 -0
- package/dist/cjs/client/aufrufe.d.ts +5 -5
- package/dist/cjs/client/aufrufe.js +22 -2
- package/dist/cjs/client/errors.js +2 -0
- package/dist/cjs/client/receipts.d.ts +34 -1
- package/dist/cjs/client/receipts.js +34 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +9 -2
- package/dist/cjs/inventory/vertrag.d.ts +1 -1
- package/dist/cjs/inventory/vertrag.js +2 -0
- package/dist/cjs/invoice/vertrag.d.ts +1 -1
- package/dist/cjs/invoice/vertrag.js +2 -0
- package/dist/cjs/models/cancellation.d.ts +49 -1
- package/dist/cjs/models/cancellation.js +139 -1
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/index.js +9 -2
- package/dist/cjs/models/payment-errors.d.ts +1 -1
- package/dist/cjs/models/payment-errors.js +2 -0
- package/dist/cjs/models/receipt-email.d.ts +1 -1
- package/dist/cjs/models/receipt-email.js +2 -0
- package/dist/cjs/models/receipt-errors.d.ts +1 -1
- package/dist/cjs/models/receipt-errors.js +2 -0
- package/dist/cjs/models/receipt-item.d.ts +10 -0
- package/dist/cjs/models/receipt-item.js +3 -0
- package/dist/cjs/pos/client.js +10 -0
- package/dist/cjs/pos/errors.d.ts +4 -3
- package/dist/cjs/pos/errors.js +21 -2
- package/dist/cjs/pos/index.d.ts +6 -2
- package/dist/cjs/pos/index.js +33 -3
- package/dist/cjs/pos/schicht-lesen.d.ts +39 -0
- package/dist/cjs/pos/schicht-lesen.js +405 -0
- package/dist/cjs/pos/schicht-typen.d.ts +380 -0
- package/dist/cjs/pos/schicht-typen.js +59 -0
- package/dist/cjs/pos/schicht.d.ts +208 -0
- package/dist/cjs/pos/schicht.js +235 -0
- package/dist/cjs/pos/settings.d.ts +37 -1
- package/dist/cjs/pos/settings.js +43 -3
- package/dist/cjs/pos/texte.d.ts +627 -0
- package/dist/cjs/pos/texte.js +236 -0
- package/dist/cjs/react/index.js +1 -1
- package/dist/cjs/receipt/grid.js +2 -2
- package/dist/cjs/receipt/layout.d.ts +5 -0
- package/dist/cjs/receipt/shift-sheet.d.ts +33 -0
- package/dist/cjs/receipt/shift-sheet.js +207 -0
- package/dist/cjs/register/errors.d.ts +1 -1
- package/dist/cjs/register/errors.js +2 -0
- package/dist/cjs/stored/draht.d.ts +1 -1
- package/dist/cjs/stored/draht.js +4 -3
- package/dist/cjs/stored/einstellungen.js +26 -3
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +118 -12
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/aufrufe.d.ts +5 -5
- package/dist/esm/client/aufrufe.js +22 -2
- package/dist/esm/client/errors.js +2 -0
- package/dist/esm/client/receipts.d.ts +34 -1
- package/dist/esm/client/receipts.js +35 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/inventory/vertrag.d.ts +1 -1
- package/dist/esm/inventory/vertrag.js +2 -0
- package/dist/esm/invoice/vertrag.d.ts +1 -1
- package/dist/esm/invoice/vertrag.js +2 -0
- package/dist/esm/models/cancellation.d.ts +49 -1
- package/dist/esm/models/cancellation.js +132 -0
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/esm/models/payment-errors.d.ts +1 -1
- package/dist/esm/models/payment-errors.js +2 -0
- package/dist/esm/models/receipt-email.d.ts +1 -1
- package/dist/esm/models/receipt-email.js +2 -0
- package/dist/esm/models/receipt-errors.d.ts +1 -1
- package/dist/esm/models/receipt-errors.js +2 -0
- package/dist/esm/models/receipt-item.d.ts +10 -0
- package/dist/esm/models/receipt-item.js +3 -0
- package/dist/esm/pos/client.js +11 -1
- package/dist/esm/pos/errors.d.ts +4 -3
- package/dist/esm/pos/errors.js +21 -2
- package/dist/esm/pos/index.d.ts +6 -2
- package/dist/esm/pos/index.js +7 -2
- package/dist/esm/pos/schicht-lesen.d.ts +39 -0
- package/dist/esm/pos/schicht-lesen.js +392 -0
- package/dist/esm/pos/schicht-typen.d.ts +380 -0
- package/dist/esm/pos/schicht-typen.js +56 -0
- package/dist/esm/pos/schicht.d.ts +208 -0
- package/dist/esm/pos/schicht.js +222 -0
- package/dist/esm/pos/settings.d.ts +37 -1
- package/dist/esm/pos/settings.js +40 -2
- package/dist/esm/pos/texte.d.ts +627 -0
- package/dist/esm/pos/texte.js +236 -0
- package/dist/esm/react/index.js +1 -1
- package/dist/esm/receipt/grid.js +2 -2
- package/dist/esm/receipt/layout.d.ts +5 -0
- package/dist/esm/receipt/shift-sheet.d.ts +33 -0
- package/dist/esm/receipt/shift-sheet.js +203 -0
- package/dist/esm/register/errors.d.ts +1 -1
- package/dist/esm/register/errors.js +2 -0
- package/dist/esm/stored/draht.d.ts +1 -1
- package/dist/esm/stored/draht.js +4 -3
- package/dist/esm/stored/einstellungen.js +27 -4
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +118 -12
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/cancellation-tip-cases.json +679 -0
- package/fixtures/expected/cash-movement.grid32.txt +15 -0
- package/fixtures/expected/cash-movement.grid48.txt +15 -0
- package/fixtures/expected/cash-movement.lines.json +171 -0
- package/fixtures/expected/shift-close-blind.grid32.txt +28 -0
- package/fixtures/expected/shift-close-blind.grid48.txt +27 -0
- package/fixtures/expected/shift-close-blind.lines.json +275 -0
- package/fixtures/expected/shift-close-put-in.grid32.txt +38 -0
- package/fixtures/expected/shift-close-put-in.grid48.txt +35 -0
- package/fixtures/expected/shift-close-put-in.lines.json +403 -0
- package/fixtures/expected/shift-close-take-out.grid32.txt +38 -0
- package/fixtures/expected/shift-close-take-out.grid48.txt +35 -0
- package/fixtures/expected/shift-close-take-out.lines.json +403 -0
- package/fixtures/expected/shift-close.grid32.txt +37 -0
- package/fixtures/expected/shift-close.grid48.txt +35 -0
- package/fixtures/expected/shift-close.lines.json +413 -0
- package/fixtures/expected/shift-interim.grid32.txt +28 -0
- package/fixtures/expected/shift-interim.grid48.txt +27 -0
- package/fixtures/expected/shift-interim.lines.json +293 -0
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +1 -1
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/pos-message-cases.json +45 -0
- package/fixtures/pos-texts.json +723 -1
- package/fixtures/receipt-due-generated.json +1 -1
- package/fixtures/shift-cases.json +87 -0
- package/fixtures/shift-receipts.json +41 -0
- package/fixtures/surface.json +119 -3
- package/fixtures/v3/antworten/belege.json +1 -1
- package/fixtures/v3/antworten/belegmail.json +1 -1
- package/fixtures/v3/antworten/kasse-belege.json +1 -1
- package/fixtures/v3/antworten/kasse.json +10874 -4865
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +1 -1
- package/fixtures/v3/antworten/storno.json +1 -1
- package/fixtures/v3/stored/belege.json +18 -6
- package/fixtures/v3/stored/kasse.json +4667 -183
- package/fixtures/v3/stored/rechnungen.json +1 -1
- package/fixtures/v3/v3-vokabular.json +739 -32
- package/fixtures/v3/zahlbetrag-faelle.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,247 @@ 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.0
|
|
8
|
+
|
|
9
|
+
Shifts, cash position and drawer log at the register: `./pos` gains the six
|
|
10
|
+
calls of the register path, the catalogues, three helpers, the texts and the
|
|
11
|
+
receipt layouts for the Z report, the X report and a cash movement. Reason:
|
|
12
|
+
the register knew sales, but not the cash in the drawer. A business with
|
|
13
|
+
several people at one drawer could not hand over, count against an expected
|
|
14
|
+
amount, book a cash drop or a change float, pay out tips or prove why the
|
|
15
|
+
drawer was opened without a sale. The backend now keeps drawers, shifts and
|
|
16
|
+
cash movements (never signed, not a turnover), and the web register and the
|
|
17
|
+
app need it through the package with the same words and the same receipts.
|
|
18
|
+
|
|
19
|
+
Additive at runtime; existing calls send the same bytes as in 1.10.1 (a
|
|
20
|
+
receipt or cancellation without `drawerId` is unchanged). The unions
|
|
21
|
+
`ApiCall`, `PosCall`, `PosErrorCode`, `MessageKey` and `LabelKey` gain
|
|
22
|
+
members, so an exhaustive `switch` with a `never` check needs the new cases.
|
|
23
|
+
|
|
24
|
+
- **Calls** (`./pos`, register path only, `registerUserAuth`):
|
|
25
|
+
`getMyDrawerState(transport, { drawerId?, cashregisterId? })` (no right
|
|
26
|
+
needed; `rights { shift, cashMove, cashView, drawer }`, the open shift,
|
|
27
|
+
`tipClaims`, and with `cashView` `expectedCents`, `suggestedFloatCents`,
|
|
28
|
+
`recentOpenings`), `openMyShift` (`openingFloatCents` with optional
|
|
29
|
+
`denominations`, or `takeOver: true`, exactly one), `recordMyCashMovement`
|
|
30
|
+
(`type`, `amountCents`, optional `location` `bank` | `safe`, `note`, `recipientId`,
|
|
31
|
+
`targetDrawerId`; answers the movement and the receipt data),
|
|
32
|
+
`logMyDrawerOpenings` (1–50 entries, each with its own `idempotencyKey`,
|
|
33
|
+
optionally `drawerId` and the `operator` who opened the drawer while the
|
|
34
|
+
entry was buffered; answers `accepted`, `duplicates` and the effective
|
|
35
|
+
`drawerId`, the main drawer for a decommissioned one), `getMyShiftReport` (shift, movements,
|
|
36
|
+
X report or Z report for a reprint) and `closeMyShift` (answers
|
|
37
|
+
`status: 'recount'`, which is not an error, or `status: 'closed'` with the
|
|
38
|
+
shift, the Z report and `lastShiftOfRegister`; the server counts the
|
|
39
|
+
attempts, at most two, `attempt` is accepted but has no effect).
|
|
40
|
+
- **Blind count**: without the right `cashView` the server sends no expected
|
|
41
|
+
amount, no counted amount, no running totals and no suggestion. The models
|
|
42
|
+
are the wire form field by field: such a field is then absent, never `0`.
|
|
43
|
+
On the receipt data (`ShiftSummaryReceipt`) the same values are `null`.
|
|
44
|
+
- **Without the right `shift`** `getMyDrawerState` still sends the open shift,
|
|
45
|
+
but only its basic data (`id`, `drawerId`, `cashregisterId`, `number`,
|
|
46
|
+
`status`, `openedAt`, `openedBy`); the register sells into it. Every other
|
|
47
|
+
field of `Shift` is therefore optional. Reason: a user without the right
|
|
48
|
+
saw no shift and the register blocked the sale although one was open.
|
|
49
|
+
- **Models**: `DrawerState`, `Shift`, `ShiftRunningTotals` (maps go out as
|
|
50
|
+
lists: `nonCashByMethod: [{ method, cents }]`, `tips: [{ registerUserId,
|
|
51
|
+
name, … }]`), `ShiftReconciliation`, `CashMovement`, `TipClaim`,
|
|
52
|
+
`DrawerOpening`, `ShiftSummaryReceipt` (`kind` `shift_close` |
|
|
53
|
+
`shift_interim`), `CashMovementReceipt` (`kind` `cash_movement`) and the
|
|
54
|
+
results `OpenShiftResult`, `CashMovementResult`, `DrawerOpeningsResult`,
|
|
55
|
+
`ShiftReport`, `CloseShiftResult`. An amount, count or number that is not
|
|
56
|
+
an integer and an unknown `status` or `kind` are response errors.
|
|
57
|
+
- **Idempotency and outcome**: `openMyShift`, `recordMyCashMovement`,
|
|
58
|
+
`logMyDrawerOpenings` and `closeMyShift` are in `UNKNOWN_OUTCOME_CALLS`:
|
|
59
|
+
after `outcome: 'unknown'` resend with the **same** key, the server books
|
|
60
|
+
once. `getMyDrawerState` and `getMyShiftReport` are reads.
|
|
61
|
+
`newIdempotencyKey()` draws a fresh key for a new action (`kasse-` and 32
|
|
62
|
+
hex characters from `crypto.getRandomValues`, the form of the register app).
|
|
63
|
+
- **Error codes**: `shift_mode_off` (`openMyShift` on a drawer without shift
|
|
64
|
+
mode) with the text `shift.mode_off`; the text of `recount_exhausted` asks
|
|
65
|
+
for the amount of the second count (a comment is only needed above the
|
|
66
|
+
threshold, `comment_required`). The lists of request error codes and
|
|
67
|
+
`PAYMENT_CALL_REJECTED_CODES` gain `second_factor_required` and
|
|
68
|
+
`action_confirmation_required`. Reason: the backend /v3 contract contains
|
|
69
|
+
them since keck#657 (confirmation in the Kasseneck app, rejected before the
|
|
70
|
+
handler).
|
|
71
|
+
- **Checked before sending**, nothing else: `drawerId`, `shiftId`, the key
|
|
72
|
+
(also per drawer opening), a non-empty `entries` list and amounts,
|
|
73
|
+
denomination counts and tip payouts as integers. Catalogue, mandatory
|
|
74
|
+
fields per type, balance and claims are left to the server.
|
|
75
|
+
- **Catalogues**: `EUR_DENOMINATIONS` (cents, largest note first),
|
|
76
|
+
`MOVEMENT_TYPES`, `MANUAL_MOVEMENT_TYPES` (the eight the register may send),
|
|
77
|
+
`CASH_LOCATIONS`, `OPENING_REASONS`, `MANUAL_OPENING_REASONS`,
|
|
78
|
+
`SHIFT_RECEIPT_KINDS`, each the contract catalogue in its order.
|
|
79
|
+
- **Helpers**: `sumDenominations(denominations)` (sum in cents, `null` for an
|
|
80
|
+
unknown value or a count that is not an integer from 0 to 100 000, the rule
|
|
81
|
+
of the server) and `parseCentsAllowZero(text)` (typed amount to cents
|
|
82
|
+
without floating point; `0` is valid, comma or point with one or two
|
|
83
|
+
decimals, no thousands separator). Their cases are shared with the Dart twin
|
|
84
|
+
in the new `fixtures/shift-cases.json`.
|
|
85
|
+
- **Receipts**: `shiftReceiptLayout(receipt, { paperSize })` (title
|
|
86
|
+
„Schichtabschluss“ or „Zwischenbericht“ by `kind`) and
|
|
87
|
+
`cashMovementLayout(receipt, { paperSize })` build the usual line model
|
|
88
|
+
(`ReceiptLayout`, grid, sheet, ESC/POS, ePOS). A line whose value is `null` (blind: expected,
|
|
89
|
+
counted, difference, cash sales, counted denominations) is left out, never
|
|
90
|
+
printed as „0,00“. Goldens from the contract answers, so layout and contract
|
|
91
|
+
cannot drift: `fixtures/expected/shift-close.*`, `shift-close-blind.*`,
|
|
92
|
+
`shift-interim.*`, `cash-movement.*` (lines, 32 and 48 character grid),
|
|
93
|
+
sources and checksums in the new `fixtures/shift-receipts.json`. The
|
|
94
|
+
receipt goldens of 1.10.1 are byte for byte unchanged.
|
|
95
|
+
- **Cash position and tip list at the register**: `ShiftRunningTotals.voucherRedeemedCents`
|
|
96
|
+
(redeemed vouchers, not cash; 0 when an older server omits it), the helper
|
|
97
|
+
`durationText(minutes)` („8 Std. 32 Min.“, „1 Tag 3 Std.“; cases in
|
|
98
|
+
`fixtures/shift-cases.json`) and the texts for the new cash position card and
|
|
99
|
+
the tip payout list (`shift.*`, `duration.*`, `tip_payout.*`,
|
|
100
|
+
`cash_movement.pay_in_short|pay_out_short`, `drawer.recent_openings_full`).
|
|
101
|
+
- **Printer warning**: four short labels for the quiet warning line at the print buttons
|
|
102
|
+
(`printer.warn_unreachable`, `printer.warn_none`, `printer.check`, `printer.set_up`).
|
|
103
|
+
- **Change float and take out / put in at shift close**: a drawer can keep a fixed
|
|
104
|
+
change float; after counting, the register takes out the rest or puts money in.
|
|
105
|
+
`DrawerInfo.changeFloatCents` and `DrawerState.suggestedFromShiftNumber` (only
|
|
106
|
+
when sent), `CloseMyShiftOptions.afterCount` (`{ type: 'cash_drop' | 'change_in',
|
|
107
|
+
amountCents }`, catalogue `AFTER_COUNT_TYPES`, only the shape is checked before
|
|
108
|
+
sending), `Shift.afterCount`/`leftInDrawerCents`, `ShiftSummaryReceipt.afterCount`/
|
|
109
|
+
`leftInDrawerCents` (blind `null`) and `afterCountReceipt` on the close result
|
|
110
|
+
(the envelope receipt). New code `after_count_not_permitted` in
|
|
111
|
+
`POS_ERROR_CODES`. `shiftReceiptLayout` prints, after a rule below the count,
|
|
112
|
+
„Entnommen“ (negative) or „Eingelegt“ and „Bleibt in der Kassenlade“ (bold); without
|
|
113
|
+
`afterCount` the Z report is byte-identical. For the bold line,
|
|
114
|
+
`LayoutColumnsLine` gains an optional `bold` (only written when `true`; grid,
|
|
115
|
+
ESC/POS, ePOS, sheet and React follow it, every existing output is unchanged).
|
|
116
|
+
New goldens `shift-close-take-out`, `shift-close-put-in`; texts `drawer.change_float*`,
|
|
117
|
+
`shift.*` for the step „Geld entnehmen“, `shift_receipt.taken_out|put_in|left_in_drawer`,
|
|
118
|
+
`shift.counted|back|done|edit_amount` (row „Gezählt“, „Zurück“, step „Fertig“,
|
|
119
|
+
accessibility label „{title} ändern“), message `shift.change_float_missing`; the
|
|
120
|
+
bold column line is pinned in the byte twin test. Reason: the drawer kept everything after a
|
|
121
|
+
shift, so the next shift started with the whole day's cash.
|
|
122
|
+
- **Texts** (`fixtures/pos-texts.json`): messages `shift.*`,
|
|
123
|
+
`shift.required_other` (shift mode on, no shift open, the signed-in user
|
|
124
|
+
lacks the `shift` right), `cash_movement.*`, `tip_payout.exceeds_claim`, `denominations.invalid`,
|
|
125
|
+
`amount.invalid`, `drawer.not_found`, `drawer.inactive`; labels for the
|
|
126
|
+
screens (`shift.*`, `drawer.reason_*`), one per movement type
|
|
127
|
+
(`cash_movement.type_*`) and the receipt lines (`shift_receipt.*`).
|
|
128
|
+
`ERROR_CODE_RULES` gains a rule for every new code (`shift_not_open`,
|
|
129
|
+
`shift_already_open`, `shift_closed`, `comment_required`,
|
|
130
|
+
`recount_exhausted`, `cash_movement_exceeds_balance`, `note_required`,
|
|
131
|
+
`invalid_movement_type`, `transfer_same_drawer`, `tip_payout_exceeds_claim`,
|
|
132
|
+
`invalid_denominations`, `invalid_amount`, `drawer_not_found`,
|
|
133
|
+
`drawer_inactive`): the register says what to do instead of the backend
|
|
134
|
+
sentence. `validation`, `module_inactive` and `not_permitted` keep the
|
|
135
|
+
readable sentence of the server, as before.
|
|
136
|
+
- **Bank or safe is optional**: `location` on `change_in` and `cash_drop` is
|
|
137
|
+
checked only when given (`bank` | `safe`, otherwise refused before sending);
|
|
138
|
+
the movement receipt prints „Ort“ only when it is set, the label of
|
|
139
|
+
`change_in` is „Wechselgeld“, and no shift receipt prints „Kein
|
|
140
|
+
Registrierkassenbeleg“ (the text `shift.not_a_receipt` is gone). Reason:
|
|
141
|
+
the register no longer asks where the change came from or the drop went,
|
|
142
|
+
the answer had no use for the cash position, and the note at the foot was
|
|
143
|
+
not wanted on the slips.
|
|
144
|
+
- **Tips during the shift**: `DrawerState.tips` lists per employee what
|
|
145
|
+
the running shift earned (`receivedImmediatelyCents`, `retainedCents`),
|
|
146
|
+
what was already paid out from the drawer in this shift (`paidOutCents`)
|
|
147
|
+
and the open claim against the drawer (`openCents`), for every session,
|
|
148
|
+
also without `cashView`. `ShiftTipTotals` gains `paidOutCents`, the new
|
|
149
|
+
`ShiftTip` adds `openCents` (`ShiftReceiptTip` is now this type, the Z and
|
|
150
|
+
X report carry the open claim at closing or now). `recordMyCashMovement`
|
|
151
|
+
with `type: 'tip_payout'` and `recipientId` is unchanged; the server now
|
|
152
|
+
also lets a user with only the right `shift` pay out the own claim (another
|
|
153
|
+
employee's claim still needs `cashMove`). New helper
|
|
154
|
+
`shiftTipLines(tip)`: the lines of one employee as the register shows and
|
|
155
|
+
prints them, „verdient“ (immediate + retained) always, „über Lohn“,
|
|
156
|
+
„schon genommen“ and „offen“ only when not 0, no line at all when
|
|
157
|
+
everything is 0; its cases are in `fixtures/shift-cases.json`. The shift
|
|
158
|
+
receipts use it. Labels `shift_receipt.tip_earned` „verdient“ and
|
|
159
|
+
`shift_receipt.tip_open` „offen“ are new, `shift_receipt.tip_paid_out`
|
|
160
|
+
now reads „schon genommen“, `shift_receipt.tip_immediately` („sofort“) is
|
|
161
|
+
gone. Reason: staff take their tips at any time, not only at the end of
|
|
162
|
+
the shift, and the slip showed lines with 0,00 nobody needed.
|
|
163
|
+
- **Cash tip kept right away**: `TipOptions.keptByEmployee` (sent only when
|
|
164
|
+
`true`; anything but a boolean is refused before sending) marks a staff
|
|
165
|
+
cash tip the employee pockets at the sale. The receipt stays as it was
|
|
166
|
+
(signed, in the DEP); the tip position carries `keptByEmployee: true`
|
|
167
|
+
(`ReceiptItem.keptByEmployee`, read and mirrored on a cancellation). In
|
|
168
|
+
the cash position the amount is not part of the expected cash and counts
|
|
169
|
+
as „schon genommen“ at once (`paidOutCents`, no line of its own); the open
|
|
170
|
+
claim does not grow. The server takes it only for staff tips paid in cash
|
|
171
|
+
and received immediately, otherwise it drops it silently. New optional
|
|
172
|
+
business setting `tipKeptByDefault` (`POS_BUSINESS_OPTIONAL_FIELDS`, sent
|
|
173
|
+
by the server only when stored, missing = off; `posTipKeptByDefault(business)`)
|
|
174
|
+
presets the switch. Labels `checkout.tip_kept` „gleich behalten“ and
|
|
175
|
+
`tip.kept_setting`, message `tip.kept_setting_hint`. Reason: a waitress
|
|
176
|
+
who keeps 2 € of a 22 € cash payment left 20 € in the drawer while the
|
|
177
|
+
expected cash said 22 € — a difference that was none. The hint now says
|
|
178
|
+
„zählt nicht ins Soll der Lade“ (it never left the cash position).
|
|
179
|
+
- **Cancelling with or without the tip**: `cancelReceipt` takes `refundTip`
|
|
180
|
+
(answer to „Trinkgeld auch zurückgeben?“; `false` leaves the staff tip on
|
|
181
|
+
the receipt, without `items` = every remaining quantity except the tip;
|
|
182
|
+
`true` with `items` adds the open tip) and `tipRefundSource` (`drawer` |
|
|
183
|
+
`employee`, `TIP_REFUND_SOURCES`, only for a cash refund: from the drawer,
|
|
184
|
+
or the employee hands it back herself). Without both the payload is the
|
|
185
|
+
same as before (a full cancellation takes the tip along). A wrong value
|
|
186
|
+
or a source with `refundTip: false` is refused before sending. The rules
|
|
187
|
+
both registers ask by: `openStaffTipCents(receipt)` (> 0 = ask the first
|
|
188
|
+
question, also for a partial cancellation), `cancellationItemsForTip`,
|
|
189
|
+
`cancellationCashRefundCents` and `asksTipRefundSource` (second question
|
|
190
|
+
only when the cash of the refund covers the tip and the employee already
|
|
191
|
+
had it); shared cases in `fixtures/cancellation-tip-cases.json`.
|
|
192
|
+
`CANCELLATION_ERROR_CODES` gains `tip_refund_conflict`,
|
|
193
|
+
`invalid_tip_refund_source` and `tip_refund_source_requires_cash`. Labels
|
|
194
|
+
`cancellation.tip_refund_question/yes/no`,
|
|
195
|
+
`cancellation.tip_source_question/drawer/employee`, messages
|
|
196
|
+
`cancellation.tip_refund_missing` and `cancellation.tip_source_missing`.
|
|
197
|
+
Reason: a tip is a voluntary gift to the employee; whether it goes back
|
|
198
|
+
with a cancelled sale, and from whose pocket, is a decision at the
|
|
199
|
+
register, and the drawer, „verdient“, „schon genommen“ and „offen“ must
|
|
200
|
+
follow it. A negative „offen“ (the employee owes the drawer) prints with
|
|
201
|
+
a minus; `shiftTipLines` keeps it like any value other than 0.
|
|
202
|
+
With a value voucher on the receipt there is no „Nein“: `asksRefundTip`
|
|
203
|
+
is false there, the registers show `cancellation.tip_refunded_with_voucher`
|
|
204
|
+
and send `refundTip: true` (the server refuses `false` with
|
|
205
|
+
`tip_keep_not_possible_with_voucher`, added to `CANCELLATION_ERROR_CODES`),
|
|
206
|
+
because only a full cancellation reverses the voucher. `refundTip: true`
|
|
207
|
+
without `tipRefundSource` on a cash refund means: from the drawer. After
|
|
208
|
+
„Nein“ the tip line of the cancellation sheet reads `cancellation.tip_stays`
|
|
209
|
+
„bleibt“.
|
|
210
|
+
- **Tip handed back by the employee**: `ShiftTipTotals.refundedByEmployeeCents`
|
|
211
|
+
(„selbst zurückgegeben“, read as 0 when an older backend leaves it out) and
|
|
212
|
+
a line `shift_receipt.tip_refunded_by_employee` in `shiftTipLines` (only
|
|
213
|
+
when not 0). Reason: a cancellation where the employee hands the tip back
|
|
214
|
+
herself showed „schon genommen -2,00“ — correct, but read wrong; now
|
|
215
|
+
„schon genommen“ never goes negative this way, and
|
|
216
|
+
open = earned − taken + handed back.
|
|
217
|
+
- **Tip carried over from earlier shifts**: `ShiftTip.carriedOverCents`
|
|
218
|
+
(„aus früheren Schichten“, the drawer's open claim when the shift was
|
|
219
|
+
opened; without an open shift the whole claim; read as 0 when missing) and
|
|
220
|
+
the line `shift_receipt.tip_carried_over` first in `shiftTipLines` (only
|
|
221
|
+
when not 0). Reason: „verdient 9,00 · offen 15,00“ left 6,00 unexplained;
|
|
222
|
+
now open = carried over + earned − retained − taken + handed back, with
|
|
223
|
+
exactly the lines shown.
|
|
224
|
+
- **Device setting** `drawerId` (inner `ladeId`): the drawer of this device.
|
|
225
|
+
Optional like on the wire, without a default (`POS_DEVICE_OPTIONAL_FIELDS`):
|
|
226
|
+
present only when a drawer is assigned, written as an id or `null` (removes
|
|
227
|
+
the assignment). `./stored` reads it the same way.
|
|
228
|
+
- **Receipts and cancellations** take `drawerId` (`sellReceipt`,
|
|
229
|
+
`createReceipt` options, `cancelReceipt`): the drawer whose cash position
|
|
230
|
+
the receipt counts in; an empty id is refused before sending.
|
|
231
|
+
- **Errors**: `POS_ERROR_CODES` gains the codes of the six calls
|
|
232
|
+
(`drawer_not_found`, `drawer_inactive`, `shift_already_open`, `shift_mode_off`,
|
|
233
|
+
`shift_not_open`, `shift_closed`, `comment_required`, `recount_exhausted`,
|
|
234
|
+
`cash_movement_exceeds_balance`, `tip_payout_exceeds_claim`,
|
|
235
|
+
`invalid_amount`, `invalid_denominations`, `invalid_movement_type`,
|
|
236
|
+
`transfer_same_drawer`, `note_required`).
|
|
237
|
+
- **Contract**: `fixtures/v3/` pulled from the backend at the state of shifts
|
|
238
|
+
and cash position; the vocabulary of `./stored` regenerated (`drawerId` in
|
|
239
|
+
the device settings), and `./stored` drops `ladeId`, `schichtId` and
|
|
240
|
+
`ausserhalbSchicht` from a stored receipt like the server does.
|
|
241
|
+
- **Counts**: `POS_CALLS` 33 → 39 (33 register-only names).
|
|
242
|
+
- **Twin check**: the source fingerprints of `kasse-settings-core.js` (optional
|
|
243
|
+
device settings) and of `INTERNE_BELEG_FELDER` in `storno-core.js` in
|
|
244
|
+
`test/fixtures/stored-zwillinge.json` follow the backend; the behaviour
|
|
245
|
+
comparison of `./stored` against the backend is green.
|
|
246
|
+
- **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.
|
|
247
|
+
|
|
7
248
|
## 1.10.1
|
|
8
249
|
|
|
9
250
|
- 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
|
|
88
|
+
/** Einer der 39 Aufrufe des Kassenwegs. */
|
|
89
89
|
export declare function isPosCall(name: string): boolean;
|
|
90
90
|
/**
|
|
91
|
-
* Nur ueber den Kassenweg erreichbar (
|
|
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
|
|
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 (
|
|
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
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -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, 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
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.
|
|
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;
|
|
4
|
+
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.asksRefundTip = exports.asksTipRefundSource = exports.cancellationCashRefundCents = exports.cancellationItemsForTip = exports.openStaffTipCents = exports.isTipRefundSource = exports.TIP_REFUND_SOURCES = 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 = exports.getReceipt = exports.zeroReceipt = exports.cancelReceipt = exports.receiptLayoutFromResult = exports.cardRefundReference = exports.paymentsExpectedCents = exports.sellReceiptWithCompany = 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; } });
|
|
@@ -56,6 +56,13 @@ Object.defineProperty(exports, "receiptErrorCode", { enumerable: true, get: func
|
|
|
56
56
|
Object.defineProperty(exports, "isReceiptError", { enumerable: true, get: function () { return index_js_2.isReceiptError; } });
|
|
57
57
|
Object.defineProperty(exports, "receiptFieldErrors", { enumerable: true, get: function () { return index_js_2.receiptFieldErrors; } });
|
|
58
58
|
Object.defineProperty(exports, "remainingQuantities", { enumerable: true, get: function () { return index_js_2.remainingQuantities; } });
|
|
59
|
+
Object.defineProperty(exports, "TIP_REFUND_SOURCES", { enumerable: true, get: function () { return index_js_2.TIP_REFUND_SOURCES; } });
|
|
60
|
+
Object.defineProperty(exports, "isTipRefundSource", { enumerable: true, get: function () { return index_js_2.isTipRefundSource; } });
|
|
61
|
+
Object.defineProperty(exports, "openStaffTipCents", { enumerable: true, get: function () { return index_js_2.openStaffTipCents; } });
|
|
62
|
+
Object.defineProperty(exports, "cancellationItemsForTip", { enumerable: true, get: function () { return index_js_2.cancellationItemsForTip; } });
|
|
63
|
+
Object.defineProperty(exports, "cancellationCashRefundCents", { enumerable: true, get: function () { return index_js_2.cancellationCashRefundCents; } });
|
|
64
|
+
Object.defineProperty(exports, "asksTipRefundSource", { enumerable: true, get: function () { return index_js_2.asksTipRefundSource; } });
|
|
65
|
+
Object.defineProperty(exports, "asksRefundTip", { enumerable: true, get: function () { return index_js_2.asksRefundTip; } });
|
|
59
66
|
Object.defineProperty(exports, "fromReceiptCompanyPayload", { enumerable: true, get: function () { return index_js_2.fromReceiptCompanyPayload; } });
|
|
60
67
|
Object.defineProperty(exports, "receiptCompanyTaxInfo", { enumerable: true, get: function () { return index_js_2.receiptCompanyTaxInfo; } });
|
|
61
68
|
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
|
|
@@ -300,6 +300,7 @@ exports.INVENTORY_ERROR_CODES = [
|
|
|
300
300
|
*/
|
|
301
301
|
exports.INVENTORY_REQUEST_ERROR_CODES = [
|
|
302
302
|
'account_not_found',
|
|
303
|
+
'action_confirmation_required',
|
|
303
304
|
'admin_required',
|
|
304
305
|
'api_not_approved',
|
|
305
306
|
'app_check_invalid',
|
|
@@ -319,6 +320,7 @@ exports.INVENTORY_REQUEST_ERROR_CODES = [
|
|
|
319
320
|
'register_user_not_allowed',
|
|
320
321
|
'register_user_not_found',
|
|
321
322
|
'response_translation_failed',
|
|
323
|
+
'second_factor_required',
|
|
322
324
|
'session_expired',
|
|
323
325
|
'session_other_cashregister',
|
|
324
326
|
'unauthorized',
|