@kreiseck/kasseneck-api 1.17.1 → 1.19.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 +32 -0
- package/README.md +20 -8
- package/dist/cjs/client/index.d.ts +1 -1
- package/dist/cjs/client/index.js +3 -2
- package/dist/cjs/client/list-receipts.d.ts +48 -5
- package/dist/cjs/client/list-receipts.js +68 -3
- package/dist/cjs/client/receipts.d.ts +6 -0
- package/dist/cjs/client/receipts.js +8 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/models/index.d.ts +1 -0
- package/dist/cjs/models/index.js +6 -1
- package/dist/cjs/models/manual-receipt.d.ts +45 -0
- package/dist/cjs/models/manual-receipt.js +58 -0
- package/dist/cjs/models/receipt-summary.d.ts +4 -0
- package/dist/cjs/models/receipt-summary.js +6 -0
- package/dist/cjs/models/receipt.d.ts +9 -3
- package/dist/cjs/models/receipt.js +6 -0
- package/dist/cjs/receipt/layout.js +57 -0
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +23 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/index.d.ts +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/client/list-receipts.d.ts +48 -5
- package/dist/esm/client/list-receipts.js +67 -3
- package/dist/esm/client/receipts.d.ts +6 -0
- package/dist/esm/client/receipts.js +8 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.js +1 -0
- package/dist/esm/models/manual-receipt.d.ts +45 -0
- package/dist/esm/models/manual-receipt.js +53 -0
- package/dist/esm/models/receipt-summary.d.ts +4 -0
- package/dist/esm/models/receipt-summary.js +6 -0
- package/dist/esm/models/receipt.d.ts +9 -3
- package/dist/esm/models/receipt.js +6 -0
- package/dist/esm/receipt/layout.js +57 -0
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +23 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/expected/manual-receipt-range-device-failure-count.grid32.txt +36 -0
- package/fixtures/expected/manual-receipt-range-device-failure-count.grid48.txt +36 -0
- package/fixtures/expected/manual-receipt-range-device-failure-count.lines.json +299 -0
- package/fixtures/expected/manual-receipt-range-device-failure-count.sheet32.json +242 -0
- package/fixtures/expected/manual-receipt-range-device-failure-count.sheet48.json +242 -0
- package/fixtures/expected/manual-receipt-range-device-failure-no-count.grid32.txt +36 -0
- package/fixtures/expected/manual-receipt-range-device-failure-no-count.grid48.txt +36 -0
- package/fixtures/expected/manual-receipt-range-device-failure-no-count.lines.json +299 -0
- package/fixtures/expected/manual-receipt-range-device-failure-no-count.sheet32.json +242 -0
- package/fixtures/expected/manual-receipt-range-device-failure-no-count.sheet48.json +242 -0
- package/fixtures/expected/manual-receipt-range-network-outage-count.grid32.txt +33 -0
- package/fixtures/expected/manual-receipt-range-network-outage-count.grid48.txt +33 -0
- package/fixtures/expected/manual-receipt-range-network-outage-count.lines.json +259 -0
- package/fixtures/expected/manual-receipt-range-network-outage-count.sheet32.json +224 -0
- package/fixtures/expected/manual-receipt-range-network-outage-count.sheet48.json +224 -0
- package/fixtures/expected/manual-receipt-range-network-outage-no-count.grid32.txt +33 -0
- package/fixtures/expected/manual-receipt-range-network-outage-no-count.grid48.txt +33 -0
- package/fixtures/expected/manual-receipt-range-network-outage-no-count.lines.json +259 -0
- package/fixtures/expected/manual-receipt-range-network-outage-no-count.sheet32.json +224 -0
- package/fixtures/expected/manual-receipt-range-network-outage-no-count.sheet48.json +224 -0
- package/fixtures/expected/manual-receipt-range-other-count.grid32.txt +36 -0
- package/fixtures/expected/manual-receipt-range-other-count.grid48.txt +36 -0
- package/fixtures/expected/manual-receipt-range-other-count.lines.json +299 -0
- package/fixtures/expected/manual-receipt-range-other-count.sheet32.json +242 -0
- package/fixtures/expected/manual-receipt-range-other-count.sheet48.json +242 -0
- package/fixtures/expected/manual-receipt-range-other-no-count.grid32.txt +36 -0
- package/fixtures/expected/manual-receipt-range-other-no-count.grid48.txt +36 -0
- package/fixtures/expected/manual-receipt-range-other-no-count.lines.json +299 -0
- package/fixtures/expected/manual-receipt-range-other-no-count.sheet32.json +242 -0
- package/fixtures/expected/manual-receipt-range-other-no-count.sheet48.json +242 -0
- package/fixtures/expected/manual-receipt-range-power-outage-count.grid32.txt +37 -0
- package/fixtures/expected/manual-receipt-range-power-outage-count.grid48.txt +37 -0
- package/fixtures/expected/manual-receipt-range-power-outage-count.lines.json +305 -0
- package/fixtures/expected/manual-receipt-range-power-outage-count.sheet32.json +248 -0
- package/fixtures/expected/manual-receipt-range-power-outage-count.sheet48.json +248 -0
- package/fixtures/expected/manual-receipt-range-power-outage-no-count.grid32.txt +37 -0
- package/fixtures/expected/manual-receipt-range-power-outage-no-count.grid48.txt +37 -0
- package/fixtures/expected/manual-receipt-range-power-outage-no-count.lines.json +305 -0
- package/fixtures/expected/manual-receipt-range-power-outage-no-count.sheet32.json +248 -0
- package/fixtures/expected/manual-receipt-range-power-outage-no-count.sheet48.json +248 -0
- package/fixtures/expected/manual-receipt-range-system-outage-count.grid32.txt +33 -0
- package/fixtures/expected/manual-receipt-range-system-outage-count.grid48.txt +33 -0
- package/fixtures/expected/manual-receipt-range-system-outage-count.lines.json +259 -0
- package/fixtures/expected/manual-receipt-range-system-outage-count.sheet32.json +224 -0
- package/fixtures/expected/manual-receipt-range-system-outage-count.sheet48.json +224 -0
- package/fixtures/expected/manual-receipt-range-system-outage-no-count.grid32.txt +33 -0
- package/fixtures/expected/manual-receipt-range-system-outage-no-count.grid48.txt +33 -0
- package/fixtures/expected/manual-receipt-range-system-outage-no-count.lines.json +259 -0
- package/fixtures/expected/manual-receipt-range-system-outage-no-count.sheet32.json +224 -0
- package/fixtures/expected/manual-receipt-range-system-outage-no-count.sheet48.json +224 -0
- package/fixtures/expected/manual-receipt-single-device-failure-no-time.grid32.txt +31 -0
- package/fixtures/expected/manual-receipt-single-device-failure-no-time.grid48.txt +31 -0
- package/fixtures/expected/manual-receipt-single-device-failure-no-time.lines.json +253 -0
- package/fixtures/expected/manual-receipt-single-device-failure-no-time.sheet32.json +212 -0
- package/fixtures/expected/manual-receipt-single-device-failure-no-time.sheet48.json +212 -0
- package/fixtures/expected/manual-receipt-single-device-failure-time.grid32.txt +31 -0
- package/fixtures/expected/manual-receipt-single-device-failure-time.grid48.txt +31 -0
- package/fixtures/expected/manual-receipt-single-device-failure-time.lines.json +253 -0
- package/fixtures/expected/manual-receipt-single-device-failure-time.sheet32.json +212 -0
- package/fixtures/expected/manual-receipt-single-device-failure-time.sheet48.json +212 -0
- package/fixtures/expected/manual-receipt-single-network-outage-no-time.grid32.txt +32 -0
- package/fixtures/expected/manual-receipt-single-network-outage-no-time.grid48.txt +31 -0
- package/fixtures/expected/manual-receipt-single-network-outage-no-time.lines.json +253 -0
- package/fixtures/expected/manual-receipt-single-network-outage-no-time.sheet32.json +218 -0
- package/fixtures/expected/manual-receipt-single-network-outage-no-time.sheet48.json +212 -0
- package/fixtures/expected/manual-receipt-single-network-outage-time.grid32.txt +32 -0
- package/fixtures/expected/manual-receipt-single-network-outage-time.grid48.txt +31 -0
- package/fixtures/expected/manual-receipt-single-network-outage-time.lines.json +253 -0
- package/fixtures/expected/manual-receipt-single-network-outage-time.sheet32.json +218 -0
- package/fixtures/expected/manual-receipt-single-network-outage-time.sheet48.json +212 -0
- package/fixtures/expected/manual-receipt-single-other-no-time.grid32.txt +35 -0
- package/fixtures/expected/manual-receipt-single-other-no-time.grid48.txt +34 -0
- package/fixtures/expected/manual-receipt-single-other-no-time.lines.json +299 -0
- package/fixtures/expected/manual-receipt-single-other-no-time.sheet32.json +236 -0
- package/fixtures/expected/manual-receipt-single-other-no-time.sheet48.json +230 -0
- package/fixtures/expected/manual-receipt-single-other-time.grid32.txt +35 -0
- package/fixtures/expected/manual-receipt-single-other-time.grid48.txt +34 -0
- package/fixtures/expected/manual-receipt-single-other-time.lines.json +299 -0
- package/fixtures/expected/manual-receipt-single-other-time.sheet32.json +236 -0
- package/fixtures/expected/manual-receipt-single-other-time.sheet48.json +230 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-no-time.grid32.txt +31 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-no-time.grid48.txt +31 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-no-time.lines.json +247 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-no-time.sheet32.json +212 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-no-time.sheet48.json +212 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-time.grid32.txt +31 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-time.grid48.txt +31 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-time.lines.json +247 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-time.sheet32.json +212 -0
- package/fixtures/expected/manual-receipt-single-outside-premises-time.sheet48.json +212 -0
- package/fixtures/expected/manual-receipt-single-power-outage-no-time.grid32.txt +35 -0
- package/fixtures/expected/manual-receipt-single-power-outage-no-time.grid48.txt +34 -0
- package/fixtures/expected/manual-receipt-single-power-outage-no-time.lines.json +299 -0
- package/fixtures/expected/manual-receipt-single-power-outage-no-time.sheet32.json +236 -0
- package/fixtures/expected/manual-receipt-single-power-outage-no-time.sheet48.json +230 -0
- package/fixtures/expected/manual-receipt-single-power-outage-time.grid32.txt +35 -0
- package/fixtures/expected/manual-receipt-single-power-outage-time.grid48.txt +34 -0
- package/fixtures/expected/manual-receipt-single-power-outage-time.lines.json +299 -0
- package/fixtures/expected/manual-receipt-single-power-outage-time.sheet32.json +236 -0
- package/fixtures/expected/manual-receipt-single-power-outage-time.sheet48.json +230 -0
- package/fixtures/expected/manual-receipt-single-small-business.grid32.txt +34 -0
- package/fixtures/expected/manual-receipt-single-small-business.grid48.txt +33 -0
- package/fixtures/expected/manual-receipt-single-small-business.lines.json +257 -0
- package/fixtures/expected/manual-receipt-single-small-business.sheet32.json +230 -0
- package/fixtures/expected/manual-receipt-single-small-business.sheet48.json +224 -0
- package/fixtures/expected/manual-receipt-single-system-outage-no-time.grid32.txt +32 -0
- package/fixtures/expected/manual-receipt-single-system-outage-no-time.grid48.txt +31 -0
- package/fixtures/expected/manual-receipt-single-system-outage-no-time.lines.json +253 -0
- package/fixtures/expected/manual-receipt-single-system-outage-no-time.sheet32.json +218 -0
- package/fixtures/expected/manual-receipt-single-system-outage-no-time.sheet48.json +212 -0
- package/fixtures/expected/manual-receipt-single-system-outage-time.grid32.txt +32 -0
- package/fixtures/expected/manual-receipt-single-system-outage-time.grid48.txt +31 -0
- package/fixtures/expected/manual-receipt-single-system-outage-time.lines.json +253 -0
- package/fixtures/expected/manual-receipt-single-system-outage-time.sheet32.json +218 -0
- package/fixtures/expected/manual-receipt-single-system-outage-time.sheet48.json +212 -0
- package/fixtures/expected/zero-outage-end-period.grid32.txt +35 -0
- package/fixtures/expected/zero-outage-end-period.grid48.txt +31 -0
- package/fixtures/expected/zero-outage-end-period.lines.json +230 -0
- package/fixtures/expected/zero-outage-end-period.sheet32.json +236 -0
- package/fixtures/expected/zero-outage-end-period.sheet48.json +212 -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/manifest.json +192 -0
- package/fixtures/pos-texts.json +1 -1
- package/fixtures/receipts/manual-receipt-range-device-failure-count.json +56 -0
- package/fixtures/receipts/manual-receipt-range-device-failure-no-count.json +55 -0
- package/fixtures/receipts/manual-receipt-range-network-outage-count.json +50 -0
- package/fixtures/receipts/manual-receipt-range-network-outage-no-count.json +49 -0
- package/fixtures/receipts/manual-receipt-range-other-count.json +57 -0
- package/fixtures/receipts/manual-receipt-range-other-no-count.json +56 -0
- package/fixtures/receipts/manual-receipt-range-power-outage-count.json +56 -0
- package/fixtures/receipts/manual-receipt-range-power-outage-no-count.json +55 -0
- package/fixtures/receipts/manual-receipt-range-system-outage-count.json +50 -0
- package/fixtures/receipts/manual-receipt-range-system-outage-no-count.json +49 -0
- package/fixtures/receipts/manual-receipt-single-device-failure-no-time.json +48 -0
- package/fixtures/receipts/manual-receipt-single-device-failure-time.json +49 -0
- package/fixtures/receipts/manual-receipt-single-network-outage-no-time.json +49 -0
- package/fixtures/receipts/manual-receipt-single-network-outage-time.json +50 -0
- package/fixtures/receipts/manual-receipt-single-other-no-time.json +55 -0
- package/fixtures/receipts/manual-receipt-single-other-time.json +56 -0
- package/fixtures/receipts/manual-receipt-single-outside-premises-no-time.json +48 -0
- package/fixtures/receipts/manual-receipt-single-outside-premises-time.json +49 -0
- package/fixtures/receipts/manual-receipt-single-power-outage-no-time.json +54 -0
- package/fixtures/receipts/manual-receipt-single-power-outage-time.json +55 -0
- package/fixtures/receipts/manual-receipt-single-small-business.json +48 -0
- package/fixtures/receipts/manual-receipt-single-system-outage-no-time.json +49 -0
- package/fixtures/receipts/manual-receipt-single-system-outage-time.json +50 -0
- package/fixtures/receipts/zero-outage-end-period.json +43 -0
- package/fixtures/surface.json +1 -1
- package/fixtures/v3/antworten/belege.json +585 -9
- package/fixtures/v3/antworten/belegmail.json +2 -2
- package/fixtures/v3/antworten/berichte.json +2 -2
- package/fixtures/v3/antworten/kasse-belege.json +433 -3
- package/fixtures/v3/antworten/kasse.json +3 -3
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +2 -2
- package/fixtures/v3/antworten/storno.json +15 -3
- package/fixtures/v3/stored/belege.json +57 -3
- package/fixtures/v3/stored/kasse.json +3 -3
- package/fixtures/v3/stored/rechnungen.json +2 -2
- package/fixtures/v3/v3-vokabular.json +188 -11
- package/fixtures/v3/zahlbetrag-faelle.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,38 @@ 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.19.0 - 2026-10-30
|
|
8
|
+
|
|
9
|
+
The full view of `listReceipts` delivers what `getReceipt` delivers (backend 30.10.2026, spec `list-receipts-voll`). Additive for reading.
|
|
10
|
+
|
|
11
|
+
- **Page of the full view: `headers`, `testCashregister`, `logoScale`.** `headers` (`ListReceiptsHeader`: `headerVersionId`, `company`) has one entry per header version of the page; each receipt's `headerVersionId` names its entry, also for old receipts without a stored id. `metadata` stays (today's company data). Reason: reprinting an old receipt from `metadata` printed today's address and footer.
|
|
12
|
+
- **Receipts of the full view: `ListedFullReceipt`** (`Receipt` plus `testSignature`); `registrationInfo` on zero receipts. No server `layout` in the list: it is the main cost driver of a page (about 2.7 times the size) and only needed for the receipt someone opens or prints, so it stays with `getReceiptWithCompany`. New helper `listedReceiptWithCompany(page, receipt)` returns the `ReceiptWithCompany` of `getReceiptWithCompany` without `outputs` and with `layout: null`; `receiptLayoutFromResult` builds the layout from it. Reason: one way to print and show a receipt, single or from the list.
|
|
13
|
+
- **Provider data follow the caller, not the channel.** The backend now returns `payments[].providerPaymentId`/`providerData` (and `cardPaymentId`/`cardPaymentData` on old card receipts) to the business itself on both channels, in `getReceipt`, `createReceipt`, `cancelReceipt`, `getReportV2` and `listReceipts`; a partner access never. No API change here (the fields were already optional); `cardRefundReference` and the card-refund check now name that rule in their messages. Reason: the restriction to the register channel stopped nobody holding the API key and pushed integrations into the register channel.
|
|
14
|
+
- Contract re-fetched from the backend: provider data now in the `/v3` cases of `belege.json` and `storno.json`, schema of `listReceipts` with the new fields; other files change only `_quelle`.
|
|
15
|
+
## 1.18.0 - 2026-10-30
|
|
16
|
+
|
|
17
|
+
Recording handwritten receipts (Nacherfassung). After a register outage or a sale outside the premises the business
|
|
18
|
+
writes paper receipts and records them in the register later; the receipt now carries the reference. Additive.
|
|
19
|
+
|
|
20
|
+
- **`manualReceipt` on `createReceipt`/`sellReceipt` and on `Receipt`, `ReceiptSummary` and the `listReceipts` summary:**
|
|
21
|
+
`number` (the paper pad's own number range, never the next register number), optional `numberTo` and `count` (daily
|
|
22
|
+
summary receipt, only after an outage), `date` (`YYYY-MM-DD`, Vienna day), optional `time` (`HH:MM`), `reason`
|
|
23
|
+
(`MANUAL_RECEIPT_REASONS`: `network_outage`, `power_outage`, `device_failure`, `system_outage`, `other` with `note`,
|
|
24
|
+
`outside_premises`). Only on `standard`; the package throws before sending otherwise. The server checks everything
|
|
25
|
+
else. The receipt's own `timeStamp` stays the time of recording (no backdating). `readManualReceipt` reads the field.
|
|
26
|
+
- **Error codes `MANUAL_RECEIPT_ERROR_CODES`** (contract `errorCodes.manualReceipt`): `invalid_manual_receipt`,
|
|
27
|
+
`manual_receipt_not_allowed`, `manual_receipt_date_in_future`, `manual_receipt_range_not_allowed`,
|
|
28
|
+
`manual_receipt_duplicate` (same number or overlapping range on the same day and register; `details.receiptId`
|
|
29
|
+
names the receipt that already recorded it), with `isManualReceiptErrorCode`.
|
|
30
|
+
- **Receipt block „NACHERFASSUNG“** below the business header: kind (after a register outage / sale outside the
|
|
31
|
+
premises), reason, number and day of the paper receipt or range and count of the daily summary, and
|
|
32
|
+
„USt: Duplikat …“ (BMF cash register decree, 3.3 and 2.4.11; not for small businesses). 23 new golden receipts `manual-receipt-*`.
|
|
33
|
+
- **Zero receipt after a signature outage** (`zeroKind: outage_end`) prints start and end of the outage from
|
|
34
|
+
`legalMessage` before the QR code; the decree (3.6.1) requires them on the receipt. New golden `zero-outage-end-period`,
|
|
35
|
+
all existing goldens unchanged.
|
|
36
|
+
- Contract re-fetched from the backend (vendored package 0.36.0): new cases `sale_manual_receipt` and
|
|
37
|
+
`error_manual_receipt_duplicate`, catalog `HANDBELEG_GRUND`; print digests of the two new server layouts recorded.
|
|
38
|
+
|
|
7
39
|
## 1.17.1 - 2026-10-29
|
|
8
40
|
|
|
9
41
|
- **Contract `v3` gains `fixtures/v3/antworten/berichte.json`** (backend keck#798): `getCashregisterReport` as a binary path, generated from the real handler. A case with `file` is the PDF (HTTP 200, `Content-Type: application/pdf`, the bytes start with `file.startsWith`); every rejection also comes with HTTP 200, as an envelope with a code (`period_not_closed` for the current month and today, `period_in_future`, `invalid_period`). New test `test/v3-berichte-vertrag.test.ts` replays the file through `createBinaryTransport`: the PDF arrives byte for byte, each rejection is a `KasseneckApiError` with the code of the contract and outcome `rejected`. No behaviour change: the binary path always decided on the first bytes. Reason: the Dart twin returned such an envelope as PDF bytes up to 11.8.0 (fixed in 11.8.1); with the case in the contract both packages and the backend are pinned to the same answer, and the Dart twin replays this file too.
|
package/README.md
CHANGED
|
@@ -580,7 +580,7 @@ it whenever it is there. Only without it does the helper build the layout,
|
|
|
580
580
|
in `fallbackPaperSize` (default `mm58`, as in 0.x). The server layout is
|
|
581
581
|
always 80 mm: on 58 mm paper choose the width at the print path
|
|
582
582
|
(`escPosLayoutBytes(layout, { paperSize: 'mm58' })`, `charsPerLine: 32`); the VAT
|
|
583
|
-
table then keeps the columns of the 80 mm grid.
|
|
583
|
+
table then keeps the columns of the 80 mm grid. For a partner access only this layout carries the card block, because
|
|
584
584
|
the receipt itself comes without provider data. If you build the layout
|
|
585
585
|
yourself, pass the options from the same response:
|
|
586
586
|
|
|
@@ -641,10 +641,19 @@ for await (const receipt of api.listAllReceipts({ from: '2026-10-01', to: '2026-
|
|
|
641
641
|
`grossByRateCents`, `paymentMethod`, `payments`, `tipCents`, `operator`,
|
|
642
642
|
`cancellationOf`, `cancellationReason`, `cancellationStatus`, `signatureOk`,
|
|
643
643
|
`customProjectId`, `fullReceiptId`); amounts in cents, no items, no layout.
|
|
644
|
-
`full` returns `
|
|
645
|
-
with
|
|
646
|
-
`
|
|
647
|
-
`
|
|
644
|
+
`full` returns `ListedFullReceipt`: the receipt document as in `getReceipt`
|
|
645
|
+
with `headerVersionId` (the header version that applies, also for old
|
|
646
|
+
receipts), `testSignature` and `registrationInfo` on zero receipts, never the
|
|
647
|
+
server `layout` (that comes only with `getReceiptWithCompany`, for the receipt
|
|
648
|
+
someone opens or prints). The page carries `headers` (one entry per header
|
|
649
|
+
version of the page, oldest first), `testCashregister`, `logoScale` and, as
|
|
650
|
+
before, `metadata` (today's company data). For printing use the header of
|
|
651
|
+
the receipt's version, not `metadata`: `listedReceiptWithCompany(page,
|
|
652
|
+
receipt)` returns the `ReceiptWithCompany` of `getReceiptWithCompany` without
|
|
653
|
+
`outputs` and with `layout: null` (zero receipts carry no logo);
|
|
654
|
+
`receiptLayoutFromResult` then builds the layout from it. For the PDF use
|
|
655
|
+
`downloadReceipt` with `fullReceiptId`. `ListReceiptsSummary` is not the `ReceiptSummary` of
|
|
656
|
+
`listMyReceipts` (register path, other fields).
|
|
648
657
|
- **`daySummary`** is only there with `date` and only on the first page
|
|
649
658
|
(`null` when the day has no statistics): `receiptCount` counts every
|
|
650
659
|
receipt of the day, `revenueCents` only standard and cancellation receipts,
|
|
@@ -714,9 +723,12 @@ try {
|
|
|
714
723
|
```
|
|
715
724
|
|
|
716
725
|
**Card refunds.** The terminal refund needs the transaction id of the original
|
|
717
|
-
card payment: `payments[].providerPaymentId` of the original receipt.
|
|
718
|
-
|
|
719
|
-
|
|
726
|
+
card payment: `payments[].providerPaymentId` of the original receipt. The
|
|
727
|
+
business itself gets it on both channels (API key on `api.kasseneck.at/v3`,
|
|
728
|
+
`registerUserAuth` on `kasse.kasseneck.at/api/v3`), in `getReceipt`,
|
|
729
|
+
`listReceipts` (`view: 'full'`) and `getReportV2`; a partner access never does.
|
|
730
|
+
`providerData` is the provider's raw data without a promised shape; base logic
|
|
731
|
+
on `provider`, `providerPaymentId` and `id`. The refund payment then carries
|
|
720
732
|
the id of the refund itself. `cancellation_outcome_unknown` means the
|
|
721
733
|
cancellation may have been booked: read the original again, never retry.
|
|
722
734
|
|
|
@@ -4,7 +4,7 @@ export { ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS
|
|
|
4
4
|
export { 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, } from './errors.js';
|
|
5
5
|
export { type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, type CancelReceiptResult, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, type ReceiptOutputEntry, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type RejectedReceiptOutput, logReceiptOutputs, } from './receipts.js';
|
|
6
6
|
export { listMyCashregisters } from './cashregisters.js';
|
|
7
|
-
export { listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, type ListReceiptsErrorCode, type ListReceiptsView, type ListReceiptsOrder, type ListReceiptsOptions, type ListReceiptsWindow, type ListReceiptsGrossByRate, type ListReceiptsSummary, type ListReceiptsDaySummary, type ListReceiptsPage, type ListedReceipt, } from './list-receipts.js';
|
|
7
|
+
export { listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, listedReceiptWithCompany, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, type ListReceiptsErrorCode, type ListReceiptsView, type ListReceiptsOrder, type ListReceiptsOptions, type ListReceiptsWindow, type ListReceiptsGrossByRate, type ListReceiptsSummary, type ListReceiptsDaySummary, type ListReceiptsPage, type ListedReceipt, type ListedFullReceipt, type ListReceiptsHeader, } from './list-receipts.js';
|
|
8
8
|
export { downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2, type CashregisterReportPeriod, type ReportV2, type ReportV2Metadata, type ReportV2Options } from './reports.js';
|
|
9
9
|
export { type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, } from './status.js';
|
|
10
10
|
export { type KasseneckApi, createKasseneckApi } from './api.js';
|
package/dist/cjs/client/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.getReportV2 = exports.getCashregisterReport = exports.downloadMonthlyReport = void 0;
|
|
3
|
+
exports.LIST_RECEIPTS_ERROR_CODES = exports.LIST_ALL_RECEIPTS_MAX_PAGES = exports.LIST_RECEIPTS_DAYS_MAX = exports.LIST_RECEIPTS_LIMIT_MAX = exports.LIST_RECEIPTS_ORDERS = exports.LIST_RECEIPTS_VIEWS = exports.listedReceiptWithCompany = exports.fromListReceiptsSummaryPayload = exports.listAllReceipts = exports.listReceipts = exports.listMyCashregisters = exports.logReceiptOutputs = exports.sendReceiptEmail = exports.checkVoucherCombinationError = exports.listMyReceipts = exports.getFirstReceiptDate = exports.generateFullReceiptId = exports.getReceiptWithCompany = 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.UNKNOWN_OUTCOME_CALLS = exports.POS_CALLS = exports.PUBLIC_CALLS = exports.ALL_CALLS = exports.createPdfOrDataTransport = exports.createBinaryTransport = exports.createTransport = exports.DEFAULT_TIMEOUT_MS = exports.POS_BASE_URL = exports.DEFAULT_BASE_URL = exports.registerUserAuth = exports.apiKeyAuth = void 0;
|
|
4
|
+
exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.getReportV2 = exports.getCashregisterReport = exports.downloadMonthlyReport = exports.downloadDailyReport = void 0;
|
|
5
5
|
var auth_js_1 = require("./auth.js");
|
|
6
6
|
Object.defineProperty(exports, "apiKeyAuth", { enumerable: true, get: function () { return auth_js_1.apiKeyAuth; } });
|
|
7
7
|
Object.defineProperty(exports, "registerUserAuth", { enumerable: true, get: function () { return auth_js_1.registerUserAuth; } });
|
|
@@ -52,6 +52,7 @@ var list_receipts_js_1 = require("./list-receipts.js");
|
|
|
52
52
|
Object.defineProperty(exports, "listReceipts", { enumerable: true, get: function () { return list_receipts_js_1.listReceipts; } });
|
|
53
53
|
Object.defineProperty(exports, "listAllReceipts", { enumerable: true, get: function () { return list_receipts_js_1.listAllReceipts; } });
|
|
54
54
|
Object.defineProperty(exports, "fromListReceiptsSummaryPayload", { enumerable: true, get: function () { return list_receipts_js_1.fromListReceiptsSummaryPayload; } });
|
|
55
|
+
Object.defineProperty(exports, "listedReceiptWithCompany", { enumerable: true, get: function () { return list_receipts_js_1.listedReceiptWithCompany; } });
|
|
55
56
|
Object.defineProperty(exports, "LIST_RECEIPTS_VIEWS", { enumerable: true, get: function () { return list_receipts_js_1.LIST_RECEIPTS_VIEWS; } });
|
|
56
57
|
Object.defineProperty(exports, "LIST_RECEIPTS_ORDERS", { enumerable: true, get: function () { return list_receipts_js_1.LIST_RECEIPTS_ORDERS; } });
|
|
57
58
|
Object.defineProperty(exports, "LIST_RECEIPTS_LIMIT_MAX", { enumerable: true, get: function () { return list_receipts_js_1.LIST_RECEIPTS_LIMIT_MAX; } });
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { KeckPaymentMethod, ReceiptType } from '../enums/index.js';
|
|
2
|
-
import { type CancellationReason, type CancellationStatus, type Receipt, type ReceiptPayment, type ZeroKind } from '../models/index.js';
|
|
2
|
+
import { type CancellationReason, type CancellationStatus, type Receipt, type ReceiptCompany, type ReceiptPayment, type ZeroKind } from '../models/index.js';
|
|
3
3
|
import type { ReportV2Metadata } from './reports.js';
|
|
4
|
+
import type { ReceiptWithCompany } from './receipts.js';
|
|
5
|
+
import type { SheetLogoSize } from '../receipt/blatt.js';
|
|
6
|
+
import { type ManualReceipt } from '../models/manual-receipt.js';
|
|
4
7
|
import type { InternerTransport } from './aufrufe.js';
|
|
5
8
|
/**
|
|
6
9
|
* Belege einer Kasse auflisten (`listReceipts`, nur unter `/v3`): ein Tag oder
|
|
@@ -143,9 +146,29 @@ export interface ListReceiptsSummary {
|
|
|
143
146
|
customProjectId: string | null;
|
|
144
147
|
/** Schluessel fuer `downloadReceipt` und den Beleg-Link, oder `null`. */
|
|
145
148
|
fullReceiptId: string | null;
|
|
149
|
+
/** Nur an nacherfassten Belegen: der Handbeleg. */
|
|
150
|
+
manualReceipt?: ManualReceipt;
|
|
146
151
|
}
|
|
147
|
-
/**
|
|
148
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Ein Beleg der vollen Ansicht: das Belegdokument wie bei `getReceipt`, dazu was `getReceipt` in der Huelle
|
|
154
|
+
* traegt, ausser `outputs` und dem Zeilenmodell `layout` (die gibt es nur einzeln ueber `getReceipt`).
|
|
155
|
+
* `headerVersionId` ist die Kopf-Version, die fuer diesen Beleg gilt (auch bei Altbelegen ohne gespeicherte
|
|
156
|
+
* Kennung); ihr Kopf steht in [ListReceiptsPage.headers]. Anbieterdaten der Zahlungen bekommt nur der Betrieb
|
|
157
|
+
* selbst (API-Schluessel oder Kassen-Anmeldung), nie ein Partner-Zugang.
|
|
158
|
+
* Druck- und Anzeigedaten wie bei `getReceiptWithCompany`: [listedReceiptWithCompany].
|
|
159
|
+
*/
|
|
160
|
+
export interface ListedFullReceipt extends Receipt {
|
|
161
|
+
/** Produktionskonto mit Test-Signatureinheit (Aufdruck TESTSIGNATUR); fehlt bei einem Backend vor dem 30.10.2026. */
|
|
162
|
+
testSignature?: boolean;
|
|
163
|
+
}
|
|
164
|
+
/** Ein Eintrag in [ListReceiptsPage.headers]: Kopf und Fuss einer Kopf-Version (Felder wie die Huelle von `getReceipt`). */
|
|
165
|
+
export interface ListReceiptsHeader {
|
|
166
|
+
/** `null` nur, wenn das Konto noch keine Kopf-Version hat (dann der heutige Stand). */
|
|
167
|
+
headerVersionId: string | null;
|
|
168
|
+
company: ReceiptCompany;
|
|
169
|
+
}
|
|
170
|
+
/** Ein Beleg der Liste je Ansicht: `full` das Belegdokument wie bei `getReceipt`, sonst die Zeile. */
|
|
171
|
+
export type ListedReceipt<V extends ListReceiptsView = 'summary'> = V extends 'full' ? ListedFullReceipt : ListReceiptsSummary;
|
|
149
172
|
/**
|
|
150
173
|
* Tagessumme aus der Tagesstatistik der Kasse, nur bei `date` und nur auf
|
|
151
174
|
* der ersten Seite. **Nicht die Summe der Liste:** `receiptCount` zaehlt jeden
|
|
@@ -180,9 +203,28 @@ export interface ListReceiptsPage<V extends ListReceiptsView = 'summary'> {
|
|
|
180
203
|
* `getReportV2().metadata`. Bei der Kurzansicht fehlt das Feld.
|
|
181
204
|
*/
|
|
182
205
|
metadata?: V extends 'full' ? ReportV2Metadata : never;
|
|
206
|
+
/**
|
|
207
|
+
* Nur bei `view: 'full'`: die Kopf-Versionen der Belege dieser Seite, je Version einmal, aelteste zuerst.
|
|
208
|
+
* Fuer den Druck gilt der Eintrag mit der `headerVersionId` des Belegs, nicht `metadata` (heutiger Stand).
|
|
209
|
+
* Fehlt bei einem Backend vor dem 30.10.2026.
|
|
210
|
+
*/
|
|
211
|
+
headers?: V extends 'full' ? ListReceiptsHeader[] : never;
|
|
212
|
+
/** Nur bei `view: 'full'`: Belege einer Testumgebung (Aufdruck TESTKASSE), wie `getReceipt`. */
|
|
213
|
+
testCashregister?: V extends 'full' ? boolean : never;
|
|
214
|
+
/** Nur bei `view: 'full'`: Groesse des Firmenlogos (`logo_scale`), wie `getReceipt`. */
|
|
215
|
+
logoScale?: V extends 'full' ? SheetLogoSize : never;
|
|
183
216
|
}
|
|
184
217
|
/** Zeile `view: summary` vom Draht. */
|
|
185
218
|
export declare function fromListReceiptsSummaryPayload(payload: Record<string, unknown>): ListReceiptsSummary;
|
|
219
|
+
/**
|
|
220
|
+
* Ein Beleg der vollen Ansicht mit den Druck- und Anzeigedaten seiner Seite, in derselben Form wie
|
|
221
|
+
* `getReceiptWithCompany` (ohne `outputs`): der Kopf der Version des Belegs aus `headers` (Nullbelege ohne
|
|
222
|
+
* Logo, wie beim Server), Testkennzeichen, Logo-Stufe. `layout` ist immer `null` -- die Liste traegt kein
|
|
223
|
+
* Zeilenmodell; [receiptLayoutFromResult] baut es dann mit denselben Angaben, oder `getReceiptWithCompany`
|
|
224
|
+
* holt das des Servers. Von einem Backend vor dem 30.10.2026 (ohne `headers`) kommt der Kopf aus
|
|
225
|
+
* `metadata`, dem heutigen Stand.
|
|
226
|
+
*/
|
|
227
|
+
export declare function listedReceiptWithCompany(page: ListReceiptsPage<'full'>, receipt: ListedFullReceipt): ReceiptWithCompany;
|
|
186
228
|
/**
|
|
187
229
|
* Eine Seite Belege der angemeldeten Kasse (`listReceipts`). Die Eingabe wird
|
|
188
230
|
* vor dem Senden nach den Regeln des Servers geprueft (genau eine Form des
|
|
@@ -190,8 +232,9 @@ export declare function fromListReceiptsSummaryPayload(payload: Record<string, u
|
|
|
190
232
|
* `order`, `view`); ein Verstoss wirft [KasseneckValidationError] mit
|
|
191
233
|
* `scope: 'request'`, ohne dass etwas hinausgeht.
|
|
192
234
|
*
|
|
193
|
-
* Mit `view: 'full'` sind die Belege das gespeicherte Belegdokument
|
|
194
|
-
*
|
|
235
|
+
* Mit `view: 'full'` sind die Belege das gespeicherte Belegdokument mit den
|
|
236
|
+
* Angaben, die `getReceipt` liefert ([ListedFullReceipt]; Kopf je Version in
|
|
237
|
+
* `headers`, ohne Zeilenmodell), sonst [ListReceiptsSummary].
|
|
195
238
|
* Alle Seiten auf einmal: [listAllReceipts].
|
|
196
239
|
*/
|
|
197
240
|
export declare function listReceipts<V extends ListReceiptsView = 'summary'>(transport: InternerTransport, options: ListReceiptsOptions<V>): Promise<ListReceiptsPage<V>>;
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LIST_RECEIPTS_ERROR_CODES = exports.LIST_ALL_RECEIPTS_MAX_PAGES = exports.LIST_RECEIPTS_DAYS_MAX = exports.LIST_RECEIPTS_LIMIT_MAX = exports.LIST_RECEIPTS_ORDERS = exports.LIST_RECEIPTS_VIEWS = void 0;
|
|
4
4
|
exports.fromListReceiptsSummaryPayload = fromListReceiptsSummaryPayload;
|
|
5
|
+
exports.listedReceiptWithCompany = listedReceiptWithCompany;
|
|
5
6
|
exports.listReceipts = listReceipts;
|
|
6
7
|
exports.listAllReceipts = listAllReceipts;
|
|
7
8
|
const index_js_1 = require("../enums/index.js");
|
|
8
9
|
const index_js_2 = require("../models/index.js");
|
|
9
10
|
const enum_payload_js_1 = require("../models/enum-payload.js");
|
|
11
|
+
const manual_receipt_js_1 = require("../models/manual-receipt.js");
|
|
10
12
|
const errors_js_1 = require("./errors.js");
|
|
11
13
|
/**
|
|
12
14
|
* Belege einer Kasse auflisten (`listReceipts`, nur unter `/v3`): ein Tag oder
|
|
@@ -163,6 +165,10 @@ const istObjekt = (w) => w != null && typeof w === 'object' && !Array.isArray(w)
|
|
|
163
165
|
const text = (w) => (typeof w === 'string' ? w : null);
|
|
164
166
|
// Ganze Cent; ein einzelner unbrauchbarer Betrag laesst die Liste nicht scheitern.
|
|
165
167
|
const cent = (w) => (typeof w === 'number' && Number.isInteger(w) ? w : 0);
|
|
168
|
+
function handbelegFeld(roh) {
|
|
169
|
+
const manualReceipt = (0, manual_receipt_js_1.readManualReceipt)(roh);
|
|
170
|
+
return manualReceipt ? { manualReceipt } : {};
|
|
171
|
+
}
|
|
166
172
|
function istStornoStand(w) {
|
|
167
173
|
return typeof w === 'string' && index_js_2.CANCELLATION_STATUSES.includes(w);
|
|
168
174
|
}
|
|
@@ -197,6 +203,7 @@ function fromListReceiptsSummaryPayload(payload) {
|
|
|
197
203
|
signatureOk: payload['signatureOk'] !== false,
|
|
198
204
|
customProjectId: text(payload['customProjectId']),
|
|
199
205
|
fullReceiptId: text(payload['fullReceiptId']),
|
|
206
|
+
...handbelegFeld(payload['manualReceipt']),
|
|
200
207
|
};
|
|
201
208
|
}
|
|
202
209
|
function tagessumme(roh) {
|
|
@@ -219,6 +226,57 @@ function kopfdaten(roh) {
|
|
|
219
226
|
const label = roh.label;
|
|
220
227
|
return { ...(0, index_js_2.fromReceiptCompanyPayload)(roh), label: typeof label === 'string' ? label : '' };
|
|
221
228
|
}
|
|
229
|
+
const LOGO_STUFEN = ['S', 'M', 'L', 'XL'];
|
|
230
|
+
/** Ein Beleg der vollen Ansicht vom Draht: das Belegdokument und die Zusaetze, die `getReceipt` in der Huelle traegt. */
|
|
231
|
+
function vollerBeleg(roh) {
|
|
232
|
+
const beleg = (0, index_js_2.fromReceiptPayload)(roh);
|
|
233
|
+
if (typeof roh['testSignature'] === 'boolean')
|
|
234
|
+
beleg.testSignature = roh['testSignature'];
|
|
235
|
+
return beleg;
|
|
236
|
+
}
|
|
237
|
+
/** `headers` der vollen Ansicht: je Kopf-Version Kennung und Kopf. */
|
|
238
|
+
function koepfe(roh) {
|
|
239
|
+
if (!Array.isArray(roh) || roh.some((h) => !istObjekt(h)))
|
|
240
|
+
throw antwortfehler('headers ist keine Liste von Kopf-Versionen');
|
|
241
|
+
return roh.map((h) => ({
|
|
242
|
+
headerVersionId: typeof h['headerVersionId'] === 'string' && h['headerVersionId'] !== '' ? h['headerVersionId'] : null,
|
|
243
|
+
company: (0, index_js_2.fromReceiptCompanyPayload)(h),
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Ein Beleg der vollen Ansicht mit den Druck- und Anzeigedaten seiner Seite, in derselben Form wie
|
|
248
|
+
* `getReceiptWithCompany` (ohne `outputs`): der Kopf der Version des Belegs aus `headers` (Nullbelege ohne
|
|
249
|
+
* Logo, wie beim Server), Testkennzeichen, Logo-Stufe. `layout` ist immer `null` -- die Liste traegt kein
|
|
250
|
+
* Zeilenmodell; [receiptLayoutFromResult] baut es dann mit denselben Angaben, oder `getReceiptWithCompany`
|
|
251
|
+
* holt das des Servers. Von einem Backend vor dem 30.10.2026 (ohne `headers`) kommt der Kopf aus
|
|
252
|
+
* `metadata`, dem heutigen Stand.
|
|
253
|
+
*/
|
|
254
|
+
function listedReceiptWithCompany(page, receipt) {
|
|
255
|
+
const kennung = receipt.headerVersionId ?? null;
|
|
256
|
+
const eintrag = page.headers?.find((h) => h.headerVersionId === kennung);
|
|
257
|
+
let company;
|
|
258
|
+
if (eintrag)
|
|
259
|
+
company = { ...eintrag.company };
|
|
260
|
+
else if (page.metadata) {
|
|
261
|
+
const { label: _label, ...kopf } = page.metadata;
|
|
262
|
+
company = kopf;
|
|
263
|
+
}
|
|
264
|
+
else
|
|
265
|
+
company = (0, index_js_2.fromReceiptCompanyPayload)({});
|
|
266
|
+
const art = typeof receipt.receiptType === 'object' ? receipt.receiptType.value : receipt.receiptType;
|
|
267
|
+
if (art === index_js_1.ReceiptType.zero.value)
|
|
268
|
+
delete company.logoUrl;
|
|
269
|
+
return {
|
|
270
|
+
receipt,
|
|
271
|
+
company,
|
|
272
|
+
testCashregister: page.testCashregister === true,
|
|
273
|
+
testSignature: receipt.testSignature === true,
|
|
274
|
+
headerVersionId: kennung,
|
|
275
|
+
layout: null,
|
|
276
|
+
registrationInfo: receipt.registrationInfo ?? null,
|
|
277
|
+
logoScale: page.logoScale ?? 'M',
|
|
278
|
+
};
|
|
279
|
+
}
|
|
222
280
|
/**
|
|
223
281
|
* Eine Seite Belege der angemeldeten Kasse (`listReceipts`). Die Eingabe wird
|
|
224
282
|
* vor dem Senden nach den Regeln des Servers geprueft (genau eine Form des
|
|
@@ -226,8 +284,9 @@ function kopfdaten(roh) {
|
|
|
226
284
|
* `order`, `view`); ein Verstoss wirft [KasseneckValidationError] mit
|
|
227
285
|
* `scope: 'request'`, ohne dass etwas hinausgeht.
|
|
228
286
|
*
|
|
229
|
-
* Mit `view: 'full'` sind die Belege das gespeicherte Belegdokument
|
|
230
|
-
*
|
|
287
|
+
* Mit `view: 'full'` sind die Belege das gespeicherte Belegdokument mit den
|
|
288
|
+
* Angaben, die `getReceipt` liefert ([ListedFullReceipt]; Kopf je Version in
|
|
289
|
+
* `headers`, ohne Zeilenmodell), sonst [ListReceiptsSummary].
|
|
231
290
|
* Alle Seiten auf einmal: [listAllReceipts].
|
|
232
291
|
*/
|
|
233
292
|
async function listReceipts(transport, options) {
|
|
@@ -248,14 +307,20 @@ async function listReceipts(transport, options) {
|
|
|
248
307
|
throw antwortfehler('nextCursor passt nicht zu hasMore (Text bei hasMore, sonst null)');
|
|
249
308
|
}
|
|
250
309
|
const receipts = (voll
|
|
251
|
-
? liste.map((b) => (
|
|
310
|
+
? liste.map((b) => vollerBeleg(b))
|
|
252
311
|
: liste.map((b) => fromListReceiptsSummaryPayload(b)));
|
|
312
|
+
const stufe = daten['logo_scale'];
|
|
253
313
|
return {
|
|
254
314
|
receipts,
|
|
255
315
|
hasMore: daten['hasMore'],
|
|
256
316
|
nextCursor: daten['hasMore'] ? weiter : null,
|
|
257
317
|
...('daySummary' in daten ? { daySummary: tagessumme(daten['daySummary']) } : {}),
|
|
258
318
|
...(voll && 'metadata' in daten ? { metadata: kopfdaten(daten['metadata']) } : {}),
|
|
319
|
+
...(voll && 'headers' in daten ? { headers: koepfe(daten['headers']) } : {}),
|
|
320
|
+
...(voll && 'testCashregister' in daten ? { testCashregister: (daten['testCashregister'] === true) } : {}),
|
|
321
|
+
...(voll && 'logo_scale' in daten
|
|
322
|
+
? { logoScale: (typeof stufe === 'string' && LOGO_STUFEN.includes(stufe) ? stufe : 'M') }
|
|
323
|
+
: {}),
|
|
259
324
|
};
|
|
260
325
|
}
|
|
261
326
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReceiptType, type ReceiptTypeKey, KeckPaymentMethod, type KeckPaymentMethodKey } from '../enums/index.js';
|
|
2
|
+
import type { ManualReceipt } from '../models/manual-receipt.js';
|
|
2
3
|
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
4
|
import { type ReceiptOutput, type ReceiptOutputEntryErrorCode, type ReceiptOutputLogKind, type ReceiptOutputResult } from '../models/receipt-output.js';
|
|
4
5
|
import type { InternerTransport } from './aufrufe.js';
|
|
@@ -43,6 +44,11 @@ export interface ReceiptCommonOptions {
|
|
|
43
44
|
legalMessage?: string[];
|
|
44
45
|
/** Freier Bezeichner des Aufrufers (Projekt, Auftrag, Schicht). */
|
|
45
46
|
customProjectId?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Nacherfassung eines Handbelegs (siehe [ManualReceipt]); nur bei
|
|
49
|
+
* `standard`. Geprueft wird am Server, die Eingabe geht unveraendert hinaus.
|
|
50
|
+
*/
|
|
51
|
+
manualReceipt?: ManualReceipt;
|
|
46
52
|
/**
|
|
47
53
|
* Trinkgeld in Cent — als Zahl (an den angemeldeten Kassen-Benutzer, Zahlart
|
|
48
54
|
* des Belegs) oder als [TipOptions]. Das Backend bucht daraus signierte
|
|
@@ -194,6 +194,12 @@ function createReceiptParams(options) {
|
|
|
194
194
|
if (options.customProjectId != null) {
|
|
195
195
|
params['customProjectId'] = options.customProjectId;
|
|
196
196
|
}
|
|
197
|
+
if (options.manualReceipt != null) {
|
|
198
|
+
if (typ !== index_js_1.ReceiptType.standard) {
|
|
199
|
+
throw eingabefehler(`manualReceipt ist nur bei receiptType standard moeglich, nicht bei "${typ.value}".`);
|
|
200
|
+
}
|
|
201
|
+
params['manualReceipt'] = options.manualReceipt;
|
|
202
|
+
}
|
|
197
203
|
if (options.customerDetails != null) {
|
|
198
204
|
params['customerDetails'] = options.customerDetails.join('\n');
|
|
199
205
|
}
|
|
@@ -920,7 +926,7 @@ function cardRefundReference(receipt, paymentId) {
|
|
|
920
926
|
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `Zahlung "${paymentId}" ist keine Kartenzahlung`, 'request');
|
|
921
927
|
}
|
|
922
928
|
if (typeof zahlung.providerPaymentId !== 'string' || zahlung.providerPaymentId === '') {
|
|
923
|
-
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `Kennung der Kartenzahlung "${paymentId}" fehlt: sie
|
|
929
|
+
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `Kennung der Kartenzahlung "${paymentId}" fehlt: der Beleg kam ohne Anbieterdaten (sie bekommt nur der Betrieb selbst, mit API-Schluessel oder Kassen-Anmeldung, nie ein Partner-Zugang)`, 'request');
|
|
924
930
|
}
|
|
925
931
|
return zahlung.providerPaymentId;
|
|
926
932
|
}
|
|
@@ -946,7 +952,7 @@ function pruefeKartenRueckbuchung(zahlungen, original) {
|
|
|
946
952
|
const orig = original != null && typeof z['refundOf'] === 'string' ? original.payments?.find((o) => o.id === z['refundOf']) : undefined;
|
|
947
953
|
if (typeof orig?.providerPaymentId === 'string' && orig.providerPaymentId !== '')
|
|
948
954
|
return;
|
|
949
|
-
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `Zahlung ${i + 1}: Karten-Rueckbuchung ohne Bezug: providerPaymentId der Erstattung am Terminal angeben (oder das Original
|
|
955
|
+
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `Zahlung ${i + 1}: Karten-Rueckbuchung ohne Bezug: providerPaymentId der Erstattung am Terminal angeben (oder das Original mit Anbieterdaten lesen: API-Schluessel des Betriebs oder Kassen-Anmeldung, dort traegt es die Kennung der Kartenzahlung)`, 'request');
|
|
950
956
|
});
|
|
951
957
|
}
|
|
952
958
|
/** Kartenanbieter pruefen — er stammt vom Aufrufer, nicht aus Serverdaten. */
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
2
|
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, type Voucher, type VoucherArticle, type IssuedVoucher, 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, RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS, type ReceiptOutputLogKind, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputResult, RECEIPT_OUTPUT_ENTRIES_MAX, type ReceiptOutput, type ReceiptOutputActor, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, type ReceiptOutputEntryErrorCode, RECEIPT_OUTPUT_ERROR_CODES, type ReceiptOutputErrorCode, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, type ReceiptOutputFieldError, 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
|
-
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, type ReceiptOutputEntry, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type RejectedReceiptOutput, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, type CashregisterReportPeriod, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, type ListReceiptsErrorCode, type ListReceiptsView, type ListReceiptsOrder, type ListReceiptsOptions, type ListReceiptsWindow, type ListReceiptsGrossByRate, type ListReceiptsSummary, type ListReceiptsDaySummary, type ListReceiptsPage, type ListedReceipt, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
|
|
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, type ReceiptOutputEntry, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type RejectedReceiptOutput, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, type CashregisterReportPeriod, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, listedReceiptWithCompany, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, type ListReceiptsErrorCode, type ListReceiptsView, type ListReceiptsOrder, type ListReceiptsOptions, type ListReceiptsWindow, type ListReceiptsGrossByRate, type ListReceiptsSummary, type ListReceiptsDaySummary, type ListReceiptsPage, type ListedReceipt, type ListedFullReceipt, type ListReceiptsHeader, 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, type VoucherDueInfo, type VoucherDueArticle, type VoucherDueType, type VoucherRedeemContext, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
|
|
6
6
|
export { type PosBusinessSettings, type PosDeviceSettings, type PosSettings, type ArticleGroup, type PosArticle, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, } from './pos/index.js';
|
package/dist/cjs/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RECEIPT_OUTPUT_LOG_KINDS = exports.RECEIPT_OUTPUT_KINDS = 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.isVoucherFloatItem = exports.isVoucherItem = 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
4
|
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 = exports.isReceiptError = exports.receiptErrorCode = exports.isReceiptErrorCode = exports.RECEIPT_ERROR_CODES = exports.receiptOutputFieldErrors = exports.isReceiptOutputError = exports.receiptOutputErrorCode = exports.isReceiptOutputErrorCode = exports.RECEIPT_OUTPUT_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRY_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRIES_MAX = exports.RECEIPT_OUTPUT_RESULTS = void 0;
|
|
5
|
-
exports.
|
|
6
|
-
exports.voucherPermsOf = 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.VOUCHER_ZERO_RATE_BUCKET_FROM = void 0;
|
|
5
|
+
exports.isReceiptDueError = exports.RECEIPT_DUE_ERROR_REASONS = exports.ReceiptDueError = exports.receiptDueBreakdown = exports.receiptDueCents = exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.LIST_RECEIPTS_ERROR_CODES = exports.LIST_ALL_RECEIPTS_MAX_PAGES = exports.LIST_RECEIPTS_DAYS_MAX = exports.LIST_RECEIPTS_LIMIT_MAX = exports.LIST_RECEIPTS_ORDERS = exports.LIST_RECEIPTS_VIEWS = exports.listedReceiptWithCompany = exports.fromListReceiptsSummaryPayload = exports.listAllReceipts = exports.listReceipts = exports.getReportV2 = exports.getCashregisterReport = exports.downloadMonthlyReport = exports.downloadDailyReport = exports.logReceiptOutputs = 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 = 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 = void 0;
|
|
6
|
+
exports.voucherPermsOf = 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.VOUCHER_ZERO_RATE_BUCKET_FROM = exports.voucherRedeemMaxCents = void 0;
|
|
7
7
|
var index_js_1 = require("./enums/index.js");
|
|
8
8
|
Object.defineProperty(exports, "ReceiptType", { enumerable: true, get: function () { return index_js_1.ReceiptType; } });
|
|
9
9
|
Object.defineProperty(exports, "VatRate", { enumerable: true, get: function () { return index_js_1.VatRate; } });
|
|
@@ -142,6 +142,7 @@ Object.defineProperty(exports, "getReportV2", { enumerable: true, get: function
|
|
|
142
142
|
Object.defineProperty(exports, "listReceipts", { enumerable: true, get: function () { return index_js_3.listReceipts; } });
|
|
143
143
|
Object.defineProperty(exports, "listAllReceipts", { enumerable: true, get: function () { return index_js_3.listAllReceipts; } });
|
|
144
144
|
Object.defineProperty(exports, "fromListReceiptsSummaryPayload", { enumerable: true, get: function () { return index_js_3.fromListReceiptsSummaryPayload; } });
|
|
145
|
+
Object.defineProperty(exports, "listedReceiptWithCompany", { enumerable: true, get: function () { return index_js_3.listedReceiptWithCompany; } });
|
|
145
146
|
Object.defineProperty(exports, "LIST_RECEIPTS_VIEWS", { enumerable: true, get: function () { return index_js_3.LIST_RECEIPTS_VIEWS; } });
|
|
146
147
|
Object.defineProperty(exports, "LIST_RECEIPTS_ORDERS", { enumerable: true, get: function () { return index_js_3.LIST_RECEIPTS_ORDERS; } });
|
|
147
148
|
Object.defineProperty(exports, "LIST_RECEIPTS_LIMIT_MAX", { enumerable: true, get: function () { return index_js_3.LIST_RECEIPTS_LIMIT_MAX; } });
|
|
@@ -10,6 +10,7 @@ export { RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS,
|
|
|
10
10
|
export { type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, } from './receipt-company.js';
|
|
11
11
|
export { type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, } from './cashregister.js';
|
|
12
12
|
export { type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind } from './receipt-summary.js';
|
|
13
|
+
export { type ManualReceipt, type ManualReceiptReason, MANUAL_RECEIPT_REASONS, readManualReceipt, type ManualReceiptErrorCode, MANUAL_RECEIPT_ERROR_CODES, isManualReceiptErrorCode, } from './manual-receipt.js';
|
|
13
14
|
export { type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, } from './report-month.js';
|
|
14
15
|
export { type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, } from './stripe-url-session.js';
|
|
15
16
|
export { type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './hobex-receipt.js';
|
package/dist/cjs/models/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
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.asksRefundTip = exports.asksTipRefundSource = exports.cancellationCashRefundCents = exports.cancellationItemsForTip = exports.openStaffTipCents = exports.isTipRefundSource = exports.TIP_REFUND_SOURCES = exports.remainingQuantities = 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.readRegistrationInfo = exports.fromReceiptPayload = exports.toReceiptPayload = exports.voucherServerFields = exports.isNewFormVoucher = exports.voucherIsValid = exports.fromVoucherPayload = exports.toVoucherPayload = exports.isVoucherFloatItem = exports.isVoucherItem = exports.isDiscountItem = exports.isTipItem = exports.negateReceiptItem = exports.receiptItemIsValid = exports.receiptItemTotalCents = exports.fromReceiptItemPayload = exports.toReceiptItemPayload = void 0;
|
|
4
|
-
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.receiptOutputFieldErrors = exports.isReceiptOutputError = exports.receiptOutputErrorCode = exports.isReceiptOutputErrorCode = exports.RECEIPT_OUTPUT_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRY_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRIES_MAX = exports.RECEIPT_OUTPUT_RESULTS = exports.RECEIPT_OUTPUT_LOG_KINDS = exports.RECEIPT_OUTPUT_KINDS = exports.receiptFieldErrors = exports.isReceiptError = exports.receiptErrorCode = exports.isReceiptErrorCode = exports.RECEIPT_ERROR_CODES = exports.receiptEmailFieldErrors = exports.isReceiptEmailError = exports.receiptEmailErrorCode = void 0;
|
|
4
|
+
exports.hobexReceiptNeedsSignature = exports.hobexReceiptToCardPaymentData = exports.fromHobexReceiptPayload = exports.toHobexReceiptPayload = exports.fromStripeUrlSessionPayload = exports.toStripeUrlSessionPayload = exports.reportMonthReadable = exports.reportMonthKey = exports.nextReportMonth = exports.previousReportMonth = exports.reportMonthFromDate = exports.isManualReceiptErrorCode = exports.MANUAL_RECEIPT_ERROR_CODES = exports.readManualReceipt = exports.MANUAL_RECEIPT_REASONS = exports.isZeroKind = exports.ZERO_KINDS = exports.fromReceiptSummaryPayload = exports.fromCashregisterPayload = exports.receiptCompanyTaxInfo = exports.fromReceiptCompanyPayload = exports.receiptOutputFieldErrors = exports.isReceiptOutputError = exports.receiptOutputErrorCode = exports.isReceiptOutputErrorCode = exports.RECEIPT_OUTPUT_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRY_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRIES_MAX = exports.RECEIPT_OUTPUT_RESULTS = exports.RECEIPT_OUTPUT_LOG_KINDS = exports.RECEIPT_OUTPUT_KINDS = exports.receiptFieldErrors = exports.isReceiptError = exports.receiptErrorCode = exports.isReceiptErrorCode = exports.RECEIPT_ERROR_CODES = exports.receiptEmailFieldErrors = exports.isReceiptEmailError = exports.receiptEmailErrorCode = void 0;
|
|
5
5
|
var receipt_item_js_1 = require("./receipt-item.js");
|
|
6
6
|
Object.defineProperty(exports, "toReceiptItemPayload", { enumerable: true, get: function () { return receipt_item_js_1.toReceiptItemPayload; } });
|
|
7
7
|
Object.defineProperty(exports, "fromReceiptItemPayload", { enumerable: true, get: function () { return receipt_item_js_1.fromReceiptItemPayload; } });
|
|
@@ -88,6 +88,11 @@ var receipt_summary_js_1 = require("./receipt-summary.js");
|
|
|
88
88
|
Object.defineProperty(exports, "fromReceiptSummaryPayload", { enumerable: true, get: function () { return receipt_summary_js_1.fromReceiptSummaryPayload; } });
|
|
89
89
|
Object.defineProperty(exports, "ZERO_KINDS", { enumerable: true, get: function () { return receipt_summary_js_1.ZERO_KINDS; } });
|
|
90
90
|
Object.defineProperty(exports, "isZeroKind", { enumerable: true, get: function () { return receipt_summary_js_1.isZeroKind; } });
|
|
91
|
+
var manual_receipt_js_1 = require("./manual-receipt.js");
|
|
92
|
+
Object.defineProperty(exports, "MANUAL_RECEIPT_REASONS", { enumerable: true, get: function () { return manual_receipt_js_1.MANUAL_RECEIPT_REASONS; } });
|
|
93
|
+
Object.defineProperty(exports, "readManualReceipt", { enumerable: true, get: function () { return manual_receipt_js_1.readManualReceipt; } });
|
|
94
|
+
Object.defineProperty(exports, "MANUAL_RECEIPT_ERROR_CODES", { enumerable: true, get: function () { return manual_receipt_js_1.MANUAL_RECEIPT_ERROR_CODES; } });
|
|
95
|
+
Object.defineProperty(exports, "isManualReceiptErrorCode", { enumerable: true, get: function () { return manual_receipt_js_1.isManualReceiptErrorCode; } });
|
|
91
96
|
var report_month_js_1 = require("./report-month.js");
|
|
92
97
|
Object.defineProperty(exports, "reportMonthFromDate", { enumerable: true, get: function () { return report_month_js_1.reportMonthFromDate; } });
|
|
93
98
|
Object.defineProperty(exports, "previousReportMonth", { enumerable: true, get: function () { return report_month_js_1.previousReportMonth; } });
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nacherfassung eines Handbelegs (`manualReceipt` am Beleg, Backend
|
|
3
|
+
* `handbeleg`): Nach einem Ausfall der Kasse oder einer Leistung ausser Haus
|
|
4
|
+
* wird der handschriftliche Beleg (Paragon) in der Kasse nacherfasst. Der
|
|
5
|
+
* Beleg traegt dann Nummer, Datum und Grund des Handbelegs; sein eigener
|
|
6
|
+
* Zeitstempel bleibt der Zeitpunkt der Nacherfassung (kein Rueckdatieren).
|
|
7
|
+
*
|
|
8
|
+
* Rechtsgrundlage: § 17 Abs 5 RKSV, Registrierkassenerlass Abschnitt 3.6.1
|
|
9
|
+
* (Ausfall, Tagessammelbeleg erlaubt) und 6.7 (ausser Haus, jeder Beleg
|
|
10
|
+
* einzeln; nicht fuer Taxi und Mietwagen, § 7 Abs 2 BarUV).
|
|
11
|
+
* Geprueft wird am Server; dieses Paket liest nur und reicht die Eingabe weiter.
|
|
12
|
+
*/
|
|
13
|
+
/** Gruende einer Nacherfassung: fuenf Ausfall-Gruende und die Leistung ausser Haus. */
|
|
14
|
+
export declare const MANUAL_RECEIPT_REASONS: readonly ["network_outage", "power_outage", "device_failure", "system_outage", "other", "outside_premises"];
|
|
15
|
+
export type ManualReceiptReason = (typeof MANUAL_RECEIPT_REASONS)[number];
|
|
16
|
+
export interface ManualReceipt {
|
|
17
|
+
/** Nummer des Handbelegs (eigene Nummernreihe des Paragons, nie die Kassennummer). */
|
|
18
|
+
number: string;
|
|
19
|
+
/** Letzte Nummer: macht den Beleg zum Tagessammelbeleg (nur nach einem Ausfall). */
|
|
20
|
+
numberTo?: string;
|
|
21
|
+
/** Zahl der Handbelege im Tagessammelbeleg. */
|
|
22
|
+
count?: number;
|
|
23
|
+
/** Tag des Handbelegs, `YYYY-MM-DD` (Wiener Tag). */
|
|
24
|
+
date: string;
|
|
25
|
+
/** Uhrzeit des Handbelegs, `HH:MM`. */
|
|
26
|
+
time?: string;
|
|
27
|
+
/** Grund; ein Wert, den dieses Paket nicht kennt, bleibt als roher Text lesbar. */
|
|
28
|
+
reason: ManualReceiptReason | string;
|
|
29
|
+
/** Eigener Text, nur beim Grund `other`. */
|
|
30
|
+
note?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Liest `manualReceipt` vom Draht. Ohne Nummer, Datum oder Grund gibt es
|
|
34
|
+
* keinen Handbeleg (`undefined`); ein einzelnes Zusatzfeld in falscher Form
|
|
35
|
+
* faellt weg, statt den Beleg scheitern zu lassen.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readManualReceipt(roh: unknown): ManualReceipt | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Fehlercodes von `createReceipt` zur Nacherfassung (Vertrag `errorCodes.manualReceipt`).
|
|
40
|
+
* `manual_receipt_duplicate` traegt in `details.receiptId` den Beleg, der den Handbeleg
|
|
41
|
+
* schon nacherfasst hat: nicht erneut senden, sondern diesen Beleg nehmen.
|
|
42
|
+
*/
|
|
43
|
+
export declare const MANUAL_RECEIPT_ERROR_CODES: readonly ["invalid_manual_receipt", "manual_receipt_not_allowed", "manual_receipt_date_in_future", "manual_receipt_range_not_allowed", "manual_receipt_duplicate"];
|
|
44
|
+
export type ManualReceiptErrorCode = (typeof MANUAL_RECEIPT_ERROR_CODES)[number];
|
|
45
|
+
export declare function isManualReceiptErrorCode(value: unknown): value is ManualReceiptErrorCode;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Nacherfassung eines Handbelegs (`manualReceipt` am Beleg, Backend
|
|
4
|
+
* `handbeleg`): Nach einem Ausfall der Kasse oder einer Leistung ausser Haus
|
|
5
|
+
* wird der handschriftliche Beleg (Paragon) in der Kasse nacherfasst. Der
|
|
6
|
+
* Beleg traegt dann Nummer, Datum und Grund des Handbelegs; sein eigener
|
|
7
|
+
* Zeitstempel bleibt der Zeitpunkt der Nacherfassung (kein Rueckdatieren).
|
|
8
|
+
*
|
|
9
|
+
* Rechtsgrundlage: § 17 Abs 5 RKSV, Registrierkassenerlass Abschnitt 3.6.1
|
|
10
|
+
* (Ausfall, Tagessammelbeleg erlaubt) und 6.7 (ausser Haus, jeder Beleg
|
|
11
|
+
* einzeln; nicht fuer Taxi und Mietwagen, § 7 Abs 2 BarUV).
|
|
12
|
+
* Geprueft wird am Server; dieses Paket liest nur und reicht die Eingabe weiter.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.MANUAL_RECEIPT_ERROR_CODES = exports.MANUAL_RECEIPT_REASONS = void 0;
|
|
16
|
+
exports.readManualReceipt = readManualReceipt;
|
|
17
|
+
exports.isManualReceiptErrorCode = isManualReceiptErrorCode;
|
|
18
|
+
/** Gruende einer Nacherfassung: fuenf Ausfall-Gruende und die Leistung ausser Haus. */
|
|
19
|
+
exports.MANUAL_RECEIPT_REASONS = [
|
|
20
|
+
'network_outage', 'power_outage', 'device_failure', 'system_outage', 'other', 'outside_premises',
|
|
21
|
+
];
|
|
22
|
+
const istText = (w) => typeof w === 'string' && w !== '';
|
|
23
|
+
/**
|
|
24
|
+
* Liest `manualReceipt` vom Draht. Ohne Nummer, Datum oder Grund gibt es
|
|
25
|
+
* keinen Handbeleg (`undefined`); ein einzelnes Zusatzfeld in falscher Form
|
|
26
|
+
* faellt weg, statt den Beleg scheitern zu lassen.
|
|
27
|
+
*/
|
|
28
|
+
function readManualReceipt(roh) {
|
|
29
|
+
if (roh === null || typeof roh !== 'object' || Array.isArray(roh))
|
|
30
|
+
return undefined;
|
|
31
|
+
const o = roh;
|
|
32
|
+
if (!istText(o['number']) || !istText(o['date']) || !istText(o['reason']))
|
|
33
|
+
return undefined;
|
|
34
|
+
return {
|
|
35
|
+
number: o['number'],
|
|
36
|
+
...(istText(o['numberTo']) ? { numberTo: o['numberTo'] } : {}),
|
|
37
|
+
...(typeof o['count'] === 'number' && Number.isInteger(o['count']) ? { count: o['count'] } : {}),
|
|
38
|
+
date: o['date'],
|
|
39
|
+
...(istText(o['time']) ? { time: o['time'] } : {}),
|
|
40
|
+
reason: o['reason'],
|
|
41
|
+
...(istText(o['note']) ? { note: o['note'] } : {}),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Fehlercodes von `createReceipt` zur Nacherfassung (Vertrag `errorCodes.manualReceipt`).
|
|
46
|
+
* `manual_receipt_duplicate` traegt in `details.receiptId` den Beleg, der den Handbeleg
|
|
47
|
+
* schon nacherfasst hat: nicht erneut senden, sondern diesen Beleg nehmen.
|
|
48
|
+
*/
|
|
49
|
+
exports.MANUAL_RECEIPT_ERROR_CODES = Object.freeze([
|
|
50
|
+
'invalid_manual_receipt',
|
|
51
|
+
'manual_receipt_not_allowed',
|
|
52
|
+
'manual_receipt_date_in_future',
|
|
53
|
+
'manual_receipt_range_not_allowed',
|
|
54
|
+
'manual_receipt_duplicate',
|
|
55
|
+
]);
|
|
56
|
+
function isManualReceiptErrorCode(value) {
|
|
57
|
+
return typeof value === 'string' && exports.MANUAL_RECEIPT_ERROR_CODES.includes(value);
|
|
58
|
+
}
|