@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KeckPaymentMethod, ReceiptType } from '../enums/index.js';
|
|
2
2
|
import { type CancellationStatus } from './cancellation.js';
|
|
3
3
|
import { type ReceiptPayment, type ReceiptPaymentPayload } from './receipt-payment.js';
|
|
4
|
+
import { type ManualReceipt } from './manual-receipt.js';
|
|
4
5
|
/**
|
|
5
6
|
* Belegzeile einer Liste — die Form, die `listMyReceipts` liefert
|
|
6
7
|
* (`projectReceiptForCustomer` in functions/index.js).
|
|
@@ -77,6 +78,8 @@ export interface ReceiptSummary {
|
|
|
77
78
|
* (`providerPaymentId`, `providerData`) bleiben im Backend.
|
|
78
79
|
*/
|
|
79
80
|
payments?: ReceiptPayment[];
|
|
81
|
+
/** Nur an nacherfassten Belegen: der Handbeleg. */
|
|
82
|
+
manualReceipt?: ManualReceipt;
|
|
80
83
|
}
|
|
81
84
|
export interface ReceiptSummaryPayload {
|
|
82
85
|
receiptId?: string | null;
|
|
@@ -105,5 +108,6 @@ export interface ReceiptSummaryPayload {
|
|
|
105
108
|
cancellationStatus?: string | null;
|
|
106
109
|
zeroKind?: string | null;
|
|
107
110
|
payments?: ReceiptPaymentPayload[] | null;
|
|
111
|
+
manualReceipt?: unknown;
|
|
108
112
|
}
|
|
109
113
|
export declare function fromReceiptSummaryPayload(payload: ReceiptSummaryPayload): ReceiptSummary;
|
|
@@ -8,6 +8,7 @@ const money_js_1 = require("../money.js");
|
|
|
8
8
|
const enum_payload_js_1 = require("./enum-payload.js");
|
|
9
9
|
const cancellation_js_1 = require("./cancellation.js");
|
|
10
10
|
const receipt_payment_js_1 = require("./receipt-payment.js");
|
|
11
|
+
const manual_receipt_js_1 = require("./manual-receipt.js");
|
|
11
12
|
/**
|
|
12
13
|
* Belegzeile einer Liste — die Form, die `listMyReceipts` liefert
|
|
13
14
|
* (`projectReceiptForCustomer` in functions/index.js).
|
|
@@ -58,8 +59,13 @@ function fromReceiptSummaryPayload(payload) {
|
|
|
58
59
|
: { cancellationStatus: isCancellationStatus(payload.cancellationStatus) ? payload.cancellationStatus : 'unknown' }),
|
|
59
60
|
...(isZeroKind(payload.zeroKind) ? { zeroKind: payload.zeroKind } : {}),
|
|
60
61
|
...(Array.isArray(payload.payments) ? { payments: payload.payments.map(receipt_payment_js_1.fromReceiptPaymentPayload) } : {}),
|
|
62
|
+
...handbelegFeld(payload.manualReceipt),
|
|
61
63
|
};
|
|
62
64
|
}
|
|
65
|
+
function handbelegFeld(roh) {
|
|
66
|
+
const manualReceipt = (0, manual_receipt_js_1.readManualReceipt)(roh);
|
|
67
|
+
return manualReceipt ? { manualReceipt } : {};
|
|
68
|
+
}
|
|
63
69
|
function isCancellationStatus(wert) {
|
|
64
70
|
return typeof wert === 'string' && cancellation_js_1.CANCELLATION_STATUSES.includes(wert);
|
|
65
71
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReceiptType, KeckPaymentMethod, CreditCardProvider } from '../enums/index.js';
|
|
2
|
+
import { type ManualReceipt } from './manual-receipt.js';
|
|
2
3
|
import { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead } from './receipt-item.js';
|
|
3
4
|
import { type Voucher, type VoucherPayload } from './voucher.js';
|
|
4
5
|
import { type Cancellation, type CancellationOf, type CancellationReason } from './cancellation.js';
|
|
@@ -24,9 +25,11 @@ import { type ReceiptPayment, type ReceiptPaymentPayload } from './receipt-payme
|
|
|
24
25
|
* **Zahlungen stehen in `payments`.** `paymentMethod` vergibt der Server
|
|
25
26
|
* (`mixed` bei mehreren Zahlarten); gesendet wird es unter `/v3` nie. Die
|
|
26
27
|
* Anbieterdaten (`payments[].providerPaymentId`/`providerData`, bei
|
|
27
|
-
* Altbelegen `cardPaymentId`/`cardPaymentData`)
|
|
28
|
-
* (
|
|
29
|
-
*
|
|
28
|
+
* Altbelegen `cardPaymentId`/`cardPaymentData`) bekommt nur der Betrieb
|
|
29
|
+
* selbst (API-Schluessel oder Kassen-Anmeldung, in beiden Kanaelen); ein
|
|
30
|
+
* Partner-Zugang nie. Darum sind sie hier optional. `providerData` ist die
|
|
31
|
+
* Rohform des Zahlungsanbieters ohne zugesagte Form; fuer Logik `provider`,
|
|
32
|
+
* `providerPaymentId` und `id` nehmen.
|
|
30
33
|
*/
|
|
31
34
|
export interface Receipt {
|
|
32
35
|
receiptId: string;
|
|
@@ -74,6 +77,8 @@ export interface Receipt {
|
|
|
74
77
|
layoutRuleset?: number;
|
|
75
78
|
/** Nur an Nullbelegen: Registrierdaten fuer den Block „Prüfangaben“. */
|
|
76
79
|
registrationInfo?: RegistrationInfo;
|
|
80
|
+
/** Nur an nacherfassten Belegen: der Handbeleg (siehe [ManualReceipt]). */
|
|
81
|
+
manualReceipt?: ManualReceipt;
|
|
77
82
|
}
|
|
78
83
|
/** Registrierdaten von Signaturkarte und Kasse (Zeitstempel oder `null`, wenn unbekannt). */
|
|
79
84
|
export interface RegistrationInfo {
|
|
@@ -125,6 +130,7 @@ export interface ReceiptPayloadRead extends Omit<ReceiptPayload, 'items' | 'vouc
|
|
|
125
130
|
cardRegisteredAt?: string | null;
|
|
126
131
|
cashregisterRegisteredAt?: string | null;
|
|
127
132
|
} | null;
|
|
133
|
+
manualReceipt?: unknown;
|
|
128
134
|
}
|
|
129
135
|
/**
|
|
130
136
|
* Schreibt die Nutzlast in der **neuen** Form — sie **normalisiert, statt zu
|
|
@@ -8,6 +8,7 @@ exports.receiptSubSumCents = receiptSubSumCents;
|
|
|
8
8
|
exports.receiptSumCents = receiptSumCents;
|
|
9
9
|
const index_js_1 = require("../enums/index.js");
|
|
10
10
|
const enum_payload_js_1 = require("./enum-payload.js");
|
|
11
|
+
const manual_receipt_js_1 = require("./manual-receipt.js");
|
|
11
12
|
const receipt_item_js_1 = require("./receipt-item.js");
|
|
12
13
|
const voucher_js_1 = require("./voucher.js");
|
|
13
14
|
const cancellation_js_1 = require("./cancellation.js");
|
|
@@ -95,8 +96,13 @@ function fromReceiptPayload(payload) {
|
|
|
95
96
|
...(payload.registrationInfo != null && typeof payload.registrationInfo === 'object'
|
|
96
97
|
? { registrationInfo: readRegistrationInfo(payload.registrationInfo) }
|
|
97
98
|
: {}),
|
|
99
|
+
...handbelegFeld(payload.manualReceipt),
|
|
98
100
|
};
|
|
99
101
|
}
|
|
102
|
+
function handbelegFeld(roh) {
|
|
103
|
+
const manualReceipt = (0, manual_receipt_js_1.readManualReceipt)(roh);
|
|
104
|
+
return manualReceipt ? { manualReceipt } : {};
|
|
105
|
+
}
|
|
100
106
|
/** Registrierdaten lesen; ein fehlender oder leerer Zeitstempel wird `null`. */
|
|
101
107
|
function readRegistrationInfo(roh) {
|
|
102
108
|
const zeit = (v) => (typeof v === 'string' && v !== '' ? v : null);
|
|
@@ -936,6 +936,49 @@ function stornoGrundText(code) {
|
|
|
936
936
|
function receiptIsSmallBusinessConsistent(receipt) {
|
|
937
937
|
return receipt.items.every((it) => Number(steuersatz(it.vat).rate) === 0);
|
|
938
938
|
}
|
|
939
|
+
/** Grund-Zeile nach einem Ausfall der Kasse; `other` druckt den eigenen Text. */
|
|
940
|
+
const NACHERFASSUNG_GRUND = {
|
|
941
|
+
network_outage: 'Internet', power_outage: 'Strom', device_failure: 'Gerät defekt', system_outage: 'Störung',
|
|
942
|
+
};
|
|
943
|
+
/** `YYYY-MM-DD` als `TT.MM.JJJJ`; anderes bleibt, wie es kam. */
|
|
944
|
+
function handbelegDatum(tag) {
|
|
945
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(tag);
|
|
946
|
+
return m ? `${m[3]}.${m[2]}.${m[1]}` : tag;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Block „NACHERFASSUNG“ (manualReceipt) unter dem Kopf: Art, Grund, Nummer
|
|
950
|
+
* und Tag des Handbelegs bzw. der Handbelege eines Tagessammelbelegs, dazu
|
|
951
|
+
* der Hinweis, dass der Beleg fuer die USt ein Duplikat ist
|
|
952
|
+
* (Registrierkassenerlass 3.3 Faelle 5 und 6, 2.4.11). Der Zeitstempel des Belegs bleibt der der
|
|
953
|
+
* Nacherfassung und steht wie immer unter „Datum:“. Kleinunternehmer
|
|
954
|
+
* (keine USt am Beleg) bekommen den USt-Hinweis nicht.
|
|
955
|
+
*/
|
|
956
|
+
function nacherfassungBlock(receipt, company) {
|
|
957
|
+
const m = receipt.manualReceipt;
|
|
958
|
+
if (!m)
|
|
959
|
+
return [];
|
|
960
|
+
const aus = [bannerZeile('NACHERFASSUNG')];
|
|
961
|
+
aus.push(textZeile(m.reason === 'outside_premises' ? 'Leistung außer Haus' : 'nach Ausfall der Kasse', 'center'));
|
|
962
|
+
const grund = m.reason === 'other' ? m.note : NACHERFASSUNG_GRUND[m.reason];
|
|
963
|
+
if (grund)
|
|
964
|
+
aus.push(textZeile(`Grund: ${grund}`, 'center'));
|
|
965
|
+
aus.push({ kind: 'space', lines: 1 });
|
|
966
|
+
const tag = handbelegDatum(m.date);
|
|
967
|
+
if (m.numberTo) {
|
|
968
|
+
aus.push(textZeile('Tagessammelbeleg', 'center'));
|
|
969
|
+
aus.push(textZeile(`Handbelege Nr. ${m.number} bis ${m.numberTo}`, 'center'));
|
|
970
|
+
aus.push(textZeile(`${m.count ? `${m.count} Belege ` : ''}vom ${tag}`, 'center'));
|
|
971
|
+
if (!company.isSmallBusiness)
|
|
972
|
+
aus.push(textZeile('USt: Duplikat der Handbelege', 'center'));
|
|
973
|
+
}
|
|
974
|
+
else {
|
|
975
|
+
aus.push(textZeile(`Handbeleg Nr. ${m.number}`, 'center'));
|
|
976
|
+
aus.push(textZeile(`vom ${tag}${m.time ? `, ${m.time} Uhr` : ''}`, 'center'));
|
|
977
|
+
if (!company.isSmallBusiness)
|
|
978
|
+
aus.push(textZeile('USt: Duplikat des Handbelegs', 'center'));
|
|
979
|
+
}
|
|
980
|
+
return aus;
|
|
981
|
+
}
|
|
939
982
|
/**
|
|
940
983
|
* Belegart-Block unter dem Betriebskopf: Titel als Banner, Untertitel als
|
|
941
984
|
* zentrierte Textzeilen. Verkaufsbelege bekommen keinen Block.
|
|
@@ -1023,6 +1066,12 @@ function buildReceiptLayout(receipt, company, options = {}) {
|
|
|
1023
1066
|
lines.push({ kind: 'space', lines: 1 });
|
|
1024
1067
|
lines.push(...belegart);
|
|
1025
1068
|
}
|
|
1069
|
+
// --- Nacherfassung eines Handbelegs unter dem Kopf, vor den Pflichtangaben
|
|
1070
|
+
const nacherfassung = nullbeleg ? [] : nacherfassungBlock(receipt, company);
|
|
1071
|
+
if (nacherfassung.length > 0) {
|
|
1072
|
+
lines.push({ kind: 'space', lines: 1 });
|
|
1073
|
+
lines.push(...nacherfassung);
|
|
1074
|
+
}
|
|
1026
1075
|
// --- Nullbeleg: reduziert (§ 132a Abs. 3 BAO / RKSV § 11 Abs. 1 -- Pflichtangaben
|
|
1027
1076
|
// ja, Positionen/MwSt-Tabelle/Zahlungsart/Fusszeilen nein).
|
|
1028
1077
|
if (nullbeleg) {
|
|
@@ -1038,6 +1087,14 @@ function buildReceiptLayout(receipt, company, options = {}) {
|
|
|
1038
1087
|
lines.push(...pruefangabenBlock(receipt, options.registrationInfo ?? null));
|
|
1039
1088
|
}
|
|
1040
1089
|
lines.push({ kind: 'space', lines: 1 });
|
|
1090
|
+
// Sammelbeleg nach Signaturausfall: Beginn und Ende des Ausfalls muessen aus
|
|
1091
|
+
// dem Beleg hervorgehen (Registrierkassenerlass 3.6.1); der Server legt sie als
|
|
1092
|
+
// legalMessage ab. Andere Nullbelege nennen ihren Anlass schon im Titel.
|
|
1093
|
+
if (receipt.zeroKind === 'outage_end' && receipt.legalMessage.length > 0) {
|
|
1094
|
+
for (const zeile of receipt.legalMessage)
|
|
1095
|
+
lines.push(textZeile(zeile, 'center'));
|
|
1096
|
+
lines.push({ kind: 'space', lines: 1 });
|
|
1097
|
+
}
|
|
1041
1098
|
if (receiptSignatureFailed(receipt)) {
|
|
1042
1099
|
lines.push(textZeile(SIGNATUR_AUSGEFALLEN, 'center'));
|
|
1043
1100
|
lines.push({ kind: 'space', lines: 1 });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
|
|
2
|
-
export declare const VOKABULAR_QUELLE = "
|
|
2
|
+
export declare const VOKABULAR_QUELLE = "f9d375a30bfb51addc8405dd6f5c24928ebc628166ae5ebf2b0c43d9f19701dd";
|
|
3
3
|
/** Schema-Notation des Vertrags: Blatt 'aussen': 'innen', Objekt { __: 'innen', ... }, Liste [ { __: 'innen', ... } ]. */
|
|
4
4
|
export type SchemaEintrag = string | SchemaObjekt | readonly [SchemaObjekt];
|
|
5
5
|
export interface SchemaObjekt {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.KATALOGE = exports.ARTIKEL_FELDER = exports.SCHEMAS = exports.VOKABULAR_QUELLE = void 0;
|
|
6
6
|
/** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
|
|
7
|
-
exports.VOKABULAR_QUELLE = "
|
|
7
|
+
exports.VOKABULAR_QUELLE = "f9d375a30bfb51addc8405dd6f5c24928ebc628166ae5ebf2b0c43d9f19701dd";
|
|
8
8
|
/** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
|
|
9
9
|
exports.SCHEMAS = {
|
|
10
10
|
"getReceipt": {
|
|
@@ -24,7 +24,17 @@ exports.SCHEMAS = {
|
|
|
24
24
|
"receivedImmediately": "sofortErhalten",
|
|
25
25
|
"keptByEmployee": "direkt"
|
|
26
26
|
}
|
|
27
|
-
]
|
|
27
|
+
],
|
|
28
|
+
"manualReceipt": {
|
|
29
|
+
"__": "handbeleg",
|
|
30
|
+
"number": "nummer",
|
|
31
|
+
"numberTo": "nummerBis",
|
|
32
|
+
"count": "anzahl",
|
|
33
|
+
"date": "datum",
|
|
34
|
+
"time": "uhrzeit",
|
|
35
|
+
"reason": "grund",
|
|
36
|
+
"note": "grundText"
|
|
37
|
+
}
|
|
28
38
|
},
|
|
29
39
|
"taxNumber": "taxnr",
|
|
30
40
|
"vatId": "uid",
|
|
@@ -80,6 +90,9 @@ exports.SCHEMAS = {
|
|
|
80
90
|
"receipt.cancellationReason": {
|
|
81
91
|
"$catalog": "STORNO_GRUND"
|
|
82
92
|
},
|
|
93
|
+
"receipt.manualReceipt.reason": {
|
|
94
|
+
"$catalog": "HANDBELEG_GRUND"
|
|
95
|
+
},
|
|
83
96
|
"layout.lines[].tone": {
|
|
84
97
|
"$catalog": "LAYOUT_TON"
|
|
85
98
|
},
|
|
@@ -570,6 +583,14 @@ exports.KATALOGE = {
|
|
|
570
583
|
"unbefristet": "unlimited",
|
|
571
584
|
"jahre": "years"
|
|
572
585
|
},
|
|
586
|
+
"HANDBELEG_GRUND": {
|
|
587
|
+
"internet": "network_outage",
|
|
588
|
+
"strom": "power_outage",
|
|
589
|
+
"geraet": "device_failure",
|
|
590
|
+
"stoerung": "system_outage",
|
|
591
|
+
"sonstiges": "other",
|
|
592
|
+
"ausser_haus": "outside_premises"
|
|
593
|
+
},
|
|
573
594
|
"KASSE_BETRIEB_WERTE.cardProvider": {
|
|
574
595
|
"keiner": "none",
|
|
575
596
|
"extern": "external",
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -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/esm/client/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { ALL_CALLS, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, } from './au
|
|
|
4
4
|
export { KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, CLIENT_ERROR_CODES, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, } from './errors.js';
|
|
5
5
|
export { sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, checkVoucherCombinationError, sendReceiptEmail, 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, } 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, } from './list-receipts.js';
|
|
8
8
|
export { downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2 } from './reports.js';
|
|
9
9
|
export { getCashboxStatus, getSignatureStatus, } from './status.js';
|
|
10
10
|
export { createKasseneckApi } from './api.js';
|
|
@@ -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>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KeckPaymentMethod, ReceiptType } from '../enums/index.js';
|
|
2
2
|
import { CANCELLATION_STATUSES, fromReceiptCompanyPayload, fromReceiptPayload, fromReceiptPaymentPayload, } from '../models/index.js';
|
|
3
3
|
import { readEnumKey } from '../models/enum-payload.js';
|
|
4
|
+
import { readManualReceipt } from '../models/manual-receipt.js';
|
|
4
5
|
import { KasseneckValidationError } from './errors.js';
|
|
5
6
|
/**
|
|
6
7
|
* Belege einer Kasse auflisten (`listReceipts`, nur unter `/v3`): ein Tag oder
|
|
@@ -157,6 +158,10 @@ const istObjekt = (w) => w != null && typeof w === 'object' && !Array.isArray(w)
|
|
|
157
158
|
const text = (w) => (typeof w === 'string' ? w : null);
|
|
158
159
|
// Ganze Cent; ein einzelner unbrauchbarer Betrag laesst die Liste nicht scheitern.
|
|
159
160
|
const cent = (w) => (typeof w === 'number' && Number.isInteger(w) ? w : 0);
|
|
161
|
+
function handbelegFeld(roh) {
|
|
162
|
+
const manualReceipt = readManualReceipt(roh);
|
|
163
|
+
return manualReceipt ? { manualReceipt } : {};
|
|
164
|
+
}
|
|
160
165
|
function istStornoStand(w) {
|
|
161
166
|
return typeof w === 'string' && CANCELLATION_STATUSES.includes(w);
|
|
162
167
|
}
|
|
@@ -191,6 +196,7 @@ export function fromListReceiptsSummaryPayload(payload) {
|
|
|
191
196
|
signatureOk: payload['signatureOk'] !== false,
|
|
192
197
|
customProjectId: text(payload['customProjectId']),
|
|
193
198
|
fullReceiptId: text(payload['fullReceiptId']),
|
|
199
|
+
...handbelegFeld(payload['manualReceipt']),
|
|
194
200
|
};
|
|
195
201
|
}
|
|
196
202
|
function tagessumme(roh) {
|
|
@@ -213,6 +219,57 @@ function kopfdaten(roh) {
|
|
|
213
219
|
const label = roh.label;
|
|
214
220
|
return { ...fromReceiptCompanyPayload(roh), label: typeof label === 'string' ? label : '' };
|
|
215
221
|
}
|
|
222
|
+
const LOGO_STUFEN = ['S', 'M', 'L', 'XL'];
|
|
223
|
+
/** Ein Beleg der vollen Ansicht vom Draht: das Belegdokument und die Zusaetze, die `getReceipt` in der Huelle traegt. */
|
|
224
|
+
function vollerBeleg(roh) {
|
|
225
|
+
const beleg = fromReceiptPayload(roh);
|
|
226
|
+
if (typeof roh['testSignature'] === 'boolean')
|
|
227
|
+
beleg.testSignature = roh['testSignature'];
|
|
228
|
+
return beleg;
|
|
229
|
+
}
|
|
230
|
+
/** `headers` der vollen Ansicht: je Kopf-Version Kennung und Kopf. */
|
|
231
|
+
function koepfe(roh) {
|
|
232
|
+
if (!Array.isArray(roh) || roh.some((h) => !istObjekt(h)))
|
|
233
|
+
throw antwortfehler('headers ist keine Liste von Kopf-Versionen');
|
|
234
|
+
return roh.map((h) => ({
|
|
235
|
+
headerVersionId: typeof h['headerVersionId'] === 'string' && h['headerVersionId'] !== '' ? h['headerVersionId'] : null,
|
|
236
|
+
company: fromReceiptCompanyPayload(h),
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Ein Beleg der vollen Ansicht mit den Druck- und Anzeigedaten seiner Seite, in derselben Form wie
|
|
241
|
+
* `getReceiptWithCompany` (ohne `outputs`): der Kopf der Version des Belegs aus `headers` (Nullbelege ohne
|
|
242
|
+
* Logo, wie beim Server), Testkennzeichen, Logo-Stufe. `layout` ist immer `null` -- die Liste traegt kein
|
|
243
|
+
* Zeilenmodell; [receiptLayoutFromResult] baut es dann mit denselben Angaben, oder `getReceiptWithCompany`
|
|
244
|
+
* holt das des Servers. Von einem Backend vor dem 30.10.2026 (ohne `headers`) kommt der Kopf aus
|
|
245
|
+
* `metadata`, dem heutigen Stand.
|
|
246
|
+
*/
|
|
247
|
+
export function listedReceiptWithCompany(page, receipt) {
|
|
248
|
+
const kennung = receipt.headerVersionId ?? null;
|
|
249
|
+
const eintrag = page.headers?.find((h) => h.headerVersionId === kennung);
|
|
250
|
+
let company;
|
|
251
|
+
if (eintrag)
|
|
252
|
+
company = { ...eintrag.company };
|
|
253
|
+
else if (page.metadata) {
|
|
254
|
+
const { label: _label, ...kopf } = page.metadata;
|
|
255
|
+
company = kopf;
|
|
256
|
+
}
|
|
257
|
+
else
|
|
258
|
+
company = fromReceiptCompanyPayload({});
|
|
259
|
+
const art = typeof receipt.receiptType === 'object' ? receipt.receiptType.value : receipt.receiptType;
|
|
260
|
+
if (art === ReceiptType.zero.value)
|
|
261
|
+
delete company.logoUrl;
|
|
262
|
+
return {
|
|
263
|
+
receipt,
|
|
264
|
+
company,
|
|
265
|
+
testCashregister: page.testCashregister === true,
|
|
266
|
+
testSignature: receipt.testSignature === true,
|
|
267
|
+
headerVersionId: kennung,
|
|
268
|
+
layout: null,
|
|
269
|
+
registrationInfo: receipt.registrationInfo ?? null,
|
|
270
|
+
logoScale: page.logoScale ?? 'M',
|
|
271
|
+
};
|
|
272
|
+
}
|
|
216
273
|
/**
|
|
217
274
|
* Eine Seite Belege der angemeldeten Kasse (`listReceipts`). Die Eingabe wird
|
|
218
275
|
* vor dem Senden nach den Regeln des Servers geprueft (genau eine Form des
|
|
@@ -220,8 +277,9 @@ function kopfdaten(roh) {
|
|
|
220
277
|
* `order`, `view`); ein Verstoss wirft [KasseneckValidationError] mit
|
|
221
278
|
* `scope: 'request'`, ohne dass etwas hinausgeht.
|
|
222
279
|
*
|
|
223
|
-
* Mit `view: 'full'` sind die Belege das gespeicherte Belegdokument
|
|
224
|
-
*
|
|
280
|
+
* Mit `view: 'full'` sind die Belege das gespeicherte Belegdokument mit den
|
|
281
|
+
* Angaben, die `getReceipt` liefert ([ListedFullReceipt]; Kopf je Version in
|
|
282
|
+
* `headers`, ohne Zeilenmodell), sonst [ListReceiptsSummary].
|
|
225
283
|
* Alle Seiten auf einmal: [listAllReceipts].
|
|
226
284
|
*/
|
|
227
285
|
export async function listReceipts(transport, options) {
|
|
@@ -242,14 +300,20 @@ export async function listReceipts(transport, options) {
|
|
|
242
300
|
throw antwortfehler('nextCursor passt nicht zu hasMore (Text bei hasMore, sonst null)');
|
|
243
301
|
}
|
|
244
302
|
const receipts = (voll
|
|
245
|
-
? liste.map((b) =>
|
|
303
|
+
? liste.map((b) => vollerBeleg(b))
|
|
246
304
|
: liste.map((b) => fromListReceiptsSummaryPayload(b)));
|
|
305
|
+
const stufe = daten['logo_scale'];
|
|
247
306
|
return {
|
|
248
307
|
receipts,
|
|
249
308
|
hasMore: daten['hasMore'],
|
|
250
309
|
nextCursor: daten['hasMore'] ? weiter : null,
|
|
251
310
|
...('daySummary' in daten ? { daySummary: tagessumme(daten['daySummary']) } : {}),
|
|
252
311
|
...(voll && 'metadata' in daten ? { metadata: kopfdaten(daten['metadata']) } : {}),
|
|
312
|
+
...(voll && 'headers' in daten ? { headers: koepfe(daten['headers']) } : {}),
|
|
313
|
+
...(voll && 'testCashregister' in daten ? { testCashregister: (daten['testCashregister'] === true) } : {}),
|
|
314
|
+
...(voll && 'logo_scale' in daten
|
|
315
|
+
? { logoScale: (typeof stufe === 'string' && LOGO_STUFEN.includes(stufe) ? stufe : 'M') }
|
|
316
|
+
: {}),
|
|
253
317
|
};
|
|
254
318
|
}
|
|
255
319
|
/**
|
|
@@ -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
|
|
@@ -173,6 +173,12 @@ export function createReceiptParams(options) {
|
|
|
173
173
|
if (options.customProjectId != null) {
|
|
174
174
|
params['customProjectId'] = options.customProjectId;
|
|
175
175
|
}
|
|
176
|
+
if (options.manualReceipt != null) {
|
|
177
|
+
if (typ !== ReceiptType.standard) {
|
|
178
|
+
throw eingabefehler(`manualReceipt ist nur bei receiptType standard moeglich, nicht bei "${typ.value}".`);
|
|
179
|
+
}
|
|
180
|
+
params['manualReceipt'] = options.manualReceipt;
|
|
181
|
+
}
|
|
176
182
|
if (options.customerDetails != null) {
|
|
177
183
|
params['customerDetails'] = options.customerDetails.join('\n');
|
|
178
184
|
}
|
|
@@ -899,7 +905,7 @@ export function cardRefundReference(receipt, paymentId) {
|
|
|
899
905
|
throw new KasseneckValidationError('cancelReceipt', `Zahlung "${paymentId}" ist keine Kartenzahlung`, 'request');
|
|
900
906
|
}
|
|
901
907
|
if (typeof zahlung.providerPaymentId !== 'string' || zahlung.providerPaymentId === '') {
|
|
902
|
-
throw new KasseneckValidationError('cancelReceipt', `Kennung der Kartenzahlung "${paymentId}" fehlt: sie
|
|
908
|
+
throw new 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');
|
|
903
909
|
}
|
|
904
910
|
return zahlung.providerPaymentId;
|
|
905
911
|
}
|
|
@@ -925,7 +931,7 @@ function pruefeKartenRueckbuchung(zahlungen, original) {
|
|
|
925
931
|
const orig = original != null && typeof z['refundOf'] === 'string' ? original.payments?.find((o) => o.id === z['refundOf']) : undefined;
|
|
926
932
|
if (typeof orig?.providerPaymentId === 'string' && orig.providerPaymentId !== '')
|
|
927
933
|
return;
|
|
928
|
-
throw new KasseneckValidationError('cancelReceipt', `Zahlung ${i + 1}: Karten-Rueckbuchung ohne Bezug: providerPaymentId der Erstattung am Terminal angeben (oder das Original
|
|
934
|
+
throw new 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');
|
|
929
935
|
});
|
|
930
936
|
}
|
|
931
937
|
/** Kartenanbieter pruefen — er stammt vom Aufrufer, nicht aus Serverdaten. */
|
package/dist/esm/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/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ReceiptType, VatRate, KeckPaymentMethod, CreditCardProvider, VoucherType, VoucherAction, StripeLinkMode, } from './enums/index.js';
|
|
2
2
|
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isVoucherItem, isVoucherFloatItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, fromReceiptPaymentPayload, toReceiptPaymentPayload, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_LOG_KINDS, RECEIPT_OUTPUT_RESULTS, RECEIPT_OUTPUT_ENTRIES_MAX, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, RECEIPT_OUTPUT_ERROR_CODES, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
|
-
export { apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, ALL_CALLS, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, createTransport, createBinaryTransport, createPdfOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, CLIENT_ERROR_CODES, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, listMyCashregisters, checkVoucherCombinationError, sendReceiptEmail, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2, 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, getCashboxStatus, getSignatureStatus, createKasseneckApi, } from './client/index.js';
|
|
3
|
+
export { apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, ALL_CALLS, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, createTransport, createBinaryTransport, createPdfOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, CLIENT_ERROR_CODES, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, listMyCashregisters, checkVoucherCombinationError, sendReceiptEmail, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2, 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, getCashboxStatus, getSignatureStatus, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock } from './vienna-time.js';
|
|
6
6
|
export { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, } from './pos/index.js';
|
|
@@ -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/esm/models/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_LOG_KINDS, RECEIPT_OUTPUT_RESULTS,
|
|
|
10
10
|
export { fromReceiptCompanyPayload, receiptCompanyTaxInfo, } from './receipt-company.js';
|
|
11
11
|
export { fromCashregisterPayload, } from './cashregister.js';
|
|
12
12
|
export { fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind } from './receipt-summary.js';
|
|
13
|
+
export { MANUAL_RECEIPT_REASONS, readManualReceipt, MANUAL_RECEIPT_ERROR_CODES, isManualReceiptErrorCode, } from './manual-receipt.js';
|
|
13
14
|
export { reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, } from './report-month.js';
|
|
14
15
|
export { toStripeUrlSessionPayload, fromStripeUrlSessionPayload, } from './stripe-url-session.js';
|
|
15
16
|
export { toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './hobex-receipt.js';
|