@kreiseck/kasseneck-api 1.13.0 → 1.15.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 +36 -0
- package/README.md +71 -2
- package/dist/cjs/client/api.d.ts +8 -1
- package/dist/cjs/client/api.js +4 -0
- package/dist/cjs/client/aufrufe.d.ts +6 -6
- package/dist/cjs/client/aufrufe.js +11 -2
- package/dist/cjs/client/index.d.ts +2 -1
- package/dist/cjs/client/index.js +13 -1
- package/dist/cjs/client/list-receipts.d.ts +211 -0
- package/dist/cjs/client/list-receipts.js +290 -0
- package/dist/cjs/client/receipts.d.ts +85 -2
- package/dist/cjs/client/receipts.js +164 -5
- package/dist/cjs/enums/voucher-type.d.ts +1 -1
- package/dist/cjs/enums/voucher-type.js +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +24 -3
- package/dist/cjs/invoice/typen.d.ts +1 -1
- package/dist/cjs/invoice/vertrag.d.ts +1 -1
- package/dist/cjs/invoice/vertrag.js +2 -0
- package/dist/cjs/models/index.d.ts +2 -1
- package/dist/cjs/models/index.js +12 -1
- package/dist/cjs/models/receipt-errors.d.ts +1 -1
- package/dist/cjs/models/receipt-errors.js +3 -0
- package/dist/cjs/models/receipt-output.d.ts +79 -0
- package/dist/cjs/models/receipt-output.js +143 -0
- package/dist/cjs/models/receipt.d.ts +2 -2
- package/dist/cjs/models/receipt.js +2 -2
- package/dist/cjs/models/voucher.d.ts +24 -2
- package/dist/cjs/models/voucher.js +2 -2
- package/dist/cjs/partner/typen.d.ts +1 -1
- package/dist/cjs/pos/index.d.ts +2 -1
- package/dist/cjs/pos/index.js +6 -1
- package/dist/cjs/pos/schicht-typen.d.ts +2 -2
- package/dist/cjs/pos/schicht-typen.js +2 -2
- package/dist/cjs/pos/settings.d.ts +1 -1
- package/dist/cjs/pos/settings.js +5 -0
- package/dist/cjs/pos/texte.d.ts +114 -0
- package/dist/cjs/pos/texte.js +64 -0
- package/dist/cjs/receipt/due.d.ts +4 -2
- package/dist/cjs/receipt/due.js +22 -5
- package/dist/cjs/receipt/duplikat.d.ts +35 -0
- package/dist/cjs/receipt/duplikat.js +76 -0
- package/dist/cjs/receipt/gutschein-plan.d.ts +2 -0
- package/dist/cjs/receipt/gutschein-plan.js +5 -0
- package/dist/cjs/receipt/index.d.ts +1 -0
- package/dist/cjs/receipt/index.js +4 -2
- package/dist/cjs/receipt/layout.js +44 -21
- package/dist/cjs/register/pairing.d.ts +6 -2
- package/dist/cjs/register/pairing.js +1 -1
- package/dist/cjs/stored/bon-layout.js +3 -4
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +47 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/api.d.ts +8 -1
- package/dist/esm/client/api.js +5 -1
- package/dist/esm/client/aufrufe.d.ts +6 -6
- package/dist/esm/client/aufrufe.js +11 -2
- package/dist/esm/client/index.d.ts +2 -1
- package/dist/esm/client/index.js +2 -1
- package/dist/esm/client/list-receipts.d.ts +211 -0
- package/dist/esm/client/list-receipts.js +284 -0
- package/dist/esm/client/receipts.d.ts +85 -2
- package/dist/esm/client/receipts.js +164 -6
- package/dist/esm/enums/voucher-type.d.ts +1 -1
- package/dist/esm/enums/voucher-type.js +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/invoice/typen.d.ts +1 -1
- package/dist/esm/invoice/vertrag.d.ts +1 -1
- package/dist/esm/invoice/vertrag.js +2 -0
- package/dist/esm/models/index.d.ts +2 -1
- package/dist/esm/models/index.js +1 -0
- package/dist/esm/models/receipt-errors.d.ts +1 -1
- package/dist/esm/models/receipt-errors.js +3 -0
- package/dist/esm/models/receipt-output.d.ts +79 -0
- package/dist/esm/models/receipt-output.js +135 -0
- package/dist/esm/models/receipt.d.ts +2 -2
- package/dist/esm/models/receipt.js +2 -2
- package/dist/esm/models/voucher.d.ts +24 -2
- package/dist/esm/models/voucher.js +2 -2
- package/dist/esm/partner/typen.d.ts +1 -1
- package/dist/esm/pos/index.d.ts +2 -1
- package/dist/esm/pos/index.js +3 -1
- package/dist/esm/pos/schicht-typen.d.ts +2 -2
- package/dist/esm/pos/schicht-typen.js +2 -2
- package/dist/esm/pos/settings.d.ts +1 -1
- package/dist/esm/pos/settings.js +5 -0
- package/dist/esm/pos/texte.d.ts +114 -0
- package/dist/esm/pos/texte.js +63 -0
- package/dist/esm/receipt/due.d.ts +4 -2
- package/dist/esm/receipt/due.js +23 -6
- package/dist/esm/receipt/duplikat.d.ts +35 -0
- package/dist/esm/receipt/duplikat.js +73 -0
- package/dist/esm/receipt/gutschein-plan.d.ts +2 -0
- package/dist/esm/receipt/gutschein-plan.js +4 -0
- package/dist/esm/receipt/index.d.ts +1 -0
- package/dist/esm/receipt/index.js +1 -0
- package/dist/esm/receipt/layout.js +44 -21
- package/dist/esm/register/pairing.d.ts +6 -2
- package/dist/esm/register/pairing.js +1 -1
- package/dist/esm/stored/bon-layout.js +3 -4
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +47 -3
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/code-table-receipts.json +1 -1
- package/fixtures/duplicate-cases.json +5616 -0
- package/fixtures/expected/cancellation-discount.grid32.txt +1 -1
- package/fixtures/expected/cancellation-discount.grid48.txt +1 -1
- package/fixtures/expected/cancellation-discount.lines.json +1 -1
- package/fixtures/expected/cancellation-discount.sheet32.json +1 -1
- package/fixtures/expected/cancellation-discount.sheet48.json +1 -1
- package/fixtures/expected/cancellation-full.grid32.txt +1 -1
- package/fixtures/expected/cancellation-full.grid48.txt +1 -1
- package/fixtures/expected/cancellation-full.lines.json +1 -1
- package/fixtures/expected/cancellation-full.sheet32.json +1 -1
- package/fixtures/expected/cancellation-full.sheet48.json +1 -1
- package/fixtures/expected/cancellation-partial.grid32.txt +1 -1
- package/fixtures/expected/cancellation-partial.grid48.txt +1 -1
- package/fixtures/expected/cancellation-partial.lines.json +1 -1
- package/fixtures/expected/cancellation-partial.sheet32.json +1 -1
- package/fixtures/expected/cancellation-partial.sheet48.json +1 -1
- package/fixtures/expected/cancellation-split-full.grid32.txt +1 -1
- package/fixtures/expected/cancellation-split-full.grid48.txt +1 -1
- package/fixtures/expected/cancellation-split-full.lines.json +1 -1
- package/fixtures/expected/cancellation-split-full.sheet32.json +1 -1
- package/fixtures/expected/cancellation-split-full.sheet48.json +1 -1
- package/fixtures/expected/cancellation-split-partial.grid32.txt +1 -1
- package/fixtures/expected/cancellation-split-partial.grid48.txt +1 -1
- package/fixtures/expected/cancellation-split-partial.lines.json +1 -1
- package/fixtures/expected/cancellation-split-partial.sheet32.json +1 -1
- package/fixtures/expected/cancellation-split-partial.sheet48.json +1 -1
- package/fixtures/expected/card-custom.grid32.txt +1 -1
- package/fixtures/expected/card-custom.grid48.txt +1 -1
- package/fixtures/expected/card-custom.lines.json +1 -1
- package/fixtures/expected/card-custom.sheet32.json +1 -1
- package/fixtures/expected/card-custom.sheet48.json +1 -1
- package/fixtures/expected/card-gptom-ios.grid32.txt +1 -1
- package/fixtures/expected/card-gptom-ios.grid48.txt +1 -1
- package/fixtures/expected/card-gptom-ios.lines.json +1 -1
- package/fixtures/expected/card-gptom-ios.sheet32.json +1 -1
- package/fixtures/expected/card-gptom-ios.sheet48.json +1 -1
- package/fixtures/expected/card-gptom.grid32.txt +1 -1
- package/fixtures/expected/card-gptom.grid48.txt +1 -1
- package/fixtures/expected/card-gptom.lines.json +1 -1
- package/fixtures/expected/card-gptom.sheet32.json +1 -1
- package/fixtures/expected/card-gptom.sheet48.json +1 -1
- package/fixtures/expected/card-hobex-cloud.grid32.txt +1 -1
- package/fixtures/expected/card-hobex-cloud.grid48.txt +1 -1
- package/fixtures/expected/card-hobex-cloud.lines.json +1 -1
- package/fixtures/expected/card-hobex-cloud.sheet32.json +1 -1
- package/fixtures/expected/card-hobex-cloud.sheet48.json +1 -1
- package/fixtures/expected/card-hobex-hps.grid32.txt +1 -1
- package/fixtures/expected/card-hobex-hps.grid48.txt +1 -1
- package/fixtures/expected/card-hobex-hps.lines.json +1 -1
- package/fixtures/expected/card-hobex-hps.sheet32.json +1 -1
- package/fixtures/expected/card-hobex-hps.sheet48.json +1 -1
- package/fixtures/expected/card-mypos.grid32.txt +1 -1
- package/fixtures/expected/card-mypos.grid48.txt +1 -1
- package/fixtures/expected/card-mypos.lines.json +1 -1
- package/fixtures/expected/card-mypos.sheet32.json +1 -1
- package/fixtures/expected/card-mypos.sheet48.json +1 -1
- package/fixtures/expected/card-stripe-eps.grid32.txt +1 -1
- package/fixtures/expected/card-stripe-eps.grid48.txt +1 -1
- package/fixtures/expected/card-stripe-eps.lines.json +1 -1
- package/fixtures/expected/card-stripe-eps.sheet32.json +1 -1
- package/fixtures/expected/card-stripe-eps.sheet48.json +1 -1
- package/fixtures/expected/card-stripe.grid32.txt +1 -1
- package/fixtures/expected/card-stripe.grid48.txt +1 -1
- package/fixtures/expected/card-stripe.lines.json +1 -1
- package/fixtures/expected/card-stripe.sheet32.json +1 -1
- package/fixtures/expected/card-stripe.sheet48.json +1 -1
- package/fixtures/expected/card-sumup.grid32.txt +1 -1
- package/fixtures/expected/card-sumup.grid48.txt +1 -1
- package/fixtures/expected/card-sumup.lines.json +1 -1
- package/fixtures/expected/card-sumup.sheet32.json +1 -1
- package/fixtures/expected/card-sumup.sheet48.json +1 -1
- package/fixtures/expected/code-table-receipt.long-item-name.iso8859_15.hex +1 -1
- package/fixtures/expected/code-table-receipt.long-item-name.pc437.hex +1 -1
- package/fixtures/expected/code-table-receipt.long-item-name.pc850.hex +1 -1
- package/fixtures/expected/code-table-receipt.long-item-name.pc858.hex +1 -1
- package/fixtures/expected/code-table-receipt.long-item-name.replacement.hex +1 -1
- package/fixtures/expected/code-table-receipt.long-item-name.wpc1252.hex +1 -1
- package/fixtures/expected/code-table-receipt.sale-cash.iso8859_15.hex +1 -1
- package/fixtures/expected/code-table-receipt.sale-cash.pc437.hex +1 -1
- package/fixtures/expected/code-table-receipt.sale-cash.pc850.hex +1 -1
- package/fixtures/expected/code-table-receipt.sale-cash.pc858.hex +1 -1
- package/fixtures/expected/code-table-receipt.sale-cash.replacement.hex +1 -1
- package/fixtures/expected/code-table-receipt.sale-cash.wpc1252.hex +1 -1
- package/fixtures/expected/code-table-receipt.special-characters.iso8859_15.hex +1 -1
- package/fixtures/expected/code-table-receipt.special-characters.pc437.hex +1 -1
- package/fixtures/expected/code-table-receipt.special-characters.pc850.hex +1 -1
- package/fixtures/expected/code-table-receipt.special-characters.pc858.hex +1 -1
- package/fixtures/expected/code-table-receipt.special-characters.replacement.hex +1 -1
- package/fixtures/expected/code-table-receipt.special-characters.wpc1252.hex +1 -1
- package/fixtures/expected/code-table-receipt.test-cashregister-sale.iso8859_15.hex +1 -1
- package/fixtures/expected/code-table-receipt.test-cashregister-sale.pc437.hex +1 -1
- package/fixtures/expected/code-table-receipt.test-cashregister-sale.pc850.hex +1 -1
- package/fixtures/expected/code-table-receipt.test-cashregister-sale.pc858.hex +1 -1
- package/fixtures/expected/code-table-receipt.test-cashregister-sale.replacement.hex +1 -1
- package/fixtures/expected/code-table-receipt.test-cashregister-sale.wpc1252.hex +1 -1
- package/fixtures/expected/discount-lines.grid32.txt +1 -1
- package/fixtures/expected/discount-lines.grid48.txt +1 -1
- package/fixtures/expected/discount-lines.lines.json +1 -1
- package/fixtures/expected/discount-lines.sheet32.json +1 -1
- package/fixtures/expected/discount-lines.sheet48.json +1 -1
- package/fixtures/expected/discount-owner-tip.grid32.txt +1 -1
- package/fixtures/expected/discount-owner-tip.grid48.txt +1 -1
- package/fixtures/expected/discount-owner-tip.lines.json +1 -1
- package/fixtures/expected/discount-owner-tip.sheet32.json +1 -1
- package/fixtures/expected/discount-owner-tip.sheet48.json +1 -1
- package/fixtures/expected/discount-simple.grid32.txt +1 -1
- package/fixtures/expected/discount-simple.grid48.txt +1 -1
- package/fixtures/expected/discount-simple.lines.json +1 -1
- package/fixtures/expected/discount-simple.sheet32.json +1 -1
- package/fixtures/expected/discount-simple.sheet48.json +1 -1
- package/fixtures/expected/discount-tip.grid32.txt +1 -1
- package/fixtures/expected/discount-tip.grid48.txt +1 -1
- package/fixtures/expected/discount-tip.lines.json +1 -1
- package/fixtures/expected/discount-tip.sheet32.json +1 -1
- package/fixtures/expected/discount-tip.sheet48.json +1 -1
- package/fixtures/expected/discount-value-voucher.grid32.txt +1 -1
- package/fixtures/expected/discount-value-voucher.grid48.txt +1 -1
- package/fixtures/expected/discount-value-voucher.lines.json +1 -1
- package/fixtures/expected/discount-value-voucher.sheet32.json +1 -1
- package/fixtures/expected/discount-value-voucher.sheet48.json +1 -1
- package/fixtures/expected/duplicate.cancellation-full.hex +44 -0
- package/fixtures/expected/duplicate.cancellation-partial.hex +33 -0
- package/fixtures/expected/duplicate.sale-cash-mm58.hex +28 -0
- package/fixtures/expected/duplicate.sale-cash-twice.hex +35 -0
- package/fixtures/expected/duplicate.sale-cash.hex +35 -0
- package/fixtures/expected/duplicate.shift-close.hex +43 -0
- package/fixtures/expected/duplicate.summer-time-last-second.hex +28 -0
- package/fixtures/expected/duplicate.summer-time-start.hex +35 -0
- package/fixtures/expected/duplicate.test-cashregister-sale-logo.hex +189 -0
- package/fixtures/expected/duplicate.voucher-multi-purpose-redeem.hex +37 -0
- package/fixtures/expected/duplicate.voucher-service-redeem-logo.hex +119 -0
- package/fixtures/expected/duplicate.winter-time-first-second.hex +28 -0
- package/fixtures/expected/duplicate.zero-start.hex +40 -0
- package/fixtures/expected/long-item-name.grid32.txt +1 -1
- package/fixtures/expected/long-item-name.grid48.txt +1 -1
- package/fixtures/expected/long-item-name.lines.json +1 -1
- package/fixtures/expected/long-item-name.sheet32.json +1 -1
- package/fixtures/expected/long-item-name.sheet48.json +1 -1
- package/fixtures/expected/sale-card.grid32.txt +1 -1
- package/fixtures/expected/sale-card.grid48.txt +1 -1
- package/fixtures/expected/sale-card.lines.json +1 -1
- package/fixtures/expected/sale-card.sheet32.json +1 -1
- package/fixtures/expected/sale-card.sheet48.json +1 -1
- package/fixtures/expected/sale-cash.grid32.txt +1 -1
- package/fixtures/expected/sale-cash.grid48.txt +1 -1
- package/fixtures/expected/sale-cash.lines.json +1 -1
- package/fixtures/expected/sale-cash.sheet32.json +1 -1
- package/fixtures/expected/sale-cash.sheet48.json +1 -1
- package/fixtures/expected/sale-small-business.grid32.txt +1 -1
- package/fixtures/expected/sale-small-business.grid48.txt +1 -1
- package/fixtures/expected/sale-small-business.lines.json +1 -1
- package/fixtures/expected/sale-small-business.sheet32.json +1 -1
- package/fixtures/expected/sale-small-business.sheet48.json +1 -1
- package/fixtures/expected/signature-outage-sale.grid32.txt +1 -1
- package/fixtures/expected/signature-outage-sale.grid48.txt +1 -1
- package/fixtures/expected/signature-outage-sale.lines.json +1 -1
- package/fixtures/expected/signature-outage-sale.sheet32.json +1 -1
- package/fixtures/expected/signature-outage-sale.sheet48.json +1 -1
- package/fixtures/expected/split-card-card-cash.grid32.txt +1 -1
- package/fixtures/expected/split-card-card-cash.grid48.txt +1 -1
- package/fixtures/expected/split-card-card-cash.lines.json +1 -1
- package/fixtures/expected/split-card-card-cash.sheet32.json +1 -1
- package/fixtures/expected/split-card-card-cash.sheet48.json +1 -1
- package/fixtures/expected/split-cash-change.grid32.txt +1 -1
- package/fixtures/expected/split-cash-change.grid48.txt +1 -1
- package/fixtures/expected/split-cash-change.lines.json +1 -1
- package/fixtures/expected/split-cash-change.sheet32.json +1 -1
- package/fixtures/expected/split-cash-change.sheet48.json +1 -1
- package/fixtures/expected/split-long-amount.grid32.txt +1 -1
- package/fixtures/expected/split-long-amount.grid48.txt +1 -1
- package/fixtures/expected/split-long-amount.lines.json +1 -1
- package/fixtures/expected/split-long-amount.sheet32.json +1 -1
- package/fixtures/expected/split-long-amount.sheet48.json +1 -1
- package/fixtures/expected/split-one-card-tip.grid32.txt +1 -1
- package/fixtures/expected/split-one-card-tip.grid48.txt +1 -1
- package/fixtures/expected/split-one-card-tip.lines.json +1 -1
- package/fixtures/expected/split-one-card-tip.sheet32.json +1 -1
- package/fixtures/expected/split-one-card-tip.sheet48.json +1 -1
- package/fixtures/expected/split-table-round-tip.grid32.txt +1 -1
- package/fixtures/expected/split-table-round-tip.grid48.txt +1 -1
- package/fixtures/expected/split-table-round-tip.lines.json +1 -1
- package/fixtures/expected/split-table-round-tip.sheet32.json +1 -1
- package/fixtures/expected/split-table-round-tip.sheet48.json +1 -1
- package/fixtures/expected/split-tip-card.grid32.txt +1 -1
- package/fixtures/expected/split-tip-card.grid48.txt +1 -1
- package/fixtures/expected/split-tip-card.lines.json +1 -1
- package/fixtures/expected/split-tip-card.sheet32.json +1 -1
- package/fixtures/expected/split-tip-card.sheet48.json +1 -1
- package/fixtures/expected/split-two-cards-same-provider.grid32.txt +1 -1
- package/fixtures/expected/split-two-cards-same-provider.grid48.txt +1 -1
- package/fixtures/expected/split-two-cards-same-provider.lines.json +1 -1
- package/fixtures/expected/split-two-cards-same-provider.sheet32.json +1 -1
- package/fixtures/expected/split-two-cards-same-provider.sheet48.json +1 -1
- package/fixtures/expected/test-cashregister-sale.grid32.txt +1 -1
- package/fixtures/expected/test-cashregister-sale.grid48.txt +1 -1
- package/fixtures/expected/test-cashregister-sale.lines.json +1 -1
- package/fixtures/expected/test-cashregister-sale.sheet32.json +1 -1
- package/fixtures/expected/test-cashregister-sale.sheet48.json +1 -1
- package/fixtures/expected/test-signature-sale.grid32.txt +1 -1
- package/fixtures/expected/test-signature-sale.grid48.txt +1 -1
- package/fixtures/expected/test-signature-sale.lines.json +1 -1
- package/fixtures/expected/test-signature-sale.sheet32.json +1 -1
- package/fixtures/expected/test-signature-sale.sheet48.json +1 -1
- package/fixtures/expected/training.grid32.txt +1 -1
- package/fixtures/expected/training.grid48.txt +1 -1
- package/fixtures/expected/training.lines.json +1 -1
- package/fixtures/expected/training.sheet32.json +1 -1
- package/fixtures/expected/training.sheet48.json +1 -1
- package/fixtures/expected/voucher-multi-purpose-sale.grid32.txt +1 -2
- package/fixtures/expected/voucher-multi-purpose-sale.grid48.txt +1 -1
- package/fixtures/expected/voucher-multi-purpose-sale.lines.json +1 -1
- package/fixtures/expected/voucher-multi-purpose-sale.sheet32.json +1 -7
- package/fixtures/expected/voucher-multi-purpose-sale.sheet48.json +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.grid32.txt +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.grid48.txt +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.lines.json +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.sheet32.json +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem-exempt.sheet48.json +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem.grid32.txt +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem.grid48.txt +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem.lines.json +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem.sheet32.json +1 -1
- package/fixtures/expected/voucher-single-purpose-redeem.sheet48.json +1 -1
- package/fixtures/expected/voucher-single-purpose-sale.grid32.txt +2 -3
- package/fixtures/expected/voucher-single-purpose-sale.grid48.txt +2 -2
- package/fixtures/expected/voucher-single-purpose-sale.lines.json +2 -2
- package/fixtures/expected/voucher-single-purpose-sale.sheet32.json +2 -8
- package/fixtures/expected/voucher-single-purpose-sale.sheet48.json +2 -2
- package/fixtures/expected/zero-annual.grid32.txt +1 -1
- package/fixtures/expected/zero-annual.grid48.txt +1 -1
- package/fixtures/expected/zero-annual.lines.json +1 -1
- package/fixtures/expected/zero-annual.sheet32.json +1 -1
- package/fixtures/expected/zero-annual.sheet48.json +1 -1
- package/fixtures/expected/zero-final.grid32.txt +1 -1
- package/fixtures/expected/zero-final.grid48.txt +1 -1
- package/fixtures/expected/zero-final.lines.json +1 -1
- package/fixtures/expected/zero-final.sheet32.json +1 -1
- package/fixtures/expected/zero-final.sheet48.json +1 -1
- package/fixtures/expected/zero-manual.grid32.txt +1 -1
- package/fixtures/expected/zero-manual.grid48.txt +1 -1
- package/fixtures/expected/zero-manual.lines.json +1 -1
- package/fixtures/expected/zero-manual.sheet32.json +1 -1
- package/fixtures/expected/zero-manual.sheet48.json +1 -1
- package/fixtures/expected/zero-monthly.grid32.txt +1 -1
- package/fixtures/expected/zero-monthly.grid48.txt +1 -1
- package/fixtures/expected/zero-monthly.lines.json +1 -1
- package/fixtures/expected/zero-monthly.sheet32.json +1 -1
- package/fixtures/expected/zero-monthly.sheet48.json +1 -1
- package/fixtures/expected/zero-outage-end.grid32.txt +1 -1
- package/fixtures/expected/zero-outage-end.grid48.txt +1 -1
- package/fixtures/expected/zero-outage-end.lines.json +1 -1
- package/fixtures/expected/zero-outage-end.sheet32.json +1 -1
- package/fixtures/expected/zero-outage-end.sheet48.json +1 -1
- package/fixtures/expected/zero-start.grid32.txt +1 -1
- package/fixtures/expected/zero-start.grid48.txt +1 -1
- package/fixtures/expected/zero-start.lines.json +1 -1
- package/fixtures/expected/zero-start.sheet32.json +1 -1
- package/fixtures/expected/zero-start.sheet48.json +1 -1
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +3 -2
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/manifest.json +260 -260
- package/fixtures/pos-texts.json +118 -1
- package/fixtures/receipt-due-voucher-generated.json +2 -2
- package/fixtures/receipt-outputs-cases.json +2778 -0
- package/fixtures/receipts/cancellation-discount.json +1 -1
- package/fixtures/receipts/cancellation-full.json +1 -1
- package/fixtures/receipts/cancellation-partial.json +1 -1
- package/fixtures/receipts/cancellation-split-full.json +1 -1
- package/fixtures/receipts/cancellation-split-partial.json +1 -1
- package/fixtures/receipts/card-custom.json +1 -1
- package/fixtures/receipts/card-gptom-ios.json +1 -1
- package/fixtures/receipts/card-gptom.json +1 -1
- package/fixtures/receipts/card-hobex-cloud.json +1 -1
- package/fixtures/receipts/card-hobex-hps.json +1 -1
- package/fixtures/receipts/card-mypos.json +1 -1
- package/fixtures/receipts/card-stripe-eps.json +1 -1
- package/fixtures/receipts/card-stripe.json +1 -1
- package/fixtures/receipts/card-sumup.json +1 -1
- package/fixtures/receipts/discount-lines.json +1 -1
- package/fixtures/receipts/discount-owner-tip.json +1 -1
- package/fixtures/receipts/discount-simple.json +1 -1
- package/fixtures/receipts/discount-tip.json +1 -1
- package/fixtures/receipts/discount-value-voucher.json +1 -1
- package/fixtures/receipts/long-item-name.json +1 -1
- package/fixtures/receipts/sale-card.json +1 -1
- package/fixtures/receipts/sale-cash.json +1 -1
- package/fixtures/receipts/sale-small-business.json +1 -1
- package/fixtures/receipts/signature-outage-sale.json +1 -1
- package/fixtures/receipts/split-card-card-cash.json +1 -1
- package/fixtures/receipts/split-cash-change.json +1 -1
- package/fixtures/receipts/split-long-amount.json +1 -1
- package/fixtures/receipts/split-one-card-tip.json +1 -1
- package/fixtures/receipts/split-table-round-tip.json +1 -1
- package/fixtures/receipts/split-tip-card.json +1 -1
- package/fixtures/receipts/split-two-cards-same-provider.json +1 -1
- package/fixtures/receipts/test-cashregister-sale.json +1 -1
- package/fixtures/receipts/test-signature-sale.json +1 -1
- package/fixtures/receipts/training.json +1 -1
- package/fixtures/receipts/zero-annual.json +1 -1
- package/fixtures/receipts/zero-final.json +1 -1
- package/fixtures/receipts/zero-manual.json +1 -1
- package/fixtures/receipts/zero-monthly.json +1 -1
- package/fixtures/receipts/zero-outage-end.json +1 -1
- package/fixtures/receipts/zero-start.json +1 -1
- package/fixtures/surface.json +30 -7
- package/fixtures/v3/README.md +10 -3
- package/fixtures/v3/antworten/belege.json +623 -125
- package/fixtures/v3/antworten/belegmail.json +2 -2
- package/fixtures/v3/antworten/kasse-belege.json +622 -122
- package/fixtures/v3/antworten/kasse.json +479 -38
- package/fixtures/v3/antworten/lager.json +1 -1
- package/fixtures/v3/antworten/rechnungen.json +4 -4
- package/fixtures/v3/antworten/storno.json +211 -3
- package/fixtures/v3/stored/belege.json +2 -2
- package/fixtures/v3/stored/kasse.json +262 -382
- package/fixtures/v3/stored/rechnungen.json +157 -17
- package/fixtures/v3/v3-vokabular.json +311 -28
- package/fixtures/v3/zahlbetrag-faelle.json +1070 -4
- package/package.json +3 -1
- package/dist/cjs/stored/gutscheine.d.ts +0 -3
- package/dist/cjs/stored/gutscheine.js +0 -60
- package/dist/esm/stored/gutscheine.d.ts +0 -3
- package/dist/esm/stored/gutscheine.js +0 -56
|
@@ -13,6 +13,7 @@ exports.getReceiptWithCompany = getReceiptWithCompany;
|
|
|
13
13
|
exports.generateFullReceiptId = generateFullReceiptId;
|
|
14
14
|
exports.getFirstReceiptDate = getFirstReceiptDate;
|
|
15
15
|
exports.sendReceiptEmail = sendReceiptEmail;
|
|
16
|
+
exports.logReceiptOutputs = logReceiptOutputs;
|
|
16
17
|
exports.checkVoucherCombinationError = checkVoucherCombinationError;
|
|
17
18
|
exports.cardRefundReference = cardRefundReference;
|
|
18
19
|
exports.belegAusHuelle = belegAusHuelle;
|
|
@@ -20,6 +21,8 @@ exports.belegMitFirmaAusHuelle = belegMitFirmaAusHuelle;
|
|
|
20
21
|
exports.paymentsExpectedCents = paymentsExpectedCents;
|
|
21
22
|
const index_js_1 = require("../enums/index.js");
|
|
22
23
|
const index_js_2 = require("../models/index.js");
|
|
24
|
+
const receipt_output_js_1 = require("../models/receipt-output.js");
|
|
25
|
+
const validator_1 = require("@kreiseck/validator");
|
|
23
26
|
const vienna_time_js_1 = require("../vienna-time.js");
|
|
24
27
|
const money_js_1 = require("../money.js");
|
|
25
28
|
const errors_js_1 = require("./errors.js");
|
|
@@ -58,14 +61,44 @@ function receiptLayoutFromResult(result, options = {}) {
|
|
|
58
61
|
* die Hand des Aufrufers, sondern zu einem der benannten Aufrufe darunter.
|
|
59
62
|
*/
|
|
60
63
|
async function createReceipt(rufen, options) {
|
|
61
|
-
const daten = await rufen
|
|
64
|
+
const daten = await createReceiptRufen(rufen, options);
|
|
62
65
|
return (0, errors_js_1.signiertGelesen)('createReceipt', () => belegAusHuelle(daten, 'createReceipt'));
|
|
63
66
|
}
|
|
64
67
|
/** Wie [createReceipt], liest aus derselben Antwort zusaetzlich die Firmendaten. */
|
|
65
68
|
async function createReceiptWithCompany(rufen, options) {
|
|
66
|
-
const daten = await rufen
|
|
69
|
+
const daten = await createReceiptRufen(rufen, options);
|
|
67
70
|
return (0, errors_js_1.signiertGelesen)('createReceipt', () => belegMitFirmaAusHuelle(daten, 'createReceipt'));
|
|
68
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Sendet `createReceipt`; die Gutschein-Codes der Nutzlast gelten als Geheimnis
|
|
74
|
+
* (normiert und formatiert): der Transport siebt Ursachen und Details, ein
|
|
75
|
+
* Servertext, der den Code wiederholt, wird hier geschwaerzt.
|
|
76
|
+
*/
|
|
77
|
+
async function createReceiptRufen(rufen, options) {
|
|
78
|
+
// Der Code geht so hinaus, wie er getippt wurde: die getippte Schreibweise (auch ungueltig,
|
|
79
|
+
// etwa mit falscher Pruefziffer) zaehlt ebenso als Geheimnis wie normiert und formatiert.
|
|
80
|
+
// Kurze Reste (Endung mit vier Zeichen) werden nie eingetragen.
|
|
81
|
+
const geheim = [...new Set((options.vouchers ?? []).flatMap((v) => {
|
|
82
|
+
if (typeof v.code !== 'string')
|
|
83
|
+
return [];
|
|
84
|
+
const roh = v.code.trim();
|
|
85
|
+
const geprueft = validator_1.VoucherCode.validate(v.code);
|
|
86
|
+
const liste = geprueft.ok ? [geprueft.normalized, validator_1.VoucherCode.format(geprueft.normalized)] : [];
|
|
87
|
+
if (roh.length >= 8)
|
|
88
|
+
liste.push(roh);
|
|
89
|
+
return liste;
|
|
90
|
+
}))].sort((a, b) => b.length - a.length);
|
|
91
|
+
try {
|
|
92
|
+
return await rufen('createReceipt', createReceiptParams(options), undefined, geheim);
|
|
93
|
+
}
|
|
94
|
+
catch (fehler) {
|
|
95
|
+
if (fehler instanceof errors_js_1.KasseneckApiError && geheim.some((g) => fehler.serverMessage.includes(g))) {
|
|
96
|
+
const text = geheim.reduce((t, g) => t.split(g).join('****'), fehler.serverMessage);
|
|
97
|
+
throw new errors_js_1.KasseneckApiError('createReceipt', text, fehler.details, fehler.code);
|
|
98
|
+
}
|
|
99
|
+
throw fehler;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
69
102
|
/**
|
|
70
103
|
* Baut die Nutzlast von `createReceipt` und prueft die Eingabe. Wirft, bevor
|
|
71
104
|
* irgendetwas rausgeht — ein Beleg ist nicht folgenlos wiederholbar.
|
|
@@ -191,6 +224,24 @@ function pruefeRueckgabeWahl(wert, pfad) {
|
|
|
191
224
|
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `${pfad}: erlaubt sind ${index_js_2.RETURN_DISPOSITIONS.join(', ')}`, 'request');
|
|
192
225
|
}
|
|
193
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Storno einer Gutschein-Auszahlung: genau eine positive Barzahlung ohne `refundOf`
|
|
229
|
+
* (das Geld kommt in die Lade zurueck). Alles andere bleibt Rueckzahlung mit negativem Betrag;
|
|
230
|
+
* ob der Beleg eine Auszahlung war, entscheidet der Server.
|
|
231
|
+
*/
|
|
232
|
+
function istStornoAuszahlung(payments, original) {
|
|
233
|
+
if (!Array.isArray(payments) || payments.length !== 1)
|
|
234
|
+
return false;
|
|
235
|
+
// Kennt der Aufrufer das Original und es hat keine Auszahlung, bleibt es bei negativen Rueckzahlungen.
|
|
236
|
+
if (original != null && !(original.vouchers ?? []).some((v) => v.action === index_js_1.VoucherAction.payout))
|
|
237
|
+
return false;
|
|
238
|
+
const z = payments[0];
|
|
239
|
+
if (z == null || typeof z !== 'object')
|
|
240
|
+
return false;
|
|
241
|
+
const m = z['method'];
|
|
242
|
+
const art = typeof m === 'object' && m !== null ? m.value : m;
|
|
243
|
+
return art === 'cash' && typeof z['amountCents'] === 'number' && z['amountCents'] > 0 && z['refundOf'] === undefined;
|
|
244
|
+
}
|
|
194
245
|
/**
|
|
195
246
|
* Storno-Beleg zu einem bestehenden Beleg — voll oder in Teilen. Prueft die
|
|
196
247
|
* Eingabe, bevor etwas hinausgeht; der Server haelt die Restmengen und die
|
|
@@ -238,7 +289,7 @@ async function cancelReceipt(transport, options) {
|
|
|
238
289
|
throw new errors_js_1.KasseneckValidationError('cancelReceipt', `${altfeld} gibt es unter /v3 nicht mehr: Rueckzahlungen gehen als payments hinaus.`, 'request');
|
|
239
290
|
}
|
|
240
291
|
// `payments: null` gilt wie im Backend als nicht angegeben.
|
|
241
|
-
const zahlungen = options.payments != null ? gepruefteZahlungen(options.payments, true, 'cancelReceipt') : undefined;
|
|
292
|
+
const zahlungen = options.payments != null ? gepruefteZahlungen(options.payments, true, 'cancelReceipt', false, istStornoAuszahlung(options.payments, options.receipt)) : undefined;
|
|
242
293
|
if (zahlungen !== undefined)
|
|
243
294
|
pruefeKartenRueckbuchung(zahlungen, options.receipt);
|
|
244
295
|
const params = { cashregisterId, originalReceiptId, reason: options.reason };
|
|
@@ -470,6 +521,111 @@ async function sendReceiptEmail(transport, options) {
|
|
|
470
521
|
via,
|
|
471
522
|
};
|
|
472
523
|
}
|
|
524
|
+
const AUSGABEN_FELDER = ['entries'];
|
|
525
|
+
const AUSGABE_FELDER = ['key', 'receiptId', 'kind', 'at', 'result'];
|
|
526
|
+
/** Idempotenzschluessel eines Eintrags, wie der Server ihn annimmt. */
|
|
527
|
+
const AUSGABE_SCHLUESSEL = /^[A-Za-z0-9_-]{8,64}$/;
|
|
528
|
+
/** Zeitpunkt als Text: RFC 3339 mit Zone, bis zu sechs Nachkommastellen (wie der Server). */
|
|
529
|
+
const AUSGABE_ZEIT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,6})?(Z|[+-]\d{2}:\d{2})$/;
|
|
530
|
+
/**
|
|
531
|
+
* Meldet Drucke und das Teilen eines Belegs an das Protokoll „Ausgaben“
|
|
532
|
+
* (Endpunkt `logReceiptOutputs`, nur ueber den Kassenweg `/api/v3`; mit
|
|
533
|
+
* `registerUserAuth` und mit `apiKeyAuth`). Registrierkassen-Erlass
|
|
534
|
+
* BMF-AV Nr. 2/2026, Abschnitt 4.2: die Belegerteilung ist zu dokumentieren.
|
|
535
|
+
* Der Beleg selbst bleibt unberuehrt; das Protokoll steht nie im DEP.
|
|
536
|
+
*
|
|
537
|
+
* **Ein Eintrag scheitert nie die anderen.** Der Server nimmt jeden Eintrag
|
|
538
|
+
* einzeln an oder lehnt ihn mit Code ab (`rejected`, Codes
|
|
539
|
+
* [RECEIPT_OUTPUT_ENTRY_ERROR_CODES]); nach einer Erfolgsantwort ist jeder
|
|
540
|
+
* gesendete Eintrag erledigt. Die Kasse puffert die Eintraege (offline,
|
|
541
|
+
* Neustart) und sendet sie spaeter; der Puffer blockiert nie Druck oder Teilen.
|
|
542
|
+
*
|
|
543
|
+
* **Wiederholen ist gefahrlos:** jeder Eintrag traegt seinen Schluessel. Bei
|
|
544
|
+
* unklarem Ausgang (`outcome: 'unknown'`) dieselben Eintraege mit denselben
|
|
545
|
+
* Schluesseln noch einmal senden.
|
|
546
|
+
*
|
|
547
|
+
* **Vor dem Senden abgewiesen** wird nur, was die ganze Anfrage scheitern
|
|
548
|
+
* liesse oder ohne Netz sicher falsch ist: keine oder mehr als 50 Eintraege,
|
|
549
|
+
* ein unbekanntes Feld (oben oder im Eintrag), ein fehlender Beleg, ein
|
|
550
|
+
* Schluessel ausserhalb der Regel des Servers, eine Art oder ein Ergebnis
|
|
551
|
+
* ausserhalb des Katalogs, eine Zeit, die weder ganze Millisekunden noch
|
|
552
|
+
* ISO 8601 mit Zone ist. `email` und `opened` gehen hinaus und kommen als
|
|
553
|
+
* `invalid_output_kind` zurueck: so verwirft der Puffer genau diesen Eintrag.
|
|
554
|
+
* Fehler der ganzen Anfrage: [RECEIPT_OUTPUT_ERROR_CODES].
|
|
555
|
+
*/
|
|
556
|
+
async function logReceiptOutputs(transport, options) {
|
|
557
|
+
const name = 'logReceiptOutputs';
|
|
558
|
+
const anfrage = (grund) => new errors_js_1.KasseneckValidationError(name, grund, 'request');
|
|
559
|
+
if (options === null || typeof options !== 'object' || Array.isArray(options))
|
|
560
|
+
throw anfrage('Anfrage muss ein Objekt sein');
|
|
561
|
+
// Ein unbekanntes Feld (etwa eine zweite cashregisterId) ginge sonst still verloren.
|
|
562
|
+
const fremd = Object.keys(options).find((k) => !AUSGABEN_FELDER.includes(k));
|
|
563
|
+
if (fremd != null)
|
|
564
|
+
throw anfrage(`unbekanntes Feld "${fremd}"`);
|
|
565
|
+
const roh = options.entries;
|
|
566
|
+
if (!Array.isArray(roh) || roh.length === 0 || roh.length > receipt_output_js_1.RECEIPT_OUTPUT_ENTRIES_MAX) {
|
|
567
|
+
throw anfrage(`entries muss 1–${receipt_output_js_1.RECEIPT_OUTPUT_ENTRIES_MAX} Eintraege haben`);
|
|
568
|
+
}
|
|
569
|
+
const entries = roh.map((e, i) => {
|
|
570
|
+
const wo = `entries[${i}]`;
|
|
571
|
+
if (e === null || typeof e !== 'object' || Array.isArray(e))
|
|
572
|
+
throw anfrage(`${wo} muss ein Objekt sein`);
|
|
573
|
+
const eintrag = {};
|
|
574
|
+
for (const [feld, w] of Object.entries(e)) {
|
|
575
|
+
if (!AUSGABE_FELDER.includes(feld))
|
|
576
|
+
throw anfrage(`${wo}: unbekanntes Feld "${feld}"`);
|
|
577
|
+
if (w !== undefined)
|
|
578
|
+
eintrag[feld] = w;
|
|
579
|
+
}
|
|
580
|
+
// Schluessel und Beleg nie getrimmt: ein veraenderter Schluessel waere ein anderer.
|
|
581
|
+
for (const feld of ['key', 'receiptId']) {
|
|
582
|
+
const w = eintrag[feld];
|
|
583
|
+
if (typeof w !== 'string' || w.trim() === '')
|
|
584
|
+
throw anfrage(`${wo}.${feld} fehlt`);
|
|
585
|
+
}
|
|
586
|
+
// Dieselbe Regel wie der Server: so traegt jede Antwort (`rejected[].key`)
|
|
587
|
+
// genau den Schluessel, unter dem die Kasse den Eintrag puffert.
|
|
588
|
+
if (!AUSGABE_SCHLUESSEL.test(eintrag.key))
|
|
589
|
+
throw anfrage(`${wo}.key muss 8–64 Zeichen [A-Za-z0-9_-] haben`);
|
|
590
|
+
// Ein Wert ausserhalb des Katalogs liesse den Rand die ganze Anfrage abweisen.
|
|
591
|
+
if (!receipt_output_js_1.RECEIPT_OUTPUT_KINDS.includes(eintrag.kind)) {
|
|
592
|
+
throw anfrage(`${wo}.kind muss ${receipt_output_js_1.RECEIPT_OUTPUT_KINDS.join(', ')} sein`);
|
|
593
|
+
}
|
|
594
|
+
if (eintrag.result !== undefined && !receipt_output_js_1.RECEIPT_OUTPUT_RESULTS.includes(eintrag.result)) {
|
|
595
|
+
throw anfrage(`${wo}.result muss ${receipt_output_js_1.RECEIPT_OUTPUT_RESULTS.join(', ')} sein`);
|
|
596
|
+
}
|
|
597
|
+
const at = eintrag.at;
|
|
598
|
+
// Text nur als ISO 8601 mit Zone (Regel des Servers): ohne Zone waere die
|
|
599
|
+
// Zeit je nach Geraet eine andere; das ist ein Fehler der Kasse, kein Fall
|
|
600
|
+
// fuer den Puffer.
|
|
601
|
+
const zeitOk = (typeof at === 'number' && Number.isSafeInteger(at) && at >= 0) || (typeof at === 'string' && AUSGABE_ZEIT.test(at));
|
|
602
|
+
if (!zeitOk)
|
|
603
|
+
throw anfrage(`${wo}.at muss Millisekunden seit 1970 oder ISO 8601 mit Zone sein`);
|
|
604
|
+
return eintrag;
|
|
605
|
+
});
|
|
606
|
+
return ausgabenGemeldet(name, await transport(name, { entries }));
|
|
607
|
+
}
|
|
608
|
+
/** Antwort von `logReceiptOutputs`, streng: `accepted` ganze Zahl ab 0, `rejected` Liste aus Schluessel und Code. */
|
|
609
|
+
function ausgabenGemeldet(name, daten) {
|
|
610
|
+
if (daten === null || typeof daten !== 'object' || Array.isArray(daten))
|
|
611
|
+
throw antwortfehler(name, 'Antwort ist kein Objekt');
|
|
612
|
+
const { accepted, rejected } = daten;
|
|
613
|
+
if (typeof accepted !== 'number' || !Number.isSafeInteger(accepted) || accepted < 0) {
|
|
614
|
+
throw antwortfehler(name, 'Antwort enthaelt keine Zahl accepted');
|
|
615
|
+
}
|
|
616
|
+
if (!Array.isArray(rejected))
|
|
617
|
+
throw antwortfehler(name, 'Antwort enthaelt keine Liste rejected');
|
|
618
|
+
return {
|
|
619
|
+
accepted,
|
|
620
|
+
rejected: rejected.map((r, i) => {
|
|
621
|
+
const { key, code } = (r ?? {});
|
|
622
|
+
if (typeof key !== 'string' || typeof code !== 'string' || code === '') {
|
|
623
|
+
throw antwortfehler(name, `rejected[${i}] ohne Schluessel oder Code`);
|
|
624
|
+
}
|
|
625
|
+
return { key, code };
|
|
626
|
+
}),
|
|
627
|
+
};
|
|
628
|
+
}
|
|
473
629
|
/**
|
|
474
630
|
* Prueft die Gutschein-Kombination eines Belegs und liefert den ersten
|
|
475
631
|
* Regelverstoss als Text (oder `null`) — Zwilling von
|
|
@@ -663,14 +819,15 @@ const MAX_ZAHLUNGEN = 20;
|
|
|
663
819
|
* (Summe, Anbieter-Pflicht und Trinkgeld prueft der Server). Wirft, bevor
|
|
664
820
|
* etwas hinausgeht.
|
|
665
821
|
*/
|
|
666
|
-
function gepruefteZahlungen(roh, storno, functionName, auszahlung = false) {
|
|
822
|
+
function gepruefteZahlungen(roh, storno, functionName, auszahlung = false, stornoAuszahlung = false) {
|
|
667
823
|
const fehler = (grund) => new errors_js_1.KasseneckValidationError(functionName, grund, 'request');
|
|
668
824
|
if (!Array.isArray(roh))
|
|
669
825
|
throw fehler('payments muss eine Liste sein.');
|
|
670
826
|
if (roh.length > MAX_ZAHLUNGEN)
|
|
671
827
|
throw fehler(`payments: es sind hoechstens ${MAX_ZAHLUNGEN} Eintraege erlaubt.`);
|
|
672
828
|
// Auszahlung eines Gutscheins: der Betrag geht bar hinaus, ohne gegeben und ohne Trinkgeld (Server pruefeZahlungen).
|
|
673
|
-
|
|
829
|
+
// Storno einer Auszahlung: der Kunde gibt das Geld zurueck, die eine Barzahlung ist positiv (zahlungen-core stornoAuszahlung).
|
|
830
|
+
const negativ = (storno && !stornoAuszahlung) || auszahlung;
|
|
674
831
|
if (auszahlung) {
|
|
675
832
|
const e = roh[0];
|
|
676
833
|
if (roh.length !== 1)
|
|
@@ -843,6 +1000,7 @@ function belegAusHuelle(daten, functionName) {
|
|
|
843
1000
|
function belegMitFirmaAusHuelle(daten, functionName) {
|
|
844
1001
|
const receipt = belegAusHuelle(daten, functionName);
|
|
845
1002
|
const d = (daten ?? {});
|
|
1003
|
+
const outputs = (0, receipt_output_js_1.receiptOutputsFromWire)(d.outputs);
|
|
846
1004
|
const layout = d.layout && typeof d.layout === 'object' && Array.isArray(d.layout.lines) ? d.layout : null;
|
|
847
1005
|
const angaben = d.registrationInfo && typeof d.registrationInfo === 'object' ? (0, index_js_2.readRegistrationInfo)(d.registrationInfo) : null;
|
|
848
1006
|
return {
|
|
@@ -854,6 +1012,7 @@ function belegMitFirmaAusHuelle(daten, functionName) {
|
|
|
854
1012
|
layout,
|
|
855
1013
|
registrationInfo: angaben,
|
|
856
1014
|
logoScale: d.logo_scale === 'S' || d.logo_scale === 'M' || d.logo_scale === 'L' || d.logo_scale === 'XL' ? d.logo_scale : 'M',
|
|
1015
|
+
...(outputs !== undefined ? { outputs } : {}),
|
|
857
1016
|
};
|
|
858
1017
|
}
|
|
859
1018
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
export declare const VoucherType: {
|
|
5
5
|
/** Altform: Wertgutschein (Wert im Cent, Code frei). */
|
|
6
6
|
readonly value: "value";
|
|
7
|
-
/** Altform: Rabatt-/
|
|
7
|
+
/** Altform: Rabatt-/Aktionsgutschein. */
|
|
8
8
|
readonly promo: "promo";
|
|
9
9
|
/** Neue Form: Mehrzweckgutschein (Zahlungsmittel, Steuer erst bei der Einloesung). */
|
|
10
10
|
readonly multi_purpose: "multi_purpose";
|
|
@@ -7,7 +7,7 @@ exports.VoucherType = void 0;
|
|
|
7
7
|
exports.VoucherType = {
|
|
8
8
|
/** Altform: Wertgutschein (Wert im Cent, Code frei). */
|
|
9
9
|
value: 'value',
|
|
10
|
-
/** Altform: Rabatt-/
|
|
10
|
+
/** Altform: Rabatt-/Aktionsgutschein. */
|
|
11
11
|
promo: 'promo',
|
|
12
12
|
/** Neue Form: Mehrzweckgutschein (Zahlungsmittel, Steuer erst bei der Einloesung). */
|
|
13
13
|
multi_purpose: 'multi_purpose',
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
|
|
2
|
-
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isVoucherItem, isVoucherFloatItem, type Voucher, type VoucherArticle, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
|
-
export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type TransportCallOptions, type KasseneckTransport, type KasseneckBinaryTransport, type KasseneckPdfOrDataTransport, type PdfOrData, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, createPdfOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, type CashregisterReportPeriod, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/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 VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, receiptValueVoucherSign, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, RECEIPT_OUTPUT_KINDS, type ReceiptOutputKind, RECEIPT_OUTPUT_LOG_KINDS, type ReceiptOutputLogKind, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputResult, RECEIPT_OUTPUT_ENTRIES_MAX, type ReceiptOutput, type ReceiptOutputActor, RECEIPT_OUTPUT_ENTRY_ERROR_CODES, type ReceiptOutputEntryErrorCode, RECEIPT_OUTPUT_ERROR_CODES, type ReceiptOutputErrorCode, isReceiptOutputErrorCode, receiptOutputErrorCode, isReceiptOutputError, receiptOutputFieldErrors, type ReceiptOutputFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, TIP_REFUND_SOURCES, type TipRefundSource, isTipRefundSource, openStaffTipCents, cancellationItemsForTip, cancellationCashRefundCents, asksTipRefundSource, asksRefundTip, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
|
|
3
|
+
export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type TransportCallOptions, type KasseneckTransport, type KasseneckBinaryTransport, type KasseneckPdfOrDataTransport, type PdfOrData, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, createPdfOrDataTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, type ReceiptOutputEntry, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type RejectedReceiptOutput, logReceiptOutputs, downloadDailyReport, downloadMonthlyReport, getCashregisterReport, type CashregisterReportPeriod, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, listReceipts, listAllReceipts, fromListReceiptsSummaryPayload, LIST_RECEIPTS_VIEWS, LIST_RECEIPTS_ORDERS, LIST_RECEIPTS_LIMIT_MAX, LIST_RECEIPTS_DAYS_MAX, LIST_ALL_RECEIPTS_MAX_PAGES, LIST_RECEIPTS_ERROR_CODES, type ListReceiptsErrorCode, type ListReceiptsView, type ListReceiptsOrder, type ListReceiptsOptions, type ListReceiptsWindow, type ListReceiptsGrossByRate, type ListReceiptsSummary, type ListReceiptsDaySummary, type ListReceiptsPage, type ListedReceipt, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
|
|
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 VoucherRedeemContext, voucherRedeemMaxCents, VOUCHER_ZERO_RATE_BUCKET_FROM, } from './receipt/due.js';
|
|
5
5
|
export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
|
|
6
6
|
export { type PosBusinessSettings, type PosDeviceSettings, type PosSettings, type ArticleGroup, type PosArticle, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, } from './pos/index.js';
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
3
|
+
exports.RECEIPT_OUTPUT_LOG_KINDS = exports.RECEIPT_OUTPUT_KINDS = exports.receiptEmailFieldErrors = exports.isReceiptEmailError = exports.receiptEmailErrorCode = exports.isReceiptEmailErrorCode = exports.RECEIPT_EMAIL_VIAS = exports.RECEIPT_EMAIL_SEND_ERROR_CODES = exports.RECEIPT_EMAIL_ERROR_CODES = exports.paymentFieldErrors = exports.isPaymentError = exports.paymentErrorCode = exports.isPaymentErrorCode = exports.PAYMENT_ERROR_CODES = exports.toReceiptPaymentPayload = exports.fromReceiptPaymentPayload = exports.cancellationFieldErrors = exports.isCancellationError = exports.cancellationErrorCode = exports.isCancellationErrorCode = exports.isReturnDisposition = exports.isCancellationReason = exports.CANCELLATION_RESERVATION_MS = exports.CANCELLATION_ERROR_CODES = exports.CANCELLATION_STATUSES = exports.CANCELLATION_REASONS = exports.RETURN_DISPOSITIONS = exports.receiptValueVoucherSign = exports.receiptSumCents = exports.receiptSubSumCents = exports.fromReceiptPayload = exports.toReceiptPayload = exports.voucherIsValid = exports.fromVoucherPayload = exports.toVoucherPayload = exports.isVoucherFloatItem = exports.isVoucherItem = exports.isTipItem = exports.negateReceiptItem = exports.receiptItemIsValid = exports.receiptItemTotalCents = exports.fromReceiptItemPayload = exports.toReceiptItemPayload = exports.StripeLinkMode = exports.VoucherAction = exports.VoucherType = exports.CreditCardProvider = exports.KeckPaymentMethod = exports.VatRate = exports.ReceiptType = void 0;
|
|
4
|
+
exports.createPdfOrDataTransport = exports.createBinaryTransport = exports.createTransport = exports.UNKNOWN_OUTCOME_CALLS = exports.POS_CALLS = exports.PUBLIC_CALLS = exports.ALL_CALLS = exports.DEFAULT_TIMEOUT_MS = exports.POS_BASE_URL = exports.DEFAULT_BASE_URL = exports.registerUserAuth = exports.apiKeyAuth = exports.hobexReceiptNeedsSignature = exports.hobexReceiptToCardPaymentData = exports.fromHobexReceiptPayload = exports.toHobexReceiptPayload = exports.fromStripeUrlSessionPayload = exports.toStripeUrlSessionPayload = exports.reportMonthReadable = exports.reportMonthKey = exports.nextReportMonth = exports.previousReportMonth = exports.reportMonthFromDate = exports.isZeroKind = exports.ZERO_KINDS = exports.fromReceiptSummaryPayload = exports.fromCashregisterPayload = exports.receiptCompanyTaxInfo = exports.fromReceiptCompanyPayload = exports.asksRefundTip = exports.asksTipRefundSource = exports.cancellationCashRefundCents = exports.cancellationItemsForTip = exports.openStaffTipCents = exports.isTipRefundSource = exports.TIP_REFUND_SOURCES = exports.remainingQuantities = exports.receiptFieldErrors = exports.isReceiptError = exports.receiptErrorCode = exports.isReceiptErrorCode = exports.RECEIPT_ERROR_CODES = exports.receiptOutputFieldErrors = exports.isReceiptOutputError = exports.receiptOutputErrorCode = exports.isReceiptOutputErrorCode = exports.RECEIPT_OUTPUT_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRY_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRIES_MAX = exports.RECEIPT_OUTPUT_RESULTS = void 0;
|
|
5
|
+
exports.voucherRedeemMaxCents = exports.isReceiptDueError = exports.RECEIPT_DUE_ERROR_REASONS = exports.ReceiptDueError = exports.receiptDueBreakdown = exports.receiptDueCents = exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.LIST_RECEIPTS_ERROR_CODES = exports.LIST_ALL_RECEIPTS_MAX_PAGES = exports.LIST_RECEIPTS_DAYS_MAX = exports.LIST_RECEIPTS_LIMIT_MAX = exports.LIST_RECEIPTS_ORDERS = exports.LIST_RECEIPTS_VIEWS = exports.fromListReceiptsSummaryPayload = exports.listAllReceipts = exports.listReceipts = exports.getReportV2 = exports.getCashregisterReport = exports.downloadMonthlyReport = exports.downloadDailyReport = exports.logReceiptOutputs = exports.sendReceiptEmail = exports.checkVoucherCombinationError = exports.listMyCashregisters = exports.listMyReceipts = exports.getFirstReceiptDate = exports.generateFullReceiptId = exports.getReceiptWithCompany = exports.getReceipt = exports.zeroReceipt = exports.cancelReceipt = exports.receiptLayoutFromResult = exports.cardRefundReference = exports.paymentsExpectedCents = exports.sellReceiptWithCompany = exports.sellReceipt = exports.isOutcomeUnknown = exports.isKasseneckValidationError = exports.isKasseneckNetworkError = exports.isKasseneckHttpError = exports.isKasseneckAuthError = exports.isKasseneckApiError = exports.CLIENT_ERROR_CODES = exports.KasseneckValidationError = exports.KasseneckNetworkError = exports.KasseneckHttpError = exports.KasseneckAuthError = exports.KasseneckApiError = void 0;
|
|
6
|
+
exports.voucherPermsOf = exports.stockViewOf = exports.receiptsScopeOf = exports.cancelScopeOf = exports.distributeDiscount = exports.setMyRegisterDeviceSettings = exports.setMyPosSettings = exports.getPosSettings = exports.listMyArticles = exports.listMyArticleGroups = exports.fromPosArticlePayload = exports.fromArticleGroupPayload = exports.mergePosSettings = exports.POS_DEVICE_DEFAULTS = exports.POS_BUSINESS_DEFAULTS = exports.toViennaWallClock = exports.parseServerTimeStamp = exports.VOUCHER_ZERO_RATE_BUCKET_FROM = void 0;
|
|
6
7
|
var index_js_1 = require("./enums/index.js");
|
|
7
8
|
Object.defineProperty(exports, "ReceiptType", { enumerable: true, get: function () { return index_js_1.ReceiptType; } });
|
|
8
9
|
Object.defineProperty(exports, "VatRate", { enumerable: true, get: function () { return index_js_1.VatRate; } });
|
|
@@ -53,6 +54,16 @@ Object.defineProperty(exports, "isReceiptEmailErrorCode", { enumerable: true, ge
|
|
|
53
54
|
Object.defineProperty(exports, "receiptEmailErrorCode", { enumerable: true, get: function () { return index_js_2.receiptEmailErrorCode; } });
|
|
54
55
|
Object.defineProperty(exports, "isReceiptEmailError", { enumerable: true, get: function () { return index_js_2.isReceiptEmailError; } });
|
|
55
56
|
Object.defineProperty(exports, "receiptEmailFieldErrors", { enumerable: true, get: function () { return index_js_2.receiptEmailFieldErrors; } });
|
|
57
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_KINDS", { enumerable: true, get: function () { return index_js_2.RECEIPT_OUTPUT_KINDS; } });
|
|
58
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_LOG_KINDS", { enumerable: true, get: function () { return index_js_2.RECEIPT_OUTPUT_LOG_KINDS; } });
|
|
59
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_RESULTS", { enumerable: true, get: function () { return index_js_2.RECEIPT_OUTPUT_RESULTS; } });
|
|
60
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_ENTRIES_MAX", { enumerable: true, get: function () { return index_js_2.RECEIPT_OUTPUT_ENTRIES_MAX; } });
|
|
61
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_ENTRY_ERROR_CODES", { enumerable: true, get: function () { return index_js_2.RECEIPT_OUTPUT_ENTRY_ERROR_CODES; } });
|
|
62
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_ERROR_CODES", { enumerable: true, get: function () { return index_js_2.RECEIPT_OUTPUT_ERROR_CODES; } });
|
|
63
|
+
Object.defineProperty(exports, "isReceiptOutputErrorCode", { enumerable: true, get: function () { return index_js_2.isReceiptOutputErrorCode; } });
|
|
64
|
+
Object.defineProperty(exports, "receiptOutputErrorCode", { enumerable: true, get: function () { return index_js_2.receiptOutputErrorCode; } });
|
|
65
|
+
Object.defineProperty(exports, "isReceiptOutputError", { enumerable: true, get: function () { return index_js_2.isReceiptOutputError; } });
|
|
66
|
+
Object.defineProperty(exports, "receiptOutputFieldErrors", { enumerable: true, get: function () { return index_js_2.receiptOutputFieldErrors; } });
|
|
56
67
|
Object.defineProperty(exports, "RECEIPT_ERROR_CODES", { enumerable: true, get: function () { return index_js_2.RECEIPT_ERROR_CODES; } });
|
|
57
68
|
Object.defineProperty(exports, "isReceiptErrorCode", { enumerable: true, get: function () { return index_js_2.isReceiptErrorCode; } });
|
|
58
69
|
Object.defineProperty(exports, "receiptErrorCode", { enumerable: true, get: function () { return index_js_2.receiptErrorCode; } });
|
|
@@ -123,10 +134,20 @@ Object.defineProperty(exports, "listMyReceipts", { enumerable: true, get: functi
|
|
|
123
134
|
Object.defineProperty(exports, "listMyCashregisters", { enumerable: true, get: function () { return index_js_3.listMyCashregisters; } });
|
|
124
135
|
Object.defineProperty(exports, "checkVoucherCombinationError", { enumerable: true, get: function () { return index_js_3.checkVoucherCombinationError; } });
|
|
125
136
|
Object.defineProperty(exports, "sendReceiptEmail", { enumerable: true, get: function () { return index_js_3.sendReceiptEmail; } });
|
|
137
|
+
Object.defineProperty(exports, "logReceiptOutputs", { enumerable: true, get: function () { return index_js_3.logReceiptOutputs; } });
|
|
126
138
|
Object.defineProperty(exports, "downloadDailyReport", { enumerable: true, get: function () { return index_js_3.downloadDailyReport; } });
|
|
127
139
|
Object.defineProperty(exports, "downloadMonthlyReport", { enumerable: true, get: function () { return index_js_3.downloadMonthlyReport; } });
|
|
128
140
|
Object.defineProperty(exports, "getCashregisterReport", { enumerable: true, get: function () { return index_js_3.getCashregisterReport; } });
|
|
129
141
|
Object.defineProperty(exports, "getReportV2", { enumerable: true, get: function () { return index_js_3.getReportV2; } });
|
|
142
|
+
Object.defineProperty(exports, "listReceipts", { enumerable: true, get: function () { return index_js_3.listReceipts; } });
|
|
143
|
+
Object.defineProperty(exports, "listAllReceipts", { enumerable: true, get: function () { return index_js_3.listAllReceipts; } });
|
|
144
|
+
Object.defineProperty(exports, "fromListReceiptsSummaryPayload", { enumerable: true, get: function () { return index_js_3.fromListReceiptsSummaryPayload; } });
|
|
145
|
+
Object.defineProperty(exports, "LIST_RECEIPTS_VIEWS", { enumerable: true, get: function () { return index_js_3.LIST_RECEIPTS_VIEWS; } });
|
|
146
|
+
Object.defineProperty(exports, "LIST_RECEIPTS_ORDERS", { enumerable: true, get: function () { return index_js_3.LIST_RECEIPTS_ORDERS; } });
|
|
147
|
+
Object.defineProperty(exports, "LIST_RECEIPTS_LIMIT_MAX", { enumerable: true, get: function () { return index_js_3.LIST_RECEIPTS_LIMIT_MAX; } });
|
|
148
|
+
Object.defineProperty(exports, "LIST_RECEIPTS_DAYS_MAX", { enumerable: true, get: function () { return index_js_3.LIST_RECEIPTS_DAYS_MAX; } });
|
|
149
|
+
Object.defineProperty(exports, "LIST_ALL_RECEIPTS_MAX_PAGES", { enumerable: true, get: function () { return index_js_3.LIST_ALL_RECEIPTS_MAX_PAGES; } });
|
|
150
|
+
Object.defineProperty(exports, "LIST_RECEIPTS_ERROR_CODES", { enumerable: true, get: function () { return index_js_3.LIST_RECEIPTS_ERROR_CODES; } });
|
|
130
151
|
Object.defineProperty(exports, "getCashboxStatus", { enumerable: true, get: function () { return index_js_3.getCashboxStatus; } });
|
|
131
152
|
Object.defineProperty(exports, "getSignatureStatus", { enumerable: true, get: function () { return index_js_3.getSignatureStatus; } });
|
|
132
153
|
Object.defineProperty(exports, "createKasseneckApi", { enumerable: true, get: function () { return index_js_3.createKasseneckApi; } });
|
|
@@ -18,7 +18,7 @@ export interface CustomerInput {
|
|
|
18
18
|
city?: string;
|
|
19
19
|
/** ISO-3166-Alpha-2, z. B. `AT`. */
|
|
20
20
|
country: string;
|
|
21
|
-
/** UID-Nummer, z. B. `
|
|
21
|
+
/** UID-Nummer, z. B. `ATU12345675`. */
|
|
22
22
|
vatId?: string;
|
|
23
23
|
/** Kuerzel fuer die Rechnungsnummer; einmal gesetzt unveraenderlich. */
|
|
24
24
|
shortCode?: string;
|
|
@@ -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"];
|
|
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"];
|
|
31
31
|
export type InvoiceErrorCode = (typeof INVOICE_ERROR_CODES)[number];
|
|
32
32
|
/**
|
|
33
33
|
* Codes, die Anmeldung und Rand auf jedem Rechnungsaufruf erzeugen koennen,
|
|
@@ -80,6 +80,8 @@ exports.INVOICE_ERROR_CODES = [
|
|
|
80
80
|
'reservation_not_found', // unbekannt oder einem anderen Konto
|
|
81
81
|
'reservation_mismatch', // keine offene Position mit gleichem Artikel am Lagerstandort der Rechnung
|
|
82
82
|
'reservation_not_active', // schon eingeloest oder freigegeben
|
|
83
|
+
// Seit 1.15.0 (Vertrag): die Rechnungsnummer ist schon vergeben (§ 11 Abs. 1 Z 3 lit. h UStG), nichts ausgestellt.
|
|
84
|
+
'invoice_number_taken',
|
|
83
85
|
];
|
|
84
86
|
/**
|
|
85
87
|
* Codes, die Anmeldung und Rand auf jedem Rechnungsaufruf erzeugen koennen,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, isVoucherItem, isVoucherFloatItem, } from './receipt-item.js';
|
|
2
|
-
export { type Voucher, type VoucherArticle, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields } from './voucher.js';
|
|
2
|
+
export { type Voucher, type VoucherArticle, type IssuedVoucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, isNewFormVoucher, voucherServerFields } 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';
|
|
5
5
|
export { type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, } from './receipt-payment.js';
|
|
6
6
|
export { type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError } from './payment-errors.js';
|
|
7
7
|
export { type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, } from './receipt-email.js';
|
|
8
8
|
export { type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, } from './receipt-errors.js';
|
|
9
|
+
export { 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, } from './receipt-output.js';
|
|
9
10
|
export { type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, } from './receipt-company.js';
|
|
10
11
|
export { type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, type CashregisterAutoLogout, type CashregisterAutoLogoutPayload, fromCashregisterPayload, } from './cashregister.js';
|
|
11
12
|
export { type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind } from './receipt-summary.js';
|
package/dist/cjs/models/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isReceiptEmailErrorCode = exports.RECEIPT_EMAIL_VIAS = exports.RECEIPT_EMAIL_SEND_ERROR_CODES = exports.RECEIPT_EMAIL_ERROR_CODES = exports.paymentFieldErrors = exports.isPaymentError = exports.paymentErrorCode = exports.isPaymentErrorCode = exports.PAYMENT_ERROR_CODES = exports.toReceiptPaymentPayload = exports.fromReceiptPaymentPayload = exports.asksRefundTip = exports.asksTipRefundSource = exports.cancellationCashRefundCents = exports.cancellationItemsForTip = exports.openStaffTipCents = exports.isTipRefundSource = exports.TIP_REFUND_SOURCES = exports.remainingQuantities = exports.cancellationFieldErrors = exports.isCancellationError = exports.cancellationErrorCode = exports.isCancellationErrorCode = exports.isReturnDisposition = exports.isCancellationReason = exports.CANCELLATION_RESERVATION_MS = exports.CANCELLATION_ERROR_CODES = exports.CANCELLATION_STATUSES = exports.CANCELLATION_REASONS = exports.RETURN_DISPOSITIONS = exports.receiptValueVoucherSign = exports.receiptSumCents = exports.receiptSubSumCents = exports.readRegistrationInfo = exports.fromReceiptPayload = exports.toReceiptPayload = exports.voucherServerFields = exports.isNewFormVoucher = exports.voucherIsValid = exports.fromVoucherPayload = exports.toVoucherPayload = exports.isVoucherFloatItem = exports.isVoucherItem = exports.isDiscountItem = exports.isTipItem = exports.negateReceiptItem = exports.receiptItemIsValid = exports.receiptItemTotalCents = exports.fromReceiptItemPayload = exports.toReceiptItemPayload = void 0;
|
|
4
|
-
exports.hobexReceiptNeedsSignature = exports.hobexReceiptToCardPaymentData = exports.fromHobexReceiptPayload = exports.toHobexReceiptPayload = exports.fromStripeUrlSessionPayload = exports.toStripeUrlSessionPayload = exports.reportMonthReadable = exports.reportMonthKey = exports.nextReportMonth = exports.previousReportMonth = exports.reportMonthFromDate = exports.isZeroKind = exports.ZERO_KINDS = exports.fromReceiptSummaryPayload = exports.fromCashregisterPayload = exports.receiptCompanyTaxInfo = exports.fromReceiptCompanyPayload = exports.receiptFieldErrors = exports.isReceiptError = exports.receiptErrorCode = exports.isReceiptErrorCode = exports.RECEIPT_ERROR_CODES = exports.receiptEmailFieldErrors = exports.isReceiptEmailError = exports.receiptEmailErrorCode = void 0;
|
|
4
|
+
exports.hobexReceiptNeedsSignature = exports.hobexReceiptToCardPaymentData = exports.fromHobexReceiptPayload = exports.toHobexReceiptPayload = exports.fromStripeUrlSessionPayload = exports.toStripeUrlSessionPayload = exports.reportMonthReadable = exports.reportMonthKey = exports.nextReportMonth = exports.previousReportMonth = exports.reportMonthFromDate = exports.isZeroKind = exports.ZERO_KINDS = exports.fromReceiptSummaryPayload = exports.fromCashregisterPayload = exports.receiptCompanyTaxInfo = exports.fromReceiptCompanyPayload = exports.receiptOutputFieldErrors = exports.isReceiptOutputError = exports.receiptOutputErrorCode = exports.isReceiptOutputErrorCode = exports.RECEIPT_OUTPUT_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRY_ERROR_CODES = exports.RECEIPT_OUTPUT_ENTRIES_MAX = exports.RECEIPT_OUTPUT_RESULTS = exports.RECEIPT_OUTPUT_LOG_KINDS = exports.RECEIPT_OUTPUT_KINDS = exports.receiptFieldErrors = exports.isReceiptError = exports.receiptErrorCode = exports.isReceiptErrorCode = exports.RECEIPT_ERROR_CODES = exports.receiptEmailFieldErrors = exports.isReceiptEmailError = exports.receiptEmailErrorCode = void 0;
|
|
5
5
|
var receipt_item_js_1 = require("./receipt-item.js");
|
|
6
6
|
Object.defineProperty(exports, "toReceiptItemPayload", { enumerable: true, get: function () { return receipt_item_js_1.toReceiptItemPayload; } });
|
|
7
7
|
Object.defineProperty(exports, "fromReceiptItemPayload", { enumerable: true, get: function () { return receipt_item_js_1.fromReceiptItemPayload; } });
|
|
@@ -68,6 +68,17 @@ Object.defineProperty(exports, "isReceiptErrorCode", { enumerable: true, get: fu
|
|
|
68
68
|
Object.defineProperty(exports, "receiptErrorCode", { enumerable: true, get: function () { return receipt_errors_js_1.receiptErrorCode; } });
|
|
69
69
|
Object.defineProperty(exports, "isReceiptError", { enumerable: true, get: function () { return receipt_errors_js_1.isReceiptError; } });
|
|
70
70
|
Object.defineProperty(exports, "receiptFieldErrors", { enumerable: true, get: function () { return receipt_errors_js_1.receiptFieldErrors; } });
|
|
71
|
+
var receipt_output_js_1 = require("./receipt-output.js");
|
|
72
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_KINDS", { enumerable: true, get: function () { return receipt_output_js_1.RECEIPT_OUTPUT_KINDS; } });
|
|
73
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_LOG_KINDS", { enumerable: true, get: function () { return receipt_output_js_1.RECEIPT_OUTPUT_LOG_KINDS; } });
|
|
74
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_RESULTS", { enumerable: true, get: function () { return receipt_output_js_1.RECEIPT_OUTPUT_RESULTS; } });
|
|
75
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_ENTRIES_MAX", { enumerable: true, get: function () { return receipt_output_js_1.RECEIPT_OUTPUT_ENTRIES_MAX; } });
|
|
76
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_ENTRY_ERROR_CODES", { enumerable: true, get: function () { return receipt_output_js_1.RECEIPT_OUTPUT_ENTRY_ERROR_CODES; } });
|
|
77
|
+
Object.defineProperty(exports, "RECEIPT_OUTPUT_ERROR_CODES", { enumerable: true, get: function () { return receipt_output_js_1.RECEIPT_OUTPUT_ERROR_CODES; } });
|
|
78
|
+
Object.defineProperty(exports, "isReceiptOutputErrorCode", { enumerable: true, get: function () { return receipt_output_js_1.isReceiptOutputErrorCode; } });
|
|
79
|
+
Object.defineProperty(exports, "receiptOutputErrorCode", { enumerable: true, get: function () { return receipt_output_js_1.receiptOutputErrorCode; } });
|
|
80
|
+
Object.defineProperty(exports, "isReceiptOutputError", { enumerable: true, get: function () { return receipt_output_js_1.isReceiptOutputError; } });
|
|
81
|
+
Object.defineProperty(exports, "receiptOutputFieldErrors", { enumerable: true, get: function () { return receipt_output_js_1.receiptOutputFieldErrors; } });
|
|
71
82
|
var receipt_company_js_1 = require("./receipt-company.js");
|
|
72
83
|
Object.defineProperty(exports, "fromReceiptCompanyPayload", { enumerable: true, get: function () { return receipt_company_js_1.fromReceiptCompanyPayload; } });
|
|
73
84
|
Object.defineProperty(exports, "receiptCompanyTaxInfo", { enumerable: true, get: function () { return receipt_company_js_1.receiptCompanyTaxInfo; } });
|
|
@@ -16,7 +16,7 @@ import { KasseneckApiError } from '../client/errors.js';
|
|
|
16
16
|
* ...) stehen in [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
|
|
17
17
|
* `KasseneckApiError.code` lesbar.
|
|
18
18
|
*/
|
|
19
|
-
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "final_receipt_expired", "final_receipt_not_allowed", "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"];
|
|
19
|
+
export declare const RECEIPT_ERROR_CODES: readonly ["cancellation_reference_unavailable", "cashregister_closed", "cashregister_decommissioned", "final_receipt_expired", "final_receipt_not_allowed", "idempotency_conflict", "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"];
|
|
20
20
|
export type ReceiptErrorCode = (typeof RECEIPT_ERROR_CODES)[number];
|
|
21
21
|
export declare function isReceiptErrorCode(value: unknown): value is ReceiptErrorCode;
|
|
22
22
|
/** Der Code eines geworfenen Fehlers, wenn er in [RECEIPT_ERROR_CODES] steht; sonst `undefined`. */
|
|
@@ -29,6 +29,9 @@ exports.RECEIPT_ERROR_CODES = Object.freeze([
|
|
|
29
29
|
'cashregister_decommissioned',
|
|
30
30
|
'final_receipt_expired',
|
|
31
31
|
'final_receipt_not_allowed',
|
|
32
|
+
// Seit 1.15.0 (Vertrag): derselbe idempotencyKey mit anderem Inhalt, nichts geschrieben. Der Server nimmt den
|
|
33
|
+
// Schluessel optional an; dieses Paket sendet (noch) keinen, der Code bleibt damit nur lesbar.
|
|
34
|
+
'idempotency_conflict',
|
|
32
35
|
'module_inactive',
|
|
33
36
|
'not_permitted',
|
|
34
37
|
'receipt_limit_exceeded',
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { KasseneckApiError } from '../client/errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Die Arten einer Ausgabe (Katalog `AUSGABE_ART`): `print` Erstdruck,
|
|
4
|
+
* `reprint` Duplikat, `email` Belegmail, `link_shared` Link geteilt,
|
|
5
|
+
* `pdf_shared` PDF geteilt, `opened` vom Kunden geoeffnet (Abrufe je Stunde).
|
|
6
|
+
*/
|
|
7
|
+
export declare const RECEIPT_OUTPUT_KINDS: readonly ["print", "reprint", "email", "link_shared", "pdf_shared", "opened"];
|
|
8
|
+
export type ReceiptOutputKind = (typeof RECEIPT_OUTPUT_KINDS)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Die Arten, die eine Kasse selbst meldet. `email` und `opened` schreibt das
|
|
11
|
+
* Backend selbst (beim Versand bzw. beim Abruf des Links); meldet eine Kasse
|
|
12
|
+
* sie, lehnt der Server genau diesen Eintrag ab (`invalid_output_kind`).
|
|
13
|
+
*/
|
|
14
|
+
export declare const RECEIPT_OUTPUT_LOG_KINDS: readonly ["print", "reprint", "link_shared", "pdf_shared"];
|
|
15
|
+
export type ReceiptOutputLogKind = (typeof RECEIPT_OUTPUT_LOG_KINDS)[number];
|
|
16
|
+
/** Ergebnis einer Ausgabe (Katalog `AUSGABE_ERGEBNIS`); Mail und Abruf sind immer `ok`. */
|
|
17
|
+
export declare const RECEIPT_OUTPUT_RESULTS: readonly ["ok", "failed", "unclear"];
|
|
18
|
+
export type ReceiptOutputResult = (typeof RECEIPT_OUTPUT_RESULTS)[number];
|
|
19
|
+
/** Hoechstens so viele Eintraege je Aufruf von `logReceiptOutputs`. */
|
|
20
|
+
export declare const RECEIPT_OUTPUT_ENTRIES_MAX = 50;
|
|
21
|
+
/** Wer die Ausgabe ausloeste: Kassen-Benutzer, bzw. beim Geraet mit api_key das Konto (`name: null`). */
|
|
22
|
+
export interface ReceiptOutputActor {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Ein Eintrag aus `outputs` einer `getReceipt`-Antwort (`/v3`). Eine Art oder
|
|
28
|
+
* ein Ergebnis, das dieses Paket noch nicht kennt (neuerer Server), bleibt
|
|
29
|
+
* lesbar stehen; die Kasse zeigt es ohne Beschriftung.
|
|
30
|
+
*/
|
|
31
|
+
export interface ReceiptOutput {
|
|
32
|
+
kind: ReceiptOutputKind | (string & {});
|
|
33
|
+
/** Zeitpunkt, ISO 8601 mit Wiener Zonenoffset; bei Kassenmeldungen der Zeitpunkt am Geraet, beim Abruf der erste der Stunde. */
|
|
34
|
+
at: string;
|
|
35
|
+
result: ReceiptOutputResult | (string & {});
|
|
36
|
+
/** `null` beim Abruf durch den Kunden. */
|
|
37
|
+
by: ReceiptOutputActor | null;
|
|
38
|
+
/** Nur bei `opened`: Zahl der Abrufe in dieser Stunde. */
|
|
39
|
+
count?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Liest `data.outputs` nachsichtig: das Protokoll ist eine Auskunft neben dem
|
|
43
|
+
* Beleg und darf das Lesen, Anzeigen und Nachdrucken des Belegs nie scheitern
|
|
44
|
+
* lassen. Keine Liste: `undefined` (Antwort ohne Protokoll, etwa `/api` oder
|
|
45
|
+
* `createReceipt`). Ein Eintrag ohne lesbare Art, Zeit oder Ergebnis faellt
|
|
46
|
+
* weg; ein Handelnder ohne Kennung gilt als `null`, eine Anzahl, die keine
|
|
47
|
+
* ganze Zahl ab 0 ist, fehlt. Paketintern.
|
|
48
|
+
*/
|
|
49
|
+
export declare function receiptOutputsFromWire(roh: unknown): ReceiptOutput[] | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Codes je Eintrag in `rejected[].code` einer Antwort von
|
|
52
|
+
* `logReceiptOutputs`: der Eintrag ist dauerhaft abgelehnt (aus dem Puffer
|
|
53
|
+
* nehmen, nicht noch einmal senden). `validation` heisst hier: ein Druck ohne
|
|
54
|
+
* oder mit unbekanntem Ergebnis.
|
|
55
|
+
*/
|
|
56
|
+
export declare const RECEIPT_OUTPUT_ENTRY_ERROR_CODES: readonly ["receipt_not_found", "invalid_output_kind", "output_time_out_of_range", "idempotency_key_required", "validation"];
|
|
57
|
+
export type ReceiptOutputEntryErrorCode = (typeof RECEIPT_OUTPUT_ENTRY_ERROR_CODES)[number];
|
|
58
|
+
/**
|
|
59
|
+
* Fehlercodes von `logReceiptOutputs`, wenn die ganze Anfrage scheitert
|
|
60
|
+
* (Vokabular `errorCodes.registerHandlersByEndpoint.logReceiptOutputs`),
|
|
61
|
+
* dahinter die Codes, die Anmeldung und Rand auf diesem Endpunkt erzeugen
|
|
62
|
+
* koennen (`errorCodes.auth` ohne die sieben des Partner-Zugangs,
|
|
63
|
+
* `errorCodes.edge`), zuletzt `route_missing` (Code des Pakets). Ein Code
|
|
64
|
+
* ausserhalb bleibt ueber `KasseneckApiError.code` lesbar.
|
|
65
|
+
*/
|
|
66
|
+
export declare const RECEIPT_OUTPUT_ERROR_CODES: readonly ["idempotency_key_required", "invalid_output_kind", "output_time_out_of_range", "receipt_not_found", "server_error", "validation", "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"];
|
|
67
|
+
export type ReceiptOutputErrorCode = (typeof RECEIPT_OUTPUT_ERROR_CODES)[number];
|
|
68
|
+
export declare function isReceiptOutputErrorCode(value: unknown): value is ReceiptOutputErrorCode;
|
|
69
|
+
/** Der Code eines geworfenen Fehlers, wenn er in [RECEIPT_OUTPUT_ERROR_CODES] steht; sonst `undefined`. */
|
|
70
|
+
export declare function receiptOutputErrorCode(error: unknown): ReceiptOutputErrorCode | undefined;
|
|
71
|
+
/** Ohne `code`: traegt der Fehler ueberhaupt einen Code aus [RECEIPT_OUTPUT_ERROR_CODES]? */
|
|
72
|
+
export declare function isReceiptOutputError(error: unknown, code?: ReceiptOutputErrorCode): error is KasseneckApiError;
|
|
73
|
+
/** Ein Feldfehler aus `data.errors[]` einer `validation`-Antwort von `logReceiptOutputs`. */
|
|
74
|
+
export interface ReceiptOutputFieldError {
|
|
75
|
+
field: string;
|
|
76
|
+
message: string;
|
|
77
|
+
}
|
|
78
|
+
/** Die Feldfehler einer `validation`-Antwort; leer, wenn es keine sind. */
|
|
79
|
+
export declare function receiptOutputFieldErrors(error: unknown): ReceiptOutputFieldError[];
|