@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
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,94 @@ Was vor 0.7.0 geschah, steht in der Commit-Historie (`git log`); ab hier wird
|
|
|
4
4
|
es hier geführt. Ein Eintrag nennt die Änderung **und ihren Grund** —
|
|
5
5
|
nur der Grund überlebt den nächsten Umbau.
|
|
6
6
|
|
|
7
|
+
## 1.2.0
|
|
8
|
+
|
|
9
|
+
Stock at the register, returns on cancellation, stock fields in the invoice
|
|
10
|
+
API. Reason: since stage 2 of the stock module the backend books sales,
|
|
11
|
+
cancellations and invoices against the stock of a location. The register has
|
|
12
|
+
to show locations and stock, choose its own location and say where returned
|
|
13
|
+
goods go; external invoicing systems have to name the article.
|
|
14
|
+
|
|
15
|
+
Additive, no breaking change; receipts and existing calls send and read the
|
|
16
|
+
same bytes as in 1.1.1.
|
|
17
|
+
|
|
18
|
+
- **Three register calls** (`./pos`, register path `/api/v3` only):
|
|
19
|
+
`listMyStockLocations(transport)`,
|
|
20
|
+
`listMyStock(transport, { locationId, articleId, belowMinimum })` and
|
|
21
|
+
`setMyCashregisterStockLocation(transport, { stockLocationId, cashregisterId })`
|
|
22
|
+
(`null` resets to the default location). Quantities are integer thousandths
|
|
23
|
+
of the base unit and keep their sign; `values` is `null` without the
|
|
24
|
+
permission `stockCosts`; a location without any address part has
|
|
25
|
+
`address: null`. A response with a missing or fractional quantity is never
|
|
26
|
+
read as `0`: it throws `KasseneckValidationError` with `scope: 'response'`
|
|
27
|
+
(a register treats that as "stock temporarily unavailable" and keeps
|
|
28
|
+
selling). New list `STOCK_LOCATION_TYPES`; `POS_ERROR_CODES` gains
|
|
29
|
+
`location_inactive`, `location_not_found` and `server_error`.
|
|
30
|
+
- **Locations on articles, registers and devices**: `PosArticle.stockLocationIds`
|
|
31
|
+
(optional on the type, so existing object literals keep compiling; the
|
|
32
|
+
reader always sets it, `null` when the article names none),
|
|
33
|
+
`Cashregister.stockLocationId`, `cashregister.stockLocationId` in
|
|
34
|
+
`listRegisterUsersForDevice`.
|
|
35
|
+
- **Register permissions** `stockView`, `stockCosts`, `stockMove`, `stockLoss`,
|
|
36
|
+
`stocktakeCount`, `stocktakeClose`, `stockLocation` in `RegisterUserPerms`
|
|
37
|
+
and `REGISTER_PERMS`. New `stockViewOf(perms)` (`./pos` and root): a missing
|
|
38
|
+
`stockView` counts as granted, only an explicit `false` blocks it, as in the
|
|
39
|
+
backend.
|
|
40
|
+
- **Returns on cancellation**: `cancelReceipt` takes `returnDisposition` for the
|
|
41
|
+
call and per line (`RETURN_DISPOSITIONS`, `isReturnDisposition`: `restock`,
|
|
42
|
+
`defective`, `disposed`), checked before sending. New code
|
|
43
|
+
`invalid_return_disposition`, the last of the `cancelReceipt`-specific codes
|
|
44
|
+
in `CANCELLATION_ERROR_CODES` (before the auth/edge and client codes).
|
|
45
|
+
Cancellation lines with an article carry `originalIndex` and
|
|
46
|
+
`returnDisposition`, and so do the items of `cancellations[]`.
|
|
47
|
+
- **Invoice API**: `items[].articleId`, `stockLocationId` on `issueInvoice`,
|
|
48
|
+
`returnDisposition` on `cancelInvoice` and `createCreditNote` (also per line,
|
|
49
|
+
`CreditNoteItemInput`, `CREDIT_NOTE_ITEM_FIELDS`). Schema
|
|
50
|
+
`fixtures/invoice-api.schema.json` and six new examples.
|
|
51
|
+
- **`./stored`**: stored receipts drop `lagerStandortId` and turn `rueckgabe`
|
|
52
|
+
into `returnDisposition`; stored articles carry `stockLocationIds`.
|
|
53
|
+
- **Contract `/v3` caught up with the backend** (not stock related):
|
|
54
|
+
`PUBLIC_CALLS` lists nine more public endpoints (partner billing, invoice
|
|
55
|
+
items and mandates; names only, no wrappers), and `api_not_approved` (the
|
|
56
|
+
developer area has to approve the account for the live API) is in every
|
|
57
|
+
derived error list. For the Dart twin: `surface.json` changes in `routes`,
|
|
58
|
+
`calls.pos`, `registerPerms`, `pos` and `invoice`.
|
|
59
|
+
- **Behaviour change**: `api_not_approved` is in `PAYMENT_CALL_REJECTED_CODES`,
|
|
60
|
+
so a payment call answered with it now has the outcome `rejected` instead of
|
|
61
|
+
`unknown`. Nothing was charged: the approval gate runs before the handler.
|
|
62
|
+
|
|
63
|
+
## 1.1.1
|
|
64
|
+
|
|
65
|
+
The code-table test sheet asks for the right row. Reason: a Bluetooth
|
|
66
|
+
printer that only knows PC437 printed rows 2 and 3 with correct umlauts but
|
|
67
|
+
wrong glyphs for `€` and `§` (`╒`, `⌡`), and row 4 correct with gaps for
|
|
68
|
+
`€` and `§`. "The first row that looks exactly like above" confused users,
|
|
69
|
+
and "the row with correct umlauts" would pick row 2. The rule now is: the
|
|
70
|
+
row with no wrong character; a gap is fine; if several fit, the one with
|
|
71
|
+
the fewest gaps; if none fits, 6.
|
|
72
|
+
|
|
73
|
+
Additive, no breaking change; receipts are byte for byte the same (the 24
|
|
74
|
+
`code-table-receipt.*.hex` files are unchanged).
|
|
75
|
+
|
|
76
|
+
- **Test sheet** (`./receipt`): reference heading `codetable.reference` is
|
|
77
|
+
now "So sehen die Zeichen richtig aus" (32 columns; with a colon it would
|
|
78
|
+
wrap), the footer is the new rule: `codetable.instruction_title` (bold),
|
|
79
|
+
`codetable.instruction`, `codetable.instruction_none` ("Passt keine:
|
|
80
|
+
{number}.", the replacement row). As before, everything outside the test
|
|
81
|
+
rows prints with replacement letters (pure ASCII), so "Lücke" from the
|
|
82
|
+
catalogue stands as "Luecke" on the sheet, on paper and in the line model.
|
|
83
|
+
Rows, big numbers, margins and the end reset are unchanged. Contract:
|
|
84
|
+
`fixtures/expected/code-table-test-sheet.*`.
|
|
85
|
+
- **Screen texts** (`fixtures/pos-texts.json`): `codetable.question` is now
|
|
86
|
+
"In welcher Zeile steht kein falsches Zeichen?"; new
|
|
87
|
+
`codetable.question_hint`, `codetable.preview_title`, `codetable.apply`,
|
|
88
|
+
`codetable.other_row`.
|
|
89
|
+
- **Preview** (`./printing`): `codeTablePreviewText(table)` returns the
|
|
90
|
+
sample "Käsekrainer 3,50 €" / "Tee 80°" as it prints with that table
|
|
91
|
+
(lines joined by `\n`), e.g. `pc437` gives "Käsekrainer 3,50 EUR", so the
|
|
92
|
+
user sees the effect of a row before applying it. Shared contract with the
|
|
93
|
+
Dart twin: `fixtures/code-table-preview.json`.
|
|
94
|
+
|
|
7
95
|
## 1.1.0
|
|
8
96
|
|
|
9
97
|
Receipt printers that print umlauts and special characters correctly.
|
package/README.md
CHANGED
|
@@ -631,6 +631,29 @@ in `receipt.cancellations[]` as `promoAdjustmentCents` (cents per VAT bucket
|
|
|
631
631
|
of the backend). The register can show it in the dialog; it does not have to
|
|
632
632
|
calculate anything.
|
|
633
633
|
|
|
634
|
+
**Returns (stock module).** If the account runs the stock module, a
|
|
635
|
+
cancellation books the goods of article lines back. `returnDisposition` says
|
|
636
|
+
where they go: `restock` (back into stock, the server's default),
|
|
637
|
+
`defective` (into stock as defective) or `disposed`. It is a default for the
|
|
638
|
+
call and can differ per line:
|
|
639
|
+
|
|
640
|
+
```ts
|
|
641
|
+
await api.cancelReceipt({
|
|
642
|
+
receipt: original,
|
|
643
|
+
reason: 'customer_cancelled',
|
|
644
|
+
returnDisposition: 'restock',
|
|
645
|
+
items: [{ index: 0, quantity: 1, returnDisposition: 'defective' }, { index: 1, quantity: 2 }],
|
|
646
|
+
});
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
Lines without `articleId` are never booked, whatever you send. A value outside
|
|
650
|
+
`RETURN_DISPOSITIONS` (also `null` or an empty string) is rejected before
|
|
651
|
+
sending with a `KasseneckValidationError` that names the path
|
|
652
|
+
(`items[0].returnDisposition`); the server would answer
|
|
653
|
+
`invalid_return_disposition`. The cancellation receipt carries `originalIndex`
|
|
654
|
+
and `returnDisposition` on its article lines, the original carries
|
|
655
|
+
`returnDisposition` in `cancellations[].items`.
|
|
656
|
+
|
|
634
657
|
**Printed receipt.** The header of a cancellation receipt names the original,
|
|
635
658
|
its date and the reason: "STORNOBELEG / Stornobuchung zu Beleg KASSE1-ID-42 /
|
|
636
659
|
vom 11.08.2026, 09:02 Uhr / Grund: Fehleingabe". The date comes from
|
|
@@ -809,6 +832,42 @@ the register's text catalogue (`MESSAGES`, `LABELS`, `messageText`,
|
|
|
809
832
|
`messageText('checkout.locked', { reason })`. The rendered German texts are
|
|
810
833
|
the same as in 0.x.
|
|
811
834
|
|
|
835
|
+
**Stock at the register.** Three calls on the register path (`/api/v3` only),
|
|
836
|
+
permissions checked by the server (`stockView`, `stockCosts`, `stockLocation`
|
|
837
|
+
in `REGISTER_PERMS`):
|
|
838
|
+
|
|
839
|
+
```ts
|
|
840
|
+
import { listMyStockLocations, listMyStock, setMyCashregisterStockLocation } from '@kreiseck/kasseneck-api/pos';
|
|
841
|
+
|
|
842
|
+
const locations = await listMyStockLocations(transport); // { id, name, type, address, licensePlate, active, virtual }
|
|
843
|
+
const { stock, values } = await listMyStock(transport, { locationId: 'van-1' });
|
|
844
|
+
await setMyCashregisterStockLocation(transport, { stockLocationId: 'van-1' }); // null resets to the default location
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
Quantities are integers in thousandths of the base unit (`1000` is one
|
|
848
|
+
piece, `250` is 0.250 kg) and can be negative when more was sold than booked;
|
|
849
|
+
the package never rounds, divides or clamps them. `values` (stock value in
|
|
850
|
+
cents, average cost in micro-euros, `null` for a quantity of 0) is `null`
|
|
851
|
+
without the permission `stockCosts`, never an empty list: show no value then,
|
|
852
|
+
not "0,00 €". `address` is `null` when the location has no address part (a
|
|
853
|
+
vehicle has none). Articles carry `stockLocationIds` (`null` when the article
|
|
854
|
+
names none), registers `stockLocationId` (absent for the default location;
|
|
855
|
+
only the result of `setMyCashregisterStockLocation` uses `null` for it), and
|
|
856
|
+
`listRegisterUsersForDevice` returns `cashregister.stockLocationId`;
|
|
857
|
+
errors such as `location_not_found` and `location_inactive` are in
|
|
858
|
+
`POS_ERROR_CODES`.
|
|
859
|
+
|
|
860
|
+
`stockViewOf(perms)` (also exported from the package root) tells whether a
|
|
861
|
+
register user may see locations and quantities: a missing `stockView` counts
|
|
862
|
+
as granted, only an explicit `false` blocks it, and the other stock
|
|
863
|
+
permissions count as denied when missing.
|
|
864
|
+
|
|
865
|
+
**Stock must never block a sale.** A response the package cannot read
|
|
866
|
+
(a `KasseneckValidationError` with `scope: 'response'` from `listMyStock` or
|
|
867
|
+
`listMyStockLocations`, for example a missing or fractional quantity) is never
|
|
868
|
+
turned into a quantity of `0`. Treat it as "stock temporarily unavailable":
|
|
869
|
+
hide the stock figures and keep selling.
|
|
870
|
+
|
|
812
871
|
`ERROR_RULES` says which text a failed call shows, one rule per kind, the
|
|
813
872
|
same in both registers. `ERROR_CODE_RULES` (per `error.code`) and
|
|
814
873
|
`ERROR_OUTCOME_RULES` (per outcome) refine it; `findErrorRule(kind, { code,
|
|
@@ -1170,6 +1229,17 @@ cent), in the invoice's `priceMode` (net or gross). `quantity` allows up to
|
|
|
1170
1229
|
three decimals, `discountPct` up to two. `taxScheme` is optional: the server
|
|
1171
1230
|
derives the tax case and checks a given value against it.
|
|
1172
1231
|
|
|
1232
|
+
**Stock.** A line may name its article (`articleId`); if the article is
|
|
1233
|
+
stock-tracked and the stock module is active, issuing the invoice books it
|
|
1234
|
+
out, from `stockLocationId` or the default location. The invoice never fails
|
|
1235
|
+
because of stock. `cancelInvoice` and `createCreditNote` take
|
|
1236
|
+
`returnDisposition` (`restock`, `defective`, `disposed`), credit-note lines
|
|
1237
|
+
also per line (`CreditNoteItemInput`); invoice lines reject it. Identifiers
|
|
1238
|
+
must not contain `/` and must not be `.`, `..` or `__…__` (`validation`).
|
|
1239
|
+
The package does not check invoice requests before sending; the server does,
|
|
1240
|
+
and the examples `issue-stock`, `credit-return-disposition` and
|
|
1241
|
+
`issue-error-stock-id` in `fixtures/invoice-api-examples/` show the shapes.
|
|
1242
|
+
|
|
1173
1243
|
**Check the setup before the first invoice.** The invoicing module must be
|
|
1174
1244
|
active, the invoice API enabled for the account by Kasseneck, the account live,
|
|
1175
1245
|
and company name, address, VAT ID, bank account and number format must be
|
|
@@ -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
|
*/
|
|
@@ -47,6 +47,8 @@ exports.ALL_CALLS = [
|
|
|
47
47
|
'listMyCashregisters',
|
|
48
48
|
'listMyPrinters',
|
|
49
49
|
'listMyReceipts',
|
|
50
|
+
'listMyStock',
|
|
51
|
+
'listMyStockLocations',
|
|
50
52
|
'listMyTipRecipients',
|
|
51
53
|
'listPartnerCustomers',
|
|
52
54
|
'listPartnerWebhookDeliveries',
|
|
@@ -64,6 +66,7 @@ exports.ALL_CALLS = [
|
|
|
64
66
|
'sendPartnerCustomerFonLink',
|
|
65
67
|
'sendPartnerWebhookTest',
|
|
66
68
|
'sendReceiptEmail',
|
|
69
|
+
'setMyCashregisterStockLocation',
|
|
67
70
|
'setMyKasseLogo',
|
|
68
71
|
'setMyKasseSettings',
|
|
69
72
|
'setMyRegisterDeviceSettings',
|
|
@@ -117,6 +120,8 @@ exports.PUBLIC_CALLS = [
|
|
|
117
120
|
'listCustomerCashregisters',
|
|
118
121
|
'getCustomerCredentials',
|
|
119
122
|
'reportCustomerContract',
|
|
123
|
+
'getPartnerBilling',
|
|
124
|
+
'getPartnerBillingMonth',
|
|
120
125
|
'createCustomer',
|
|
121
126
|
'getCustomer',
|
|
122
127
|
'updateCustomer',
|
|
@@ -131,6 +136,16 @@ exports.PUBLIC_CALLS = [
|
|
|
131
136
|
'getInvoiceSetupStatus',
|
|
132
137
|
'listBrands',
|
|
133
138
|
'recordInvoicePayment',
|
|
139
|
+
// Rechnungskorb und SEPA-Mandate (Backend keck#557): nur die Namen, damit
|
|
140
|
+
// die Liste dem Vertrag folgt; umhuellt sind sie in diesem Paket noch nicht
|
|
141
|
+
// (der offene Transport nimmt jeden Namen).
|
|
142
|
+
'createInvoiceItem',
|
|
143
|
+
'updateInvoiceItem',
|
|
144
|
+
'withdrawInvoiceItem',
|
|
145
|
+
'getInvoiceItem',
|
|
146
|
+
'listInvoiceItems',
|
|
147
|
+
'setCustomerMandate',
|
|
148
|
+
'revokeCustomerMandate',
|
|
134
149
|
];
|
|
135
150
|
/**
|
|
136
151
|
* Die Endpunkte des Kassenwegs (`https://kasse.kasseneck.at/api/v3/<name>`,
|
|
@@ -164,16 +179,20 @@ exports.POS_CALLS = [
|
|
|
164
179
|
'createPrintJob',
|
|
165
180
|
'getPrintJob',
|
|
166
181
|
'listMyTipRecipients',
|
|
182
|
+
// Lager an der Kasse (Lager-Kern Stufe 2): nur ueber den Kassenweg.
|
|
183
|
+
'listMyStockLocations',
|
|
184
|
+
'listMyStock',
|
|
185
|
+
'setMyCashregisterStockLocation',
|
|
167
186
|
];
|
|
168
187
|
const OEFFENTLICH = new Set(exports.PUBLIC_CALLS);
|
|
169
188
|
const KASSENWEG = new Set(exports.POS_CALLS);
|
|
170
189
|
const NUR_KASSE = new Set(exports.POS_CALLS.filter((name) => !OEFFENTLICH.has(name)));
|
|
171
|
-
/** Einer der
|
|
190
|
+
/** Einer der 28 Aufrufe des Kassenwegs. */
|
|
172
191
|
function isPosCall(name) {
|
|
173
192
|
return KASSENWEG.has(name);
|
|
174
193
|
}
|
|
175
194
|
/**
|
|
176
|
-
* Nur ueber den Kassenweg erreichbar (
|
|
195
|
+
* Nur ueber den Kassenweg erreichbar (22 Namen): unter `api.kasseneck.at/v3`
|
|
177
196
|
* gibt es sie nicht. Der Transport schickt sie darum ohne eigene Basis an
|
|
178
197
|
* [POS_BASE_URL] statt an die oeffentliche Basis.
|
|
179
198
|
*/
|
|
@@ -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.
|
|
@@ -243,7 +243,7 @@ const GELDWEGE = new Set(['hobexPayApi', 'hobexRefundApi', 'stripeCaptureIntent'
|
|
|
243
243
|
* v3, `errorCodes`; dieselbe Liste wie `paymentCallRejectedCodes` im
|
|
244
244
|
* Dart-Zwilling):
|
|
245
245
|
*
|
|
246
|
-
* - `errorCodes.auth` ohne die sieben des Partner-Zugangs (
|
|
246
|
+
* - `errorCodes.auth` ohne die sieben des Partner-Zugangs (19 Codes):
|
|
247
247
|
* Anmeldung und Pruefung in `checkRequest` laufen vor jeder Zeile des
|
|
248
248
|
* Handlers; `validation` heisst dort Pflichtfeld fehlt oder falscher Typ.
|
|
249
249
|
* Der Partner-Zugang trifft diese `api_key`-Aufrufe mit Kassen-Token nie.
|
|
@@ -272,6 +272,7 @@ exports.PAYMENT_CALL_REJECTED_CODES = Object.freeze([
|
|
|
272
272
|
'cashregister_not_found',
|
|
273
273
|
'account_not_found',
|
|
274
274
|
'live_not_enabled',
|
|
275
|
+
'api_not_approved', // Live-API ohne Freigabe (Entwicklerbereich): vor dem Handler abgewiesen
|
|
275
276
|
'unauthorized',
|
|
276
277
|
'mfa_required',
|
|
277
278
|
'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
|
|
@@ -152,6 +152,12 @@ function sellReceiptWithCompany(transport, options) {
|
|
|
152
152
|
return createReceiptWithCompany(transport, { ...options, receiptType: index_js_1.ReceiptType.standard });
|
|
153
153
|
}
|
|
154
154
|
const NOTE_MAX = 200;
|
|
155
|
+
/** Prueft eine Rueckgabe-Wahl (Vorgabe oder Position); `pfad` nennt das Feld in der Meldung. */
|
|
156
|
+
function pruefeRueckgabeWahl(wert, pfad) {
|
|
157
|
+
if (wert !== undefined && !(0, index_js_2.isReturnDisposition)(wert)) {
|
|
158
|
+
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `${pfad}: erlaubt sind ${index_js_2.RETURN_DISPOSITIONS.join(', ')}`, 'request');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
155
161
|
/**
|
|
156
162
|
* Storno-Beleg zu einem bestehenden Beleg — voll oder in Teilen. Prueft die
|
|
157
163
|
* Eingabe, bevor etwas hinausgeht; der Server haelt die Restmengen und die
|
|
@@ -170,14 +176,16 @@ async function cancelReceipt(transport, options) {
|
|
|
170
176
|
if (!(0, index_js_2.isCancellationReason)(options.reason)) {
|
|
171
177
|
throw new errors_js_1.KasseneckValidationError('cancelReceipt', 'Storno-Grund fehlt oder ist unbekannt', 'request');
|
|
172
178
|
}
|
|
179
|
+
pruefeRueckgabeWahl(options.returnDisposition, 'returnDisposition');
|
|
173
180
|
if (options.items !== undefined) {
|
|
174
181
|
if (!Array.isArray(options.items) || options.items.length === 0) {
|
|
175
182
|
throw new errors_js_1.KasseneckValidationError('cancelReceipt', 'items muss eine nicht leere Liste sein', 'request');
|
|
176
183
|
}
|
|
177
|
-
for (const pos of options.items) {
|
|
184
|
+
for (const [i, pos] of options.items.entries()) {
|
|
178
185
|
if (!Number.isInteger(pos.index) || pos.index < 0 || !Number.isInteger(pos.quantity) || pos.quantity < 1) {
|
|
179
186
|
throw new errors_js_1.KasseneckValidationError('cancelReceipt', 'Storno-Menge muss eine ganze Zahl >= 1 sein', 'request');
|
|
180
187
|
}
|
|
188
|
+
pruefeRueckgabeWahl(pos.returnDisposition, `items[${i}].returnDisposition`);
|
|
181
189
|
}
|
|
182
190
|
}
|
|
183
191
|
if (options.note !== undefined && options.note.length > NOTE_MAX) {
|
|
@@ -192,8 +200,15 @@ async function cancelReceipt(transport, options) {
|
|
|
192
200
|
if (zahlungen !== undefined)
|
|
193
201
|
pruefeKartenRueckbuchung(zahlungen, options.receipt);
|
|
194
202
|
const params = { cashregisterId, originalReceiptId, reason: options.reason };
|
|
195
|
-
if (options.items !== undefined)
|
|
196
|
-
params.items = options.items.map((p) => ({
|
|
203
|
+
if (options.items !== undefined) {
|
|
204
|
+
params.items = options.items.map((p) => ({
|
|
205
|
+
index: p.index,
|
|
206
|
+
quantity: p.quantity,
|
|
207
|
+
...(p.returnDisposition !== undefined ? { returnDisposition: p.returnDisposition } : {}),
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
if (options.returnDisposition !== undefined)
|
|
211
|
+
params.returnDisposition = options.returnDisposition;
|
|
197
212
|
if (options.note !== undefined && options.note !== '')
|
|
198
213
|
params.note = options.note;
|
|
199
214
|
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
|
*/
|
|
@@ -123,9 +123,9 @@ function createCore(options) {
|
|
|
123
123
|
pruefeKennung(kennung);
|
|
124
124
|
const kopfzeilenSenden = options.omitKasseneckHeaders !== true;
|
|
125
125
|
/**
|
|
126
|
-
* Basis je Aufruf. Die
|
|
126
|
+
* Basis je Aufruf. Die 22 reinen Kassenaufrufe gehen immer an den
|
|
127
127
|
* Kassenweg (unter der oeffentlichen Basis gibt es sie nicht), und die
|
|
128
|
-
* Kassen-Anmeldung ruft alle
|
|
128
|
+
* Kassen-Anmeldung ruft alle 28 Aufrufe des Kassenwegs dort, auch die sechs
|
|
129
129
|
* oeffentlichen (Kanal `app`). Was der Kassenweg gar nicht fuehrt
|
|
130
130
|
* (Berichte, Zahlungen, FinanzOnline), geht an die oeffentliche Basis.
|
|
131
131
|
*/
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
|
|
2
|
-
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/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.receiptsScopeOf = exports.cancelScopeOf = exports.distributeDiscount = exports.setMyRegisterDeviceSettings = exports.setMyPosSettings = exports.getPosSettings = exports.listMyArticles = exports.listMyArticleGroups = exports.fromPosArticlePayload = exports.fromArticleGroupPayload = exports.mergePosSettings = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.toViennaWallClock = exports.parseServerTimeStamp = exports.isReceiptDueError = exports.RECEIPT_DUE_ERROR_REASONS = exports.ReceiptDueError = exports.receiptDueBreakdown = exports.receiptDueCents = exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.getReportV2 = exports.downloadMonthlyReport = exports.downloadDailyReport = exports.sendReceiptEmail = exports.checkVoucherCombinationError = exports.listMyCashregisters = void 0;
|
|
3
|
+
exports.receiptFieldErrors = exports.isReceiptError = exports.receiptErrorCode = exports.isReceiptErrorCode = exports.RECEIPT_ERROR_CODES = exports.receiptEmailFieldErrors = exports.isReceiptEmailError = exports.receiptEmailErrorCode = exports.isReceiptEmailErrorCode = exports.RECEIPT_EMAIL_VIAS = exports.RECEIPT_EMAIL_SEND_ERROR_CODES = exports.RECEIPT_EMAIL_ERROR_CODES = exports.paymentFieldErrors = exports.isPaymentError = exports.paymentErrorCode = exports.isPaymentErrorCode = exports.PAYMENT_ERROR_CODES = exports.toReceiptPaymentPayload = exports.fromReceiptPaymentPayload = exports.cancellationFieldErrors = exports.isCancellationError = exports.cancellationErrorCode = exports.isCancellationErrorCode = exports.isReturnDisposition = exports.isCancellationReason = exports.CANCELLATION_RESERVATION_MS = exports.CANCELLATION_ERROR_CODES = exports.CANCELLATION_STATUSES = exports.CANCELLATION_REASONS = exports.RETURN_DISPOSITIONS = exports.receiptSumCents = exports.receiptSubSumCents = exports.fromReceiptPayload = exports.toReceiptPayload = exports.voucherIsValid = exports.fromVoucherPayload = exports.toVoucherPayload = exports.isTipItem = exports.negateReceiptItem = exports.receiptItemIsValid = exports.receiptItemTotalCents = exports.fromReceiptItemPayload = exports.toReceiptItemPayload = exports.StripeLinkMode = exports.VoucherAction = exports.VoucherType = exports.CreditCardProvider = exports.KeckPaymentMethod = exports.VatRate = exports.ReceiptType = void 0;
|
|
4
|
+
exports.generateFullReceiptId = exports.getReceiptWithCompany = exports.getReceipt = exports.zeroReceipt = exports.cancelReceipt = exports.receiptLayoutFromResult = exports.cardRefundReference = exports.paymentsExpectedCents = exports.sellReceiptWithCompany = exports.sellReceipt = exports.isOutcomeUnknown = exports.isKasseneckValidationError = exports.isKasseneckNetworkError = exports.isKasseneckHttpError = exports.isKasseneckAuthError = exports.isKasseneckApiError = exports.CLIENT_ERROR_CODES = exports.KasseneckValidationError = exports.KasseneckNetworkError = exports.KasseneckHttpError = exports.KasseneckAuthError = exports.KasseneckApiError = exports.createBinaryTransport = exports.createTransport = exports.POS_CALLS = exports.PUBLIC_CALLS = exports.ALL_CALLS = exports.DEFAULT_TIMEOUT_MS = exports.POS_BASE_URL = exports.DEFAULT_BASE_URL = exports.registerUserAuth = exports.apiKeyAuth = exports.hobexReceiptNeedsSignature = exports.hobexReceiptToCardPaymentData = exports.fromHobexReceiptPayload = exports.toHobexReceiptPayload = exports.fromStripeUrlSessionPayload = exports.toStripeUrlSessionPayload = exports.reportMonthReadable = exports.reportMonthKey = exports.nextReportMonth = exports.previousReportMonth = exports.reportMonthFromDate = exports.isZeroKind = exports.ZERO_KINDS = exports.fromReceiptSummaryPayload = exports.fromCashregisterPayload = exports.receiptCompanyTaxInfo = exports.fromReceiptCompanyPayload = exports.remainingQuantities = void 0;
|
|
5
|
+
exports.stockViewOf = exports.receiptsScopeOf = exports.cancelScopeOf = exports.distributeDiscount = exports.setMyRegisterDeviceSettings = exports.setMyPosSettings = exports.getPosSettings = exports.listMyArticles = exports.listMyArticleGroups = exports.fromPosArticlePayload = exports.fromArticleGroupPayload = exports.mergePosSettings = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.toViennaWallClock = exports.parseServerTimeStamp = exports.isReceiptDueError = exports.RECEIPT_DUE_ERROR_REASONS = exports.ReceiptDueError = exports.receiptDueBreakdown = exports.receiptDueCents = exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.getReportV2 = exports.downloadMonthlyReport = exports.downloadDailyReport = exports.sendReceiptEmail = exports.checkVoucherCombinationError = exports.listMyCashregisters = exports.listMyReceipts = exports.getFirstReceiptDate = void 0;
|
|
6
6
|
var index_js_1 = require("./enums/index.js");
|
|
7
7
|
Object.defineProperty(exports, "ReceiptType", { enumerable: true, get: function () { return index_js_1.ReceiptType; } });
|
|
8
8
|
Object.defineProperty(exports, "VatRate", { enumerable: true, get: function () { return index_js_1.VatRate; } });
|
|
@@ -25,11 +25,13 @@ Object.defineProperty(exports, "toReceiptPayload", { enumerable: true, get: func
|
|
|
25
25
|
Object.defineProperty(exports, "fromReceiptPayload", { enumerable: true, get: function () { return index_js_2.fromReceiptPayload; } });
|
|
26
26
|
Object.defineProperty(exports, "receiptSubSumCents", { enumerable: true, get: function () { return index_js_2.receiptSubSumCents; } });
|
|
27
27
|
Object.defineProperty(exports, "receiptSumCents", { enumerable: true, get: function () { return index_js_2.receiptSumCents; } });
|
|
28
|
+
Object.defineProperty(exports, "RETURN_DISPOSITIONS", { enumerable: true, get: function () { return index_js_2.RETURN_DISPOSITIONS; } });
|
|
28
29
|
Object.defineProperty(exports, "CANCELLATION_REASONS", { enumerable: true, get: function () { return index_js_2.CANCELLATION_REASONS; } });
|
|
29
30
|
Object.defineProperty(exports, "CANCELLATION_STATUSES", { enumerable: true, get: function () { return index_js_2.CANCELLATION_STATUSES; } });
|
|
30
31
|
Object.defineProperty(exports, "CANCELLATION_ERROR_CODES", { enumerable: true, get: function () { return index_js_2.CANCELLATION_ERROR_CODES; } });
|
|
31
32
|
Object.defineProperty(exports, "CANCELLATION_RESERVATION_MS", { enumerable: true, get: function () { return index_js_2.CANCELLATION_RESERVATION_MS; } });
|
|
32
33
|
Object.defineProperty(exports, "isCancellationReason", { enumerable: true, get: function () { return index_js_2.isCancellationReason; } });
|
|
34
|
+
Object.defineProperty(exports, "isReturnDisposition", { enumerable: true, get: function () { return index_js_2.isReturnDisposition; } });
|
|
33
35
|
Object.defineProperty(exports, "isCancellationErrorCode", { enumerable: true, get: function () { return index_js_2.isCancellationErrorCode; } });
|
|
34
36
|
Object.defineProperty(exports, "cancellationErrorCode", { enumerable: true, get: function () { return index_js_2.cancellationErrorCode; } });
|
|
35
37
|
Object.defineProperty(exports, "isCancellationError", { enumerable: true, get: function () { return index_js_2.isCancellationError; } });
|
|
@@ -138,3 +140,4 @@ Object.defineProperty(exports, "setMyRegisterDeviceSettings", { enumerable: true
|
|
|
138
140
|
Object.defineProperty(exports, "distributeDiscount", { enumerable: true, get: function () { return index_js_4.distributeDiscount; } });
|
|
139
141
|
Object.defineProperty(exports, "cancelScopeOf", { enumerable: true, get: function () { return index_js_4.cancelScopeOf; } });
|
|
140
142
|
Object.defineProperty(exports, "receiptsScopeOf", { enumerable: true, get: function () { return index_js_4.receiptsScopeOf; } });
|
|
143
|
+
Object.defineProperty(exports, "stockViewOf", { enumerable: true, get: function () { return index_js_4.stockViewOf; } });
|
|
@@ -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';
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.INVOICE_PAYMENT_METHODS = exports.INVOICE_LANGUAGES = exports.WRITE_OFF_REASON_CODES = exports.EINVOICE_MISSING_CODES = exports.EINVOICE_FORMATS = exports.DOC_TYPES = exports.INVOICE_LIST_STATUS = exports.CUSTOMER_TYPES = exports.VAT_RATES = exports.PRICE_MODES = exports.TAX_SCHEMES = exports.CREDIT_NOTE_REASONS = exports.INVOICE_REQUEST_ERROR_CODES = exports.INVOICE_ERROR_CODES = exports.INVOICE_ENDPOINTS = exports.INVOICE_CONTRACT_VERSION = exports.formatVatRate = exports.vatRateMapKey = exports.roundDiv = exports.calculateInvoice = exports.CalcError = exports.formatUnitPrice = exports.itemFromEuro = exports.MAX_AMOUNT_CENTS = exports.proratedPriceMicros = exports.ZERO_RATED_TAX_SCHEMES = exports.computeInvoiceTotals = exports.invoiceText = exports.INVOICE_TEXTS = exports.updateCustomer = exports.searchCustomers = exports.recordInvoicePayment = exports.previewInvoice = exports.listInvoices = exports.listBrands = exports.issueInvoice = exports.getInvoiceXml = exports.getInvoiceSetupStatus = exports.getInvoicePdf = exports.getInvoice = exports.getCustomer = exports.createCustomer = exports.createCreditNote = exports.cancelInvoice = exports.invoiceFieldErrors = exports.invoiceErrorCode = exports.isInvoiceErrorCode = exports.isInvoiceError = exports.invoiceKeyAuth = exports.createInvoiceApi = void 0;
|
|
16
|
-
exports.INVOICE_AT_LEAST_ONE = exports.INVOICE_EXACTLY_ONE = exports.INVOICE_REQUESTS = exports.ITEM_PRICE_EXACTLY_ONE = exports.ITEM_FIELDS = exports.CUSTOMER_FIELDS = exports.INVOICE_SETUP_REQUIREMENTS = exports.INVOICE_UNIT_CODES = exports.INVOICE_UNITS = exports.INVOICE_NOTICE_CODES = exports.REVERSE_CHARGE_REASONS = exports.ITEM_KINDS = void 0;
|
|
16
|
+
exports.INVOICE_AT_LEAST_ONE = exports.INVOICE_EXACTLY_ONE = exports.INVOICE_REQUESTS = exports.ITEM_PRICE_EXACTLY_ONE = exports.RETURN_DISPOSITIONS = exports.CREDIT_NOTE_ITEM_FIELDS = exports.ITEM_FIELDS = exports.CUSTOMER_FIELDS = exports.INVOICE_SETUP_REQUIREMENTS = exports.INVOICE_UNIT_CODES = exports.INVOICE_UNITS = exports.INVOICE_NOTICE_CODES = exports.REVERSE_CHARGE_REASONS = exports.ITEM_KINDS = void 0;
|
|
17
17
|
var api_js_1 = require("./api.js");
|
|
18
18
|
Object.defineProperty(exports, "createInvoiceApi", { enumerable: true, get: function () { return api_js_1.createInvoiceApi; } });
|
|
19
19
|
var auth_js_1 = require("./auth.js");
|
|
@@ -80,6 +80,8 @@ Object.defineProperty(exports, "INVOICE_UNIT_CODES", { enumerable: true, get: fu
|
|
|
80
80
|
Object.defineProperty(exports, "INVOICE_SETUP_REQUIREMENTS", { enumerable: true, get: function () { return vertrag_js_1.INVOICE_SETUP_REQUIREMENTS; } });
|
|
81
81
|
Object.defineProperty(exports, "CUSTOMER_FIELDS", { enumerable: true, get: function () { return vertrag_js_1.CUSTOMER_FIELDS; } });
|
|
82
82
|
Object.defineProperty(exports, "ITEM_FIELDS", { enumerable: true, get: function () { return vertrag_js_1.ITEM_FIELDS; } });
|
|
83
|
+
Object.defineProperty(exports, "CREDIT_NOTE_ITEM_FIELDS", { enumerable: true, get: function () { return vertrag_js_1.CREDIT_NOTE_ITEM_FIELDS; } });
|
|
84
|
+
Object.defineProperty(exports, "RETURN_DISPOSITIONS", { enumerable: true, get: function () { return vertrag_js_1.RETURN_DISPOSITIONS; } });
|
|
83
85
|
Object.defineProperty(exports, "ITEM_PRICE_EXACTLY_ONE", { enumerable: true, get: function () { return vertrag_js_1.ITEM_PRICE_EXACTLY_ONE; } });
|
|
84
86
|
Object.defineProperty(exports, "INVOICE_REQUESTS", { enumerable: true, get: function () { return vertrag_js_1.INVOICE_REQUESTS; } });
|
|
85
87
|
Object.defineProperty(exports, "INVOICE_EXACTLY_ONE", { enumerable: true, get: function () { return vertrag_js_1.INVOICE_EXACTLY_ONE; } });
|
|
@@ -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
|