@kreiseck/kasseneck-api 1.37.0 → 1.39.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 +39 -1
- package/README.md +19 -1
- package/dist/cjs/client/aufrufe.d.ts +2 -2
- package/dist/cjs/client/aufrufe.js +12 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +6 -5
- package/dist/cjs/invoice/texte.d.ts +18 -1
- package/dist/cjs/invoice/texte.js +43 -2
- package/dist/cjs/invoice/vertrag.d.ts +1 -1
- package/dist/cjs/invoice/vertrag.js +1 -0
- package/dist/cjs/models/cancellation.d.ts +1 -1
- package/dist/cjs/models/cancellation.js +2 -0
- package/dist/cjs/models/index.d.ts +2 -1
- package/dist/cjs/models/index.js +6 -3
- package/dist/cjs/models/invoice-payment-ref.d.ts +42 -0
- package/dist/cjs/models/invoice-payment-ref.js +38 -0
- package/dist/cjs/models/receipt-item.d.ts +10 -2
- package/dist/cjs/models/receipt-item.js +14 -1
- package/dist/cjs/models/receipt.d.ts +7 -0
- package/dist/cjs/models/receipt.js +6 -0
- package/dist/cjs/payments/hobex-hps/connect-client.d.ts +17 -0
- package/dist/cjs/payments/hobex-hps/connect-client.js +17 -0
- package/dist/cjs/payments/hobex-hps/index.d.ts +1 -1
- package/dist/cjs/payments/index.d.ts +1 -1
- package/dist/cjs/pos/client.js +2 -1
- package/dist/cjs/pos/index.d.ts +1 -1
- package/dist/cjs/pos/index.js +7 -5
- package/dist/cjs/pos/schicht-lesen.js +5 -0
- package/dist/cjs/pos/schicht-typen.d.ts +11 -0
- package/dist/cjs/pos/settings.d.ts +14 -1
- package/dist/cjs/pos/settings.js +16 -2
- package/dist/cjs/pos/texte.d.ts +400 -2
- package/dist/cjs/pos/texte.js +152 -3
- package/dist/cjs/receipt/index.d.ts +1 -0
- package/dist/cjs/receipt/index.js +4 -2
- package/dist/cjs/receipt/layout.d.ts +2 -2
- package/dist/cjs/receipt/layout.js +106 -117
- package/dist/cjs/receipt/shift-sheet.js +6 -1
- package/dist/cjs/receipt/vermerke.d.ts +80 -0
- package/dist/cjs/receipt/vermerke.js +167 -0
- package/dist/cjs/register/errors.d.ts +1 -1
- package/dist/cjs/register/errors.js +4 -0
- package/dist/cjs/register/index.d.ts +1 -1
- package/dist/cjs/register/index.js +3 -1
- package/dist/cjs/register/pairing.d.ts +51 -0
- package/dist/cjs/register/pairing.js +59 -0
- package/dist/cjs/stored/draht.js +25 -1
- package/dist/cjs/stored/einstellungen.js +5 -2
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +22 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/aufrufe.d.ts +2 -2
- package/dist/esm/client/aufrufe.js +12 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/invoice/texte.d.ts +18 -1
- package/dist/esm/invoice/texte.js +43 -2
- package/dist/esm/invoice/vertrag.d.ts +1 -1
- package/dist/esm/invoice/vertrag.js +1 -0
- package/dist/esm/models/cancellation.d.ts +1 -1
- package/dist/esm/models/cancellation.js +2 -0
- package/dist/esm/models/index.d.ts +2 -1
- package/dist/esm/models/index.js +2 -1
- package/dist/esm/models/invoice-payment-ref.d.ts +42 -0
- package/dist/esm/models/invoice-payment-ref.js +35 -0
- package/dist/esm/models/receipt-item.d.ts +10 -2
- package/dist/esm/models/receipt-item.js +13 -1
- package/dist/esm/models/receipt.d.ts +7 -0
- package/dist/esm/models/receipt.js +6 -0
- package/dist/esm/payments/hobex-hps/connect-client.d.ts +17 -0
- package/dist/esm/payments/hobex-hps/connect-client.js +17 -0
- package/dist/esm/payments/hobex-hps/index.d.ts +1 -1
- package/dist/esm/payments/index.d.ts +1 -1
- package/dist/esm/pos/client.js +3 -2
- package/dist/esm/pos/index.d.ts +1 -1
- package/dist/esm/pos/index.js +1 -1
- package/dist/esm/pos/schicht-lesen.js +5 -0
- package/dist/esm/pos/schicht-typen.d.ts +11 -0
- package/dist/esm/pos/settings.d.ts +14 -1
- package/dist/esm/pos/settings.js +14 -1
- package/dist/esm/pos/texte.d.ts +400 -2
- package/dist/esm/pos/texte.js +152 -3
- package/dist/esm/receipt/index.d.ts +1 -0
- package/dist/esm/receipt/index.js +1 -0
- package/dist/esm/receipt/layout.d.ts +2 -2
- package/dist/esm/receipt/layout.js +103 -113
- package/dist/esm/receipt/shift-sheet.js +6 -1
- package/dist/esm/receipt/vermerke.d.ts +80 -0
- package/dist/esm/receipt/vermerke.js +155 -0
- package/dist/esm/register/errors.d.ts +1 -1
- package/dist/esm/register/errors.js +4 -0
- package/dist/esm/register/index.d.ts +1 -1
- package/dist/esm/register/index.js +1 -1
- package/dist/esm/register/pairing.d.ts +51 -0
- package/dist/esm/register/pairing.js +57 -0
- package/dist/esm/stored/draht.js +25 -1
- package/dist/esm/stored/einstellungen.js +6 -3
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +22 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/expected/invoice-payment-cancellation.grid32.txt +28 -0
- package/fixtures/expected/invoice-payment-cancellation.grid48.txt +26 -0
- package/fixtures/expected/invoice-payment-cancellation.lines.json +189 -0
- package/fixtures/expected/invoice-payment-cancellation.sheet32.json +194 -0
- package/fixtures/expected/invoice-payment-cancellation.sheet48.json +182 -0
- package/fixtures/expected/invoice-payment-manual-receipt.grid32.txt +30 -0
- package/fixtures/expected/invoice-payment-manual-receipt.grid48.txt +29 -0
- package/fixtures/expected/invoice-payment-manual-receipt.lines.json +199 -0
- package/fixtures/expected/invoice-payment-manual-receipt.sheet32.json +206 -0
- package/fixtures/expected/invoice-payment-manual-receipt.sheet48.json +200 -0
- package/fixtures/expected/invoice-payment-normal.grid32.txt +22 -0
- package/fixtures/expected/invoice-payment-normal.grid48.txt +21 -0
- package/fixtures/expected/invoice-payment-normal.lines.json +192 -0
- package/fixtures/expected/invoice-payment-normal.sheet32.json +158 -0
- package/fixtures/expected/invoice-payment-normal.sheet48.json +152 -0
- package/fixtures/expected/invoice-payment-outage.grid32.txt +23 -0
- package/fixtures/expected/invoice-payment-outage.grid48.txt +21 -0
- package/fixtures/expected/invoice-payment-outage.lines.json +172 -0
- package/fixtures/expected/invoice-payment-outage.sheet32.json +164 -0
- package/fixtures/expected/invoice-payment-outage.sheet48.json +152 -0
- package/fixtures/expected/invoice-payment-partial.grid32.txt +20 -0
- package/fixtures/expected/invoice-payment-partial.grid48.txt +20 -0
- package/fixtures/expected/invoice-payment-partial.lines.json +162 -0
- package/fixtures/expected/invoice-payment-partial.sheet32.json +146 -0
- package/fixtures/expected/invoice-payment-partial.sheet48.json +146 -0
- package/fixtures/expected/invoice-payment-refund.grid32.txt +20 -0
- package/fixtures/expected/invoice-payment-refund.grid48.txt +20 -0
- package/fixtures/expected/invoice-payment-refund.lines.json +162 -0
- package/fixtures/expected/invoice-payment-refund.sheet32.json +146 -0
- package/fixtures/expected/invoice-payment-refund.sheet48.json +146 -0
- package/fixtures/expected/invoice-payment-see-invoice.grid32.txt +22 -0
- package/fixtures/expected/invoice-payment-see-invoice.grid48.txt +21 -0
- package/fixtures/expected/invoice-payment-see-invoice.lines.json +192 -0
- package/fixtures/expected/invoice-payment-see-invoice.sheet32.json +158 -0
- package/fixtures/expected/invoice-payment-see-invoice.sheet48.json +152 -0
- package/fixtures/expected/invoice-payment-training.grid32.txt +30 -0
- package/fixtures/expected/invoice-payment-training.grid48.txt +27 -0
- package/fixtures/expected/invoice-payment-training.lines.json +183 -0
- package/fixtures/expected/invoice-payment-training.sheet32.json +206 -0
- package/fixtures/expected/invoice-payment-training.sheet48.json +188 -0
- package/fixtures/expected/invoice-payment-without-vat.grid32.txt +20 -0
- package/fixtures/expected/invoice-payment-without-vat.grid48.txt +19 -0
- package/fixtures/expected/invoice-payment-without-vat.lines.json +162 -0
- package/fixtures/expected/invoice-payment-without-vat.sheet32.json +146 -0
- package/fixtures/expected/invoice-payment-without-vat.sheet48.json +140 -0
- package/fixtures/expected/invoice-payment-zero-percent.grid32.txt +22 -0
- package/fixtures/expected/invoice-payment-zero-percent.grid48.txt +21 -0
- package/fixtures/expected/invoice-payment-zero-percent.lines.json +192 -0
- package/fixtures/expected/invoice-payment-zero-percent.sheet32.json +158 -0
- package/fixtures/expected/invoice-payment-zero-percent.sheet48.json +152 -0
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +3 -2
- package/fixtures/invoice-texts.json +37 -3
- package/fixtures/manifest.json +80 -0
- package/fixtures/pos-message-cases.json +3 -0
- package/fixtures/pos-texts.json +458 -1
- package/fixtures/receipt-due-generated.json +3 -3
- package/fixtures/receipt-due-voucher-generated.json +5 -5
- package/fixtures/receipts/invoice-payment-cancellation.json +70 -0
- package/fixtures/receipts/invoice-payment-manual-receipt.json +69 -0
- package/fixtures/receipts/invoice-payment-normal.json +65 -0
- package/fixtures/receipts/invoice-payment-outage.json +63 -0
- package/fixtures/receipts/invoice-payment-partial.json +63 -0
- package/fixtures/receipts/invoice-payment-refund.json +63 -0
- package/fixtures/receipts/invoice-payment-see-invoice.json +65 -0
- package/fixtures/receipts/invoice-payment-training.json +63 -0
- package/fixtures/receipts/invoice-payment-without-vat.json +63 -0
- package/fixtures/receipts/invoice-payment-zero-percent.json +65 -0
- package/fixtures/surface.json +16 -4
- package/fixtures/v3/antworten/belege.json +2 -2
- package/fixtures/v3/antworten/belegmail.json +2 -2
- package/fixtures/v3/antworten/berichte.json +2 -2
- package/fixtures/v3/antworten/kasse-belege.json +2 -2
- package/fixtures/v3/antworten/kasse.json +702 -127
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +2 -2
- package/fixtures/v3/antworten/storno.json +2 -2
- package/fixtures/v3/stored/belege.json +2 -2
- package/fixtures/v3/stored/kasse.json +210 -4
- package/fixtures/v3/stored/rechnungen.json +2 -2
- package/fixtures/v3/v3-vokabular.json +237 -20
- package/fixtures/v3/zahlbetrag-faelle.json +2 -2
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ReceiptType, VatRate, KeckPaymentMethod, CreditCardProvider, VoucherType, VoucherAction, StripeLinkMode, } from './enums/index.js';
|
|
2
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, fromReceiptPaymentPayload, toReceiptPaymentPayload, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_LOG_KINDS, RECEIPT_OUTPUT_RESULTS, RECEIPT_OUTPUT_ENTRIES_MAX, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, RECEIPT_OUTPUT_ERROR_CODES, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, isInvoicePaymentItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, fromReceiptPaymentPayload, toReceiptPaymentPayload, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_LOG_KINDS, RECEIPT_OUTPUT_RESULTS, RECEIPT_OUTPUT_ENTRIES_MAX, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, RECEIPT_OUTPUT_ERROR_CODES, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, ALL_CALLS, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, createTransport, createBinaryTransport, createPdfOrDataTransport, createFileOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, CLIENT_ERROR_CODES, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, listMyCashregisters, checkVoucherCombinationError, sendReceiptEmail, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2, listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, listedReceiptWithCompany, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, createDepExport, getDepExport, waitForDepExport, getDepExportFile, createDepHandoverLink, revokeDepHandoverLink, DepExportTimeoutError, DepExportChecksumError, DEP_EXPORT_STATUSES, DEP_EXPORT_FILES, DEP_EXPORT_ERROR_CODES, DEP_EXPORT_FAILURES, DEP_EXPORT_POLL_START_MS, DEP_EXPORT_POLL_FACTOR, DEP_EXPORT_POLL_MAX_MS, DEP_EXPORT_WAIT_TIMEOUT_MS, DEP_EXPORT_DOWNLOAD_TIMEOUT_MS, registerTerminalDevice, getTerminalAccess, claimTerminal, requestTerminalCode, getTerminalCode, reportTerminalLogin, reportTerminalReady, TERMINAL_PLATFORMS, TERMINAL_SETUP_STATES, TERMINAL_CODE_STATUSES, TERMINAL_CODE_SOURCES, TERMINAL_ERROR_CODES, TERMINAL_LABEL_MAX, TERMINAL_APP_MAX, TERMINAL_REQUESTED_BY_MAX, EWP_REASONS, EWP_WARNING_CODES, getCashboxStatus, getSignatureStatus, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock } from './vienna-time.js';
|
|
@@ -18,6 +18,8 @@ import type { InvoiceLanguage } from './vertrag.js';
|
|
|
18
18
|
declare const DE: {
|
|
19
19
|
readonly 'pdf.title.invoice': "RECHNUNG";
|
|
20
20
|
readonly 'pdf.title.credit_note': "GUTSCHRIFT";
|
|
21
|
+
readonly 'pdf.title.payment_confirmation': "ZAHLUNGSBESTÄTIGUNG";
|
|
22
|
+
readonly 'pdf.title.refund_confirmation': "RÜCKZAHLUNGSBESTÄTIGUNG";
|
|
21
23
|
readonly 'pdf.badge.paid': "BEZAHLT";
|
|
22
24
|
readonly 'pdf.badge.direct_debit': "SEPA-LASTSCHRIFT";
|
|
23
25
|
readonly 'pdf.meta.number.invoice': "Rechnungsnr.";
|
|
@@ -78,9 +80,24 @@ declare const DE: {
|
|
|
78
80
|
readonly 'pdf.payment.note_until': "Zahlbar ohne Abzug bis {date}. Vielen Dank für Ihren Auftrag.";
|
|
79
81
|
readonly 'pdf.payment.note': "Zahlbar ohne Abzug. Vielen Dank für Ihren Auftrag.";
|
|
80
82
|
readonly 'pdf.payment.qr': "Mit Banking-App scannen & zahlen";
|
|
81
|
-
readonly 'pdf.paid.text': "Diese Rechnung ist beglichen.
|
|
83
|
+
readonly 'pdf.paid.text': "Diese Rechnung ist beglichen.";
|
|
82
84
|
readonly 'pdf.paid.date': "Bezahlt am";
|
|
85
|
+
readonly 'pdf.paid.cash': "Bar bezahlt am {date}.";
|
|
86
|
+
readonly 'pdf.paid.card': "Mit Karte bezahlt am {date}.";
|
|
83
87
|
readonly 'pdf.paid.payment_method': "Zahlungsart";
|
|
88
|
+
readonly 'pdf.cash_register.header': "REGISTRIERKASSE";
|
|
89
|
+
readonly 'pdf.cash_register.receipt_number': "Beleg-Nr.";
|
|
90
|
+
readonly 'pdf.cash_register.date': "Datum";
|
|
91
|
+
readonly 'pdf.cash_register.tax.incl_vat': "inkl. USt";
|
|
92
|
+
readonly 'pdf.cash_register.tax.zero_percent': "0 % USt";
|
|
93
|
+
readonly 'pdf.cash_register.tax.see_invoice': "Steuerangaben siehe Rechnung";
|
|
94
|
+
readonly 'pdf.confirmation.intro': "Wir bestätigen den Erhalt Ihrer Zahlung.";
|
|
95
|
+
readonly 'pdf.confirmation.not_invoice': "Diese Bestätigung ist keine Rechnung.";
|
|
96
|
+
readonly 'pdf.confirmation.table.invoice': "Rechnung";
|
|
97
|
+
readonly 'pdf.confirmation.table.amount': "Betrag";
|
|
98
|
+
readonly 'pdf.confirmation.table.paid_so_far': "Bisher bezahlt";
|
|
99
|
+
readonly 'pdf.confirmation.table.received_today': "Heute erhalten";
|
|
100
|
+
readonly 'pdf.confirmation.table.still_open': "Noch offen";
|
|
84
101
|
readonly 'payment_method.cash': "Bar";
|
|
85
102
|
readonly 'payment_method.transfer': "Überweisung";
|
|
86
103
|
readonly 'payment_method.card': "Karte";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const DE = {
|
|
2
2
|
'pdf.title.invoice': 'RECHNUNG',
|
|
3
3
|
'pdf.title.credit_note': 'GUTSCHRIFT',
|
|
4
|
+
// Zahlung auf Rechnung (1.38.0): eigene Bestaetigung, wenn spaeter bar oder mit Karte bezahlt wird.
|
|
5
|
+
'pdf.title.payment_confirmation': 'ZAHLUNGSBESTÄTIGUNG',
|
|
6
|
+
'pdf.title.refund_confirmation': 'RÜCKZAHLUNGSBESTÄTIGUNG',
|
|
4
7
|
'pdf.badge.paid': 'BEZAHLT',
|
|
5
8
|
'pdf.badge.direct_debit': 'SEPA-LASTSCHRIFT',
|
|
6
9
|
'pdf.meta.number.invoice': 'Rechnungsnr.',
|
|
@@ -69,9 +72,30 @@ const DE = {
|
|
|
69
72
|
'pdf.payment.note_until': 'Zahlbar ohne Abzug bis {date}. Vielen Dank für Ihren Auftrag.',
|
|
70
73
|
'pdf.payment.note': 'Zahlbar ohne Abzug. Vielen Dank für Ihren Auftrag.',
|
|
71
74
|
'pdf.payment.qr': 'Mit Banking-App scannen & zahlen',
|
|
72
|
-
|
|
75
|
+
// Kurz, fuer jede bezahlte Rechnung (auch Ueberweisung); der Satz „Es ist nichts weiter zu tun.“ entfiel mit 1.38.0.
|
|
76
|
+
'pdf.paid.text': 'Diese Rechnung ist beglichen.',
|
|
73
77
|
'pdf.paid.date': 'Bezahlt am',
|
|
78
|
+
// Kurztexte (1.38.0) fuer die Zahlung vor Ort; {date} = Zahltag.
|
|
79
|
+
'pdf.paid.cash': 'Bar bezahlt am {date}.',
|
|
80
|
+
'pdf.paid.card': 'Mit Karte bezahlt am {date}.',
|
|
74
81
|
'pdf.paid.payment_method': 'Zahlungsart',
|
|
82
|
+
// Kassenteil (1.38.0): der Zahlungsbeleg der Kasse unten auf Rechnung und Zahlungsbestaetigung. Kopfzeile
|
|
83
|
+
// mit der Kassen-ID dahinter; Vermerke und Positionstexte bleiben deutsch (Pflichtwoerter, receiptNotes).
|
|
84
|
+
'pdf.cash_register.header': 'REGISTRIERKASSE',
|
|
85
|
+
'pdf.cash_register.receipt_number': 'Beleg-Nr.',
|
|
86
|
+
'pdf.cash_register.date': 'Datum',
|
|
87
|
+
// Steuerhinweis unter der Zahlung (Spec 2026-11-11, Abschnitt 16): Umsatzsteuer ausgewiesen, steuerfrei/nicht steuerbar, Reverse Charge.
|
|
88
|
+
'pdf.cash_register.tax.incl_vat': 'inkl. USt',
|
|
89
|
+
'pdf.cash_register.tax.zero_percent': '0 % USt',
|
|
90
|
+
'pdf.cash_register.tax.see_invoice': 'Steuerangaben siehe Rechnung',
|
|
91
|
+
// Zahlungsbestaetigung (1.38.0): Einleitung, Hinweis und die Spalten der Tabelle je Rechnung.
|
|
92
|
+
'pdf.confirmation.intro': 'Wir bestätigen den Erhalt Ihrer Zahlung.',
|
|
93
|
+
'pdf.confirmation.not_invoice': 'Diese Bestätigung ist keine Rechnung.',
|
|
94
|
+
'pdf.confirmation.table.invoice': 'Rechnung',
|
|
95
|
+
'pdf.confirmation.table.amount': 'Betrag',
|
|
96
|
+
'pdf.confirmation.table.paid_so_far': 'Bisher bezahlt',
|
|
97
|
+
'pdf.confirmation.table.received_today': 'Heute erhalten',
|
|
98
|
+
'pdf.confirmation.table.still_open': 'Noch offen',
|
|
75
99
|
'payment_method.cash': 'Bar',
|
|
76
100
|
'payment_method.transfer': 'Überweisung',
|
|
77
101
|
'payment_method.card': 'Karte',
|
|
@@ -216,6 +240,8 @@ const DE = {
|
|
|
216
240
|
const EN = {
|
|
217
241
|
'pdf.title.invoice': 'INVOICE',
|
|
218
242
|
'pdf.title.credit_note': 'CREDIT NOTE',
|
|
243
|
+
'pdf.title.payment_confirmation': 'PAYMENT CONFIRMATION',
|
|
244
|
+
'pdf.title.refund_confirmation': 'REFUND CONFIRMATION',
|
|
219
245
|
'pdf.badge.paid': 'PAID',
|
|
220
246
|
'pdf.badge.direct_debit': 'SEPA DIRECT DEBIT',
|
|
221
247
|
'pdf.meta.number.invoice': 'Invoice no.',
|
|
@@ -276,9 +302,24 @@ const EN = {
|
|
|
276
302
|
'pdf.payment.note_until': 'Payable without deduction by {date}. Thank you for your business.',
|
|
277
303
|
'pdf.payment.note': 'Payable without deduction. Thank you for your business.',
|
|
278
304
|
'pdf.payment.qr': 'Scan with your banking app to pay',
|
|
279
|
-
'pdf.paid.text': 'This invoice has been paid.
|
|
305
|
+
'pdf.paid.text': 'This invoice has been paid.',
|
|
280
306
|
'pdf.paid.date': 'Paid on',
|
|
307
|
+
'pdf.paid.cash': 'Paid in cash on {date}.',
|
|
308
|
+
'pdf.paid.card': 'Paid by card on {date}.',
|
|
281
309
|
'pdf.paid.payment_method': 'Payment method',
|
|
310
|
+
'pdf.cash_register.header': 'CASH REGISTER',
|
|
311
|
+
'pdf.cash_register.receipt_number': 'Receipt no.',
|
|
312
|
+
'pdf.cash_register.date': 'Date',
|
|
313
|
+
'pdf.cash_register.tax.incl_vat': 'incl. VAT',
|
|
314
|
+
'pdf.cash_register.tax.zero_percent': '0 % VAT',
|
|
315
|
+
'pdf.cash_register.tax.see_invoice': 'Tax details see invoice',
|
|
316
|
+
'pdf.confirmation.intro': 'We confirm receipt of your payment.',
|
|
317
|
+
'pdf.confirmation.not_invoice': 'This confirmation is not an invoice.',
|
|
318
|
+
'pdf.confirmation.table.invoice': 'Invoice',
|
|
319
|
+
'pdf.confirmation.table.amount': 'Amount',
|
|
320
|
+
'pdf.confirmation.table.paid_so_far': 'Paid so far',
|
|
321
|
+
'pdf.confirmation.table.received_today': 'Received today',
|
|
322
|
+
'pdf.confirmation.table.still_open': 'Still open',
|
|
282
323
|
'payment_method.cash': 'Cash',
|
|
283
324
|
'payment_method.transfer': 'Bank transfer',
|
|
284
325
|
'payment_method.card': 'Card',
|
|
@@ -27,7 +27,7 @@ export type InvoiceEndpoint = (typeof INVOICE_ENDPOINTS)[number];
|
|
|
27
27
|
* Stabile Fehlercodes. Das Fremdsystem verzweigt am Code, der Text darf sich
|
|
28
28
|
* aendern. `validation` traegt zusaetzlich `errors: [{ field, message }]`.
|
|
29
29
|
*/
|
|
30
|
-
export declare const INVOICE_ERROR_CODES: readonly ["validation", "idempotency_conflict", "module_inactive", "customer_not_found", "customer_exists", "short_code_taken", "short_code_immutable", "recipient_required", "invoice_requirements_missing", "invoice_not_found", "invoice_ambiguous", "not_cancellable", "partial_credit_exists", "credit_exceeds_invoice", "einvoice_incomplete", "invoice_api_not_enabled", "invoice_setup_incomplete", "language_not_allowed", "brand_not_found", "not_payable", "payment_exceeds_invoice", "tax_scheme_mismatch", "vat_rate_not_in_country", "reverse_charge_reason_required", "reverse_charge_threshold", "mixed_supply_not_allowed", "oss_not_enabled", "einvoice_unavailable", "amount_too_large", "vat_id_invalid", "vat_id_check_pending", "reservation_not_found", "reservation_mismatch", "reservation_not_active", "invoice_number_taken", "deposit_not_enabled", "deposit_type_not_found", "deposit_set_by_server", "invalid_deposit_quantity", "invalid_deposit"];
|
|
30
|
+
export declare const INVOICE_ERROR_CODES: readonly ["validation", "idempotency_conflict", "module_inactive", "customer_not_found", "customer_exists", "short_code_taken", "short_code_immutable", "recipient_required", "invoice_requirements_missing", "invoice_not_found", "invoice_ambiguous", "not_cancellable", "partial_credit_exists", "credit_exceeds_invoice", "einvoice_incomplete", "invoice_api_not_enabled", "invoice_setup_incomplete", "language_not_allowed", "brand_not_found", "not_payable", "payment_exceeds_invoice", "tax_scheme_mismatch", "vat_rate_not_in_country", "reverse_charge_reason_required", "reverse_charge_threshold", "mixed_supply_not_allowed", "oss_not_enabled", "einvoice_unavailable", "amount_too_large", "vat_id_invalid", "vat_id_check_pending", "reservation_not_found", "reservation_mismatch", "reservation_not_active", "invoice_number_taken", "deposit_not_enabled", "deposit_type_not_found", "deposit_set_by_server", "invalid_deposit_quantity", "invalid_deposit", "cash_receipt_pending"];
|
|
31
31
|
export type InvoiceErrorCode = (typeof INVOICE_ERROR_CODES)[number];
|
|
32
32
|
/**
|
|
33
33
|
* Codes, die Anmeldung und Rand auf jedem Rechnungsaufruf erzeugen koennen,
|
|
@@ -85,6 +85,7 @@ export const INVOICE_ERROR_CODES = [
|
|
|
85
85
|
'deposit_set_by_server', // das Pfand zu einer Artikelposition leitet der Server selbst ab
|
|
86
86
|
'invalid_deposit_quantity', // die Pfandmenge passt nicht zur Menge der Position
|
|
87
87
|
'invalid_deposit', // sonstige Pfandangabe unzulaessig, `index` nennt die Position
|
|
88
|
+
'cash_receipt_pending', // Rechnung bar bezahlt, der Kassenbeleg der Zahlung ist noch nicht fertig: PDF spaeter abrufen
|
|
88
89
|
];
|
|
89
90
|
/**
|
|
90
91
|
* Codes, die Anmeldung und Rand auf jedem Rechnungsaufruf erzeugen koennen,
|
|
@@ -54,7 +54,7 @@ export declare function isReturnDisposition(value: unknown): value is ReturnDisp
|
|
|
54
54
|
* [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
|
|
55
55
|
* `KasseneckApiError.code` lesbar.
|
|
56
56
|
*/
|
|
57
|
-
export declare const CANCELLATION_ERROR_CODES: readonly ["receipt_not_found", "receipt_type_not_cancellable", "training_receipt", "already_cancelled", "invalid_line", "quantity_exceeds_remaining", "unknown_reason", "note_too_long", "invalid_items", "cashregister_not_assigned", "not_permitted", "own_receipts_only", "cashregister_incomplete", "cancellation_failed", "cancellation_payments_required", "cancellation_refund_exceeds_payment", "cancellation_refund_reference_required", "cancellation_refund_reference_unknown", "cancellation_outcome_unknown", "invalid_return_disposition", "tip_refund_conflict", "invalid_tip_refund_source", "tip_refund_source_requires_cash", "tip_keep_not_possible_with_voucher", "refund_as_invalid", "refund_as_conflict", "refund_as_voucher_not_available", "refund_as_voucher_reason", "refund_as_voucher_with_voucher", "refund_as_voucher_no_type", "refund_as_voucher_amount", "idempotency_key_required", "account_not_found", "action_confirmation_required", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
|
|
57
|
+
export declare const CANCELLATION_ERROR_CODES: readonly ["receipt_not_found", "receipt_type_not_cancellable", "training_receipt", "already_cancelled", "invalid_line", "quantity_exceeds_remaining", "unknown_reason", "note_too_long", "invalid_items", "cashregister_not_assigned", "not_permitted", "own_receipts_only", "cashregister_incomplete", "cancellation_failed", "cancellation_payments_required", "cancellation_refund_exceeds_payment", "cancellation_refund_reference_required", "cancellation_refund_reference_unknown", "cancellation_outcome_unknown", "invalid_return_disposition", "tip_refund_conflict", "invalid_tip_refund_source", "tip_refund_source_requires_cash", "tip_keep_not_possible_with_voucher", "refund_as_invalid", "refund_as_conflict", "refund_as_voucher_not_available", "refund_as_voucher_reason", "refund_as_voucher_with_voucher", "refund_as_voucher_no_type", "refund_as_voucher_amount", "idempotency_key_required", "invoice_payment_not_cancellable", "account_not_found", "action_confirmation_required", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "password_change_required", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
|
|
58
58
|
export type CancellationErrorCode = (typeof CANCELLATION_ERROR_CODES)[number];
|
|
59
59
|
export declare function isCancellationErrorCode(value: unknown): value is CancellationErrorCode;
|
|
60
60
|
/** Der Code eines geworfenen Fehlers, wenn er in [CANCELLATION_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -90,6 +90,8 @@ export const CANCELLATION_ERROR_CODES = Object.freeze([
|
|
|
90
90
|
'refund_as_voucher_no_type', // keine passende Rueckgabe-Sorte eingestellt
|
|
91
91
|
'refund_as_voucher_amount', // Betrag ohne Trinkgeld ausserhalb 1,00 bis 10.000,00 Euro
|
|
92
92
|
'idempotency_key_required', // refundAs ohne idempotencyKey
|
|
93
|
+
// Zahlung auf Rechnung (Server 2026-11): ein Zahlungsbeleg wird nur im Kundenbereich bei der Rechnung storniert
|
|
94
|
+
'invoice_payment_not_cancellable', // Original ist ein Zahlungsbeleg (Positionen invoice_payment)
|
|
93
95
|
// Anmeldung und Rand (errorCodes.auth ohne Partner-Zugang, errorCodes.edge)
|
|
94
96
|
'account_not_found',
|
|
95
97
|
'action_confirmation_required',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, } from './receipt-item.js';
|
|
1
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, isInvoicePaymentItem, } from './receipt-item.js';
|
|
2
2
|
export { type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, type ExternalVoucherNumberCheck, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, } from './voucher.js';
|
|
3
3
|
export { type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, readRegistrationInfo, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, } from './receipt.js';
|
|
4
4
|
export { 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, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, } from './cancellation.js';
|
|
@@ -11,6 +11,7 @@ export { type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayl
|
|
|
11
11
|
export { type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, } from './cashregister.js';
|
|
12
12
|
export { type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind } from './receipt-summary.js';
|
|
13
13
|
export { type ManualReceipt, type ManualReceiptReason, MANUAL_RECEIPT_REASONS, readManualReceipt, type ManualReceiptErrorCode, MANUAL_RECEIPT_ERROR_CODES, isManualReceiptErrorCode, } from './manual-receipt.js';
|
|
14
|
+
export { type InvoicePaymentRef, type InvoicePaymentTaxNote, readInvoicePaymentRefs } from './invoice-payment-ref.js';
|
|
14
15
|
export { type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, } from './report-month.js';
|
|
15
16
|
export { type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, } from './stripe-url-session.js';
|
|
16
17
|
export { type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './hobex-receipt.js';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, } from './receipt-item.js';
|
|
1
|
+
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, isInvoicePaymentItem, } from './receipt-item.js';
|
|
2
2
|
export { toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, } from './voucher.js';
|
|
3
3
|
export { toReceiptPayload, fromReceiptPayload, readRegistrationInfo, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, } from './receipt.js';
|
|
4
4
|
export { RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, } from './cancellation.js';
|
|
@@ -11,6 +11,7 @@ export { fromReceiptCompanyPayload, receiptCompanyTaxInfo, } from './receipt-com
|
|
|
11
11
|
export { fromCashregisterPayload, } from './cashregister.js';
|
|
12
12
|
export { fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind } from './receipt-summary.js';
|
|
13
13
|
export { MANUAL_RECEIPT_REASONS, readManualReceipt, MANUAL_RECEIPT_ERROR_CODES, isManualReceiptErrorCode, } from './manual-receipt.js';
|
|
14
|
+
export { readInvoicePaymentRefs } from './invoice-payment-ref.js';
|
|
14
15
|
export { reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, } from './report-month.js';
|
|
15
16
|
export { toStripeUrlSessionPayload, fromStripeUrlSessionPayload, } from './stripe-url-session.js';
|
|
16
17
|
export { toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './hobex-receipt.js';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zahlung auf Rechnung (`invoicePayments` am Beleg, Backend `rechnungszahlung`):
|
|
3
|
+
* Ein Zahlungsbeleg nimmt in der Kasse Geld fuer eine oder mehrere Rechnungen
|
|
4
|
+
* entgegen (bar oder mit Karte vor Ort) bzw. gibt es zu einer Gutschrift
|
|
5
|
+
* zurueck. Seine Positionen tragen `kind: 'invoice_payment'` und zaehlen im
|
|
6
|
+
* RKSV-Feld „Null“; die Umsatzsteuer steht auf der Rechnung, nicht am Beleg.
|
|
7
|
+
*
|
|
8
|
+
* Je Rechnung ein Bezug, in der Reihenfolge der Positionen (eine Zeile je
|
|
9
|
+
* Rechnung). Der Bezug ist nicht signiert (wie `cancellationOf`), die
|
|
10
|
+
* Rechnungsnummer steht zusaetzlich im Text der Position.
|
|
11
|
+
*
|
|
12
|
+
* Nur der Server legt solche Belege an; dieses Paket liest sie nur.
|
|
13
|
+
*/
|
|
14
|
+
export interface InvoicePaymentRef {
|
|
15
|
+
invoiceId: string;
|
|
16
|
+
/** Nummer der Rechnung bzw. Gutschrift aus ihrem Rechnungskreis (`2026-0042`). */
|
|
17
|
+
invoiceNumber: string;
|
|
18
|
+
/** Kennung des Zahlungseintrags an der Rechnung. */
|
|
19
|
+
paymentId: string;
|
|
20
|
+
customerId: string | null;
|
|
21
|
+
/** Betrag dieser Zeile in Cent; bei einer Rueckzahlung zu einer Gutschrift negativ. */
|
|
22
|
+
amountCents: number;
|
|
23
|
+
/** Teilzahlung: weniger als der Rechnungsbetrag. */
|
|
24
|
+
partial: boolean;
|
|
25
|
+
/** Zahlungstag `YYYY-MM-DD` (Wiener Tag), `null` wenn unbekannt. */
|
|
26
|
+
paidOn: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Steuerhinweis unter der Position: `incl_vat` (die Rechnung weist Umsatzsteuer aus), `zero_percent`
|
|
29
|
+
* (steuerfrei oder nicht steuerbar) oder `see_invoice` (Reverse Charge). Fehlt er, steht kein Hinweis.
|
|
30
|
+
*/
|
|
31
|
+
taxNote?: InvoicePaymentTaxNote;
|
|
32
|
+
}
|
|
33
|
+
/** Werte von [InvoicePaymentRef.taxNote] (gespeichert `inkl_ust` | `null_prozent` | `siehe_rechnung`). */
|
|
34
|
+
export type InvoicePaymentTaxNote = 'incl_vat' | 'zero_percent' | 'see_invoice';
|
|
35
|
+
/**
|
|
36
|
+
* Liest `invoicePayments` vom Draht. Ein Eintrag ohne Rechnungs-ID, Nummer,
|
|
37
|
+
* Zahlungs-ID oder ganzzahligen Betrag faellt weg (lesen tolerant, der Beleg
|
|
38
|
+
* bleibt anzeigbar); ohne brauchbaren Eintrag gibt es keinen Bezug
|
|
39
|
+
* (`undefined`). Ein unbekannter oder fehlender `taxNote` ergibt keinen
|
|
40
|
+
* Hinweis: ein Beleg behauptet nie eine Steuer, die er nicht kennt.
|
|
41
|
+
*/
|
|
42
|
+
export declare function readInvoicePaymentRefs(roh: unknown): InvoicePaymentRef[] | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const STEUERHINWEISE = ['incl_vat', 'zero_percent', 'see_invoice'];
|
|
2
|
+
const istText = (w) => typeof w === 'string' && w !== '';
|
|
3
|
+
/**
|
|
4
|
+
* Liest `invoicePayments` vom Draht. Ein Eintrag ohne Rechnungs-ID, Nummer,
|
|
5
|
+
* Zahlungs-ID oder ganzzahligen Betrag faellt weg (lesen tolerant, der Beleg
|
|
6
|
+
* bleibt anzeigbar); ohne brauchbaren Eintrag gibt es keinen Bezug
|
|
7
|
+
* (`undefined`). Ein unbekannter oder fehlender `taxNote` ergibt keinen
|
|
8
|
+
* Hinweis: ein Beleg behauptet nie eine Steuer, die er nicht kennt.
|
|
9
|
+
*/
|
|
10
|
+
export function readInvoicePaymentRefs(roh) {
|
|
11
|
+
if (!Array.isArray(roh))
|
|
12
|
+
return undefined;
|
|
13
|
+
const raus = [];
|
|
14
|
+
for (const e of roh) {
|
|
15
|
+
if (e === null || typeof e !== 'object' || Array.isArray(e))
|
|
16
|
+
continue;
|
|
17
|
+
const o = e;
|
|
18
|
+
if (!istText(o['invoiceId']) || !istText(o['invoiceNumber']) || !istText(o['paymentId']))
|
|
19
|
+
continue;
|
|
20
|
+
if (!Number.isSafeInteger(o['amountCents']))
|
|
21
|
+
continue;
|
|
22
|
+
const hinweis = o['taxNote'];
|
|
23
|
+
raus.push({
|
|
24
|
+
invoiceId: o['invoiceId'],
|
|
25
|
+
invoiceNumber: o['invoiceNumber'],
|
|
26
|
+
paymentId: o['paymentId'],
|
|
27
|
+
customerId: istText(o['customerId']) ? o['customerId'] : null,
|
|
28
|
+
amountCents: o['amountCents'],
|
|
29
|
+
partial: o['partial'] === true,
|
|
30
|
+
paidOn: istText(o['paidOn']) ? o['paidOn'] : null,
|
|
31
|
+
...(typeof hinweis === 'string' && STEUERHINWEISE.includes(hinweis) ? { taxNote: hinweis } : {}),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return raus.length > 0 ? raus : undefined;
|
|
35
|
+
}
|
|
@@ -35,8 +35,10 @@ export interface ReceiptItem {
|
|
|
35
35
|
* Inhaber-Trinkgeld (`recipient.owner`) Umsatz. Rabatt-Positionen sind
|
|
36
36
|
* negative Entgeltminderungen je Steuersatz; die Kennzeichnung steuert nur
|
|
37
37
|
* die Bon-Darstellung (Summenzeile mit Aufteilung), nie die Beträge.
|
|
38
|
+
* `invoice_payment`: Zahlung auf Rechnung (Zahlungsbeleg, nur vom Server; Bezug in
|
|
39
|
+
* `Receipt.invoicePayments`), siehe [isInvoicePaymentItem].
|
|
38
40
|
*/
|
|
39
|
-
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float' | 'deposit' | 'deposit_return';
|
|
41
|
+
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float' | 'deposit' | 'deposit_return' | 'invoice_payment';
|
|
40
42
|
/** Empfaenger der Trinkgeld-Position; `null` = nicht zugeordnet. */
|
|
41
43
|
recipient?: TipRecipient | null;
|
|
42
44
|
/** Zahlart der Trinkgeld-Position (kann von der des Belegs abweichen). */
|
|
@@ -92,6 +94,12 @@ export interface ReceiptItem {
|
|
|
92
94
|
export declare function isDepositItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
93
95
|
/** Leergutzeile (Ruecknahme, negativer Betrag)? */
|
|
94
96
|
export declare function isDepositReturnItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Zahlung auf Rechnung (Zahlungsbeleg)? Die Position zaehlt im RKSV-Feld „Null“, ist aber kein
|
|
99
|
+
* steuerfreier Umsatz: die Umsatzsteuer steht auf der Rechnung. Am Bon steht sie ohne Satzkennzeichen
|
|
100
|
+
* und nicht in der Steuertabelle. Ein Beleg mit einer solchen Position besteht nur aus solchen.
|
|
101
|
+
*/
|
|
102
|
+
export declare function isInvoicePaymentItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
95
103
|
/** Empfaenger einer Trinkgeld-Position (Kassen-Benutzer, Snapshot des Namens). */
|
|
96
104
|
export interface TipRecipient {
|
|
97
105
|
registerUserId: string;
|
|
@@ -121,7 +129,7 @@ export interface ReceiptItemPayload {
|
|
|
121
129
|
unitPriceCents: number;
|
|
122
130
|
vatRate: number;
|
|
123
131
|
/** Trinkgeld-/Rabatt-/Gutschein-Kennzeichnung, siehe [ReceiptItem.kind]. */
|
|
124
|
-
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float' | 'deposit' | 'deposit_return';
|
|
132
|
+
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float' | 'deposit' | 'deposit_return' | 'invoice_payment';
|
|
125
133
|
recipient?: TipRecipient | null;
|
|
126
134
|
paymentMethod?: string;
|
|
127
135
|
receivedImmediately?: boolean;
|
|
@@ -9,6 +9,14 @@ export function isDepositItem(item) {
|
|
|
9
9
|
export function isDepositReturnItem(item) {
|
|
10
10
|
return item != null && item.kind === 'deposit_return';
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Zahlung auf Rechnung (Zahlungsbeleg)? Die Position zaehlt im RKSV-Feld „Null“, ist aber kein
|
|
14
|
+
* steuerfreier Umsatz: die Umsatzsteuer steht auf der Rechnung. Am Bon steht sie ohne Satzkennzeichen
|
|
15
|
+
* und nicht in der Steuertabelle. Ein Beleg mit einer solchen Position besteht nur aus solchen.
|
|
16
|
+
*/
|
|
17
|
+
export function isInvoicePaymentItem(item) {
|
|
18
|
+
return item != null && item.kind === 'invoice_payment';
|
|
19
|
+
}
|
|
12
20
|
/** Trinkgeld-Position? Die eine Erkennungsstelle — niemand prueft `kind` selbst. */
|
|
13
21
|
export function isTipItem(item) {
|
|
14
22
|
return item != null && item.kind === 'tip';
|
|
@@ -62,6 +70,10 @@ export function toReceiptItemPayload(item) {
|
|
|
62
70
|
// (createReceipt weist sie als voucher_invalid ab).
|
|
63
71
|
if (item.kind === 'voucher' || item.kind === 'voucher_float')
|
|
64
72
|
nutzlast.kind = item.kind;
|
|
73
|
+
// Zahlung auf Rechnung (vom Server): reist mit wie die Gutschein-Positionen; ein Wunsch an den Server
|
|
74
|
+
// traegt sie nie (createReceipt weist sie ausser beim Selbstaufruf ab).
|
|
75
|
+
if (item.kind === 'invoice_payment')
|
|
76
|
+
nutzlast.kind = 'invoice_payment';
|
|
65
77
|
// Pfand & Leergut: Kennzeichen und Felder reisen mit (Cache schreibt gelesene Belege wieder; ein Wunsch an
|
|
66
78
|
// den Server traegt `deposit` nie mit `articleId`, siehe createReceiptParams).
|
|
67
79
|
if (item.kind === 'deposit' || item.kind === 'deposit_return') {
|
|
@@ -131,7 +143,7 @@ export function fromReceiptItemPayload(payload) {
|
|
|
131
143
|
}
|
|
132
144
|
: payload.kind === 'discount'
|
|
133
145
|
? { kind: 'discount' }
|
|
134
|
-
: payload.kind === 'voucher' || payload.kind === 'voucher_float'
|
|
146
|
+
: payload.kind === 'voucher' || payload.kind === 'voucher_float' || payload.kind === 'invoice_payment'
|
|
135
147
|
? { kind: payload.kind }
|
|
136
148
|
: payload.kind === 'deposit' || payload.kind === 'deposit_return'
|
|
137
149
|
? {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReceiptType, KeckPaymentMethod, CreditCardProvider } from '../enums/index.js';
|
|
2
2
|
import { type ManualReceipt } from './manual-receipt.js';
|
|
3
|
+
import { type InvoicePaymentRef } from './invoice-payment-ref.js';
|
|
3
4
|
import { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead } from './receipt-item.js';
|
|
4
5
|
import { type Voucher, type VoucherPayload } from './voucher.js';
|
|
5
6
|
import { type Cancellation, type CancellationOf, type CancellationReason } from './cancellation.js';
|
|
@@ -86,6 +87,11 @@ export interface Receipt {
|
|
|
86
87
|
* Kasse `returns: 'shared'` hat und der Beleg Pfand traegt. Der Bon druckt daraus die Fusszeile.
|
|
87
88
|
*/
|
|
88
89
|
sharedReturnPoint?: SharedReturnPoint;
|
|
90
|
+
/**
|
|
91
|
+
* Nur am Zahlungsbeleg (Zahlung auf Rechnung, Positionen `kind: 'invoice_payment'`): je Rechnung ein
|
|
92
|
+
* Bezug, in der Reihenfolge der Positionen (gespeichert `rechnungszahlung`). Siehe [InvoicePaymentRef].
|
|
93
|
+
*/
|
|
94
|
+
invoicePayments?: InvoicePaymentRef[];
|
|
89
95
|
}
|
|
90
96
|
/** Gemeinsame Ruecknahmestelle fuer Leergut (Name und Anschrift, wie der Server sie am Beleg stempelt). */
|
|
91
97
|
export interface SharedReturnPoint {
|
|
@@ -148,6 +154,7 @@ export interface ReceiptPayloadRead extends Omit<ReceiptPayload, 'items' | 'vouc
|
|
|
148
154
|
name?: string | null;
|
|
149
155
|
address?: string | null;
|
|
150
156
|
} | null;
|
|
157
|
+
invoicePayments?: unknown;
|
|
151
158
|
}
|
|
152
159
|
/**
|
|
153
160
|
* Schreibt die Nutzlast in der **neuen** Form — sie **normalisiert, statt zu
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReceiptType, KeckPaymentMethod, CreditCardProvider, VoucherAction, VoucherType } from '../enums/index.js';
|
|
2
2
|
import { readEnumKey, requireEnumKey } from './enum-payload.js';
|
|
3
3
|
import { readManualReceipt } from './manual-receipt.js';
|
|
4
|
+
import { readInvoicePaymentRefs } from './invoice-payment-ref.js';
|
|
4
5
|
import { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, } from './receipt-item.js';
|
|
5
6
|
import { toVoucherPayload, fromVoucherPayload } from './voucher.js';
|
|
6
7
|
import { isReturnDisposition } from './cancellation.js';
|
|
@@ -91,8 +92,13 @@ export function fromReceiptPayload(payload) {
|
|
|
91
92
|
...handbelegFeld(payload.manualReceipt),
|
|
92
93
|
...(typeof payload.onPremises === 'boolean' ? { onPremises: payload.onPremises } : {}),
|
|
93
94
|
...pfandStelleFeld(payload.sharedReturnPoint),
|
|
95
|
+
...rechnungszahlungFeld(payload.invoicePayments),
|
|
94
96
|
};
|
|
95
97
|
}
|
|
98
|
+
function rechnungszahlungFeld(roh) {
|
|
99
|
+
const invoicePayments = readInvoicePaymentRefs(roh);
|
|
100
|
+
return invoicePayments ? { invoicePayments } : {};
|
|
101
|
+
}
|
|
96
102
|
function pfandStelleFeld(roh) {
|
|
97
103
|
if (roh == null || typeof roh !== 'object')
|
|
98
104
|
return {};
|
|
@@ -105,6 +105,16 @@ export type HpsConnectFetch = (url: string, init: {
|
|
|
105
105
|
body: string;
|
|
106
106
|
signal: AbortSignal;
|
|
107
107
|
}) => Promise<HpsConnectFetchResponse>;
|
|
108
|
+
/**
|
|
109
|
+
* Die Adresse, unter der Connect das Terminal tatsaechlich erreicht hat
|
|
110
|
+
* (Feld `endpoint` der Antwort ab Connect 1.5.0). `relocated: true` heisst:
|
|
111
|
+
* nicht die mitgegebene, sondern eine wiedergefundene Adresse.
|
|
112
|
+
*/
|
|
113
|
+
export interface HpsConnectEndpoint {
|
|
114
|
+
host: string;
|
|
115
|
+
port: number;
|
|
116
|
+
relocated: boolean;
|
|
117
|
+
}
|
|
108
118
|
export interface HpsConnectClientOptions {
|
|
109
119
|
/** Basisadresse des Agenten. Vorgabe `http://127.0.0.1:27182` (README `kasseneck-connect`). */
|
|
110
120
|
baseUrl?: string;
|
|
@@ -124,6 +134,13 @@ export interface HpsConnectClientOptions {
|
|
|
124
134
|
paymentTimeoutMs?: number;
|
|
125
135
|
/** Eigene `fetch`-Umsetzung (Tests). Vorgabe: globales `fetch`. */
|
|
126
136
|
fetch?: HpsConnectFetch;
|
|
137
|
+
/**
|
|
138
|
+
* Wird mit der benutzten Adresse des Terminals aufgerufen, wenn Connect sie
|
|
139
|
+
* in einer ERFOLGREICHEN Antwort (`ok: true`) mitschickt (ab Connect 1.5.0).
|
|
140
|
+
* Bei einer Fehlerhuelle und bei Antworten ohne `endpoint` (Connect 1.4.2)
|
|
141
|
+
* nie. Ein Wurf des Aufrufers bleibt ohne Wirkung auf die Zahlung.
|
|
142
|
+
*/
|
|
143
|
+
onEndpoint?: (endpoint: HpsConnectEndpoint) => void;
|
|
127
144
|
}
|
|
128
145
|
export interface HpsConnectClient {
|
|
129
146
|
payment(options: HpsConnectPaymentOptions): Promise<HpsTransactionResponse>;
|
|
@@ -59,6 +59,22 @@ export function createHpsConnectClient(options) {
|
|
|
59
59
|
const shortTimeoutMs = options.shortTimeoutMs ?? DEFAULT_SHORT_TIMEOUT_MS;
|
|
60
60
|
const paymentTimeoutMs = options.paymentTimeoutMs ?? DEFAULT_PAYMENT_TIMEOUT_MS;
|
|
61
61
|
const holen = options.fetch ?? globalHpsConnectFetch();
|
|
62
|
+
// Nur aus einer Antwort mit `ok: true` und einer vollstaendigen Adresse;
|
|
63
|
+
// alles andere bleibt unbeachtet. Die Zahlung haengt nie am Aufrufer.
|
|
64
|
+
function meldeAdresse(huelle) {
|
|
65
|
+
const e = huelle['endpoint'];
|
|
66
|
+
if (options.onEndpoint === undefined || e === null || typeof e !== 'object')
|
|
67
|
+
return;
|
|
68
|
+
const { host, port, relocated } = e;
|
|
69
|
+
if (typeof host !== 'string' || host === '' || typeof port !== 'number' || !Number.isInteger(port))
|
|
70
|
+
return;
|
|
71
|
+
try {
|
|
72
|
+
options.onEndpoint({ host, port, relocated: relocated === true });
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
// Der Aufrufer darf die Antwort nicht kippen.
|
|
76
|
+
}
|
|
77
|
+
}
|
|
62
78
|
async function rufen(path, body, timeoutMs) {
|
|
63
79
|
const abbruch = new AbortController();
|
|
64
80
|
const wecker = setTimeout(() => abbruch.abort(), timeoutMs);
|
|
@@ -99,6 +115,7 @@ export function createHpsConnectClient(options) {
|
|
|
99
115
|
}
|
|
100
116
|
const h = huelle;
|
|
101
117
|
if (h.ok === true) {
|
|
118
|
+
meldeAdresse(h);
|
|
102
119
|
return h;
|
|
103
120
|
}
|
|
104
121
|
const code = typeof h.error?.code === 'string' ? h.error.code : undefined;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* tatsaechlichen Adresse (z. B. ueber `GET /v1/status` je Port) bleibt Sache
|
|
18
18
|
* des Aufrufers.
|
|
19
19
|
*/
|
|
20
|
-
export { type HpsConnectCancelOptions, type HpsConnectClient, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, createHpsConnectClient, } from './connect-client.js';
|
|
20
|
+
export { type HpsConnectCancelOptions, type HpsConnectClient, type HpsConnectClientOptions, type HpsConnectEndpoint, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, createHpsConnectClient, } from './connect-client.js';
|
|
21
21
|
export { HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, } from './errors.js';
|
|
22
22
|
export { type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, } from './events.js';
|
|
23
23
|
export { type CardPaymentOutcome, type HpsPaymentResult, isHostUncertainResult, mayRetrySafely, } from './outcome.js';
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
export { StripeLinkMode, type StripeLinkModeKey } from '../enums/index.js';
|
|
44
44
|
export { type CreateStripeLinkOptions, type StripeCaptureResult, createStripeLink, stripeCaptureIntent, } from './stripe.js';
|
|
45
45
|
export { type HobexPayOptions, type HobexRefundOptions, type HobexTransactionIdOptions, hobexPay, hobexRefund, newHobexTransactionId, } from './hobex.js';
|
|
46
|
-
export { type CardPaymentOutcome, type HpsConnectClient, type HpsConnectCancelOptions, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, type HpsCancelOptions, type HpsClarifyOptions, type HpsCode, type HpsCodeEffect, type HpsCodeReason, type HpsCodeSource, type HpsMeasuredCode, type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, type HpsPaymentOptions, type HpsPayments, type HpsPaymentResult, type HpsPaymentsOptions, type HpsRefundOptions, type HpsTransactionIdGeneratorOptions, type HpsTransactionResponse, ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HOBEX_SUPPORT, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, hobexReceiptFromHps, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
|
|
46
|
+
export { type CardPaymentOutcome, type HpsConnectClient, type HpsConnectCancelOptions, type HpsConnectClientOptions, type HpsConnectEndpoint, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, type HpsCancelOptions, type HpsClarifyOptions, type HpsCode, type HpsCodeEffect, type HpsCodeReason, type HpsCodeSource, type HpsMeasuredCode, type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, type HpsPaymentOptions, type HpsPayments, type HpsPaymentResult, type HpsPaymentsOptions, type HpsRefundOptions, type HpsTransactionIdGeneratorOptions, type HpsTransactionResponse, ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HOBEX_SUPPORT, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, hobexReceiptFromHps, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
|
package/dist/esm/pos/client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { KasseneckValidationError } from '../client/errors.js';
|
|
|
2
2
|
import { posVoucherSettingsFromWire } from './gutschein.js';
|
|
3
3
|
import { posDepositSettingsFromWire } from './pfand.js';
|
|
4
4
|
import { checkDiscountPresets, INVALID_DISCOUNT_PRESET } from './rabatt-vorlagen.js';
|
|
5
|
-
import { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, POS_SHORTCUT_ACTIONS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_BUSINESS_OPTIONAL_LISTS, POS_DEVICE_OPTIONAL_CHOICES, mergePosSettings, posShortcutConflict, _istAltwert0x, _optionalerWert, } from './settings.js';
|
|
5
|
+
import { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, POS_SHORTCUT_ACTIONS, POS_DEVICE_OPTIONAL_FIELDS, POS_DEVICE_OPTIONAL_SWITCHES, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_BUSINESS_OPTIONAL_LISTS, POS_DEVICE_OPTIONAL_CHOICES, mergePosSettings, posShortcutConflict, _istAltwert0x, _optionalerWert, } from './settings.js';
|
|
6
6
|
/*
|
|
7
7
|
* Die Einstellungs-Aufrufe am Draht `/api/v3`: Parameter und Antwort heissen
|
|
8
8
|
* `business`/`device`, Schluessel und Werte englisch (Nachtrag §11.7.2).
|
|
@@ -143,7 +143,8 @@ function pruefeTeil(name, teil, block, standard, werte) {
|
|
|
143
143
|
throw new KasseneckValidationError(name, `${teil}.${schluessel}: Kennung oder null erwartet`, 'request');
|
|
144
144
|
continue;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
const schalter = teil === 'business' ? POS_BUSINESS_OPTIONAL_FIELDS : POS_DEVICE_OPTIONAL_SWITCHES;
|
|
147
|
+
if (schalter.includes(schluessel)) {
|
|
147
148
|
if (typeof wert !== 'boolean')
|
|
148
149
|
throw new KasseneckValidationError(name, `${teil}.${schluessel}: true oder false erwartet`, 'request');
|
|
149
150
|
continue;
|
package/dist/esm/pos/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* die Backend-Functions (die Rewrites-Waechter der Web-App leiten daraus ab)
|
|
7
7
|
* und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
|
|
8
8
|
*/
|
|
9
|
-
export { type PosTheme, type PosFontSize, type PosWatermark, type PosQuantity, type PosTipMode, type PosCheckoutMode, type PosCardProvider, type PosReceiptOutput, type PosShortcutAction, type PosShortcutMap, POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, type PosLayout, type PosCategoryPosition, type PosTileHeight, type PosPrinterType, type PosTerminalVia, type PosTerminalType, type PosPaperSize, type PosCodePage, type PosCut, type PosDrawerAutoOpen, type PosQrMode, type PosLogoSize, type PosSettingsFontSize, type PosTileStyle, type PosAutoLogoutMinutes, type PosDiscount, type PosWatermarkSide, type PosWatermarkStrength, type PosLogoScale, type PosWatermarkScale, type PosDoneScreenSeconds, type PosToggleMap, type PosBusinessSettings, type PosDeviceSettings, type PosSettings, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posCustomDiscountAllowed, posTipKeptMode, posTipCardKeptByDefault, posTipCardKeptMode, posTipSelfPayout, tipKeptFor, type TipKeptDecision, type TipPaymentKind, DISCOUNT_PRESET_KIND, type PosDiscountPreset, type PosDiscountPresetKind, POS_BUSINESS_OPTIONAL_LISTS, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, type PosOpen, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict, THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, TIP_KEPT_MODE, TIP_CARD_KEPT_MODE, type PosTipKeptMode, CART_WIDTH, type PosTipKind, type PosCartWidth, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
|
|
9
|
+
export { type PosTheme, type PosFontSize, type PosWatermark, type PosQuantity, type PosTipMode, type PosCheckoutMode, type PosCardProvider, type PosReceiptOutput, type PosShortcutAction, type PosShortcutMap, POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, type PosLayout, type PosCategoryPosition, type PosTileHeight, type PosPrinterType, type PosTerminalVia, type PosTerminalType, type PosPaperSize, type PosCodePage, type PosCut, type PosDrawerAutoOpen, type PosQrMode, type PosLogoSize, type PosSettingsFontSize, type PosTileStyle, type PosAutoLogoutMinutes, type PosDiscount, type PosWatermarkSide, type PosWatermarkStrength, type PosLogoScale, type PosWatermarkScale, type PosDoneScreenSeconds, type PosToggleMap, type PosBusinessSettings, type PosDeviceSettings, type PosSettings, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_DEVICE_OPTIONAL_SWITCHES, posPrinterHint, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posCustomDiscountAllowed, posTipKeptMode, posTipCardKeptByDefault, posTipCardKeptMode, posTipSelfPayout, tipKeptFor, type TipKeptDecision, type TipPaymentKind, DISCOUNT_PRESET_KIND, type PosDiscountPreset, type PosDiscountPresetKind, POS_BUSINESS_OPTIONAL_LISTS, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, type PosOpen, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict, THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, TIP_KEPT_MODE, TIP_CARD_KEPT_MODE, type PosTipKeptMode, CART_WIDTH, type PosTipKind, type PosCartWidth, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
|
|
10
10
|
export { type ArticleGroup, type ArticleGroupPayload, fromArticleGroupPayload, type PosArticle, type PosArticlePayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, QUANTITY_RULES, type QuantityRule, type QuantityDefaults, quantityRuleForUnit, quantityDefaults, allowedQuantity, isBookableArticle, tilePrompts, } from './artikel.js';
|
|
11
11
|
export { REFERENCE_MODES, type ReferenceMode, type PosReference, REFERENCE_INPUT_MAX, REFERENCE_LABEL_MAX, REFERENCE_HINT_MAX, REFERENCE_PATTERN_MAX, REFERENCE_PATTERN_TEMPLATES, cleanReferenceText, isValidReferencePattern, isDigitsOnlyPattern, type ReferenceCheckResult, checkReference, referenceLineName, fromReferencePayload, } from './kachel-referenz.js';
|
|
12
12
|
export { ADD_ONS_MAX, ADD_ON_BLOCK_REASONS, type AddOnBlockReason, isSelectableAddOn, addOnsFor, addOnReferencesValid, addOnsOfItem, addOnRemap, addOnDisplayOrder, orderAddOnLines, } from './zusaetze.js';
|
package/dist/esm/pos/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* die Backend-Functions (die Rewrites-Waechter der Web-App leiten daraus ab)
|
|
7
7
|
* und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
|
|
8
8
|
*/
|
|
9
|
-
export { POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posCustomDiscountAllowed, posTipKeptMode, posTipCardKeptByDefault, posTipCardKeptMode, posTipSelfPayout, tipKeptFor, DISCOUNT_PRESET_KIND, POS_BUSINESS_OPTIONAL_LISTS, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict,
|
|
9
|
+
export { POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_DEVICE_OPTIONAL_SWITCHES, posPrinterHint, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posCustomDiscountAllowed, posTipKeptMode, posTipCardKeptByDefault, posTipCardKeptMode, posTipSelfPayout, tipKeptFor, DISCOUNT_PRESET_KIND, POS_BUSINESS_OPTIONAL_LISTS, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict,
|
|
10
10
|
// Die Enums als Laufzeitlisten, benannt nach ihrem Feld.
|
|
11
11
|
THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, TIP_KEPT_MODE, TIP_CARD_KEPT_MODE, CART_WIDTH, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
|
|
12
12
|
export { fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, QUANTITY_RULES, quantityRuleForUnit, quantityDefaults, allowedQuantity, isBookableArticle, tilePrompts, } from './artikel.js';
|
|
@@ -141,6 +141,9 @@ function laufstand(ort, w) {
|
|
|
141
141
|
raus.unassignedTipCents = ganzzahl(ort, o, 'unassignedTipCents');
|
|
142
142
|
if (o.discounts !== undefined && o.discounts !== null)
|
|
143
143
|
raus.discounts = liste(ort, o, 'discounts', rabatt);
|
|
144
|
+
// Zahlungen auf Rechnungen (1.38.0, nur Information): gelesen wie gesendet.
|
|
145
|
+
if (o.invoicePaymentCents !== undefined && o.invoicePaymentCents !== null)
|
|
146
|
+
raus.invoicePaymentCents = ganzzahl(ort, o, 'invoicePaymentCents');
|
|
144
147
|
return raus;
|
|
145
148
|
}
|
|
146
149
|
function rabatt(ort, w) {
|
|
@@ -388,6 +391,8 @@ export function schichtBon(ort, w) {
|
|
|
388
391
|
wennWert(r, o, 'discounts', () => liste(ort, o, 'discounts', rabatt));
|
|
389
392
|
// Kartentrinkgeld bar aus der Lade genommen (Summe); nur mit Karten-direkt.
|
|
390
393
|
wennWert(r, o, 'cardTipsTakenCents', () => ganzzahl(ort, o, 'cardTipsTakenCents'));
|
|
394
|
+
// Nur Information: Zahlungen auf Rechnungen (1.38.0); der Server sendet sie erst mit dem ersten Zahlungsbeleg.
|
|
395
|
+
wennWert(r, o, 'invoicePaymentCents', () => ganzzahl(ort, o, 'invoicePaymentCents'));
|
|
391
396
|
wennWert(r, o, 'differenceParts', () => liste(ort, o, 'differenceParts', differenzTeil));
|
|
392
397
|
wennDa(r, o, 'countedBeforePayoutCents', () => ganzzahlOderNull(ort, o, 'countedBeforePayoutCents'));
|
|
393
398
|
wennDa(r, o, 'countedBeforePayoutDenominations', () => stueckelung(ort, o, 'countedBeforePayoutDenominations'));
|
|
@@ -170,6 +170,12 @@ export interface ShiftRunningTotals {
|
|
|
170
170
|
* auf dem Z-Bon steht es als Block ([discountBlockLines]).
|
|
171
171
|
*/
|
|
172
172
|
discounts?: ShiftDiscount[];
|
|
173
|
+
/**
|
|
174
|
+
* Zahlungen auf Rechnungen in Cent (1.38.0): Summe der Positionen „Zahlung auf Rechnung“ der Schicht,
|
|
175
|
+
* bar und unbar, ein Storno negativ. Nur Information, nie zusaetzlich im Soll: das Geld steckt schon im
|
|
176
|
+
* Barumsatz bzw. in `nonCashByMethod`. Der Server sendet es nur, wenn es etwas gibt (fehlt = keine).
|
|
177
|
+
*/
|
|
178
|
+
invoicePaymentCents?: number;
|
|
173
179
|
}
|
|
174
180
|
/** Ein Eintrag von [ShiftRunningTotals.discounts] bzw. [ShiftSummaryReceipt.discounts]. */
|
|
175
181
|
export interface ShiftDiscount {
|
|
@@ -440,6 +446,11 @@ export interface ShiftSummaryReceipt extends ShiftReceiptHeader {
|
|
|
440
446
|
discounts?: ShiftDiscount[];
|
|
441
447
|
/** Kartentrinkgeld bar aus der Lade genommen, Summe (Soll − Betrag); fehlt ohne Karten-direkt. */
|
|
442
448
|
cardTipsTakenCents?: number;
|
|
449
|
+
/**
|
|
450
|
+
* Zahlungen auf Rechnungen in Cent, wie [ShiftRunningTotals.invoicePaymentCents]; fehlt ohne solche
|
|
451
|
+
* (der Bon bleibt dann wie bisher).
|
|
452
|
+
*/
|
|
453
|
+
invoicePaymentCents?: number;
|
|
443
454
|
/** Entnommen bzw. eingelegt nach dem Zaehlen; fehlt, wenn kein Geld bewegt wurde. */
|
|
444
455
|
afterCount?: AfterCount;
|
|
445
456
|
/**
|