@kreiseck/kasseneck-api 1.1.0 → 1.2.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 +88 -0
- package/README.md +70 -0
- package/dist/cjs/client/aufrufe.d.ts +5 -5
- package/dist/cjs/client/aufrufe.js +21 -2
- package/dist/cjs/client/errors.d.ts +1 -1
- package/dist/cjs/client/errors.js +2 -1
- package/dist/cjs/client/receipts.d.ts +9 -1
- package/dist/cjs/client/receipts.js +18 -3
- package/dist/cjs/client/transport.d.ts +3 -3
- package/dist/cjs/client/transport.js +2 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +6 -3
- package/dist/cjs/invoice/index.d.ts +2 -2
- package/dist/cjs/invoice/index.js +3 -1
- package/dist/cjs/invoice/typen.d.ts +13 -2
- package/dist/cjs/invoice/vertrag.d.ts +10 -1
- package/dist/cjs/invoice/vertrag.js +39 -2
- package/dist/cjs/models/cancellation.d.ts +14 -2
- package/dist/cjs/models/cancellation.js +15 -1
- package/dist/cjs/models/cashregister.d.ts +3 -0
- package/dist/cjs/models/cashregister.js +1 -0
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/index.js +4 -2
- package/dist/cjs/models/payment-errors.d.ts +1 -1
- package/dist/cjs/models/payment-errors.js +1 -0
- package/dist/cjs/models/receipt-email.d.ts +1 -1
- package/dist/cjs/models/receipt-email.js +1 -0
- package/dist/cjs/models/receipt-errors.d.ts +1 -1
- package/dist/cjs/models/receipt-errors.js +1 -0
- package/dist/cjs/models/receipt-item.d.ts +9 -0
- package/dist/cjs/models/receipt-item.js +5 -0
- package/dist/cjs/models/receipt.d.ts +1 -1
- package/dist/cjs/models/receipt.js +6 -1
- package/dist/cjs/pos/artikel.d.ts +14 -0
- package/dist/cjs/pos/artikel.js +13 -2
- package/dist/cjs/pos/errors.d.ts +3 -3
- package/dist/cjs/pos/errors.js +6 -2
- package/dist/cjs/pos/index.d.ts +5 -2
- package/dist/cjs/pos/index.js +13 -2
- package/dist/cjs/pos/lager.d.ts +95 -0
- package/dist/cjs/pos/lager.js +160 -0
- package/dist/cjs/pos/texte.d.ts +22 -3
- package/dist/cjs/pos/texte.js +22 -6
- package/dist/cjs/printing/code-table-preview.d.ts +15 -0
- package/dist/cjs/printing/code-table-preview.js +24 -0
- package/dist/cjs/printing/index.d.ts +1 -0
- package/dist/cjs/printing/index.js +3 -1
- package/dist/cjs/receipt/code-table-test-sheet.d.ts +8 -2
- package/dist/cjs/receipt/code-table-test-sheet.js +2 -0
- package/dist/cjs/register/errors.d.ts +1 -1
- package/dist/cjs/register/errors.js +1 -0
- package/dist/cjs/register/pairing.d.ts +27 -1
- package/dist/cjs/register/pairing.js +18 -1
- package/dist/cjs/stored/draht.d.ts +4 -2
- package/dist/cjs/stored/draht.js +46 -5
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +5 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/aufrufe.d.ts +5 -5
- package/dist/esm/client/aufrufe.js +21 -2
- package/dist/esm/client/errors.d.ts +1 -1
- package/dist/esm/client/errors.js +2 -1
- package/dist/esm/client/receipts.d.ts +9 -1
- package/dist/esm/client/receipts.js +19 -4
- package/dist/esm/client/transport.d.ts +3 -3
- package/dist/esm/client/transport.js +2 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/invoice/index.d.ts +2 -2
- package/dist/esm/invoice/index.js +1 -1
- package/dist/esm/invoice/typen.d.ts +13 -2
- package/dist/esm/invoice/vertrag.d.ts +10 -1
- package/dist/esm/invoice/vertrag.js +38 -1
- package/dist/esm/models/cancellation.d.ts +14 -2
- package/dist/esm/models/cancellation.js +13 -0
- package/dist/esm/models/cashregister.d.ts +3 -0
- package/dist/esm/models/cashregister.js +1 -0
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/esm/models/payment-errors.d.ts +1 -1
- package/dist/esm/models/payment-errors.js +1 -0
- package/dist/esm/models/receipt-email.d.ts +1 -1
- package/dist/esm/models/receipt-email.js +1 -0
- package/dist/esm/models/receipt-errors.d.ts +1 -1
- package/dist/esm/models/receipt-errors.js +1 -0
- package/dist/esm/models/receipt-item.d.ts +9 -0
- package/dist/esm/models/receipt-item.js +5 -0
- package/dist/esm/models/receipt.d.ts +1 -1
- package/dist/esm/models/receipt.js +6 -1
- package/dist/esm/pos/artikel.d.ts +14 -0
- package/dist/esm/pos/artikel.js +13 -3
- package/dist/esm/pos/errors.d.ts +3 -3
- package/dist/esm/pos/errors.js +6 -2
- package/dist/esm/pos/index.d.ts +5 -2
- package/dist/esm/pos/index.js +6 -2
- package/dist/esm/pos/lager.d.ts +95 -0
- package/dist/esm/pos/lager.js +154 -0
- package/dist/esm/pos/texte.d.ts +22 -3
- package/dist/esm/pos/texte.js +22 -6
- package/dist/esm/printing/code-table-preview.d.ts +15 -0
- package/dist/esm/printing/code-table-preview.js +21 -0
- package/dist/esm/printing/index.d.ts +1 -0
- package/dist/esm/printing/index.js +1 -0
- package/dist/esm/receipt/code-table-test-sheet.d.ts +8 -2
- package/dist/esm/receipt/code-table-test-sheet.js +2 -0
- package/dist/esm/register/errors.d.ts +1 -1
- package/dist/esm/register/errors.js +1 -0
- package/dist/esm/register/pairing.d.ts +27 -1
- package/dist/esm/register/pairing.js +17 -1
- package/dist/esm/stored/draht.d.ts +4 -2
- package/dist/esm/stored/draht.js +45 -4
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +5 -3
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/code-table-preview.json +14 -0
- package/fixtures/expected/code-table-test-sheet.lines.json +22 -4
- package/fixtures/expected/code-table-test-sheet.mm58.hex +58 -55
- package/fixtures/expected/code-table-test-sheet.mm80.hex +59 -56
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api-examples/cancel-error-return-disposition.json +17 -0
- package/fixtures/invoice-api-examples/credit-error-return-disposition.json +26 -0
- package/fixtures/invoice-api-examples/credit-return-disposition.json +23 -0
- package/fixtures/invoice-api-examples/issue-error-return-disposition.json +25 -0
- package/fixtures/invoice-api-examples/issue-error-stock-id.json +27 -0
- package/fixtures/invoice-api-examples/issue-stock.json +22 -0
- package/fixtures/invoice-api.schema.json +37 -1
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/pos-texts.json +25 -4
- package/fixtures/surface.json +48 -4
- package/fixtures/v3/antworten/belege.json +1 -1
- package/fixtures/v3/antworten/belegmail.json +1 -1
- package/fixtures/v3/antworten/kasse-belege.json +1 -1
- package/fixtures/v3/antworten/kasse.json +662 -3
- package/fixtures/v3/antworten/rechnungen.json +1 -1
- package/fixtures/v3/antworten/storno.json +1 -1
- package/fixtures/v3/stored/belege.json +1 -1
- package/fixtures/v3/stored/kasse.json +58 -3
- package/fixtures/v3/stored/rechnungen.json +1 -1
- package/fixtures/v3/v3-vokabular.json +249 -16
- package/fixtures/v3/zahlbetrag-faelle.json +1 -1
- package/package.json +1 -1
|
@@ -10,10 +10,12 @@ export declare function regel(eintrag: SchemaEintrag): {
|
|
|
10
10
|
};
|
|
11
11
|
/** Innere Namen einer Schema-Ebene (was der Server innen an dieser Stelle kennt). */
|
|
12
12
|
export declare function innereNamen(schema: SchemaObjekt): Map<string, string>;
|
|
13
|
+
/** Rueckgabe-Wahl innen -> aussen (Katalog RUECKGABE; stored.test.ts vergleicht mit dem Vertrag). */
|
|
14
|
+
export declare const _RUECKGABE_NACH_AUSSEN: Readonly<Record<string, string>>;
|
|
13
15
|
/**
|
|
14
16
|
* Ein Belegdokument, wie Handler und Rand es vor der Uebersetzung sehen:
|
|
15
|
-
* ohne Storno-Marke (storno-core.
|
|
16
|
-
* ohneStornoMarke). Alles andere bleibt woertlich, auch `pruefangaben` im
|
|
17
|
+
* ohne Storno-Marke und Lager-Standort (storno-core.ohneInterneBelegFelder,
|
|
18
|
+
* Rand ohneStornoMarke). Alles andere bleibt woertlich, auch `pruefangaben` im
|
|
17
19
|
* Beleg selbst (der Server reicht sie so durch). Wirft, wenn es kein
|
|
18
20
|
* Belegdokument ist.
|
|
19
21
|
*/
|
package/dist/cjs/stored/draht.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.istObjekt = exports.hat = void 0;
|
|
3
|
+
exports._RUECKGABE_NACH_AUSSEN = exports.istObjekt = exports.hat = void 0;
|
|
4
4
|
exports.regel = regel;
|
|
5
5
|
exports.innereNamen = innereNamen;
|
|
6
6
|
exports._storedReceiptInner = _storedReceiptInner;
|
|
@@ -93,7 +93,7 @@ const aeussereWerte = (name) => new Set(Object.values(vokabular_js_1.KATALOGE[na
|
|
|
93
93
|
/**
|
|
94
94
|
* Interne Marke der Storno-Reservierung: `stornoMarke` am Storno-Beleg,
|
|
95
95
|
* `marke` im Bezug und in `cancellations[]`. Handler
|
|
96
|
-
* (storno-core.
|
|
96
|
+
* (storno-core.ohneInterneBelegFelder) und Rand (ohneStornoMarke) nehmen sie
|
|
97
97
|
* heraus; der Vertrag nennt die Namen nicht (nur `$function: belegJeKanal`).
|
|
98
98
|
*/
|
|
99
99
|
const STORNO_MARKE = 'stornoMarke';
|
|
@@ -104,6 +104,44 @@ const ohneMarke = (o) => {
|
|
|
104
104
|
const { [MARKE]: _m, ...rest } = o;
|
|
105
105
|
return rest;
|
|
106
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* Interne Dokumentfelder eines Belegs, die keine Antwort traegt (Zwilling von
|
|
109
|
+
* storno-core.INTERNE_BELEG_FELDER): der Lager-Standort der Kasse, den
|
|
110
|
+
* createReceipt fuer die Lagerbuchung an den Beleg kopiert.
|
|
111
|
+
*/
|
|
112
|
+
const INTERNE_BELEG_FELDER = ['lagerStandortId'];
|
|
113
|
+
/** Rueckgabe-Wahl innen -> aussen (Katalog RUECKGABE; stored.test.ts vergleicht mit dem Vertrag). */
|
|
114
|
+
exports._RUECKGABE_NACH_AUSSEN = Object.freeze({ lager: 'restock', defekt: 'defective', entsorgt: 'disposed' });
|
|
115
|
+
/**
|
|
116
|
+
* Zwilling von `rueckgabeUmbenennen` (Rand): `rueckgabe` heisst aussen
|
|
117
|
+
* `returnDisposition`, an Ort und Stelle; ein Wert ausserhalb des Katalogs
|
|
118
|
+
* faellt weg (der Server schreibt dafuer eine Warnzeile).
|
|
119
|
+
*/
|
|
120
|
+
function rueckgabeUmbenennen(o) {
|
|
121
|
+
if (!(0, exports.istObjekt)(o) || !(0, exports.hat)(o, 'rueckgabe'))
|
|
122
|
+
return o;
|
|
123
|
+
const raus = {};
|
|
124
|
+
for (const [k, w] of Object.entries(o)) {
|
|
125
|
+
if (k !== 'rueckgabe') {
|
|
126
|
+
raus[k] = w;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (typeof w === 'string' && (0, exports.hat)(exports._RUECKGABE_NACH_AUSSEN, w))
|
|
130
|
+
raus.returnDisposition = exports._RUECKGABE_NACH_AUSSEN[w];
|
|
131
|
+
}
|
|
132
|
+
return raus;
|
|
133
|
+
}
|
|
134
|
+
const zeilenMitRueckgabe = (items) => (Array.isArray(items) ? items.map(rueckgabeUmbenennen) : items);
|
|
135
|
+
/** Zwilling von `belegRueckgabeNachAussen`: Storno-Zeilen und Eintraege in `cancellations[]`. */
|
|
136
|
+
function belegRueckgabeNachAussen(beleg) {
|
|
137
|
+
const raus = { ...beleg };
|
|
138
|
+
if (Array.isArray(beleg.items))
|
|
139
|
+
raus.items = zeilenMitRueckgabe(beleg.items);
|
|
140
|
+
if (Array.isArray(beleg.cancellations)) {
|
|
141
|
+
raus.cancellations = beleg.cancellations.map((c) => ((0, exports.istObjekt)(c) && Array.isArray(c.items) ? { ...c, items: zeilenMitRueckgabe(c.items) } : c));
|
|
142
|
+
}
|
|
143
|
+
return raus;
|
|
144
|
+
}
|
|
107
145
|
/**
|
|
108
146
|
* Zwilling von `beleg-pruefangaben.alsIso`: leer (auch 0, '') -> null;
|
|
109
147
|
* Firestore-Zeitstempel, Zahl oder Zeichenkette -> ISO-Zeitpunkt in UTC;
|
|
@@ -121,8 +159,8 @@ function alsIso(ts) {
|
|
|
121
159
|
}
|
|
122
160
|
/**
|
|
123
161
|
* Ein Belegdokument, wie Handler und Rand es vor der Uebersetzung sehen:
|
|
124
|
-
* ohne Storno-Marke (storno-core.
|
|
125
|
-
* ohneStornoMarke). Alles andere bleibt woertlich, auch `pruefangaben` im
|
|
162
|
+
* ohne Storno-Marke und Lager-Standort (storno-core.ohneInterneBelegFelder,
|
|
163
|
+
* Rand ohneStornoMarke). Alles andere bleibt woertlich, auch `pruefangaben` im
|
|
126
164
|
* Beleg selbst (der Server reicht sie so durch). Wirft, wenn es kein
|
|
127
165
|
* Belegdokument ist.
|
|
128
166
|
*/
|
|
@@ -131,6 +169,8 @@ function _storedReceiptInner(doc, functionName) {
|
|
|
131
169
|
throw new errors_js_1.KasseneckValidationError(functionName, 'Kein Belegdokument (receiptId fehlt)', 'response');
|
|
132
170
|
}
|
|
133
171
|
const { [STORNO_MARKE]: _s, ...beleg } = doc;
|
|
172
|
+
for (const feld of INTERNE_BELEG_FELDER)
|
|
173
|
+
delete beleg[feld];
|
|
134
174
|
if ((0, exports.hat)(beleg, 'cancellationOf'))
|
|
135
175
|
beleg.cancellationOf = ohneMarke(beleg.cancellationOf);
|
|
136
176
|
if (Array.isArray(beleg.cancellations))
|
|
@@ -152,7 +192,8 @@ function pruefangabenDerHuelle(p) {
|
|
|
152
192
|
*/
|
|
153
193
|
function _receiptEnvelopeToWire(huelle) {
|
|
154
194
|
const schema = vokabular_js_1.SCHEMAS.getReceipt;
|
|
155
|
-
|
|
195
|
+
const draht = werteNachAussen(schluesselNachAussen(huelle, schema.data), schema.werte);
|
|
196
|
+
return (0, exports.istObjekt)(draht.receipt) ? { ...draht, receipt: belegRueckgabeNachAussen(draht.receipt) } : draht;
|
|
156
197
|
}
|
|
157
198
|
/**
|
|
158
199
|
* Ein Belegdokument (`users/{uid}/cashregisters/{id}/receipts/{id}`) in der
|
|
@@ -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 = "b1049e2f65e9261cf8f729481d9ce1e5afda2cf620333f38ae6bf1afb36c8712";
|
|
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 = "b1049e2f65e9261cf8f729481d9ce1e5afda2cf620333f38ae6bf1afb36c8712";
|
|
8
8
|
/** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
|
|
9
9
|
exports.SCHEMAS = {
|
|
10
10
|
"getReceipt": {
|
|
@@ -222,7 +222,8 @@ exports.SCHEMAS = {
|
|
|
222
222
|
"__": "kasse",
|
|
223
223
|
"visible": "sichtbar",
|
|
224
224
|
"sort": "sort"
|
|
225
|
-
}
|
|
225
|
+
},
|
|
226
|
+
"stockLocationIds": "standorte"
|
|
226
227
|
}
|
|
227
228
|
]
|
|
228
229
|
},
|
|
@@ -259,7 +260,8 @@ exports.ARTIKEL_FELDER = [
|
|
|
259
260
|
"revenueGroupId",
|
|
260
261
|
"active",
|
|
261
262
|
"groupId",
|
|
262
|
-
"tile"
|
|
263
|
+
"tile",
|
|
264
|
+
"stockLocationIds"
|
|
263
265
|
];
|
|
264
266
|
/** Wertkataloge innen (deutsch) -> aussen (englisch). */
|
|
265
267
|
exports.KATALOGE = {
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* umhuellt, muss ihn weiterhin absetzen koennen.
|
|
14
14
|
*/
|
|
15
15
|
import type { TransportBodyFields } from './transport.js';
|
|
16
|
-
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook"];
|
|
16
|
+
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook"];
|
|
17
17
|
export type ApiCall = typeof ALL_CALLS[number];
|
|
18
18
|
/**
|
|
19
19
|
* Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
|
|
@@ -21,20 +21,20 @@ export type ApiCall = typeof ALL_CALLS[number];
|
|
|
21
21
|
* (`fixtures/v3/v3-vokabular.json`, `endpoints.public`, umbenannt nach
|
|
22
22
|
* `names`). Ein Test haelt beide Listen deckungsgleich.
|
|
23
23
|
*/
|
|
24
|
-
export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "cancelReceipt", "sendReceiptEmail", "generateFullReceiptId", "downloadReceipt", "getFirstReceiptDate", "getReportV2", "downloadReport", "downloadDailyReport", "createPaymentLinkStripe", "stripeCaptureIntent", "hobexPayApi", "hobexRefundApi", "hobexGetStatus", "financeWebService", "listMyTipRecipients", "getPartnerInfo", "createPartnerCustomer", "checkPartnerCustomerEmail", "listPartnerCustomers", "getPartnerCustomer", "sendPartnerCustomerFonLink", "createPartnerWebhook", "updatePartnerWebhook", "deletePartnerWebhook", "listPartnerWebhooks", "sendPartnerWebhookTest", "rotatePartnerWebhookSecret", "listPartnerWebhookDeliveries", "requestCustomerSignature", "getCustomerSignatureStatus", "createCustomerCashregister", "activateCashregister", "listCustomerCashregisters", "getCustomerCredentials", "reportCustomerContract", "createCustomer", "getCustomer", "updateCustomer", "searchCustomers", "issueInvoice", "cancelInvoice", "createCreditNote", "getInvoice", "listInvoices", "getInvoicePdf", "getInvoiceXml", "getInvoiceSetupStatus", "listBrands", "recordInvoicePayment"];
|
|
24
|
+
export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "cancelReceipt", "sendReceiptEmail", "generateFullReceiptId", "downloadReceipt", "getFirstReceiptDate", "getReportV2", "downloadReport", "downloadDailyReport", "createPaymentLinkStripe", "stripeCaptureIntent", "hobexPayApi", "hobexRefundApi", "hobexGetStatus", "financeWebService", "listMyTipRecipients", "getPartnerInfo", "createPartnerCustomer", "checkPartnerCustomerEmail", "listPartnerCustomers", "getPartnerCustomer", "sendPartnerCustomerFonLink", "createPartnerWebhook", "updatePartnerWebhook", "deletePartnerWebhook", "listPartnerWebhooks", "sendPartnerWebhookTest", "rotatePartnerWebhookSecret", "listPartnerWebhookDeliveries", "requestCustomerSignature", "getCustomerSignatureStatus", "createCustomerCashregister", "activateCashregister", "listCustomerCashregisters", "getCustomerCredentials", "reportCustomerContract", "getPartnerBilling", "getPartnerBillingMonth", "createCustomer", "getCustomer", "updateCustomer", "searchCustomers", "issueInvoice", "cancelInvoice", "createCreditNote", "getInvoice", "listInvoices", "getInvoicePdf", "getInvoiceXml", "getInvoiceSetupStatus", "listBrands", "recordInvoicePayment", "createInvoiceItem", "updateInvoiceItem", "withdrawInvoiceItem", "getInvoiceItem", "listInvoiceItems", "setCustomerMandate", "revokeCustomerMandate"];
|
|
25
25
|
/**
|
|
26
26
|
* Die Endpunkte des Kassenwegs (`https://kasse.kasseneck.at/api/v3/<name>`,
|
|
27
27
|
* Web-Kasse: gleicher Ursprung `/api/v3`), in der Reihenfolge von
|
|
28
28
|
* `endpoints.register`. Sechs davon sind zugleich oeffentlich; die Kasse ruft
|
|
29
29
|
* sie trotzdem ueber diesen Weg (ein Dialekt je Client, Nachtrag §5.2).
|
|
30
30
|
*/
|
|
31
|
-
export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients"];
|
|
31
|
+
export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation"];
|
|
32
32
|
export type PublicCall = typeof PUBLIC_CALLS[number];
|
|
33
33
|
export type PosCall = typeof POS_CALLS[number];
|
|
34
|
-
/** Einer der
|
|
34
|
+
/** Einer der 28 Aufrufe des Kassenwegs. */
|
|
35
35
|
export declare function isPosCall(name: string): boolean;
|
|
36
36
|
/**
|
|
37
|
-
* Nur ueber den Kassenweg erreichbar (
|
|
37
|
+
* Nur ueber den Kassenweg erreichbar (22 Namen): unter `api.kasseneck.at/v3`
|
|
38
38
|
* gibt es sie nicht. Der Transport schickt sie darum ohne eigene Basis an
|
|
39
39
|
* [POS_BASE_URL] statt an die oeffentliche Basis.
|
|
40
40
|
*/
|
|
@@ -42,6 +42,8 @@ export const ALL_CALLS = [
|
|
|
42
42
|
'listMyCashregisters',
|
|
43
43
|
'listMyPrinters',
|
|
44
44
|
'listMyReceipts',
|
|
45
|
+
'listMyStock',
|
|
46
|
+
'listMyStockLocations',
|
|
45
47
|
'listMyTipRecipients',
|
|
46
48
|
'listPartnerCustomers',
|
|
47
49
|
'listPartnerWebhookDeliveries',
|
|
@@ -59,6 +61,7 @@ export const ALL_CALLS = [
|
|
|
59
61
|
'sendPartnerCustomerFonLink',
|
|
60
62
|
'sendPartnerWebhookTest',
|
|
61
63
|
'sendReceiptEmail',
|
|
64
|
+
'setMyCashregisterStockLocation',
|
|
62
65
|
'setMyKasseLogo',
|
|
63
66
|
'setMyKasseSettings',
|
|
64
67
|
'setMyRegisterDeviceSettings',
|
|
@@ -112,6 +115,8 @@ export const PUBLIC_CALLS = [
|
|
|
112
115
|
'listCustomerCashregisters',
|
|
113
116
|
'getCustomerCredentials',
|
|
114
117
|
'reportCustomerContract',
|
|
118
|
+
'getPartnerBilling',
|
|
119
|
+
'getPartnerBillingMonth',
|
|
115
120
|
'createCustomer',
|
|
116
121
|
'getCustomer',
|
|
117
122
|
'updateCustomer',
|
|
@@ -126,6 +131,16 @@ export const PUBLIC_CALLS = [
|
|
|
126
131
|
'getInvoiceSetupStatus',
|
|
127
132
|
'listBrands',
|
|
128
133
|
'recordInvoicePayment',
|
|
134
|
+
// Rechnungskorb und SEPA-Mandate (Backend keck#557): nur die Namen, damit
|
|
135
|
+
// die Liste dem Vertrag folgt; umhuellt sind sie in diesem Paket noch nicht
|
|
136
|
+
// (der offene Transport nimmt jeden Namen).
|
|
137
|
+
'createInvoiceItem',
|
|
138
|
+
'updateInvoiceItem',
|
|
139
|
+
'withdrawInvoiceItem',
|
|
140
|
+
'getInvoiceItem',
|
|
141
|
+
'listInvoiceItems',
|
|
142
|
+
'setCustomerMandate',
|
|
143
|
+
'revokeCustomerMandate',
|
|
129
144
|
];
|
|
130
145
|
/**
|
|
131
146
|
* Die Endpunkte des Kassenwegs (`https://kasse.kasseneck.at/api/v3/<name>`,
|
|
@@ -159,16 +174,20 @@ export const POS_CALLS = [
|
|
|
159
174
|
'createPrintJob',
|
|
160
175
|
'getPrintJob',
|
|
161
176
|
'listMyTipRecipients',
|
|
177
|
+
// Lager an der Kasse (Lager-Kern Stufe 2): nur ueber den Kassenweg.
|
|
178
|
+
'listMyStockLocations',
|
|
179
|
+
'listMyStock',
|
|
180
|
+
'setMyCashregisterStockLocation',
|
|
162
181
|
];
|
|
163
182
|
const OEFFENTLICH = new Set(PUBLIC_CALLS);
|
|
164
183
|
const KASSENWEG = new Set(POS_CALLS);
|
|
165
184
|
const NUR_KASSE = new Set(POS_CALLS.filter((name) => !OEFFENTLICH.has(name)));
|
|
166
|
-
/** Einer der
|
|
185
|
+
/** Einer der 28 Aufrufe des Kassenwegs. */
|
|
167
186
|
export function isPosCall(name) {
|
|
168
187
|
return KASSENWEG.has(name);
|
|
169
188
|
}
|
|
170
189
|
/**
|
|
171
|
-
* Nur ueber den Kassenweg erreichbar (
|
|
190
|
+
* Nur ueber den Kassenweg erreichbar (22 Namen): unter `api.kasseneck.at/v3`
|
|
172
191
|
* gibt es sie nicht. Der Transport schickt sie darum ohne eigene Basis an
|
|
173
192
|
* [POS_BASE_URL] statt an die oeffentliche Basis.
|
|
174
193
|
*/
|
|
@@ -117,7 +117,7 @@ export type ErrorOutcome = 'unknown' | 'rejected';
|
|
|
117
117
|
* v3, `errorCodes`; dieselbe Liste wie `paymentCallRejectedCodes` im
|
|
118
118
|
* Dart-Zwilling):
|
|
119
119
|
*
|
|
120
|
-
* - `errorCodes.auth` ohne die sieben des Partner-Zugangs (
|
|
120
|
+
* - `errorCodes.auth` ohne die sieben des Partner-Zugangs (19 Codes):
|
|
121
121
|
* Anmeldung und Pruefung in `checkRequest` laufen vor jeder Zeile des
|
|
122
122
|
* Handlers; `validation` heisst dort Pflichtfeld fehlt oder falscher Typ.
|
|
123
123
|
* Der Partner-Zugang trifft diese `api_key`-Aufrufe mit Kassen-Token nie.
|
|
@@ -231,7 +231,7 @@ const GELDWEGE = new Set(['hobexPayApi', 'hobexRefundApi', 'stripeCaptureIntent'
|
|
|
231
231
|
* v3, `errorCodes`; dieselbe Liste wie `paymentCallRejectedCodes` im
|
|
232
232
|
* Dart-Zwilling):
|
|
233
233
|
*
|
|
234
|
-
* - `errorCodes.auth` ohne die sieben des Partner-Zugangs (
|
|
234
|
+
* - `errorCodes.auth` ohne die sieben des Partner-Zugangs (19 Codes):
|
|
235
235
|
* Anmeldung und Pruefung in `checkRequest` laufen vor jeder Zeile des
|
|
236
236
|
* Handlers; `validation` heisst dort Pflichtfeld fehlt oder falscher Typ.
|
|
237
237
|
* Der Partner-Zugang trifft diese `api_key`-Aufrufe mit Kassen-Token nie.
|
|
@@ -260,6 +260,7 @@ export const PAYMENT_CALL_REJECTED_CODES = Object.freeze([
|
|
|
260
260
|
'cashregister_not_found',
|
|
261
261
|
'account_not_found',
|
|
262
262
|
'live_not_enabled',
|
|
263
|
+
'api_not_approved', // Live-API ohne Freigabe (Entwicklerbereich): vor dem Handler abgewiesen
|
|
263
264
|
'unauthorized',
|
|
264
265
|
'mfa_required',
|
|
265
266
|
'user_verification_failed',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReceiptType, type ReceiptTypeKey, KeckPaymentMethod, type KeckPaymentMethodKey } from '../enums/index.js';
|
|
2
|
-
import { type Receipt, type ReceiptCompany, type ReceiptItem, type Voucher, type ReceiptSummary, type ReportMonth, type CancellationItem, type CancellationOf, type CancellationReason, type ReceiptPaymentInput, type RegistrationInfo, type ReceiptEmailVia } from '../models/index.js';
|
|
2
|
+
import { type Receipt, type ReceiptCompany, type ReceiptItem, type Voucher, type ReceiptSummary, type ReportMonth, type CancellationItem, type CancellationOf, type CancellationReason, type ReturnDisposition, type ReceiptPaymentInput, type RegistrationInfo, type ReceiptEmailVia } from '../models/index.js';
|
|
3
3
|
import type { InternerTransport } from './aufrufe.js';
|
|
4
4
|
import { type ReceiptLayout } from '../receipt/layout.js';
|
|
5
5
|
import type { PosPaperSize } from '../printing/escpos.js';
|
|
@@ -114,6 +114,14 @@ export type CancelReceiptOptions = {
|
|
|
114
114
|
items?: CancellationItem[];
|
|
115
115
|
/** Interne Anmerkung (≤ 200 Zeichen), wird gespeichert, nie gedruckt. */
|
|
116
116
|
note?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Wohin die Ware der stornierten Artikelzeilen geht (Lager-Kern Stufe 2):
|
|
119
|
+
* Vorgabe fuer alle Positionen, je Position abweichend ueber
|
|
120
|
+
* `items[].returnDisposition`. Fehlt beides, bucht der Server `restock`.
|
|
121
|
+
* Zeilen ohne `articleId` bucht er nie. Ein falscher Wert geht nicht hinaus;
|
|
122
|
+
* der Server meldete ihn als `invalid_return_disposition`.
|
|
123
|
+
*/
|
|
124
|
+
returnDisposition?: ReturnDisposition;
|
|
117
125
|
/**
|
|
118
126
|
* Rueckzahlung je Zahlung (Betraege negativ, `refundOf` = `id` der
|
|
119
127
|
* Originalzahlung). Ohne Angabe spiegelt der Server die Restbetraege jeder
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReceiptType, KeckPaymentMethod, CreditCardProvider, VoucherAction, VoucherType, } from '../enums/index.js';
|
|
2
|
-
import { fromReceiptCompanyPayload, fromReceiptPayload, toReceiptItemPayload, toVoucherPayload, receiptItemIsValid, voucherIsValid, fromReceiptSummaryPayload, isCancellationReason, RECEIPT_EMAIL_VIAS, readRegistrationInfo, } from '../models/index.js';
|
|
2
|
+
import { fromReceiptCompanyPayload, fromReceiptPayload, toReceiptItemPayload, toVoucherPayload, receiptItemIsValid, voucherIsValid, fromReceiptSummaryPayload, isCancellationReason, isReturnDisposition, RETURN_DISPOSITIONS, RECEIPT_EMAIL_VIAS, readRegistrationInfo, } from '../models/index.js';
|
|
3
3
|
import { parseServerTimeStamp, toViennaWallClock } from '../vienna-time.js';
|
|
4
4
|
import { euroToCents } from '../money.js';
|
|
5
5
|
import { KasseneckValidationError, isKasseneckApiError, signiertGelesen } from './errors.js';
|
|
@@ -133,6 +133,12 @@ export function sellReceiptWithCompany(transport, options) {
|
|
|
133
133
|
return createReceiptWithCompany(transport, { ...options, receiptType: ReceiptType.standard });
|
|
134
134
|
}
|
|
135
135
|
const NOTE_MAX = 200;
|
|
136
|
+
/** Prueft eine Rueckgabe-Wahl (Vorgabe oder Position); `pfad` nennt das Feld in der Meldung. */
|
|
137
|
+
function pruefeRueckgabeWahl(wert, pfad) {
|
|
138
|
+
if (wert !== undefined && !isReturnDisposition(wert)) {
|
|
139
|
+
throw new KasseneckValidationError('cancelReceipt', `${pfad}: erlaubt sind ${RETURN_DISPOSITIONS.join(', ')}`, 'request');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
136
142
|
/**
|
|
137
143
|
* Storno-Beleg zu einem bestehenden Beleg — voll oder in Teilen. Prueft die
|
|
138
144
|
* Eingabe, bevor etwas hinausgeht; der Server haelt die Restmengen und die
|
|
@@ -151,14 +157,16 @@ export async function cancelReceipt(transport, options) {
|
|
|
151
157
|
if (!isCancellationReason(options.reason)) {
|
|
152
158
|
throw new KasseneckValidationError('cancelReceipt', 'Storno-Grund fehlt oder ist unbekannt', 'request');
|
|
153
159
|
}
|
|
160
|
+
pruefeRueckgabeWahl(options.returnDisposition, 'returnDisposition');
|
|
154
161
|
if (options.items !== undefined) {
|
|
155
162
|
if (!Array.isArray(options.items) || options.items.length === 0) {
|
|
156
163
|
throw new KasseneckValidationError('cancelReceipt', 'items muss eine nicht leere Liste sein', 'request');
|
|
157
164
|
}
|
|
158
|
-
for (const pos of options.items) {
|
|
165
|
+
for (const [i, pos] of options.items.entries()) {
|
|
159
166
|
if (!Number.isInteger(pos.index) || pos.index < 0 || !Number.isInteger(pos.quantity) || pos.quantity < 1) {
|
|
160
167
|
throw new KasseneckValidationError('cancelReceipt', 'Storno-Menge muss eine ganze Zahl >= 1 sein', 'request');
|
|
161
168
|
}
|
|
169
|
+
pruefeRueckgabeWahl(pos.returnDisposition, `items[${i}].returnDisposition`);
|
|
162
170
|
}
|
|
163
171
|
}
|
|
164
172
|
if (options.note !== undefined && options.note.length > NOTE_MAX) {
|
|
@@ -173,8 +181,15 @@ export async function cancelReceipt(transport, options) {
|
|
|
173
181
|
if (zahlungen !== undefined)
|
|
174
182
|
pruefeKartenRueckbuchung(zahlungen, options.receipt);
|
|
175
183
|
const params = { cashregisterId, originalReceiptId, reason: options.reason };
|
|
176
|
-
if (options.items !== undefined)
|
|
177
|
-
params.items = options.items.map((p) => ({
|
|
184
|
+
if (options.items !== undefined) {
|
|
185
|
+
params.items = options.items.map((p) => ({
|
|
186
|
+
index: p.index,
|
|
187
|
+
quantity: p.quantity,
|
|
188
|
+
...(p.returnDisposition !== undefined ? { returnDisposition: p.returnDisposition } : {}),
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
191
|
+
if (options.returnDisposition !== undefined)
|
|
192
|
+
params.returnDisposition = options.returnDisposition;
|
|
178
193
|
if (options.note !== undefined && options.note !== '')
|
|
179
194
|
params.note = options.note;
|
|
180
195
|
if (zahlungen !== undefined)
|
|
@@ -85,16 +85,16 @@ export interface TransportOptions {
|
|
|
85
85
|
auth: KasseneckAuth;
|
|
86
86
|
/**
|
|
87
87
|
* Abweichende Basis der **oeffentlichen** Aufrufe (Vorgabe
|
|
88
|
-
* [DEFAULT_BASE_URL]): alles ausser den
|
|
88
|
+
* [DEFAULT_BASE_URL]): alles ausser den 28 Aufrufen des Kassenwegs, und die
|
|
89
89
|
* sechs oeffentlichen davon nur, wenn nicht mit `registerUserAuth`
|
|
90
90
|
* angemeldet. Muss auf `/v3` enden (eigene Proxys erlaubt), sonst wirft das
|
|
91
91
|
* Anlegen; `/v1` oder `/api` gibt es in der 1.x-Linie nicht.
|
|
92
92
|
*/
|
|
93
93
|
baseUrl?: string;
|
|
94
94
|
/**
|
|
95
|
-
* Abweichende Basis des **Kassenwegs** (Vorgabe [POS_BASE_URL]): die
|
|
95
|
+
* Abweichende Basis des **Kassenwegs** (Vorgabe [POS_BASE_URL]): die 22
|
|
96
96
|
* reinen Kassenaufrufe (Kopplung, Anmeldung, Einstellungen, Artikel,
|
|
97
|
-
* Drucker, ...) und mit `registerUserAuth` alle
|
|
97
|
+
* Drucker, ...) und mit `registerUserAuth` alle 28 Aufrufe des Kassenwegs.
|
|
98
98
|
* Die Web-Kasse gibt `'/api/v3'` (gleicher Ursprung). Muss auf `/v3` enden
|
|
99
99
|
* (in der Regel `/api/v3`), sonst wirft das Anlegen.
|
|
100
100
|
*/
|
|
@@ -118,9 +118,9 @@ function createCore(options) {
|
|
|
118
118
|
pruefeKennung(kennung);
|
|
119
119
|
const kopfzeilenSenden = options.omitKasseneckHeaders !== true;
|
|
120
120
|
/**
|
|
121
|
-
* Basis je Aufruf. Die
|
|
121
|
+
* Basis je Aufruf. Die 22 reinen Kassenaufrufe gehen immer an den
|
|
122
122
|
* Kassenweg (unter der oeffentlichen Basis gibt es sie nicht), und die
|
|
123
|
-
* Kassen-Anmeldung ruft alle
|
|
123
|
+
* Kassen-Anmeldung ruft alle 28 Aufrufe des Kassenwegs dort, auch die sechs
|
|
124
124
|
* oeffentlichen (Kanal `app`). Was der Kassenweg gar nicht fuehrt
|
|
125
125
|
* (Berichte, Zahlungen, FinanzOnline), geht an die oeffentliche Basis.
|
|
126
126
|
*/
|
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
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type KasseneckTransport, type KasseneckBinaryTransport, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, downloadDailyReport, downloadMonthlyReport, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { type ReceiptDueTip, type ReceiptDueTipRecipient, type ReceiptDueOptions, type ReceiptDueBuckets, type ReceiptDueBreakdown, type ReceiptDueErrorReason, receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
|
|
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, } from './pos/index.js';
|
|
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, } 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
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, 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_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, 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_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, ALL_CALLS, PUBLIC_CALLS, POS_CALLS, createTransport, createBinaryTransport, 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, downloadDailyReport, downloadMonthlyReport, getReportV2, getCashboxStatus, getSignatureStatus, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock } from './vienna-time.js';
|
|
6
|
-
export { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, } from './pos/index.js';
|
|
6
|
+
export { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, } from './pos/index.js';
|
|
@@ -14,8 +14,8 @@ export { createInvoiceApi, type InvoiceApi, type InvoiceApiOptions } from './api
|
|
|
14
14
|
export { invoiceKeyAuth, type InvoiceKeyAuthOptions } from './auth.js';
|
|
15
15
|
export { isInvoiceError, isInvoiceErrorCode, invoiceErrorCode, invoiceFieldErrors, type InvoiceApiErrorCode, type InvoiceFieldError, } from './fehler.js';
|
|
16
16
|
export { cancelInvoice, createCreditNote, createCustomer, getCustomer, getInvoice, getInvoicePdf, getInvoiceSetupStatus, getInvoiceXml, issueInvoice, listBrands, listInvoices, previewInvoice, recordInvoicePayment, searchCustomers, updateCustomer, } from './endpunkte.js';
|
|
17
|
-
export type { Brand, CancelInvoiceRequest, CancelResult, CreditNoteRequest, CreditNoteResult, Customer, CustomerInput, CustomerPage, CustomerSearch, EInvoiceStatus, Invoice, InvoiceDetail, InvoiceDetailPayment, InvoiceItem, InvoiceItemInput, InvoiceListQuery, InvoicePage, InvoiceRecipient, InvoiceSetupGap, InvoiceSetupStatus, InvoiceTotals, InvoiceXml, InvoiceNotice, InvoicePayment, InvoicePreview, InvoiceRateTotals, IssueInvoiceRequest, IssueResult, PaymentInput, PreviewResult, RecordPaymentRequest, RecordPaymentResult, } from './typen.js';
|
|
17
|
+
export type { Brand, CancelInvoiceRequest, CancelResult, CreditNoteItemInput, CreditNoteRequest, CreditNoteResult, Customer, CustomerInput, CustomerPage, CustomerSearch, EInvoiceStatus, Invoice, InvoiceDetail, InvoiceDetailPayment, InvoiceItem, InvoiceItemInput, InvoiceListQuery, InvoicePage, InvoiceRecipient, InvoiceSetupGap, InvoiceSetupStatus, InvoiceTotals, InvoiceXml, InvoiceNotice, InvoicePayment, InvoicePreview, InvoiceRateTotals, IssueInvoiceRequest, IssueResult, PaymentInput, PreviewResult, RecordPaymentRequest, RecordPaymentResult, } from './typen.js';
|
|
18
18
|
export { INVOICE_TEXTS, invoiceText, type InvoiceTextKey } from './texte.js';
|
|
19
19
|
export { computeInvoiceTotals, ZERO_RATED_TAX_SCHEMES, type TotalsItem } from './summen.js';
|
|
20
20
|
export { proratedPriceMicros, MAX_AMOUNT_CENTS, itemFromEuro, formatUnitPrice, CalcError, calculateInvoice, roundDiv, vatRateMapKey, formatVatRate, type CalcResult, type CalcErrorCode, type CalcOptions, type CalcItem, type RateTotal, type ItemConversion, type ConversionReason, type LineAmount, } from './calc.js';
|
|
21
|
-
export { INVOICE_CONTRACT_VERSION, INVOICE_ENDPOINTS, INVOICE_ERROR_CODES, INVOICE_REQUEST_ERROR_CODES, CREDIT_NOTE_REASONS, TAX_SCHEMES, PRICE_MODES, VAT_RATES, CUSTOMER_TYPES, INVOICE_LIST_STATUS, DOC_TYPES, EINVOICE_FORMATS, EINVOICE_MISSING_CODES, WRITE_OFF_REASON_CODES, INVOICE_LANGUAGES, INVOICE_PAYMENT_METHODS, ITEM_KINDS, REVERSE_CHARGE_REASONS, INVOICE_NOTICE_CODES, INVOICE_UNITS, INVOICE_UNIT_CODES, INVOICE_SETUP_REQUIREMENTS, CUSTOMER_FIELDS, ITEM_FIELDS, ITEM_PRICE_EXACTLY_ONE, INVOICE_REQUESTS, INVOICE_EXACTLY_ONE, INVOICE_AT_LEAST_ONE, type InvoiceEndpoint, type InvoiceErrorCode, type InvoiceRequestErrorCode, type CreditNoteReason, type TaxScheme, type PriceMode, type VatRatePercent, type CustomerType, type InvoiceListStatus, type DocType, type EInvoiceFormat, type EInvoiceMissingCode, type WriteOffReasonCode, type InvoiceLanguage, type InvoicePaymentMethod, type ItemKind, type ReverseChargeReason, type InvoiceNoticeCode, type InvoiceUnit, type InvoiceSetupRequirement, type FieldFormat, type Field, } from './vertrag.js';
|
|
21
|
+
export { INVOICE_CONTRACT_VERSION, INVOICE_ENDPOINTS, INVOICE_ERROR_CODES, INVOICE_REQUEST_ERROR_CODES, CREDIT_NOTE_REASONS, TAX_SCHEMES, PRICE_MODES, VAT_RATES, CUSTOMER_TYPES, INVOICE_LIST_STATUS, DOC_TYPES, EINVOICE_FORMATS, EINVOICE_MISSING_CODES, WRITE_OFF_REASON_CODES, INVOICE_LANGUAGES, INVOICE_PAYMENT_METHODS, ITEM_KINDS, REVERSE_CHARGE_REASONS, INVOICE_NOTICE_CODES, INVOICE_UNITS, INVOICE_UNIT_CODES, INVOICE_SETUP_REQUIREMENTS, CUSTOMER_FIELDS, ITEM_FIELDS, CREDIT_NOTE_ITEM_FIELDS, RETURN_DISPOSITIONS, ITEM_PRICE_EXACTLY_ONE, INVOICE_REQUESTS, INVOICE_EXACTLY_ONE, INVOICE_AT_LEAST_ONE, type InvoiceEndpoint, type InvoiceErrorCode, type InvoiceRequestErrorCode, type CreditNoteReason, type ReturnDisposition, type TaxScheme, type PriceMode, type VatRatePercent, type CustomerType, type InvoiceListStatus, type DocType, type EInvoiceFormat, type EInvoiceMissingCode, type WriteOffReasonCode, type InvoiceLanguage, type InvoicePaymentMethod, type ItemKind, type ReverseChargeReason, type InvoiceNoticeCode, type InvoiceUnit, type InvoiceSetupRequirement, type FieldFormat, type Field, } from './vertrag.js';
|
|
@@ -17,4 +17,4 @@ export { cancelInvoice, createCreditNote, createCustomer, getCustomer, getInvoic
|
|
|
17
17
|
export { INVOICE_TEXTS, invoiceText } from './texte.js';
|
|
18
18
|
export { computeInvoiceTotals, ZERO_RATED_TAX_SCHEMES } from './summen.js';
|
|
19
19
|
export { proratedPriceMicros, MAX_AMOUNT_CENTS, itemFromEuro, formatUnitPrice, CalcError, calculateInvoice, roundDiv, vatRateMapKey, formatVatRate, } from './calc.js';
|
|
20
|
-
export { INVOICE_CONTRACT_VERSION, INVOICE_ENDPOINTS, INVOICE_ERROR_CODES, INVOICE_REQUEST_ERROR_CODES, CREDIT_NOTE_REASONS, TAX_SCHEMES, PRICE_MODES, VAT_RATES, CUSTOMER_TYPES, INVOICE_LIST_STATUS, DOC_TYPES, EINVOICE_FORMATS, EINVOICE_MISSING_CODES, WRITE_OFF_REASON_CODES, INVOICE_LANGUAGES, INVOICE_PAYMENT_METHODS, ITEM_KINDS, REVERSE_CHARGE_REASONS, INVOICE_NOTICE_CODES, INVOICE_UNITS, INVOICE_UNIT_CODES, INVOICE_SETUP_REQUIREMENTS, CUSTOMER_FIELDS, ITEM_FIELDS, ITEM_PRICE_EXACTLY_ONE, INVOICE_REQUESTS, INVOICE_EXACTLY_ONE, INVOICE_AT_LEAST_ONE, } from './vertrag.js';
|
|
20
|
+
export { INVOICE_CONTRACT_VERSION, INVOICE_ENDPOINTS, INVOICE_ERROR_CODES, INVOICE_REQUEST_ERROR_CODES, CREDIT_NOTE_REASONS, TAX_SCHEMES, PRICE_MODES, VAT_RATES, CUSTOMER_TYPES, INVOICE_LIST_STATUS, DOC_TYPES, EINVOICE_FORMATS, EINVOICE_MISSING_CODES, WRITE_OFF_REASON_CODES, INVOICE_LANGUAGES, INVOICE_PAYMENT_METHODS, ITEM_KINDS, REVERSE_CHARGE_REASONS, INVOICE_NOTICE_CODES, INVOICE_UNITS, INVOICE_UNIT_CODES, INVOICE_SETUP_REQUIREMENTS, CUSTOMER_FIELDS, ITEM_FIELDS, CREDIT_NOTE_ITEM_FIELDS, RETURN_DISPOSITIONS, ITEM_PRICE_EXACTLY_ONE, INVOICE_REQUESTS, INVOICE_EXACTLY_ONE, INVOICE_AT_LEAST_ONE, } from './vertrag.js';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Betraege sind ueberall ganze Cent. Datumsangaben sind `YYYY-MM-DD` nach
|
|
6
6
|
* Wiener Kalender.
|
|
7
7
|
*/
|
|
8
|
-
import type { CreditNoteReason, CustomerType, DocType, EInvoiceFormat, EInvoiceMissingCode, InvoiceLanguage, InvoiceNoticeCode, ItemKind, ReverseChargeReason, InvoicePaymentMethod, InvoiceUnit, InvoiceSetupRequirement, InvoiceListStatus, PriceMode, TaxScheme, VatRatePercent, WriteOffReasonCode } from './vertrag.js';
|
|
8
|
+
import type { CreditNoteReason, CustomerType, DocType, EInvoiceFormat, EInvoiceMissingCode, InvoiceLanguage, InvoiceNoticeCode, ItemKind, ReverseChargeReason, InvoicePaymentMethod, InvoiceUnit, InvoiceSetupRequirement, InvoiceListStatus, PriceMode, ReturnDisposition, TaxScheme, VatRatePercent, WriteOffReasonCode } from './vertrag.js';
|
|
9
9
|
export interface CustomerInput {
|
|
10
10
|
type: CustomerType;
|
|
11
11
|
name: string;
|
|
@@ -86,6 +86,13 @@ export interface InvoiceItemInput {
|
|
|
86
86
|
vatRate: VatRatePercent;
|
|
87
87
|
/** Zeilenrabatt in Prozent, hoechstens zwei Nachkommastellen. */
|
|
88
88
|
discountPct?: number;
|
|
89
|
+
/** Artikel aus dem Artikelstamm; bestandsgefuehrt bucht das Ausstellen ihn vom Lager ab. */
|
|
90
|
+
articleId?: string;
|
|
91
|
+
}
|
|
92
|
+
/** Eine Gutschriftsposition: wie eine Rechnungsposition, dazu die Rueckgabe-Wahl. */
|
|
93
|
+
export interface CreditNoteItemInput extends InvoiceItemInput {
|
|
94
|
+
/** Wohin die Ware dieser Position geht; fehlt = Vorgabe des Aufrufs bzw. `restock`. */
|
|
95
|
+
returnDisposition?: ReturnDisposition;
|
|
89
96
|
}
|
|
90
97
|
export interface IssueInvoiceRequest {
|
|
91
98
|
/** Pflicht: dieselbe Anfrage mit demselben Schluessel erzeugt nie eine zweite Rechnung. */
|
|
@@ -115,6 +122,8 @@ export interface IssueInvoiceRequest {
|
|
|
115
122
|
language?: InvoiceLanguage;
|
|
116
123
|
/** Marke (Kennung aus `listBrands`); sonst die Standardmarke. Unbekannt = `brand_not_found`. */
|
|
117
124
|
brandId?: string;
|
|
125
|
+
/** Lager-Standort fuer bestandsgefuehrte Positionen; sonst der Standard-Standort. */
|
|
126
|
+
stockLocationId?: string;
|
|
118
127
|
/**
|
|
119
128
|
* Schon bezahlt (Shop kassiert online, Rechnung folgt). Die Zahlung entsteht
|
|
120
129
|
* in derselben Transaktion wie das Festschreiben: das PDF traegt dann keine
|
|
@@ -175,9 +184,11 @@ export interface CancelInvoiceRequest {
|
|
|
175
184
|
invoiceId: string;
|
|
176
185
|
reason: CreditNoteReason;
|
|
177
186
|
note?: string;
|
|
187
|
+
/** Wohin die Ware bestandsgefuehrter Positionen geht; fehlt = `restock`. */
|
|
188
|
+
returnDisposition?: ReturnDisposition;
|
|
178
189
|
}
|
|
179
190
|
export interface CreditNoteRequest extends CancelInvoiceRequest {
|
|
180
|
-
items:
|
|
191
|
+
items: CreditNoteItemInput[];
|
|
181
192
|
}
|
|
182
193
|
/**
|
|
183
194
|
* Summen einer Rechnung in Cent, **immer positiv** — auch bei einer Gutschrift
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
* Beschrieben wird die Anfrage. Was der Server daraus macht — Rechnungsdatum,
|
|
18
18
|
* Nummer, Summen — ist bewusst **nicht** setzbar.
|
|
19
19
|
*/
|
|
20
|
+
import { RETURN_DISPOSITIONS } from '../models/cancellation.js';
|
|
21
|
+
export { RETURN_DISPOSITIONS };
|
|
22
|
+
export type { ReturnDisposition } from '../models/cancellation.js';
|
|
20
23
|
export declare const INVOICE_CONTRACT_VERSION = 2;
|
|
21
24
|
export declare const INVOICE_ENDPOINTS: readonly ["createCustomer", "getCustomer", "updateCustomer", "searchCustomers", "issueInvoice", "cancelInvoice", "createCreditNote", "getInvoice", "listInvoices", "getInvoicePdf", "getInvoiceXml", "getInvoiceSetupStatus", "listBrands", "recordInvoicePayment"];
|
|
22
25
|
export type InvoiceEndpoint = (typeof INVOICE_ENDPOINTS)[number];
|
|
@@ -34,7 +37,7 @@ export type InvoiceErrorCode = (typeof INVOICE_ERROR_CODES)[number];
|
|
|
34
37
|
* genau der Katalog des Servers (das Backend vergleicht ihn mit dem Schema);
|
|
35
38
|
* die Helfer in `./invoice` erkennen beide Listen.
|
|
36
39
|
*/
|
|
37
|
-
export declare const INVOICE_REQUEST_ERROR_CODES: readonly ["account_not_found", "admin_required", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing"];
|
|
40
|
+
export declare const INVOICE_REQUEST_ERROR_CODES: readonly ["account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing"];
|
|
38
41
|
export type InvoiceRequestErrorCode = (typeof INVOICE_REQUEST_ERROR_CODES)[number];
|
|
39
42
|
/** Gruende einer Gutschrift. Der Server druckt den deutschen Anzeigetext. */
|
|
40
43
|
export declare const CREDIT_NOTE_REASONS: readonly ["cancellation", "price_reduction", "return", "incorrect_invoice", "other"];
|
|
@@ -269,6 +272,12 @@ export declare const CUSTOMER_FIELDS: Readonly<Record<string, Field>>;
|
|
|
269
272
|
export declare const ITEM_FIELDS: Readonly<Record<string, Field>>;
|
|
270
273
|
/** Genau einer der beiden Preise je Position (§ 9.1). */
|
|
271
274
|
export declare const ITEM_PRICE_EXACTLY_ONE: readonly (readonly string[])[];
|
|
275
|
+
/**
|
|
276
|
+
* Eine Gutschriftsposition: die Rechnungsposition plus `returnDisposition`
|
|
277
|
+
* (wohin die zurueckgenommene Ware geht). An einer Rechnungsposition weist der
|
|
278
|
+
* Server das Feld als unbekannt ab.
|
|
279
|
+
*/
|
|
280
|
+
export declare const CREDIT_NOTE_ITEM_FIELDS: Readonly<Record<string, Field>>;
|
|
272
281
|
/**
|
|
273
282
|
* Eine Zahlung zu einer Rechnung. Ohne `amountCents` gilt der volle
|
|
274
283
|
* Bruttobetrag, ohne `paidAt` der heutige Wiener Tag. `reference` ist die
|