@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.
Files changed (208) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +20 -8
  3. package/dist/cjs/client/index.d.ts +1 -1
  4. package/dist/cjs/client/index.js +3 -2
  5. package/dist/cjs/client/list-receipts.d.ts +48 -5
  6. package/dist/cjs/client/list-receipts.js +68 -3
  7. package/dist/cjs/client/receipts.d.ts +6 -0
  8. package/dist/cjs/client/receipts.js +8 -2
  9. package/dist/cjs/index.d.ts +1 -1
  10. package/dist/cjs/index.js +3 -2
  11. package/dist/cjs/models/index.d.ts +1 -0
  12. package/dist/cjs/models/index.js +6 -1
  13. package/dist/cjs/models/manual-receipt.d.ts +45 -0
  14. package/dist/cjs/models/manual-receipt.js +58 -0
  15. package/dist/cjs/models/receipt-summary.d.ts +4 -0
  16. package/dist/cjs/models/receipt-summary.js +6 -0
  17. package/dist/cjs/models/receipt.d.ts +9 -3
  18. package/dist/cjs/models/receipt.js +6 -0
  19. package/dist/cjs/receipt/layout.js +57 -0
  20. package/dist/cjs/stored/vokabular.d.ts +1 -1
  21. package/dist/cjs/stored/vokabular.js +23 -2
  22. package/dist/cjs/version.d.ts +1 -1
  23. package/dist/cjs/version.js +1 -1
  24. package/dist/esm/client/index.d.ts +1 -1
  25. package/dist/esm/client/index.js +1 -1
  26. package/dist/esm/client/list-receipts.d.ts +48 -5
  27. package/dist/esm/client/list-receipts.js +67 -3
  28. package/dist/esm/client/receipts.d.ts +6 -0
  29. package/dist/esm/client/receipts.js +8 -2
  30. package/dist/esm/index.d.ts +1 -1
  31. package/dist/esm/index.js +1 -1
  32. package/dist/esm/models/index.d.ts +1 -0
  33. package/dist/esm/models/index.js +1 -0
  34. package/dist/esm/models/manual-receipt.d.ts +45 -0
  35. package/dist/esm/models/manual-receipt.js +53 -0
  36. package/dist/esm/models/receipt-summary.d.ts +4 -0
  37. package/dist/esm/models/receipt-summary.js +6 -0
  38. package/dist/esm/models/receipt.d.ts +9 -3
  39. package/dist/esm/models/receipt.js +6 -0
  40. package/dist/esm/receipt/layout.js +57 -0
  41. package/dist/esm/stored/vokabular.d.ts +1 -1
  42. package/dist/esm/stored/vokabular.js +23 -2
  43. package/dist/esm/version.d.ts +1 -1
  44. package/dist/esm/version.js +1 -1
  45. package/fixtures/expected/manual-receipt-range-device-failure-count.grid32.txt +36 -0
  46. package/fixtures/expected/manual-receipt-range-device-failure-count.grid48.txt +36 -0
  47. package/fixtures/expected/manual-receipt-range-device-failure-count.lines.json +299 -0
  48. package/fixtures/expected/manual-receipt-range-device-failure-count.sheet32.json +242 -0
  49. package/fixtures/expected/manual-receipt-range-device-failure-count.sheet48.json +242 -0
  50. package/fixtures/expected/manual-receipt-range-device-failure-no-count.grid32.txt +36 -0
  51. package/fixtures/expected/manual-receipt-range-device-failure-no-count.grid48.txt +36 -0
  52. package/fixtures/expected/manual-receipt-range-device-failure-no-count.lines.json +299 -0
  53. package/fixtures/expected/manual-receipt-range-device-failure-no-count.sheet32.json +242 -0
  54. package/fixtures/expected/manual-receipt-range-device-failure-no-count.sheet48.json +242 -0
  55. package/fixtures/expected/manual-receipt-range-network-outage-count.grid32.txt +33 -0
  56. package/fixtures/expected/manual-receipt-range-network-outage-count.grid48.txt +33 -0
  57. package/fixtures/expected/manual-receipt-range-network-outage-count.lines.json +259 -0
  58. package/fixtures/expected/manual-receipt-range-network-outage-count.sheet32.json +224 -0
  59. package/fixtures/expected/manual-receipt-range-network-outage-count.sheet48.json +224 -0
  60. package/fixtures/expected/manual-receipt-range-network-outage-no-count.grid32.txt +33 -0
  61. package/fixtures/expected/manual-receipt-range-network-outage-no-count.grid48.txt +33 -0
  62. package/fixtures/expected/manual-receipt-range-network-outage-no-count.lines.json +259 -0
  63. package/fixtures/expected/manual-receipt-range-network-outage-no-count.sheet32.json +224 -0
  64. package/fixtures/expected/manual-receipt-range-network-outage-no-count.sheet48.json +224 -0
  65. package/fixtures/expected/manual-receipt-range-other-count.grid32.txt +36 -0
  66. package/fixtures/expected/manual-receipt-range-other-count.grid48.txt +36 -0
  67. package/fixtures/expected/manual-receipt-range-other-count.lines.json +299 -0
  68. package/fixtures/expected/manual-receipt-range-other-count.sheet32.json +242 -0
  69. package/fixtures/expected/manual-receipt-range-other-count.sheet48.json +242 -0
  70. package/fixtures/expected/manual-receipt-range-other-no-count.grid32.txt +36 -0
  71. package/fixtures/expected/manual-receipt-range-other-no-count.grid48.txt +36 -0
  72. package/fixtures/expected/manual-receipt-range-other-no-count.lines.json +299 -0
  73. package/fixtures/expected/manual-receipt-range-other-no-count.sheet32.json +242 -0
  74. package/fixtures/expected/manual-receipt-range-other-no-count.sheet48.json +242 -0
  75. package/fixtures/expected/manual-receipt-range-power-outage-count.grid32.txt +37 -0
  76. package/fixtures/expected/manual-receipt-range-power-outage-count.grid48.txt +37 -0
  77. package/fixtures/expected/manual-receipt-range-power-outage-count.lines.json +305 -0
  78. package/fixtures/expected/manual-receipt-range-power-outage-count.sheet32.json +248 -0
  79. package/fixtures/expected/manual-receipt-range-power-outage-count.sheet48.json +248 -0
  80. package/fixtures/expected/manual-receipt-range-power-outage-no-count.grid32.txt +37 -0
  81. package/fixtures/expected/manual-receipt-range-power-outage-no-count.grid48.txt +37 -0
  82. package/fixtures/expected/manual-receipt-range-power-outage-no-count.lines.json +305 -0
  83. package/fixtures/expected/manual-receipt-range-power-outage-no-count.sheet32.json +248 -0
  84. package/fixtures/expected/manual-receipt-range-power-outage-no-count.sheet48.json +248 -0
  85. package/fixtures/expected/manual-receipt-range-system-outage-count.grid32.txt +33 -0
  86. package/fixtures/expected/manual-receipt-range-system-outage-count.grid48.txt +33 -0
  87. package/fixtures/expected/manual-receipt-range-system-outage-count.lines.json +259 -0
  88. package/fixtures/expected/manual-receipt-range-system-outage-count.sheet32.json +224 -0
  89. package/fixtures/expected/manual-receipt-range-system-outage-count.sheet48.json +224 -0
  90. package/fixtures/expected/manual-receipt-range-system-outage-no-count.grid32.txt +33 -0
  91. package/fixtures/expected/manual-receipt-range-system-outage-no-count.grid48.txt +33 -0
  92. package/fixtures/expected/manual-receipt-range-system-outage-no-count.lines.json +259 -0
  93. package/fixtures/expected/manual-receipt-range-system-outage-no-count.sheet32.json +224 -0
  94. package/fixtures/expected/manual-receipt-range-system-outage-no-count.sheet48.json +224 -0
  95. package/fixtures/expected/manual-receipt-single-device-failure-no-time.grid32.txt +31 -0
  96. package/fixtures/expected/manual-receipt-single-device-failure-no-time.grid48.txt +31 -0
  97. package/fixtures/expected/manual-receipt-single-device-failure-no-time.lines.json +253 -0
  98. package/fixtures/expected/manual-receipt-single-device-failure-no-time.sheet32.json +212 -0
  99. package/fixtures/expected/manual-receipt-single-device-failure-no-time.sheet48.json +212 -0
  100. package/fixtures/expected/manual-receipt-single-device-failure-time.grid32.txt +31 -0
  101. package/fixtures/expected/manual-receipt-single-device-failure-time.grid48.txt +31 -0
  102. package/fixtures/expected/manual-receipt-single-device-failure-time.lines.json +253 -0
  103. package/fixtures/expected/manual-receipt-single-device-failure-time.sheet32.json +212 -0
  104. package/fixtures/expected/manual-receipt-single-device-failure-time.sheet48.json +212 -0
  105. package/fixtures/expected/manual-receipt-single-network-outage-no-time.grid32.txt +32 -0
  106. package/fixtures/expected/manual-receipt-single-network-outage-no-time.grid48.txt +31 -0
  107. package/fixtures/expected/manual-receipt-single-network-outage-no-time.lines.json +253 -0
  108. package/fixtures/expected/manual-receipt-single-network-outage-no-time.sheet32.json +218 -0
  109. package/fixtures/expected/manual-receipt-single-network-outage-no-time.sheet48.json +212 -0
  110. package/fixtures/expected/manual-receipt-single-network-outage-time.grid32.txt +32 -0
  111. package/fixtures/expected/manual-receipt-single-network-outage-time.grid48.txt +31 -0
  112. package/fixtures/expected/manual-receipt-single-network-outage-time.lines.json +253 -0
  113. package/fixtures/expected/manual-receipt-single-network-outage-time.sheet32.json +218 -0
  114. package/fixtures/expected/manual-receipt-single-network-outage-time.sheet48.json +212 -0
  115. package/fixtures/expected/manual-receipt-single-other-no-time.grid32.txt +35 -0
  116. package/fixtures/expected/manual-receipt-single-other-no-time.grid48.txt +34 -0
  117. package/fixtures/expected/manual-receipt-single-other-no-time.lines.json +299 -0
  118. package/fixtures/expected/manual-receipt-single-other-no-time.sheet32.json +236 -0
  119. package/fixtures/expected/manual-receipt-single-other-no-time.sheet48.json +230 -0
  120. package/fixtures/expected/manual-receipt-single-other-time.grid32.txt +35 -0
  121. package/fixtures/expected/manual-receipt-single-other-time.grid48.txt +34 -0
  122. package/fixtures/expected/manual-receipt-single-other-time.lines.json +299 -0
  123. package/fixtures/expected/manual-receipt-single-other-time.sheet32.json +236 -0
  124. package/fixtures/expected/manual-receipt-single-other-time.sheet48.json +230 -0
  125. package/fixtures/expected/manual-receipt-single-outside-premises-no-time.grid32.txt +31 -0
  126. package/fixtures/expected/manual-receipt-single-outside-premises-no-time.grid48.txt +31 -0
  127. package/fixtures/expected/manual-receipt-single-outside-premises-no-time.lines.json +247 -0
  128. package/fixtures/expected/manual-receipt-single-outside-premises-no-time.sheet32.json +212 -0
  129. package/fixtures/expected/manual-receipt-single-outside-premises-no-time.sheet48.json +212 -0
  130. package/fixtures/expected/manual-receipt-single-outside-premises-time.grid32.txt +31 -0
  131. package/fixtures/expected/manual-receipt-single-outside-premises-time.grid48.txt +31 -0
  132. package/fixtures/expected/manual-receipt-single-outside-premises-time.lines.json +247 -0
  133. package/fixtures/expected/manual-receipt-single-outside-premises-time.sheet32.json +212 -0
  134. package/fixtures/expected/manual-receipt-single-outside-premises-time.sheet48.json +212 -0
  135. package/fixtures/expected/manual-receipt-single-power-outage-no-time.grid32.txt +35 -0
  136. package/fixtures/expected/manual-receipt-single-power-outage-no-time.grid48.txt +34 -0
  137. package/fixtures/expected/manual-receipt-single-power-outage-no-time.lines.json +299 -0
  138. package/fixtures/expected/manual-receipt-single-power-outage-no-time.sheet32.json +236 -0
  139. package/fixtures/expected/manual-receipt-single-power-outage-no-time.sheet48.json +230 -0
  140. package/fixtures/expected/manual-receipt-single-power-outage-time.grid32.txt +35 -0
  141. package/fixtures/expected/manual-receipt-single-power-outage-time.grid48.txt +34 -0
  142. package/fixtures/expected/manual-receipt-single-power-outage-time.lines.json +299 -0
  143. package/fixtures/expected/manual-receipt-single-power-outage-time.sheet32.json +236 -0
  144. package/fixtures/expected/manual-receipt-single-power-outage-time.sheet48.json +230 -0
  145. package/fixtures/expected/manual-receipt-single-small-business.grid32.txt +34 -0
  146. package/fixtures/expected/manual-receipt-single-small-business.grid48.txt +33 -0
  147. package/fixtures/expected/manual-receipt-single-small-business.lines.json +257 -0
  148. package/fixtures/expected/manual-receipt-single-small-business.sheet32.json +230 -0
  149. package/fixtures/expected/manual-receipt-single-small-business.sheet48.json +224 -0
  150. package/fixtures/expected/manual-receipt-single-system-outage-no-time.grid32.txt +32 -0
  151. package/fixtures/expected/manual-receipt-single-system-outage-no-time.grid48.txt +31 -0
  152. package/fixtures/expected/manual-receipt-single-system-outage-no-time.lines.json +253 -0
  153. package/fixtures/expected/manual-receipt-single-system-outage-no-time.sheet32.json +218 -0
  154. package/fixtures/expected/manual-receipt-single-system-outage-no-time.sheet48.json +212 -0
  155. package/fixtures/expected/manual-receipt-single-system-outage-time.grid32.txt +32 -0
  156. package/fixtures/expected/manual-receipt-single-system-outage-time.grid48.txt +31 -0
  157. package/fixtures/expected/manual-receipt-single-system-outage-time.lines.json +253 -0
  158. package/fixtures/expected/manual-receipt-single-system-outage-time.sheet32.json +218 -0
  159. package/fixtures/expected/manual-receipt-single-system-outage-time.sheet48.json +212 -0
  160. package/fixtures/expected/zero-outage-end-period.grid32.txt +35 -0
  161. package/fixtures/expected/zero-outage-end-period.grid48.txt +31 -0
  162. package/fixtures/expected/zero-outage-end-period.lines.json +230 -0
  163. package/fixtures/expected/zero-outage-end-period.sheet32.json +236 -0
  164. package/fixtures/expected/zero-outage-end-period.sheet48.json +212 -0
  165. package/fixtures/hobex-hps-codes.json +1 -1
  166. package/fixtures/invoice-api.schema.json +1 -1
  167. package/fixtures/invoice-texts.json +1 -1
  168. package/fixtures/manifest.json +192 -0
  169. package/fixtures/pos-texts.json +1 -1
  170. package/fixtures/receipts/manual-receipt-range-device-failure-count.json +56 -0
  171. package/fixtures/receipts/manual-receipt-range-device-failure-no-count.json +55 -0
  172. package/fixtures/receipts/manual-receipt-range-network-outage-count.json +50 -0
  173. package/fixtures/receipts/manual-receipt-range-network-outage-no-count.json +49 -0
  174. package/fixtures/receipts/manual-receipt-range-other-count.json +57 -0
  175. package/fixtures/receipts/manual-receipt-range-other-no-count.json +56 -0
  176. package/fixtures/receipts/manual-receipt-range-power-outage-count.json +56 -0
  177. package/fixtures/receipts/manual-receipt-range-power-outage-no-count.json +55 -0
  178. package/fixtures/receipts/manual-receipt-range-system-outage-count.json +50 -0
  179. package/fixtures/receipts/manual-receipt-range-system-outage-no-count.json +49 -0
  180. package/fixtures/receipts/manual-receipt-single-device-failure-no-time.json +48 -0
  181. package/fixtures/receipts/manual-receipt-single-device-failure-time.json +49 -0
  182. package/fixtures/receipts/manual-receipt-single-network-outage-no-time.json +49 -0
  183. package/fixtures/receipts/manual-receipt-single-network-outage-time.json +50 -0
  184. package/fixtures/receipts/manual-receipt-single-other-no-time.json +55 -0
  185. package/fixtures/receipts/manual-receipt-single-other-time.json +56 -0
  186. package/fixtures/receipts/manual-receipt-single-outside-premises-no-time.json +48 -0
  187. package/fixtures/receipts/manual-receipt-single-outside-premises-time.json +49 -0
  188. package/fixtures/receipts/manual-receipt-single-power-outage-no-time.json +54 -0
  189. package/fixtures/receipts/manual-receipt-single-power-outage-time.json +55 -0
  190. package/fixtures/receipts/manual-receipt-single-small-business.json +48 -0
  191. package/fixtures/receipts/manual-receipt-single-system-outage-no-time.json +49 -0
  192. package/fixtures/receipts/manual-receipt-single-system-outage-time.json +50 -0
  193. package/fixtures/receipts/zero-outage-end-period.json +43 -0
  194. package/fixtures/surface.json +1 -1
  195. package/fixtures/v3/antworten/belege.json +585 -9
  196. package/fixtures/v3/antworten/belegmail.json +2 -2
  197. package/fixtures/v3/antworten/berichte.json +2 -2
  198. package/fixtures/v3/antworten/kasse-belege.json +433 -3
  199. package/fixtures/v3/antworten/kasse.json +3 -3
  200. package/fixtures/v3/antworten/lager.json +1 -1
  201. package/fixtures/v3/antworten/rechnungen.json +2 -2
  202. package/fixtures/v3/antworten/storno.json +15 -3
  203. package/fixtures/v3/stored/belege.json +57 -3
  204. package/fixtures/v3/stored/kasse.json +3 -3
  205. package/fixtures/v3/stored/rechnungen.json +2 -2
  206. package/fixtures/v3/v3-vokabular.json +188 -11
  207. package/fixtures/v3/zahlbetrag-faelle.json +2 -2
  208. 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. On the public channel only this layout carries the card block, because
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 `Receipt`, the same shape as `getReportV2`. For one receipt
645
- with its print layout use `getReceiptWithCompany`, for the PDF
646
- `downloadReceipt` with `fullReceiptId`. `ListReceiptsSummary` is not the
647
- `ReceiptSummary` of `listMyReceipts` (register path, other fields).
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. Only the
718
- register channel (`registerUserAuth`, `kasse.kasseneck.at/api/v3`) returns it;
719
- the public channel leaves provider data out. The refund payment then carries
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';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.downloadDailyReport = 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.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 = 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
- /** Ein Beleg der Liste je Ansicht: `full` das Belegdokument wie bei `getReportV2`, sonst die Zeile. */
148
- export type ListedReceipt<V extends ListReceiptsView = 'summary'> = V extends 'full' ? Receipt : ListReceiptsSummary;
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
- * ([Receipt], dieselbe Form wie `getReportV2`), sonst [ListReceiptsSummary].
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
- * ([Receipt], dieselbe Form wie `getReportV2`), sonst [ListReceiptsSummary].
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) => (0, index_js_2.fromReceiptPayload)(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 kommt nur ueber den Kassenweg (registerUserAuth, kasse.kasseneck.at/api/v3), nicht ueber den oeffentlichen Weg`, 'request');
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 ueber den Kassenweg lesen, dort traegt es die Kennung der Kartenzahlung)`, 'request');
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. */
@@ -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.voucherRedeemMaxCents = 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.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 = 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';
@@ -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
+ }