@kreiseck/kasseneck-api 1.31.0 → 1.32.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 +16 -0
- package/dist/cjs/client/aufrufe.d.ts +3 -3
- package/dist/cjs/client/aufrufe.js +8 -0
- package/dist/cjs/client/receipts.d.ts +11 -0
- package/dist/cjs/client/receipts.js +14 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +8 -5
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/index.js +5 -2
- package/dist/cjs/models/receipt-errors.d.ts +1 -1
- package/dist/cjs/models/receipt-errors.js +9 -0
- package/dist/cjs/models/receipt-item.d.ts +44 -2
- package/dist/cjs/models/receipt-item.js +56 -1
- package/dist/cjs/models/receipt.d.ts +17 -0
- package/dist/cjs/models/receipt.js +9 -0
- package/dist/cjs/pos/artikel.d.ts +14 -0
- package/dist/cjs/pos/artikel.js +3 -0
- package/dist/cjs/pos/client.d.ts +1 -0
- package/dist/cjs/pos/client.js +3 -0
- package/dist/cjs/pos/errors.d.ts +1 -1
- package/dist/cjs/pos/errors.js +12 -0
- package/dist/cjs/pos/index.d.ts +4 -2
- package/dist/cjs/pos/index.js +24 -4
- package/dist/cjs/pos/leergut.d.ts +60 -0
- package/dist/cjs/pos/leergut.js +82 -0
- package/dist/cjs/pos/pfand.d.ts +144 -0
- package/dist/cjs/pos/pfand.js +382 -0
- package/dist/cjs/pos/settings.d.ts +3 -7
- package/dist/cjs/pos/settings.js +7 -0
- package/dist/cjs/pos/texte.d.ts +68 -0
- package/dist/cjs/pos/texte.js +40 -1
- package/dist/cjs/receipt/discount.js +3 -0
- package/dist/cjs/receipt/due.d.ts +6 -0
- package/dist/cjs/receipt/due.js +16 -5
- package/dist/cjs/receipt/gutschein-plan.d.ts +7 -1
- package/dist/cjs/receipt/gutschein-plan.js +16 -2
- package/dist/cjs/receipt/layout.js +108 -2
- package/dist/cjs/register/pairing.d.ts +15 -1
- package/dist/cjs/register/pairing.js +14 -1
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +72 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/aufrufe.d.ts +3 -3
- package/dist/esm/client/aufrufe.js +8 -0
- package/dist/esm/client/receipts.d.ts +11 -0
- package/dist/esm/client/receipts.js +14 -0
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/esm/models/receipt-errors.d.ts +1 -1
- package/dist/esm/models/receipt-errors.js +9 -0
- package/dist/esm/models/receipt-item.d.ts +44 -2
- package/dist/esm/models/receipt-item.js +54 -1
- package/dist/esm/models/receipt.d.ts +17 -0
- package/dist/esm/models/receipt.js +9 -0
- package/dist/esm/pos/artikel.d.ts +14 -0
- package/dist/esm/pos/artikel.js +3 -0
- package/dist/esm/pos/client.d.ts +1 -0
- package/dist/esm/pos/client.js +3 -0
- package/dist/esm/pos/errors.d.ts +1 -1
- package/dist/esm/pos/errors.js +12 -0
- package/dist/esm/pos/index.d.ts +4 -2
- package/dist/esm/pos/index.js +4 -2
- package/dist/esm/pos/leergut.d.ts +60 -0
- package/dist/esm/pos/leergut.js +77 -0
- package/dist/esm/pos/pfand.d.ts +144 -0
- package/dist/esm/pos/pfand.js +371 -0
- package/dist/esm/pos/settings.d.ts +3 -7
- package/dist/esm/pos/settings.js +7 -0
- package/dist/esm/pos/texte.d.ts +68 -0
- package/dist/esm/pos/texte.js +38 -0
- package/dist/esm/receipt/discount.js +4 -1
- package/dist/esm/receipt/due.d.ts +6 -0
- package/dist/esm/receipt/due.js +17 -6
- package/dist/esm/receipt/gutschein-plan.d.ts +7 -1
- package/dist/esm/receipt/gutschein-plan.js +14 -2
- package/dist/esm/receipt/layout.js +109 -3
- package/dist/esm/register/pairing.d.ts +15 -1
- package/dist/esm/register/pairing.js +13 -1
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +72 -4
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/deposit-cases.json +4758 -0
- package/fixtures/expected/deposit-return.grid32.txt +28 -0
- package/fixtures/expected/deposit-return.grid48.txt +28 -0
- package/fixtures/expected/deposit-return.lines.json +275 -0
- package/fixtures/expected/deposit-return.sheet32.json +194 -0
- package/fixtures/expected/deposit-return.sheet48.json +194 -0
- package/fixtures/expected/deposit.grid32.txt +34 -0
- package/fixtures/expected/deposit.grid48.txt +32 -0
- package/fixtures/expected/deposit.lines.json +316 -0
- package/fixtures/expected/deposit.sheet32.json +230 -0
- package/fixtures/expected/deposit.sheet48.json +218 -0
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +1 -1
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/manifest.json +16 -0
- package/fixtures/pos-texts.json +62 -1
- package/fixtures/receipts/deposit-return.json +63 -0
- package/fixtures/receipts/deposit.json +83 -0
- package/fixtures/return-code-cases.json +1338 -0
- package/fixtures/surface.json +44 -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 +428 -13
- 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 +42 -4
- package/fixtures/v3/stored/rechnungen.json +2 -2
- package/fixtures/v3/v3-vokabular.json +808 -27
- package/fixtures/v3/zahlbetrag-faelle.json +187 -3
- package/package.json +1 -1
|
@@ -99,6 +99,16 @@ export function createReceiptParams(options) {
|
|
|
99
99
|
if (items?.some((item) => item.kind === 'voucher' || item.kind === 'voucher_float') ?? false) {
|
|
100
100
|
throw eingabefehler('voucher_invalid: Gutschein-Positionen (kind voucher, voucher_float) setzt nur der Server.');
|
|
101
101
|
}
|
|
102
|
+
// Pfandzeilen setzt der Server aus den Artikeln: eine Zeile `deposit` mit `articleId` waere doppelt gemeint.
|
|
103
|
+
if (items?.some((item) => item.kind === 'deposit' && item.articleId != null && item.articleId !== '') ?? false) {
|
|
104
|
+
throw eingabefehler('invalid_deposit: Eine Pfandzeile (kind deposit) traegt keine articleId; der Server setzt sie aus dem Artikel (autoDeposits).');
|
|
105
|
+
}
|
|
106
|
+
for (const feld of ['autoDeposits', 'onPremises']) {
|
|
107
|
+
const wert = options[feld];
|
|
108
|
+
if (wert !== undefined && typeof wert !== 'boolean') {
|
|
109
|
+
throw eingabefehler(`${feld} muss true oder false sein (oder weglassen).`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
102
112
|
if (typ.needsItems) {
|
|
103
113
|
// Ein reiner Gutscheinverkauf ist ein Umsatz ohne Positionen, deshalb
|
|
104
114
|
// zaehlt er hier wie eine Position (wie im Flutter-Vorbild).
|
|
@@ -191,6 +201,10 @@ export function createReceiptParams(options) {
|
|
|
191
201
|
if (options.idempotencyKey != null) {
|
|
192
202
|
params['idempotencyKey'] = belegSchluessel(options.idempotencyKey);
|
|
193
203
|
}
|
|
204
|
+
if (options.autoDeposits !== undefined)
|
|
205
|
+
params['autoDeposits'] = options.autoDeposits;
|
|
206
|
+
if (options.onPremises !== undefined)
|
|
207
|
+
params['onPremises'] = options.onPremises;
|
|
194
208
|
return params;
|
|
195
209
|
}
|
|
196
210
|
/** Hoechstlaenge des `idempotencyKey` am Beleg, wie am Server (beleg-idempotenz-core `SCHLUESSEL_MAX`). */
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
|
|
2
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape, type ExternalVoucherNumberCheck, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS, type ReceiptOutputLogKind, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputResult, RECEIPT_OUTPUT_ENTRIES_MAX, type ReceiptOutput, type ReceiptOutputActor, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, type ReceiptOutputEntryErrorCode, RECEIPT_OUTPUT_ERROR_CODES, type ReceiptOutputErrorCode, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, type ReceiptOutputFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
2
|
+
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, type Voucher, type VoucherArticle, type IssuedVoucher, type ReturnIssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type VoucherSource, type LegacyValueVoucherWish, VOUCHER_SOURCES, isExternalVoucher, externalVoucherIsValid, normalizeExternalVoucherNumber, checkExternalVoucherNumber, ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape, type ExternalVoucherNumberCheck, EXTERNAL_VOUCHER_NUMBER_MAX, EXTERNAL_VOUCHER_TAXED_WITH_MAX, EXTERNAL_VOUCHER_VAT_RATES_BP, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS, type ReceiptOutputLogKind, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputResult, RECEIPT_OUTPUT_ENTRIES_MAX, type ReceiptOutput, type ReceiptOutputActor, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, type ReceiptOutputEntryErrorCode, RECEIPT_OUTPUT_ERROR_CODES, type ReceiptOutputErrorCode, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, type ReceiptOutputFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
3
|
export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type TransportCallOptions, type KasseneckTransport, type KasseneckBinaryTransport, type KasseneckPdfOrDataTransport, type PdfOrData, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, createPdfOrDataTransport, createFileOrDataTransport, type FileOrData, type FileOrDataCallOptions, type KasseneckFileOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, type ReceiptOutputEntry, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type RejectedReceiptOutput, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, type CashregisterReportPeriod, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, listedReceiptWithCompany, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, type ListReceiptsErrorCode, type ListReceiptsView, type ListReceiptsOrder, type ListReceiptsOptions, type ListReceiptsWindow, type ListReceiptsGrossByRate, type ListReceiptsSummary, type ListReceiptsDaySummary, type ListReceiptsPage, type ListedReceipt, 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, type DepExportStatus, type DepExportFileKind, type DepExportErrorCode, type DepExportFailure, type CreateDepExportOptions, type CreateDepExportResult, type DepExportGap, type DepExportChainBreak, type DepExportFindings, type DepExportItems, type DepHandoverLinkInfo, type DepExport, type WaitForDepExportOptions, type GetDepExportFileOptions, type DepExportFile, type DepHandoverLink, type RevokedDepHandoverLink, 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, type TerminalPlatform, type TerminalSetupState, type TerminalCodeStatus, type TerminalCodeSource, type TerminalErrorCode, type TerminalDeviceCredentials, type RegisterTerminalDeviceOptions, type RegisteredTerminalDevice, type GetTerminalAccessOptions, type ClaimTerminalOptions, type RequestTerminalCodeOptions, type ReportTerminalLoginOptions, type TerminalSetup, type TerminalCodeFormat, type TerminalAccess, type TerminalListEntry, type TerminalAccessUnavailable, type TerminalAccessResult, type TerminalCodeRequest, type TerminalCode, type ListedFullReceipt, type ListReceiptsHeader, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { type ReceiptDueTip, type ReceiptDueTipRecipient, type ReceiptDueOptions, type ReceiptDueBuckets, type ReceiptDueBreakdown, type ReceiptDueErrorReason, receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, type VoucherDueInfo, type VoucherDueArticle, type VoucherDueType, type VoucherRedeemContext, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
|
|
6
|
-
export { type PosBusinessSettings, type PosDeviceSettings, type PosSettings, type ArticleGroup, type PosArticle, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, } from './pos/index.js';
|
|
6
|
+
export { type PosBusinessSettings, type PosDeviceSettings, type PosSettings, type ArticleGroup, type PosArticle, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, depositReturnOf, } from './pos/index.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ReceiptType, VatRate, KeckPaymentMethod, CreditCardProvider, VoucherType, VoucherAction, StripeLinkMode, } from './enums/index.js';
|
|
2
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isVoucherItem, isVoucherFloatItem, 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, 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, getCashboxStatus, getSignatureStatus, createKasseneckApi, } from './client/index.js';
|
|
4
4
|
export { receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock } from './vienna-time.js';
|
|
6
|
-
export { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, } from './pos/index.js';
|
|
6
|
+
export { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, depositReturnOf, } from './pos/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, } 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, } 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';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, } from './receipt-item.js';
|
|
1
|
+
export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, isDepositItem, isDepositReturnItem, } 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';
|
|
@@ -18,7 +18,7 @@ import { KasseneckApiError } from '../client/errors.js';
|
|
|
18
18
|
* ...) stehen in [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
|
|
19
19
|
* `KasseneckApiError.code` lesbar.
|
|
20
20
|
*/
|
|
21
|
-
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "final_receipt_expired", "final_receipt_not_allowed", "idempotency_conflict", "invalid_add_on_reference", "module_inactive", "not_permitted", "receipt_limit_exceeded", "receipt_not_found", "receipt_outcome_unknown", "receipt_type_invalid", "server_error", "signature_incomplete", "signature_missing", "signing_failed", "small_business_vat_not_allowed", "tip_invalid", "tip_not_allowed", "tip_recipient_unknown", "validation", "voucher_balance_changed", "account_not_found", "action_confirmation_required", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "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", "route_missing", "response_unreadable"];
|
|
21
|
+
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "deposit_not_enabled", "deposit_return_not_offered", "deposit_set_by_server", "deposit_type_not_found", "deposit_type_not_issued", "final_receipt_expired", "final_receipt_not_allowed", "idempotency_conflict", "invalid_add_on_reference", "invalid_deposit", "invalid_deposit_quantity", "invalid_item_kind", "module_inactive", "not_permitted", "receipt_limit_exceeded", "receipt_not_found", "receipt_outcome_unknown", "receipt_type_invalid", "server_error", "signature_incomplete", "signature_missing", "signing_failed", "small_business_vat_not_allowed", "tip_invalid", "tip_not_allowed", "tip_recipient_unknown", "validation", "voucher_balance_changed", "account_not_found", "action_confirmation_required", "admin_required", "api_not_approved", "app_check_invalid", "app_check_missing", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "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", "route_missing", "response_unreadable"];
|
|
22
22
|
export type ReceiptErrorCode = (typeof RECEIPT_ERROR_CODES)[number];
|
|
23
23
|
export declare function isReceiptErrorCode(value: unknown): value is ReceiptErrorCode;
|
|
24
24
|
/** Der Code eines geworfenen Fehlers, wenn er in [RECEIPT_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -22,6 +22,12 @@ export const RECEIPT_ERROR_CODES = Object.freeze([
|
|
|
22
22
|
'cancellation_reference_unavailable',
|
|
23
23
|
'cashregister_closed',
|
|
24
24
|
'cashregister_decommissioned',
|
|
25
|
+
// Seit Pfand & Leergut Teil 2: Pfandzeilen an createReceipt (Antworten des Servers, errorCodes.registerHandlersByEndpoint).
|
|
26
|
+
'deposit_not_enabled',
|
|
27
|
+
'deposit_return_not_offered',
|
|
28
|
+
'deposit_set_by_server',
|
|
29
|
+
'deposit_type_not_found',
|
|
30
|
+
'deposit_type_not_issued',
|
|
25
31
|
'final_receipt_expired',
|
|
26
32
|
'final_receipt_not_allowed',
|
|
27
33
|
// Seit 1.15.0 (Vertrag): derselbe idempotencyKey mit anderem Inhalt, nichts geschrieben. Seit 1.22.0 sendet
|
|
@@ -29,6 +35,9 @@ export const RECEIPT_ERROR_CODES = Object.freeze([
|
|
|
29
35
|
'idempotency_conflict',
|
|
30
36
|
// Seit 1.27.0 (Zusatz-Kacheln): addOnOf zeigt nicht nach vorne auf eine Warenposition, die selbst kein Zusatz ist.
|
|
31
37
|
'invalid_add_on_reference',
|
|
38
|
+
'invalid_deposit',
|
|
39
|
+
'invalid_deposit_quantity',
|
|
40
|
+
'invalid_item_kind',
|
|
32
41
|
'module_inactive',
|
|
33
42
|
'not_permitted',
|
|
34
43
|
'receipt_limit_exceeded',
|
|
@@ -36,7 +36,7 @@ export interface ReceiptItem {
|
|
|
36
36
|
* negative Entgeltminderungen je Steuersatz; die Kennzeichnung steuert nur
|
|
37
37
|
* die Bon-Darstellung (Summenzeile mit Aufteilung), nie die Beträge.
|
|
38
38
|
*/
|
|
39
|
-
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float';
|
|
39
|
+
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float' | 'deposit' | 'deposit_return';
|
|
40
40
|
/** Empfaenger der Trinkgeld-Position; `null` = nicht zugeordnet. */
|
|
41
41
|
recipient?: TipRecipient | null;
|
|
42
42
|
/** Zahlart der Trinkgeld-Position (kann von der des Belegs abweichen). */
|
|
@@ -67,7 +67,31 @@ export interface ReceiptItem {
|
|
|
67
67
|
* Warenposition, die selbst kein Zusatz ist (`invalid_add_on_reference`).
|
|
68
68
|
*/
|
|
69
69
|
addOnOf?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Pfand & Leergut: Pfandart (Kennung aus `getKasseSettings` `deposit.depositTypes[].id`); nur an
|
|
72
|
+
* `deposit`- und `deposit_return`-Zeilen. Der Server setzt Pfandzeilen aus den Artikeln und rechnet
|
|
73
|
+
* den Betrag selbst; bei einer ausdruecklichen Zeile des Aufrufers (ohne `articleId`) prueft er sie.
|
|
74
|
+
*/
|
|
75
|
+
depositTypeId?: string;
|
|
76
|
+
/** Index der Warenposition im selben Beleg, zu der die Pfandzeile gehoert (nur `deposit`). */
|
|
77
|
+
depositFor?: number;
|
|
78
|
+
/** Art der Pfandart zum Belegzeitpunkt: Einweg oder Mehrweg. */
|
|
79
|
+
depositKind?: 'single_use' | 'reusable';
|
|
80
|
+
/** Pfand je Stueck in Cent bei einer Pfandzeile; der Zeilenpreis ist Menge mal dieser Betrag. */
|
|
81
|
+
perUnit?: number;
|
|
82
|
+
/** Strichcode des Gebindes (GTIN), falls bekannt. */
|
|
83
|
+
gtin?: string;
|
|
84
|
+
/** Strichcode des Artikels (EAN), falls bekannt. */
|
|
85
|
+
ean?: string;
|
|
86
|
+
/** Das Gebinde wurde im Betrieb selbst befuellt (eigene Abfuellung). */
|
|
87
|
+
ownFilling?: boolean;
|
|
88
|
+
/** Gelernte Leergut-Codes der Zeile (Code -> Menge); nur an `deposit_return`. */
|
|
89
|
+
codes?: Record<string, number>;
|
|
70
90
|
}
|
|
91
|
+
/** Pfandzeile (Pfand zum Verkauf)? Die eine Erkennungsstelle — niemand prueft `kind` selbst. */
|
|
92
|
+
export declare function isDepositItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
93
|
+
/** Leergutzeile (Ruecknahme, negativer Betrag)? */
|
|
94
|
+
export declare function isDepositReturnItem(item: ReceiptItem | ReceiptItemPayloadRead): boolean;
|
|
71
95
|
/** Empfaenger einer Trinkgeld-Position (Kassen-Benutzer, Snapshot des Namens). */
|
|
72
96
|
export interface TipRecipient {
|
|
73
97
|
registerUserId: string;
|
|
@@ -97,7 +121,7 @@ export interface ReceiptItemPayload {
|
|
|
97
121
|
unitPriceCents: number;
|
|
98
122
|
vatRate: number;
|
|
99
123
|
/** Trinkgeld-/Rabatt-/Gutschein-Kennzeichnung, siehe [ReceiptItem.kind]. */
|
|
100
|
-
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float';
|
|
124
|
+
kind?: 'tip' | 'discount' | 'voucher' | 'voucher_float' | 'deposit' | 'deposit_return';
|
|
101
125
|
recipient?: TipRecipient | null;
|
|
102
126
|
paymentMethod?: string;
|
|
103
127
|
receivedImmediately?: boolean;
|
|
@@ -107,6 +131,15 @@ export interface ReceiptItemPayload {
|
|
|
107
131
|
articleId?: string;
|
|
108
132
|
/** Hauptposition eines Zusatzes, siehe [ReceiptItem.addOnOf]. */
|
|
109
133
|
addOnOf?: number;
|
|
134
|
+
/** Pfandzeile, siehe [ReceiptItem.depositTypeId] und die folgenden Felder. */
|
|
135
|
+
depositTypeId?: string;
|
|
136
|
+
depositFor?: number;
|
|
137
|
+
depositKind?: 'single_use' | 'reusable';
|
|
138
|
+
perUnit?: number;
|
|
139
|
+
gtin?: string;
|
|
140
|
+
ean?: string;
|
|
141
|
+
ownFilling?: boolean;
|
|
142
|
+
codes?: Record<string, number>;
|
|
110
143
|
}
|
|
111
144
|
/**
|
|
112
145
|
* Nutzlast-Form, die dieses Paket **liest** — v2 und v1 nebeneinander, alles
|
|
@@ -154,6 +187,15 @@ export interface ReceiptItemPayloadRead {
|
|
|
154
187
|
returnDisposition?: string | null;
|
|
155
188
|
/** Hauptposition eines Zusatzes, siehe [ReceiptItem.addOnOf]. */
|
|
156
189
|
addOnOf?: number | null;
|
|
190
|
+
/** Pfandzeile, siehe [ReceiptItem.depositTypeId] und die folgenden Felder. */
|
|
191
|
+
depositTypeId?: string | null;
|
|
192
|
+
depositFor?: number | null;
|
|
193
|
+
depositKind?: string | null;
|
|
194
|
+
perUnit?: number | null;
|
|
195
|
+
gtin?: string | null;
|
|
196
|
+
ean?: string | null;
|
|
197
|
+
ownFilling?: boolean | null;
|
|
198
|
+
codes?: Record<string, number> | null;
|
|
157
199
|
}
|
|
158
200
|
export declare function toReceiptItemPayload(item: ReceiptItem): ReceiptItemPayload;
|
|
159
201
|
/**
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { VatRate } from '../enums/index.js';
|
|
2
2
|
import { readVatRateByRate, requireVatRateByRate } from './enum-payload.js';
|
|
3
3
|
import { isReturnDisposition } from './cancellation.js';
|
|
4
|
+
/** Pfandzeile (Pfand zum Verkauf)? Die eine Erkennungsstelle — niemand prueft `kind` selbst. */
|
|
5
|
+
export function isDepositItem(item) {
|
|
6
|
+
return item != null && item.kind === 'deposit';
|
|
7
|
+
}
|
|
8
|
+
/** Leergutzeile (Ruecknahme, negativer Betrag)? */
|
|
9
|
+
export function isDepositReturnItem(item) {
|
|
10
|
+
return item != null && item.kind === 'deposit_return';
|
|
11
|
+
}
|
|
4
12
|
/** Trinkgeld-Position? Die eine Erkennungsstelle — niemand prueft `kind` selbst. */
|
|
5
13
|
export function isTipItem(item) {
|
|
6
14
|
return item != null && item.kind === 'tip';
|
|
@@ -54,6 +62,28 @@ export function toReceiptItemPayload(item) {
|
|
|
54
62
|
// (createReceipt weist sie als voucher_invalid ab).
|
|
55
63
|
if (item.kind === 'voucher' || item.kind === 'voucher_float')
|
|
56
64
|
nutzlast.kind = item.kind;
|
|
65
|
+
// Pfand & Leergut: Kennzeichen und Felder reisen mit (Cache schreibt gelesene Belege wieder; ein Wunsch an
|
|
66
|
+
// den Server traegt `deposit` nie mit `articleId`, siehe createReceiptParams).
|
|
67
|
+
if (item.kind === 'deposit' || item.kind === 'deposit_return') {
|
|
68
|
+
nutzlast.kind = item.kind;
|
|
69
|
+
if (typeof item.depositTypeId === 'string' && item.depositTypeId !== '')
|
|
70
|
+
nutzlast.depositTypeId = item.depositTypeId;
|
|
71
|
+
if (istIndex(item.depositFor))
|
|
72
|
+
nutzlast.depositFor = item.depositFor;
|
|
73
|
+
if (item.depositKind === 'single_use' || item.depositKind === 'reusable')
|
|
74
|
+
nutzlast.depositKind = item.depositKind;
|
|
75
|
+
if (typeof item.perUnit === 'number' && Number.isFinite(item.perUnit))
|
|
76
|
+
nutzlast.perUnit = item.perUnit;
|
|
77
|
+
if (typeof item.gtin === 'string' && item.gtin !== '')
|
|
78
|
+
nutzlast.gtin = item.gtin;
|
|
79
|
+
if (typeof item.ean === 'string' && item.ean !== '')
|
|
80
|
+
nutzlast.ean = item.ean;
|
|
81
|
+
if (typeof item.ownFilling === 'boolean')
|
|
82
|
+
nutzlast.ownFilling = item.ownFilling;
|
|
83
|
+
const codes = leergutCodes(item.codes);
|
|
84
|
+
if (codes != null)
|
|
85
|
+
nutzlast.codes = codes;
|
|
86
|
+
}
|
|
57
87
|
// Artikel-Verweis reist mit (Erloesgruppen im Bericht); leere Werte nicht.
|
|
58
88
|
if (item.articleId != null && item.articleId !== '')
|
|
59
89
|
nutzlast.articleId = item.articleId;
|
|
@@ -103,7 +133,19 @@ export function fromReceiptItemPayload(payload) {
|
|
|
103
133
|
? { kind: 'discount' }
|
|
104
134
|
: payload.kind === 'voucher' || payload.kind === 'voucher_float'
|
|
105
135
|
? { kind: payload.kind }
|
|
106
|
-
:
|
|
136
|
+
: payload.kind === 'deposit' || payload.kind === 'deposit_return'
|
|
137
|
+
? {
|
|
138
|
+
kind: payload.kind,
|
|
139
|
+
...(typeof payload.depositTypeId === 'string' && payload.depositTypeId !== '' ? { depositTypeId: payload.depositTypeId } : {}),
|
|
140
|
+
...(istIndex(payload.depositFor) ? { depositFor: payload.depositFor } : {}),
|
|
141
|
+
...(payload.depositKind === 'single_use' || payload.depositKind === 'reusable' ? { depositKind: payload.depositKind } : {}),
|
|
142
|
+
...(typeof payload.perUnit === 'number' && Number.isFinite(payload.perUnit) ? { perUnit: payload.perUnit } : {}),
|
|
143
|
+
...(typeof payload.gtin === 'string' && payload.gtin !== '' ? { gtin: payload.gtin } : {}),
|
|
144
|
+
...(typeof payload.ean === 'string' && payload.ean !== '' ? { ean: payload.ean } : {}),
|
|
145
|
+
...(typeof payload.ownFilling === 'boolean' ? { ownFilling: payload.ownFilling } : {}),
|
|
146
|
+
...(leergutCodes(payload.codes) != null ? { codes: leergutCodes(payload.codes) } : {}),
|
|
147
|
+
}
|
|
148
|
+
: {}),
|
|
107
149
|
// Artikel-Verweis erhalten (Storno-Spiegelung schreibt ihn wieder mit).
|
|
108
150
|
...(typeof payload.articleId === 'string' && payload.articleId !== '' ? { articleId: payload.articleId } : {}),
|
|
109
151
|
// Lager: Bezug und Rueckgabe-Wahl einer Storno-Zeile (nur gelesen; ein
|
|
@@ -114,6 +156,17 @@ export function fromReceiptItemPayload(payload) {
|
|
|
114
156
|
...(istIndex(payload.addOnOf) ? { addOnOf: payload.addOnOf } : {}),
|
|
115
157
|
};
|
|
116
158
|
}
|
|
159
|
+
/** Gelernte Codes (Code -> ganze Menge >= 1); ohne brauchbaren Eintrag `undefined`. */
|
|
160
|
+
function leergutCodes(wert) {
|
|
161
|
+
if (wert === null || typeof wert !== 'object' || Array.isArray(wert))
|
|
162
|
+
return undefined;
|
|
163
|
+
const raus = {};
|
|
164
|
+
for (const [code, menge] of Object.entries(wert)) {
|
|
165
|
+
if (code !== '' && Number.isInteger(menge) && menge >= 1)
|
|
166
|
+
raus[code] = menge;
|
|
167
|
+
}
|
|
168
|
+
return Object.keys(raus).length > 0 ? raus : undefined;
|
|
169
|
+
}
|
|
117
170
|
function istIndex(wert) {
|
|
118
171
|
return Number.isInteger(wert) && wert >= 0;
|
|
119
172
|
}
|
|
@@ -79,6 +79,18 @@ export interface Receipt {
|
|
|
79
79
|
registrationInfo?: RegistrationInfo;
|
|
80
80
|
/** Nur an nacherfassten Belegen: der Handbeleg (siehe [ManualReceipt]). */
|
|
81
81
|
manualReceipt?: ManualReceipt;
|
|
82
|
+
/** Pfand & Leergut: der Kunde trinkt/verzehrt vor Ort (gespeichert `vorOrt`); nur ein Wahrheitswert. */
|
|
83
|
+
onPremises?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Gemeinsame Ruecknahmestelle fuer Leergut (gespeichert `pfandStelle`); der Server stempelt sie nur, wenn die
|
|
86
|
+
* Kasse `returns: 'shared'` hat und der Beleg Pfand traegt. Der Bon druckt daraus die Fusszeile.
|
|
87
|
+
*/
|
|
88
|
+
sharedReturnPoint?: SharedReturnPoint;
|
|
89
|
+
}
|
|
90
|
+
/** Gemeinsame Ruecknahmestelle fuer Leergut (Name und Anschrift, wie der Server sie am Beleg stempelt). */
|
|
91
|
+
export interface SharedReturnPoint {
|
|
92
|
+
name: string;
|
|
93
|
+
address: string;
|
|
82
94
|
}
|
|
83
95
|
/** Registrierdaten von Signaturkarte und Kasse (Zeitstempel oder `null`, wenn unbekannt). */
|
|
84
96
|
export interface RegistrationInfo {
|
|
@@ -131,6 +143,11 @@ export interface ReceiptPayloadRead extends Omit<ReceiptPayload, 'items' | 'vouc
|
|
|
131
143
|
cashregisterRegisteredAt?: string | null;
|
|
132
144
|
} | null;
|
|
133
145
|
manualReceipt?: unknown;
|
|
146
|
+
onPremises?: boolean | null;
|
|
147
|
+
sharedReturnPoint?: {
|
|
148
|
+
name?: string | null;
|
|
149
|
+
address?: string | null;
|
|
150
|
+
} | null;
|
|
134
151
|
}
|
|
135
152
|
/**
|
|
136
153
|
* Schreibt die Nutzlast in der **neuen** Form — sie **normalisiert, statt zu
|
|
@@ -89,8 +89,17 @@ export function fromReceiptPayload(payload) {
|
|
|
89
89
|
? { registrationInfo: readRegistrationInfo(payload.registrationInfo) }
|
|
90
90
|
: {}),
|
|
91
91
|
...handbelegFeld(payload.manualReceipt),
|
|
92
|
+
...(typeof payload.onPremises === 'boolean' ? { onPremises: payload.onPremises } : {}),
|
|
93
|
+
...pfandStelleFeld(payload.sharedReturnPoint),
|
|
92
94
|
};
|
|
93
95
|
}
|
|
96
|
+
function pfandStelleFeld(roh) {
|
|
97
|
+
if (roh == null || typeof roh !== 'object')
|
|
98
|
+
return {};
|
|
99
|
+
const name = typeof roh.name === 'string' ? roh.name : '';
|
|
100
|
+
const address = typeof roh.address === 'string' ? roh.address : '';
|
|
101
|
+
return name !== '' || address !== '' ? { sharedReturnPoint: { name, address } } : {};
|
|
102
|
+
}
|
|
94
103
|
function handbelegFeld(roh) {
|
|
95
104
|
const manualReceipt = readManualReceipt(roh);
|
|
96
105
|
return manualReceipt ? { manualReceipt } : {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { InternerTransport } from '../client/aufrufe.js';
|
|
2
2
|
import { type PosReference } from './kachel-referenz.js';
|
|
3
|
+
import { type DepositEntry } from './pfand.js';
|
|
3
4
|
import { type ArticleExternalVoucher } from './fremdgutschein-artikel.js';
|
|
4
5
|
/**
|
|
5
6
|
* Artikelgruppen (Kategorien der Kachel-Kasse) und Artikel in der Form, die
|
|
@@ -22,6 +23,11 @@ export interface ArticleGroup {
|
|
|
22
23
|
* erst ueber [addOnsFor].
|
|
23
24
|
*/
|
|
24
25
|
addOns?: string[] | null;
|
|
26
|
+
/**
|
|
27
|
+
* Pfand der Gruppe (Pfand & Leergut): gilt fuer Artikel ohne eigene Liste; null = keines.
|
|
28
|
+
* Optional wie `addOns`, der Leser setzt es immer.
|
|
29
|
+
*/
|
|
30
|
+
deposits?: DepositEntry[] | null;
|
|
25
31
|
}
|
|
26
32
|
export interface ArticleGroupPayload {
|
|
27
33
|
id?: string | null;
|
|
@@ -31,6 +37,7 @@ export interface ArticleGroupPayload {
|
|
|
31
37
|
sort?: number | null;
|
|
32
38
|
vatRate?: number | null;
|
|
33
39
|
addOns?: unknown;
|
|
40
|
+
deposits?: unknown;
|
|
34
41
|
}
|
|
35
42
|
/** Zusatzliste am Draht: nur eine Liste von Texten zaehlt, sonst null. Paketintern. */
|
|
36
43
|
export declare function addOnListe(wert: unknown): string[] | null;
|
|
@@ -132,6 +139,12 @@ export interface PosArticle {
|
|
|
132
139
|
* unbekannter Wert wird null.
|
|
133
140
|
*/
|
|
134
141
|
externalVoucher?: ArticleExternalVoucher | null;
|
|
142
|
+
/**
|
|
143
|
+
* Pfand des Artikels (Pfand & Leergut): `null` = keine eigene Angabe (die Gruppe gilt), `[]` = ausdruecklich
|
|
144
|
+
* ohne Pfand, sonst die Eintraege. Der Server setzt die Pfandzeilen am Beleg daraus (`autoDeposits`). Optional wie
|
|
145
|
+
* `addOns`, der Leser setzt es immer.
|
|
146
|
+
*/
|
|
147
|
+
deposits?: DepositEntry[] | null;
|
|
135
148
|
}
|
|
136
149
|
/**
|
|
137
150
|
* Kann die Kachel gebucht werden? Mit festem Preis immer, ohne Preis nur mit
|
|
@@ -173,6 +186,7 @@ export interface PosArticlePayload {
|
|
|
173
186
|
reference?: unknown;
|
|
174
187
|
addOns?: unknown;
|
|
175
188
|
externalVoucher?: unknown;
|
|
189
|
+
deposits?: unknown;
|
|
176
190
|
}
|
|
177
191
|
export declare function fromPosArticlePayload(p: PosArticlePayload): PosArticle;
|
|
178
192
|
/**
|
package/dist/esm/pos/artikel.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { KasseneckValidationError } from '../client/errors.js';
|
|
2
2
|
import { fromReferencePayload } from './kachel-referenz.js';
|
|
3
|
+
import { depositEntriesFromWire } from './pfand.js';
|
|
3
4
|
import { isArticleExternalVoucher } from './fremdgutschein-artikel.js';
|
|
4
5
|
/** Zusatzliste am Draht: nur eine Liste von Texten zaehlt, sonst null. Paketintern. */
|
|
5
6
|
export function addOnListe(wert) {
|
|
@@ -14,6 +15,7 @@ export function fromArticleGroupPayload(p) {
|
|
|
14
15
|
sort: typeof p.sort === 'number' ? p.sort : 0,
|
|
15
16
|
vatRate: typeof p.vatRate === 'number' ? p.vatRate : null,
|
|
16
17
|
addOns: addOnListe(p.addOns),
|
|
18
|
+
deposits: depositEntriesFromWire(p.deposits),
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
@@ -94,6 +96,7 @@ export function fromPosArticlePayload(p) {
|
|
|
94
96
|
reference: fromReferencePayload(p.reference),
|
|
95
97
|
addOns: addOnListe(p.addOns),
|
|
96
98
|
externalVoucher: isArticleExternalVoucher(p.externalVoucher) ? p.externalVoucher : null,
|
|
99
|
+
deposits: depositEntriesFromWire(p.deposits),
|
|
97
100
|
};
|
|
98
101
|
}
|
|
99
102
|
/**
|
package/dist/esm/pos/client.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare function posSettingsFromWire(data: {
|
|
|
9
9
|
business?: unknown;
|
|
10
10
|
device?: unknown;
|
|
11
11
|
vouchers?: unknown;
|
|
12
|
+
deposit?: unknown;
|
|
12
13
|
} | null | undefined): PosSettings;
|
|
13
14
|
/** Betriebsweite Einstellungen schreiben (Recht `layout`); liefert den gemischten Stand. */
|
|
14
15
|
export declare function setMyPosSettings(transport: InternerTransport, business: Partial<PosBusinessSettings>): Promise<PosBusinessSettings>;
|
package/dist/esm/pos/client.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { KasseneckValidationError } from '../client/errors.js';
|
|
2
2
|
import { posVoucherSettingsFromWire } from './gutschein.js';
|
|
3
|
+
import { posDepositSettingsFromWire } from './pfand.js';
|
|
3
4
|
import { checkDiscountPresets, INVALID_DISCOUNT_PRESET } from './rabatt-vorlagen.js';
|
|
4
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
6
|
/*
|
|
@@ -31,10 +32,12 @@ export async function getPosSettings(transport, options = {}) {
|
|
|
31
32
|
}
|
|
32
33
|
/** `{business, device, vouchers}` einer Antwort, gemischt mit den Standardwerten. */
|
|
33
34
|
export function posSettingsFromWire(data) {
|
|
35
|
+
const deposit = posDepositSettingsFromWire(data?.deposit);
|
|
34
36
|
return {
|
|
35
37
|
vouchers: posVoucherSettingsFromWire(data?.vouchers),
|
|
36
38
|
business: mergePosSettings(POS_BUSINESS_DEFAULTS, objekt(data?.business)),
|
|
37
39
|
device: mergePosSettings(POS_DEVICE_DEFAULTS, objekt(data?.device)),
|
|
40
|
+
...(deposit ? { deposit } : {}),
|
|
38
41
|
};
|
|
39
42
|
}
|
|
40
43
|
/** Betriebsweite Einstellungen schreiben (Recht `layout`); liefert den gemischten Stand. */
|
package/dist/esm/pos/errors.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { KasseneckApiError } from '../client/errors.js';
|
|
|
21
21
|
* ueber `KasseneckApiError.code` lesbar; die Kasse braucht dafuer einen
|
|
22
22
|
* Rueckfallzweig.
|
|
23
23
|
*/
|
|
24
|
-
export declare const POS_ERROR_CODES: readonly ["account_not_found", "action_confirmation_required", "admin_required", "after_count_not_permitted", "api_not_approved", "app_check_invalid", "app_check_missing", "article_not_found", "article_not_in_scope", "article_not_tracked", "cash_movement_exceeds_balance", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "comment_required", "count_already_voided", "count_not_found", "device_not_found", "dialect_mismatch", "drawer_inactive", "drawer_not_found", "idempotency_conflict", "idempotency_key_required", "internal_translation_error", "invalid_amount", "invalid_cursor", "invalid_denominations", "invalid_discount_preset", "invalid_movement_type", "invalid_quantity", "invalid_serial", "live_not_enabled", "location_inactive", "location_not_found", "logo_invalid", "logo_invalid_type", "logo_too_large", "method_not_allowed", "mfa_required", "module_inactive", "not_found", "not_permitted", "note_required", "password_change_required", "print_job_not_found", "print_layout_failed", "printer_not_found", "recount_exhausted", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "serial_already_counted", "serial_not_allowed", "serial_required", "server_error", "session_expired", "session_other_cashregister", "shift_already_open", "shift_closed", "shift_mode_off", "shift_not_open", "stocktake_closed", "stocktake_closing", "stocktake_not_found", "stocktake_not_open", "tip_payout_exceeds_claim", "too_many_counts", "transfer_same_drawer", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
24
|
+
export declare const POS_ERROR_CODES: readonly ["account_not_found", "action_confirmation_required", "admin_required", "after_count_not_permitted", "api_not_approved", "app_check_invalid", "app_check_missing", "article_not_found", "article_not_in_scope", "article_not_tracked", "cash_movement_exceeds_balance", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "comment_required", "count_already_voided", "count_not_found", "deposit_follows_item", "deposit_not_enabled", "deposit_return_not_offered", "deposit_set_by_server", "deposit_type_in_use", "deposit_type_not_found", "deposit_type_not_issued", "device_not_found", "dialect_mismatch", "drawer_inactive", "drawer_not_found", "filler_role_required", "idempotency_conflict", "idempotency_key_required", "internal_translation_error", "invalid_amount", "invalid_cursor", "invalid_denominations", "invalid_deposit", "invalid_deposit_quantity", "invalid_discount_preset", "invalid_item_kind", "invalid_movement_type", "invalid_quantity", "invalid_serial", "live_not_enabled", "location_inactive", "location_not_found", "logo_invalid", "logo_invalid_type", "logo_too_large", "method_not_allowed", "mfa_required", "module_inactive", "not_found", "not_permitted", "note_required", "password_change_required", "print_job_not_found", "print_layout_failed", "printer_not_found", "recount_exhausted", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "serial_already_counted", "serial_not_allowed", "serial_required", "server_error", "session_expired", "session_other_cashregister", "shift_already_open", "shift_closed", "shift_mode_off", "shift_not_open", "stocktake_closed", "stocktake_closing", "stocktake_not_found", "stocktake_not_open", "tip_payout_exceeds_claim", "too_many_counts", "too_many_deposit_types", "transfer_same_drawer", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
25
25
|
export type PosErrorCode = typeof POS_ERROR_CODES[number];
|
|
26
26
|
export declare function isPosErrorCode(value: unknown): value is PosErrorCode;
|
|
27
27
|
/** Der Code eines geworfenen Fehlers, wenn er in [POS_ERROR_CODES] steht; sonst `undefined`. */
|
package/dist/esm/pos/errors.js
CHANGED
|
@@ -40,17 +40,28 @@ export const POS_ERROR_CODES = Object.freeze([
|
|
|
40
40
|
'comment_required',
|
|
41
41
|
'count_already_voided',
|
|
42
42
|
'count_not_found',
|
|
43
|
+
'deposit_follows_item',
|
|
44
|
+
'deposit_not_enabled',
|
|
45
|
+
'deposit_return_not_offered',
|
|
46
|
+
'deposit_set_by_server',
|
|
47
|
+
'deposit_type_in_use',
|
|
48
|
+
'deposit_type_not_found',
|
|
49
|
+
'deposit_type_not_issued',
|
|
43
50
|
'device_not_found',
|
|
44
51
|
'dialect_mismatch',
|
|
45
52
|
'drawer_inactive',
|
|
46
53
|
'drawer_not_found',
|
|
54
|
+
'filler_role_required',
|
|
47
55
|
'idempotency_conflict',
|
|
48
56
|
'idempotency_key_required',
|
|
49
57
|
'internal_translation_error',
|
|
50
58
|
'invalid_amount',
|
|
51
59
|
'invalid_cursor',
|
|
52
60
|
'invalid_denominations',
|
|
61
|
+
'invalid_deposit',
|
|
62
|
+
'invalid_deposit_quantity',
|
|
53
63
|
'invalid_discount_preset',
|
|
64
|
+
'invalid_item_kind',
|
|
54
65
|
'invalid_movement_type',
|
|
55
66
|
'invalid_quantity',
|
|
56
67
|
'invalid_serial',
|
|
@@ -92,6 +103,7 @@ export const POS_ERROR_CODES = Object.freeze([
|
|
|
92
103
|
'stocktake_not_open',
|
|
93
104
|
'tip_payout_exceeds_claim',
|
|
94
105
|
'too_many_counts',
|
|
106
|
+
'too_many_deposit_types',
|
|
95
107
|
'transfer_same_drawer',
|
|
96
108
|
'unauthorized',
|
|
97
109
|
'user_disabled',
|
package/dist/esm/pos/index.d.ts
CHANGED
|
@@ -10,18 +10,20 @@ export { type PosTheme, type PosFontSize, type PosWatermark, type PosQuantity, t
|
|
|
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';
|
|
13
|
+
export { DEPOSIT_KINDS, type DepositKind, DEPOSIT_TYPES, type DepositContainerType, DEPOSIT_RETURN_MODES, type DepositReturnMode, DEPOSIT_ON_PREMISES_DEFAULTS, type DepositOnPremisesDefault, type DepositAmount, type DepositType, type DepositSettings, type DepositEntry, type DepositSharedReturnPoint, type CashRegisterDeposit, posDepositSettingsFromWire, depositEntriesFromWire, cashRegisterDepositFromWire, depositsFor, depositAmountOn, viennaDay, withDepositLines, depositReturnLine, type DepositPreviewItem, type DepositPreviewLine, type DepositPreviewInput, type DepositPreviewArticle, type DepositPreviewResult, type DepositPreviewErrorCode, } from './pfand.js';
|
|
13
14
|
export { ARTICLE_EXTERNAL_VOUCHER_TYPES, type ArticleExternalVoucher, ARTICLE_EXTERNAL_VOUCHER_INVALID, ARTICLE_EXTERNAL_VOUCHER_VAT_RATES, EXTERNAL_VOUCHER_ARTICLE_REASONS, type ExternalVoucherArticleReason, type ExternalVoucherArticleInput, isArticleExternalVoucher, checkExternalVoucherValue, checkExternalVoucherArticle, type ExternalVoucherTileBlock, externalVoucherTileBlock, } from './fremdgutschein-artikel.js';
|
|
14
15
|
export { ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES, type OwnVoucherCodeShape } from '../models/voucher.js';
|
|
15
16
|
export { getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, setMyPosLogo, posSettingsFromWire, type SetMyPosLogoOptions, } from './client.js';
|
|
16
17
|
export { POS_ERROR_CODES, type PosErrorCode, isPosErrorCode, posErrorCode, isPosError, type PosFieldError, posFieldErrors, } from './errors.js';
|
|
17
18
|
export { distributeDiscount } from '../receipt/discount.js';
|
|
18
|
-
export { cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, type VoucherPerms, type RegisterScope, type RegisterUserPerms } from '../register/pairing.js';
|
|
19
|
+
export { cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, depositReturnOf, type VoucherPerms, type RegisterScope, type RegisterUserPerms } from '../register/pairing.js';
|
|
19
20
|
export { type NetworkPrinter, type PrintJob, type PrintJobStatus, PRINT_JOB_STATUSES, type PrintJobSource, PRINT_JOB_SOURCES, isPrintJobFinished, type CreatePrintJobOptions, listMyPrinters, createPrintJob, getPrintJob, } from './drucker.js';
|
|
20
21
|
export { listMyTipRecipients } from './trinkgeld.js';
|
|
21
22
|
export { posDiscountPresets, discountPresetChipText, discountChipsFromPresets, checkDiscountPresets, discountBlockLines, INVALID_DISCOUNT_PRESET, DISCOUNT_PRESETS_MAX, DISCOUNT_PRESET_NAME_MAX, DISCOUNT_PRESET_PERCENT_BP, DISCOUNT_PRESET_AMOUNT_CENTS, DISCOUNT_PRESET_MESSAGES, type DiscountPresetReason, type DiscountPresetError, type DiscountPresetsCheck, type DiscountBlockLine, type DiscountTotal, } from './rabatt-vorlagen.js';
|
|
22
23
|
export { depFolderName } from './dep.js';
|
|
23
24
|
export { type RegisterInspectionInfo, type RegisterInspectionSignature, type InspectionSignatureStatus, type InspectionInfoRow, type InspectionInfoRowKey, type InspectionInfoSection, type InspectionInfoLinesOptions, getRegisterInspectionInfo, inspectionInfoRows, inspectionInfoLines, } from './kasseninfo.js';
|
|
24
25
|
export { type ConnectStateReport, reportConnectState } from './connect-bestand.js';
|
|
26
|
+
export { type ReturnCode, type ReturnCodeEntry, type ReturnCodeMatch, type ReturnCodeArticle, type ReturnCodeGroup, type ReturnCodeInput, learnReturnCode, listReturnCodes, matchReturnCode, } from './leergut.js';
|
|
25
27
|
export { STOCK_LOCATION_TYPES, type StockLocationType, type StockLocation, type StockLocationAddress, type StockLevel, type StockValue, type StockList, type ListMyStockOptions, type SetMyCashregisterStockLocationOptions, type CashregisterStockLocation, listMyStockLocations, listMyStock, setMyCashregisterStockLocation, } from './lager.js';
|
|
26
28
|
export { type ListMyStocktakesOptions, type ListMyStocktakeItemsOptions, type ListMyStocktakeCountsOptions, type RecordMyStocktakeCountOptions, type VoidMyStocktakeCountOptions, listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMyStocktakeCount, voidMyStocktakeCount, parseQuantityMilli, } from './inventur.js';
|
|
27
29
|
export type { Stocktake, StocktakeItem, StocktakeCount, StocktakeCountResult, StocktakeItemPage, StocktakeCountPage, StocktakeActor, StocktakeProgress, StocktakeReview, StocktakeRecount, StocktakeScope, } from '../inventory/typen.js';
|
|
@@ -32,5 +34,5 @@ export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATION
|
|
|
32
34
|
export { type ShiftReceiptLayoutOptions, shiftReceiptLayout, cashMovementLayout } from '../receipt/shift-sheet.js';
|
|
33
35
|
export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputKind, type ReceiptOutputResult } from '../models/receipt-output.js';
|
|
34
36
|
export { RETURN_DISPOSITIONS, isReturnDisposition, type ReturnDisposition } from '../models/cancellation.js';
|
|
35
|
-
export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, EXTERNAL_VOUCHER_TILE_MESSAGES, EXTERNAL_VOUCHER_ARTICLE_MESSAGES, externalVoucherArticleErrorMessage, EXTERNAL_VOUCHERS_LABELS, EXTERNAL_VOUCHER_KIND_LABELS, TIP_KEPT_MODE_LABELS, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
|
|
37
|
+
export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, DEPOSIT_ERROR_MESSAGES, depositErrorMessage, EXTERNAL_VOUCHER_TILE_MESSAGES, EXTERNAL_VOUCHER_ARTICLE_MESSAGES, externalVoucherArticleErrorMessage, EXTERNAL_VOUCHERS_LABELS, EXTERNAL_VOUCHER_KIND_LABELS, TIP_KEPT_MODE_LABELS, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
|
|
36
38
|
export { roundUpSuggestions } from './aufrunden.js';
|
package/dist/esm/pos/index.js
CHANGED
|
@@ -12,6 +12,7 @@ THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, TIP_KEPT_
|
|
|
12
12
|
export { fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, QUANTITY_RULES, quantityRuleForUnit, quantityDefaults, allowedQuantity, isBookableArticle, tilePrompts, } from './artikel.js';
|
|
13
13
|
export { REFERENCE_MODES, REFERENCE_INPUT_MAX, REFERENCE_LABEL_MAX, REFERENCE_HINT_MAX, REFERENCE_PATTERN_MAX, REFERENCE_PATTERN_TEMPLATES, cleanReferenceText, isValidReferencePattern, isDigitsOnlyPattern, checkReference, referenceLineName, fromReferencePayload, } from './kachel-referenz.js';
|
|
14
14
|
export { ADD_ONS_MAX, ADD_ON_BLOCK_REASONS, isSelectableAddOn, addOnsFor, addOnReferencesValid, addOnsOfItem, addOnRemap, addOnDisplayOrder, orderAddOnLines, } from './zusaetze.js';
|
|
15
|
+
export { DEPOSIT_KINDS, DEPOSIT_TYPES, DEPOSIT_RETURN_MODES, DEPOSIT_ON_PREMISES_DEFAULTS, posDepositSettingsFromWire, depositEntriesFromWire, cashRegisterDepositFromWire, depositsFor, depositAmountOn, viennaDay, withDepositLines, depositReturnLine, } from './pfand.js';
|
|
15
16
|
export { ARTICLE_EXTERNAL_VOUCHER_TYPES, ARTICLE_EXTERNAL_VOUCHER_INVALID, ARTICLE_EXTERNAL_VOUCHER_VAT_RATES, EXTERNAL_VOUCHER_ARTICLE_REASONS, isArticleExternalVoucher, checkExternalVoucherValue, checkExternalVoucherArticle, externalVoucherTileBlock, } from './fremdgutschein-artikel.js';
|
|
16
17
|
// Form-Erkennung eigener Codes im Gutschein-Feld (Nachfrage statt Abweisung); dieselbe Funktion wie an der Wurzel.
|
|
17
18
|
export { ownVoucherCodeShape, OWN_VOUCHER_CODE_SHAPES } from '../models/voucher.js';
|
|
@@ -20,7 +21,7 @@ export { POS_ERROR_CODES, isPosErrorCode, posErrorCode, isPosError, posFieldErro
|
|
|
20
21
|
export { distributeDiscount } from '../receipt/discount.js';
|
|
21
22
|
// Reichweiten der Kassen-Rechte (Migration wie im Backend) -- bewusst NICHT im
|
|
22
23
|
// Register-Unterpfad: dessen Exportnamen sind 1:1 Function-Namen (Rewrites).
|
|
23
|
-
export { cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf } from '../register/pairing.js';
|
|
24
|
+
export { cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, depositReturnOf } from '../register/pairing.js';
|
|
24
25
|
export { PRINT_JOB_STATUSES, PRINT_JOB_SOURCES, isPrintJobFinished, listMyPrinters, createPrintJob, getPrintJob, } from './drucker.js';
|
|
25
26
|
export { listMyTipRecipients } from './trinkgeld.js';
|
|
26
27
|
export { posDiscountPresets, discountPresetChipText, discountChipsFromPresets, checkDiscountPresets, discountBlockLines, INVALID_DISCOUNT_PRESET, DISCOUNT_PRESETS_MAX, DISCOUNT_PRESET_NAME_MAX, DISCOUNT_PRESET_PERCENT_BP, DISCOUNT_PRESET_AMOUNT_CENTS, DISCOUNT_PRESET_MESSAGES, } from './rabatt-vorlagen.js';
|
|
@@ -30,6 +31,7 @@ export { depFolderName } from './dep.js';
|
|
|
30
31
|
export { getRegisterInspectionInfo, inspectionInfoRows, inspectionInfoLines, } from './kasseninfo.js';
|
|
31
32
|
// Connect-Bestand: die Kasse meldet Version und System von Kasseneck Connect.
|
|
32
33
|
export { reportConnectState } from './connect-bestand.js';
|
|
34
|
+
export { learnReturnCode, listReturnCodes, matchReturnCode, } from './leergut.js';
|
|
33
35
|
export { STOCK_LOCATION_TYPES, listMyStockLocations, listMyStock, setMyCashregisterStockLocation, } from './lager.js';
|
|
34
36
|
export { listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMyStocktakeCount, voidMyStocktakeCount, parseQuantityMilli, } from './inventur.js';
|
|
35
37
|
// Gutschein pruefen und Etikett nachdrucken an der Kasse; Gutschein-Sorten (Stufe 4b, 1.17.0).
|
|
@@ -43,5 +45,5 @@ export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS } from '../models/receipt-
|
|
|
43
45
|
// Rueckgabe-Wahl beim Storno (Kassen-Dialog); dieselbe Liste wie an der Wurzel.
|
|
44
46
|
export { RETURN_DISPOSITIONS, isReturnDisposition } from '../models/cancellation.js';
|
|
45
47
|
// Was die Kasse selbst sagt: ein Katalog fuer Browser-Kasse und App.
|
|
46
|
-
export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, EXTERNAL_VOUCHER_TILE_MESSAGES, EXTERNAL_VOUCHER_ARTICLE_MESSAGES, externalVoucherArticleErrorMessage, EXTERNAL_VOUCHERS_LABELS, EXTERNAL_VOUCHER_KIND_LABELS, TIP_KEPT_MODE_LABELS, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, } from './texte.js';
|
|
48
|
+
export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, DEPOSIT_ERROR_MESSAGES, depositErrorMessage, EXTERNAL_VOUCHER_TILE_MESSAGES, EXTERNAL_VOUCHER_ARTICLE_MESSAGES, externalVoucherArticleErrorMessage, EXTERNAL_VOUCHERS_LABELS, EXTERNAL_VOUCHER_KIND_LABELS, TIP_KEPT_MODE_LABELS, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, } from './texte.js';
|
|
47
49
|
export { roundUpSuggestions } from './aufrunden.js';
|