@kreiseck/kasseneck-api 1.12.0 → 1.14.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 +29 -0
- package/README.md +1 -0
- package/dist/cjs/client/api.d.ts +3 -1
- package/dist/cjs/client/api.js +1 -0
- package/dist/cjs/client/aufrufe.d.ts +5 -5
- package/dist/cjs/client/aufrufe.js +7 -2
- package/dist/cjs/client/index.d.ts +1 -1
- package/dist/cjs/client/index.js +2 -1
- 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 +15 -3
- package/dist/cjs/invoice/typen.d.ts +1 -1
- package/dist/cjs/models/index.d.ts +2 -1
- package/dist/cjs/models/index.js +12 -1
- 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 +187 -0
- package/dist/cjs/pos/texte.js +88 -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 +34 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/api.d.ts +3 -1
- package/dist/esm/client/api.js +2 -1
- package/dist/esm/client/aufrufe.d.ts +5 -5
- package/dist/esm/client/aufrufe.js +7 -2
- package/dist/esm/client/index.d.ts +1 -1
- package/dist/esm/client/index.js +1 -1
- 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/models/index.d.ts +2 -1
- package/dist/esm/models/index.js +1 -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 +187 -0
- package/dist/esm/pos/texte.js +87 -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 +34 -2
- 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 +1 -1
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/manifest.json +260 -260
- package/fixtures/pos-texts.json +205 -1
- package/fixtures/receipt-due-voucher-generated.json +1 -1
- 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 +25 -5
- 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 +407 -31
- 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 +114 -4
- package/fixtures/v3/stored/rechnungen.json +17 -17
- package/fixtures/v3/v3-vokabular.json +224 -19
- 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
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,35 @@ Was vor 0.7.0 geschah, steht in der Commit-Historie (`git log`); ab hier wird
|
|
|
4
4
|
es hier geführt. Ein Eintrag nennt die Änderung **und ihren Grund** —
|
|
5
5
|
nur der Grund überlebt den nächsten Umbau.
|
|
6
6
|
|
|
7
|
+
## 1.14.0 - 2026-10-23
|
|
8
|
+
|
|
9
|
+
Vouchers at the register, catch-up: the receipt rules of the voucher form, words for the register navigation, the drawer reason of a voucher payout and three shortcut actions; in addition the line `Duplikat am:` on every reprint (`markAsDuplicate`) and the receipt outputs (`logReceiptOutputs`, `outputs` from `getReceipt`, words for the receipt detail). Additive, with one type narrowing (see below).
|
|
10
|
+
|
|
11
|
+
- **Tip rule: a voucher never covers the tip.** The pre-filled voucher amount and the due amount leave the tip out (also after a promotion discount; never negative); a single-purpose voucher that covers only goods keeps its pre-fill above 0. Reason: the tip is paid in cash or by card, never by voucher; the server rejects the other case. Eight contract cases from the server (staff and owner tip, `payments[].tipCents`, promotion plus voucher, single-purpose, the boundary 20.00 accepted and 20.01 rejected) now check `receiptDueCents` and `voucherRedeemMaxCents` against the server's answer, and the tests fail on any contract case they do not know.
|
|
12
|
+
- **Receipt rules of the voucher form (rule set of the vendored server package 0.35.0):** a single mask `····-{suffix}` in the item name and in the entry, the printed word changes from Promotionsgutschein to Aktionsgutschein, the rest at the voucher with the euro sign, the promotional voucher as its own line, no payment-type line when vouchers cover the whole receipt (it stays when cash is above 0), the cancellation of a covered receipt mirrors this, and old receipts (item name with `×`, long mask in `vouchers[].code`) still print without error. The server hands the receipt to the package unchanged; the preparation step of the older server is gone. Reason: both sides must set the same receipt line by line.
|
|
13
|
+
- **`./stored` twin sets the stored receipt like the server** (rest at the voucher, line without quantity column, payout with reason, payout and zero-rate bucket not in the voucher list). Reason: a receipt must read the same in the list as in the detail.
|
|
14
|
+
- **`cancelReceipt` accepts the cancellation of a voucher payout:** exactly one cash payment with a positive amount and no `refundOf` (the customer gives the money back); every other positive refund is still rejected before sending (with `receipt` passed and no payout entry on it, a positive single cash payment is rejected too). Reason: the server takes this form (contract case `cancel_payout_voucher`), the check for negative refunds refused it.
|
|
15
|
+
- **24 labels in `LABELS`:** `quantity.at_most`/`at_least`, `receipts.number_hint`/`clear_number`/`open`, `receipt.creating`, `receipt_done.*` (sale, paid by voucher, payout, paid out), `voucher.code_mask` (`····-{suffix}`, next to the unchanged `voucher.payment_line`), `cart.close`, `nav.*` (register, receipts, vouchers, open drawer, stocktake, settings, settings locked, logout, logging out, fullscreen, fullscreen exit) and `drawer.reason_voucher_payout`. Reason: both registers kept these words in their own constants; one catalogue keeps them equal.
|
|
16
|
+
- **Drawer reason `voucher_payout`** in `OPENING_REASONS` (the register reports it itself when a voucher is paid out; not in `MANUAL_OPENING_REASONS`). Reason: the server records the opening of the drawer with this reason, and the list equals the `/v3` vocabulary.
|
|
17
|
+
- **Shortcut actions `shiftStatus`, `openDrawer`, `voucherPayout`** in `POS_SHORTCUT_ACTIONS`, without a default key (like `splitPayment`). The server does not hold them in its default map, so an answer without these keys reads as "no key" (empty list), never as an error and never as a guessed key. Reason: an unproven key is caught by some browser; the owner assigns one when needed.
|
|
18
|
+
- **`createReceipt` keeps voucher codes out of every error:** each `vouchers[].code` goes out as a secret parameter (as typed, normalised and formatted), so the thrown message, `serverMessage` and `details` show `****` where the server quotes one of those spellings. Other spellings the server may invent are not covered. Reason: the server text may quote the code, like `checkVoucher` already guarded.
|
|
19
|
+
- **Type narrowing: `RegisterDeviceUsers.settings` is `Omit<PosSettings, 'vouchers'>`.** The `listRegisterUsersForDevice` answer carries only `{business, device}`; the package no longer invents a defaulted `vouchers` block there (read `getPosSettings` after the login for it). Code that read `settings.vouchers` from this answer fails to compile and must switch to `getPosSettings`.
|
|
20
|
+
- **Type `IssuedVoucher`** for `data.issuedVouchers[]` of `createReceipt` with `articleName?` (only service vouchers, `/v3`). Declared type only: no reader parses `issuedVouchers` yet.
|
|
21
|
+
- **Mark a reprint as a duplicate (Nachdruck als Duplikat kennzeichnen): `markAsDuplicate(layout, printedAt)`** in `./receipt`. A pure function on `ReceiptLayout`: it returns a copy with one plain (not bold) two-column line `Duplikat am:` and the time of the reprint, placed right after the line `Beleg-ID:` (column widths 5/7, the time at the right edge like `Datum:`): on 32 characters `Duplikat am: 24.10.2026 14:10:05`, on 48 characters `Duplikat am:` and the time 17 spaces apart. `printedAt` is an instant (`Date`); the line shows it in Europe/Vienna time (EU summer time rule, `DD.MM.YYYY HH:MM:SS`, fractions cut), never in the time zone of the machine. A layout without a `Beleg-ID:` columns line (shift receipts) gets the line on top. Applying it again replaces the time (one line, the latest reprint counts); the input is never changed; an invalid `printedAt` throws `KasseneckValidationError` (`scope: 'request'`). Registers must call it on **every reprint and on "print copy"** with the print time, never on the first print and never for mail, link or PDF (the customer gets the receipt itself there), and hand the result to the same print path (`escPosLayoutBytes`, `eposPrintXml`, `receiptSheet`, React views). Reason: Erlass BMF-AV Nr. 2/2026, section 4.5.6, requires a receipt duplicate to be labelled as such (not signed again, not written to the DEP, no change to the turnover counter; a reprint of the stored receipt already meets those three). On the printer the reprint is the first print plus exactly this line, byte for byte (same code page prefix as every line, no style command). Contract file `fixtures/duplicate-cases.json` (version 2: cases with the reprint instants, around the summer time changes in March and October, 58 and 80 mm, zero receipt, cancellation, voucher redemption, with logo, without `Beleg-ID:`, applied twice; `expected/duplicate.*.hex` with the bytes) for the Dart twin, written by `npm run fixtures:duplikat`.
|
|
22
|
+
- **Receipt outputs (Ausgaben eines Belegs): `logReceiptOutputs`** (root and `createKasseneckApi`, register path `/api/v3` only, with `registerUserAuth` or `apiKeyAuth`). The register reports its prints and shares of a receipt: `entries` (1-50, `RECEIPT_OUTPUT_ENTRIES_MAX`) of `{ key, receiptId, kind, at, result? }`, `kind` from `RECEIPT_OUTPUT_LOG_KINDS` (`print` first print, `reprint` duplicate, `link_shared`, `pdf_shared`), `at` as milliseconds or ISO 8601 with zone, `result` from `RECEIPT_OUTPUT_RESULTS` (`ok`, `failed`, `unclear`; required for prints). The answer `{ accepted, rejected: [{ key, code }] }` names each rejected entry with a code from `RECEIPT_OUTPUT_ENTRY_ERROR_CODES` (`receipt_not_found` also for a receipt of another register, `invalid_output_kind`, `output_time_out_of_range` only for an unreadable time, `idempotency_key_required`, `validation`; a device clock that runs wrong is never rejected, the server clamps the time to receipt time until arrival); one entry never fails the others. A call with effect (`UNKNOWN_OUTCOME_CALLS`): after an unclear outcome send the same entries with the same keys again, the server keeps each key once. Rejected before sending: no or more than 50 entries, an unknown field (top level or entry; `cashregisterId` stays with the sign-in), a missing receipt, a key outside the server's rule (8-64 characters `[A-Za-z0-9_-]`, so `rejected[].key` always equals the buffered key), a kind or result outside the catalogue, a time that is neither whole milliseconds nor ISO 8601 text with a zone (RFC 3339, up to six fraction digits; text without a zone is a register bug and fails early); `email` and `opened` go out and come back as `invalid_output_kind`, so the register's buffer drops exactly that entry. Errors of the whole request: `RECEIPT_OUTPUT_ERROR_CODES` with `isReceiptOutputError`, `receiptOutputErrorCode`, `isReceiptOutputErrorCode`, `receiptOutputFieldErrors`. Reason: Erlass BMF-AV Nr. 2/2026, section 4.2, requires the way a receipt was handed over to be documented; the server keeps the log next to the receipt (never on it, never in the DEP) and writes mail and customer opens itself.
|
|
23
|
+
- **`ReceiptWithCompany.outputs?: ReceiptOutput[]`** from `getReceipt` under `/v3` (`getReceiptWithCompany`): the latest 20 outputs, newest first, each `{ kind, at, result, by: { id, name } | null, count? }` (`RECEIPT_OUTPUT_KINDS`: `print`, `reprint`, `email`, `link_shared`, `pdf_shared`, `opened`; `count` only on `opened`, the opens in that hour). Absent when the answer has no list (sale, `/api`). Read leniently: an entry without kind, time or result is dropped, an actor without id reads as `null`, an unknown kind or result stays readable; a broken log never fails reading or reprinting the receipt. `./pos` exports `RECEIPT_OUTPUT_KINDS` and `RECEIPT_OUTPUT_RESULTS` too (contract `surface.json`, `pos.receiptOutputKinds`/`receiptOutputResults`).
|
|
24
|
+
- **9 labels in `LABELS` for the receipt detail:** `receipt.outputs_title` (Ausgaben), `receipt.outputs_count` ({count} Ausgaben), `receipt.output_print` (Erstdruck), `receipt.output_reprint` (Duplikat), `receipt.output_email` (E-Mail), `receipt.output_link_shared` (Link geteilt), `receipt.output_pdf_shared` (PDF geteilt), `receipt.output_opened` (Link geöffnet ({count}×)), `receipt.output_failed` (fehlgeschlagen); every kind has its label under `receipt.output_<kind>`. `receiptOutputLabel(output)` in `./pos` returns the label of the kind and never throws: `null` for a kind the package does not know (newer server), `opened` without a valid count (whole number from 1) counts as one open; it returns the kind only, the register adds `receipt.output_failed` itself when `result` is `failed`. Reason: the web register, the app register and the panel show the same row in the same words.
|
|
25
|
+
- **Contract file `fixtures/receipt-outputs-cases.json`** (version 1, `npm run fixtures:ausgaben`) for the Dart twin: `outputs` read cases (raw `data.outputs` -> the list read leniently and `receiptOutputLabel` of each entry) and `logReceiptOutputs` request cases (entries -> the request body sent, or the rejection before sending with its reason: key rule, time without zone, unknown field, 0 and 51 entries, the contract case `mixed`). The tests of this package run every case, so both packages read and check the same way.
|
|
26
|
+
- Contract re-fetched from the backend with `logReceiptOutputs` (register path, 42 calls, 36 only there) and the contract case `get_receipt_with_outputs`; its print layout equals `sale_cash_tendered`, so the print goldens of both channels repeat those digests.
|
|
27
|
+
- Contract guards: the keys of the `registerUserLogin`/`registerPinLogin` answer and the voucher permissions are checked against the contract; the contract case `cancel_payout_voucher` (cancellation of a multi-purpose payout, both channels) is covered.
|
|
28
|
+
- **Replacement data in fixtures, tests and docs** (`ATU12345675`, `91-123/4565`, invented names). Reason: no real identifiers in the repository; the goldens were redrawn.
|
|
29
|
+
|
|
30
|
+
## 1.13.0
|
|
31
|
+
|
|
32
|
+
Vouchers at the register, stage 3: the sentences and words of the voucher screens move into the shared text catalogue, so the web register and the app register say the same. Additive; no existing key changes.
|
|
33
|
+
|
|
34
|
+
- **14 sentences in `MESSAGES`** (`voucher.reentry_needed`, `voucher.reentry_mismatch`, `voucher.not_this_voucher`, `voucher.reentry_no_permission`, `voucher.already_covered`, `voucher.payout_reason_too_long`, `voucher.payout_reason_missing`, `voucher.payout_check_first`, `voucher.sale_max_amount`, `voucher.sale_not_at_terminal`, `voucher.no_redeem_with_sale`, `voucher.code_not_on_receipt`, `cancellation.voucher_sale_cancelled`, `cancellation.promo_valid_again`) and 8 labels in `LABELS` (`voucher.apply`, `voucher.redeemable_until`, `voucher.remove_line`, `voucher.reenter_code`, `voucher.refundable_until`, `voucher.code_done`, `voucher.article`, `voucher.add`). Reason: the web register kept these words in its own constant until the catalogue had keys for them; both registers now take them from here, and the contract file `fixtures/pos-texts.json` carries them to the app.
|
|
35
|
+
|
|
7
36
|
## 1.12.0
|
|
8
37
|
|
|
9
38
|
Vouchers in the new form at the register (multi-purpose, single-purpose, service, promotional; code shown once). Additive for existing calls, with three notes for callers:
|
package/README.md
CHANGED
|
@@ -407,6 +407,7 @@ the received body.
|
|
|
407
407
|
| `CANCELLATION_ERROR_CODES` | `isCancellationError` | `cancelReceipt` |
|
|
408
408
|
| `PAYMENT_ERROR_CODES` | `isPaymentError` | `payments[]` of a sale or cancellation |
|
|
409
409
|
| `RECEIPT_EMAIL_ERROR_CODES` | `isReceiptEmailError` | `sendReceiptEmail` |
|
|
410
|
+
| `RECEIPT_OUTPUT_ERROR_CODES` | `isReceiptOutputError` | `logReceiptOutputs` (each rejected entry: `RECEIPT_OUTPUT_ENTRY_ERROR_CODES`) |
|
|
410
411
|
| `REGISTER_ERROR_CODES` | `isRegisterError` (`…/register`) | pairing and sign-in |
|
|
411
412
|
| `POS_ERROR_CODES` | `isPosError` (`…/pos`) | settings, articles, printers, tip recipients |
|
|
412
413
|
| `PARTNER_ERROR_CODES` + `PARTNER_REQUEST_ERROR_CODES` | `isPartnerError` (`…/partner`) | partner API |
|
package/dist/cjs/client/api.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type HobexPayOptions, type HobexRefundOptions } from '../payments/hobex
|
|
|
4
4
|
import { type TransportOptions } from './transport.js';
|
|
5
5
|
import { type CashregisterReportPeriod, type ReportV2, type ReportV2Options } from './reports.js';
|
|
6
6
|
import { type CashboxStatus, type SignatureStatus } from './status.js';
|
|
7
|
-
import { type SendReceiptEmailOptions, type SendReceiptEmailResult, type ListMyReceiptsOptions, type ReceiptList, type ReceiptWithCompany, type SellReceiptOptions, type CancelReceiptOptions, type CancelReceiptResult } from './receipts.js';
|
|
7
|
+
import { type SendReceiptEmailOptions, type SendReceiptEmailResult, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type ListMyReceiptsOptions, type ReceiptList, type ReceiptWithCompany, type SellReceiptOptions, type CancelReceiptOptions, type CancelReceiptResult } from './receipts.js';
|
|
8
8
|
/**
|
|
9
9
|
* Schlichte Factory ueber den Endpunkt-Funktionen: bindet einen Transport
|
|
10
10
|
* einmal und liefert die Aufrufe ohne den wiederkehrenden ersten Parameter.
|
|
@@ -48,6 +48,8 @@ export interface KasseneckApi {
|
|
|
48
48
|
getFirstReceiptDate(): Promise<ReportMonth>;
|
|
49
49
|
/** Beleg als Link auf die oeffentliche Belegseite per E-Mail schicken. */
|
|
50
50
|
sendReceiptEmail(options: SendReceiptEmailOptions): Promise<SendReceiptEmailResult>;
|
|
51
|
+
/** Drucke und Teilen eines Belegs an das Protokoll „Ausgaben“ melden (nur Kassenweg). */
|
|
52
|
+
logReceiptOutputs(options: LogReceiptOutputsOptions): Promise<LogReceiptOutputsResult>;
|
|
51
53
|
/** Belegliste einer Kasse samt Kennzahlen (nur mit ID-Token, siehe receipts.ts). */
|
|
52
54
|
listMyReceipts(options: ListMyReceiptsOptions): Promise<ReceiptList>;
|
|
53
55
|
/** Kassen des angemeldeten Benutzers (nur mit ID-Token, siehe cashregisters.ts). */
|
package/dist/cjs/client/api.js
CHANGED
|
@@ -25,6 +25,7 @@ function createKasseneckApi(options) {
|
|
|
25
25
|
getFirstReceiptDate: () => (0, receipts_js_1.getFirstReceiptDate)(rufen),
|
|
26
26
|
listMyReceipts: (o) => (0, receipts_js_1.listMyReceipts)(rufen, o),
|
|
27
27
|
sendReceiptEmail: (o) => (0, receipts_js_1.sendReceiptEmail)(rufen, o),
|
|
28
|
+
logReceiptOutputs: (o) => (0, receipts_js_1.logReceiptOutputs)(rufen, o),
|
|
28
29
|
listMyCashregisters: () => (0, cashregisters_js_1.listMyCashregisters)(rufen),
|
|
29
30
|
getReportV2: (o) => (0, reports_js_1.getReportV2)(rufen, o),
|
|
30
31
|
getCashregisterReport: (options) => (0, reports_js_1.getCashregisterReport)(rufenBinaer, options),
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* umhuellt, muss ihn weiterhin absetzen koennen.
|
|
14
14
|
*/
|
|
15
15
|
import type { PdfOrData, TransportBodyFields, TransportCallOptions } from './transport.js';
|
|
16
|
-
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "orderSignatureCard", "getSignatureCardOrder", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift"];
|
|
16
|
+
export declare const ALL_CALLS: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCashregisterReport", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "getReportV2", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listBrands", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyStock", "listMyStockLocations", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "recordInvoicePayment", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "reportCustomerContract", "requestCustomerSignature", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook", "getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries", "createArticle", "updateArticle", "deactivateArticle", "receiveGoods", "transferStock", "recordStockLoss", "changeStockCondition", "reverseStockMovement", "createReservation", "extendReservation", "releaseReservation", "getReservation", "listReservations", "createVariantGroup", "updateVariantGroup", "getVariantGroup", "listVariantGroups", "addVariant", "createStocktake", "listStocktakes", "getStocktake", "listStocktakeItems", "recordStocktakeCount", "voidStocktakeCount", "listStocktakeCounts", "reviewStocktake", "recountStocktake", "closeStocktake", "cancelStocktake", "getStocktakePdf", "orderSignatureCard", "getSignatureCardOrder", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "logReceiptOutputs"];
|
|
17
17
|
export type ApiCall = typeof ALL_CALLS[number];
|
|
18
18
|
/**
|
|
19
19
|
* Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
|
|
@@ -28,7 +28,7 @@ export declare const PUBLIC_CALLS: readonly ["createReceipt", "getReceipt", "can
|
|
|
28
28
|
* `endpoints.register`. Sechs davon sind zugleich oeffentlich; die Kasse ruft
|
|
29
29
|
* sie trotzdem ueber diesen Weg (ein Dialekt je Client, Nachtrag §5.2).
|
|
30
30
|
*/
|
|
31
|
-
export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift"];
|
|
31
|
+
export declare const POS_CALLS: readonly ["pairRegisterDevice", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "registerUserLogin", "registerPinLogin", "renewRegisterSession", "endRegisterSession", "unpairRegisterDevice", "listMyCashregisters", "listMyReceipts", "getReceipt", "createReceipt", "generateFullReceiptId", "cancelReceipt", "sendReceiptEmail", "listMyArticleGroups", "listMyArticles", "getKasseSettings", "setMyKasseSettings", "setMyKasseLogo", "setMyRegisterDeviceSettings", "listMyPrinters", "createPrintJob", "getPrintJob", "listMyTipRecipients", "listMyStockLocations", "listMyStock", "setMyCashregisterStockLocation", "listMyStocktakes", "listMyStocktakeItems", "listMyStocktakeCounts", "recordMyStocktakeCount", "voidMyStocktakeCount", "checkVoucher", "reprintVoucherLabel", "getMyDrawerState", "openMyShift", "recordMyCashMovement", "logMyDrawerOpenings", "getMyShiftReport", "closeMyShift", "logReceiptOutputs"];
|
|
32
32
|
export type PublicCall = typeof PUBLIC_CALLS[number];
|
|
33
33
|
export type PosCall = typeof POS_CALLS[number];
|
|
34
34
|
/**
|
|
@@ -49,7 +49,7 @@ export type PosCall = typeof POS_CALLS[number];
|
|
|
49
49
|
* [ALL_CALLS], [PUBLIC_CALLS] und [POS_CALLS] steht entweder hier oder in
|
|
50
50
|
* [CALLS_WITHOUT_EFFECT] (Waechter `test/ausgang-einordnung.test.ts`).
|
|
51
51
|
*/
|
|
52
|
-
export declare const UNKNOWN_OUTCOME_CALLS: readonly ["activateCashregister", "addVariant", "cancelInvoice", "cancelReceipt", "cancelStocktake", "changeStockCondition", "closeMyShift", "closeStocktake", "createArticle", "createCreditNote", "createCustomer", "createCustomerCashregister", "createInvoiceItem", "createPartnerCustomer", "createPartnerWebhook", "createPrintJob", "createReceipt", "createReservation", "createStocktake", "createVariantGroup", "createWebhook", "deactivateArticle", "deletePartnerWebhook", "deleteWebhook", "extendReservation", "financeWebService", "hobexPayApi", "hobexRefundApi", "issueInvoice", "logMyDrawerOpenings", "openMyShift", "orderSignatureCard", "pairRegisterDevice", "receiveGoods", "recordInvoicePayment", "recordMyCashMovement", "recordMyStocktakeCount", "recordStockLoss", "recordStocktakeCount", "recountStocktake", "releaseReservation", "reportCustomerContract", "requestCustomerSignature", "reverseStockMovement", "reviewStocktake", "revokeCustomerMandate", "rotatePartnerWebhookSecret", "rotateWebhookSecret", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "sendWebhookTest", "setCustomerMandate", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "transferStock", "unpairRegisterDevice", "updateArticle", "updateCustomer", "updateInvoiceItem", "updatePartnerWebhook", "updateVariantGroup", "updateWebhook", "voidMyStocktakeCount", "voidStocktakeCount", "withdrawInvoiceItem"];
|
|
52
|
+
export declare const UNKNOWN_OUTCOME_CALLS: readonly ["activateCashregister", "addVariant", "cancelInvoice", "cancelReceipt", "cancelStocktake", "changeStockCondition", "closeMyShift", "closeStocktake", "createArticle", "createCreditNote", "createCustomer", "createCustomerCashregister", "createInvoiceItem", "createPartnerCustomer", "createPartnerWebhook", "createPrintJob", "createReceipt", "createReservation", "createStocktake", "createVariantGroup", "createWebhook", "deactivateArticle", "deletePartnerWebhook", "deleteWebhook", "extendReservation", "financeWebService", "hobexPayApi", "hobexRefundApi", "issueInvoice", "logMyDrawerOpenings", "logReceiptOutputs", "openMyShift", "orderSignatureCard", "pairRegisterDevice", "receiveGoods", "recordInvoicePayment", "recordMyCashMovement", "recordMyStocktakeCount", "recordStockLoss", "recordStocktakeCount", "recountStocktake", "releaseReservation", "reportCustomerContract", "requestCustomerSignature", "reverseStockMovement", "reviewStocktake", "revokeCustomerMandate", "rotatePartnerWebhookSecret", "rotateWebhookSecret", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "sendWebhookTest", "setCustomerMandate", "setMyCashregisterStockLocation", "setMyKasseLogo", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "transferStock", "unpairRegisterDevice", "updateArticle", "updateCustomer", "updateInvoiceItem", "updatePartnerWebhook", "updateVariantGroup", "updateWebhook", "voidMyStocktakeCount", "voidStocktakeCount", "withdrawInvoiceItem"];
|
|
53
53
|
/** Warum ein Aufruf keine Wirkung hat, die ein Zeitlimit offen lassen koennte. */
|
|
54
54
|
export type CallWithoutEffectReason = 'read' | 'repeatable';
|
|
55
55
|
/**
|
|
@@ -85,10 +85,10 @@ export declare const CALLS_WITHOUT_EFFECT: Readonly<Record<string, CallWithoutEf
|
|
|
85
85
|
* absetzt, sagt es mit `hasEffect: true`.
|
|
86
86
|
*/
|
|
87
87
|
export declare function isUnknownOutcomeCall(name: string): boolean;
|
|
88
|
-
/** Einer der
|
|
88
|
+
/** Einer der 42 Aufrufe des Kassenwegs. */
|
|
89
89
|
export declare function isPosCall(name: string): boolean;
|
|
90
90
|
/**
|
|
91
|
-
* Nur ueber den Kassenweg erreichbar (
|
|
91
|
+
* Nur ueber den Kassenweg erreichbar (36 Namen): unter `api.kasseneck.at/v3`
|
|
92
92
|
* gibt es sie nicht. Der Transport schickt sie darum ohne eigene Basis an
|
|
93
93
|
* [POS_BASE_URL] statt an die oeffentliche Basis.
|
|
94
94
|
*/
|
|
@@ -144,6 +144,8 @@ exports.ALL_CALLS = [
|
|
|
144
144
|
'logMyDrawerOpenings',
|
|
145
145
|
'getMyShiftReport',
|
|
146
146
|
'closeMyShift',
|
|
147
|
+
// Ausgaben eines Belegs (Drucke, Teilen) melden: nur ueber den Kassenweg.
|
|
148
|
+
'logReceiptOutputs',
|
|
147
149
|
];
|
|
148
150
|
/**
|
|
149
151
|
* Die oeffentlichen Endpunkte unter `/v3` (`https://api.kasseneck.at/v3/<name>`),
|
|
@@ -319,6 +321,8 @@ exports.POS_CALLS = [
|
|
|
319
321
|
'logMyDrawerOpenings',
|
|
320
322
|
'getMyShiftReport',
|
|
321
323
|
'closeMyShift',
|
|
324
|
+
// Ausgaben eines Belegs melden: nur ueber den Kassenweg.
|
|
325
|
+
'logReceiptOutputs',
|
|
322
326
|
];
|
|
323
327
|
/**
|
|
324
328
|
* Die Aufrufe **mit Wirkung**, alphabetisch: sie legen etwas an, aendern oder
|
|
@@ -369,6 +373,7 @@ exports.UNKNOWN_OUTCOME_CALLS = [
|
|
|
369
373
|
'hobexRefundApi',
|
|
370
374
|
'issueInvoice',
|
|
371
375
|
'logMyDrawerOpenings',
|
|
376
|
+
'logReceiptOutputs',
|
|
372
377
|
'openMyShift',
|
|
373
378
|
'orderSignatureCard',
|
|
374
379
|
'pairRegisterDevice',
|
|
@@ -522,12 +527,12 @@ function isUnknownOutcomeCall(name) {
|
|
|
522
527
|
const OEFFENTLICH = new Set(exports.PUBLIC_CALLS);
|
|
523
528
|
const KASSENWEG = new Set(exports.POS_CALLS);
|
|
524
529
|
const NUR_KASSE = new Set(exports.POS_CALLS.filter((name) => !OEFFENTLICH.has(name)));
|
|
525
|
-
/** Einer der
|
|
530
|
+
/** Einer der 42 Aufrufe des Kassenwegs. */
|
|
526
531
|
function isPosCall(name) {
|
|
527
532
|
return KASSENWEG.has(name);
|
|
528
533
|
}
|
|
529
534
|
/**
|
|
530
|
-
* Nur ueber den Kassenweg erreichbar (
|
|
535
|
+
* Nur ueber den Kassenweg erreichbar (36 Namen): unter `api.kasseneck.at/v3`
|
|
531
536
|
* gibt es sie nicht. Der Transport schickt sie darum ohne eigene Basis an
|
|
532
537
|
* [POS_BASE_URL] statt an die oeffentliche Basis.
|
|
533
538
|
*/
|
|
@@ -2,7 +2,7 @@ export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type
|
|
|
2
2
|
export { 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, createTransport, createBinaryTransport, createPdfOrDataTransport, } from './transport.js';
|
|
3
3
|
export { ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, UNKNOWN_OUTCOME_CALLS, type PublicCall, type PosCall, } from './aufrufe.js';
|
|
4
4
|
export { 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, } from './errors.js';
|
|
5
|
-
export { type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, type CancelReceiptResult, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, } from './receipts.js';
|
|
5
|
+
export { type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, type CancelReceiptResult, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, type ReceiptOutputEntry, type LogReceiptOutputsOptions, type LogReceiptOutputsResult, type RejectedReceiptOutput, logReceiptOutputs, } from './receipts.js';
|
|
6
6
|
export { listMyCashregisters } from './cashregisters.js';
|
|
7
7
|
export { downloadDailyReport, downloadMonthlyReport, getCashregisterReport, getReportV2, type CashregisterReportPeriod, type ReportV2, type ReportV2Metadata, type ReportV2Options } from './reports.js';
|
|
8
8
|
export { type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, } from './status.js';
|
package/dist/cjs/client/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.getReportV2 = exports.getCashregisterReport = exports.downloadMonthlyReport = exports.downloadDailyReport = exports.listMyCashregisters = exports.sendReceiptEmail = exports.checkVoucherCombinationError = 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 = exports.UNKNOWN_OUTCOME_CALLS = exports.POS_CALLS = exports.PUBLIC_CALLS = exports.ALL_CALLS = exports.createPdfOrDataTransport = exports.createBinaryTransport = exports.createTransport = exports.DEFAULT_TIMEOUT_MS = exports.POS_BASE_URL = exports.DEFAULT_BASE_URL = exports.registerUserAuth = exports.apiKeyAuth = void 0;
|
|
3
|
+
exports.createKasseneckApi = exports.getSignatureStatus = exports.getCashboxStatus = exports.getReportV2 = exports.getCashregisterReport = exports.downloadMonthlyReport = exports.downloadDailyReport = exports.listMyCashregisters = exports.logReceiptOutputs = exports.sendReceiptEmail = exports.checkVoucherCombinationError = 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 = exports.UNKNOWN_OUTCOME_CALLS = exports.POS_CALLS = exports.PUBLIC_CALLS = exports.ALL_CALLS = exports.createPdfOrDataTransport = exports.createBinaryTransport = exports.createTransport = exports.DEFAULT_TIMEOUT_MS = exports.POS_BASE_URL = exports.DEFAULT_BASE_URL = exports.registerUserAuth = exports.apiKeyAuth = void 0;
|
|
4
4
|
var auth_js_1 = require("./auth.js");
|
|
5
5
|
Object.defineProperty(exports, "apiKeyAuth", { enumerable: true, get: function () { return auth_js_1.apiKeyAuth; } });
|
|
6
6
|
Object.defineProperty(exports, "registerUserAuth", { enumerable: true, get: function () { return auth_js_1.registerUserAuth; } });
|
|
@@ -44,6 +44,7 @@ Object.defineProperty(exports, "getFirstReceiptDate", { enumerable: true, get: f
|
|
|
44
44
|
Object.defineProperty(exports, "listMyReceipts", { enumerable: true, get: function () { return receipts_js_1.listMyReceipts; } });
|
|
45
45
|
Object.defineProperty(exports, "checkVoucherCombinationError", { enumerable: true, get: function () { return receipts_js_1.checkVoucherCombinationError; } });
|
|
46
46
|
Object.defineProperty(exports, "sendReceiptEmail", { enumerable: true, get: function () { return receipts_js_1.sendReceiptEmail; } });
|
|
47
|
+
Object.defineProperty(exports, "logReceiptOutputs", { enumerable: true, get: function () { return receipts_js_1.logReceiptOutputs; } });
|
|
47
48
|
var cashregisters_js_1 = require("./cashregisters.js");
|
|
48
49
|
Object.defineProperty(exports, "listMyCashregisters", { enumerable: true, get: function () { return cashregisters_js_1.listMyCashregisters; } });
|
|
49
50
|
var reports_js_1 = require("./reports.js");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReceiptType, type ReceiptTypeKey, KeckPaymentMethod, type KeckPaymentMethodKey } from '../enums/index.js';
|
|
2
2
|
import { type Receipt, type ReceiptCompany, type ReceiptItem, type Voucher, type ReceiptSummary, type ReportMonth, type CancellationItem, type CancellationOf, type CancellationReason, type TipRefundSource, type ReturnDisposition, type ReceiptPaymentInput, type RegistrationInfo, type ReceiptEmailVia } from '../models/index.js';
|
|
3
|
+
import { type ReceiptOutput, type ReceiptOutputEntryErrorCode, type ReceiptOutputLogKind, type ReceiptOutputResult } from '../models/receipt-output.js';
|
|
3
4
|
import type { InternerTransport } from './aufrufe.js';
|
|
4
5
|
import { type ReceiptLayout } from '../receipt/layout.js';
|
|
5
6
|
import type { PosPaperSize } from '../printing/escpos.js';
|
|
@@ -140,8 +141,9 @@ export type CancelReceiptOptions = {
|
|
|
140
141
|
/**
|
|
141
142
|
* Rueckzahlung je Zahlung (Betraege negativ, `refundOf` = `id` der
|
|
142
143
|
* Originalzahlung). Ohne Angabe spiegelt der Server die Restbetraege jeder
|
|
143
|
-
* Originalzahlung
|
|
144
|
-
*
|
|
144
|
+
* Originalzahlung (Ausnahme Storno einer Gutschein-Auszahlung: genau eine
|
|
145
|
+
* positive Barzahlung ohne `refundOf`); ein Teilstorno eines Belegs mit
|
|
146
|
+
* mehreren Zahlungen braucht sie (`cancellation_payments_required`).
|
|
145
147
|
*
|
|
146
148
|
* **Karten-Storno:** `provider`, `providerPaymentId` und `providerData`
|
|
147
149
|
* beschreiben die ERSTATTUNG am Terminal, nie die Originalzahlung. Die
|
|
@@ -216,6 +218,13 @@ export interface ReceiptWithCompany {
|
|
|
216
218
|
* setzen das Logo in genau dieser Stufe; fehlt der Wert, gilt `M`.
|
|
217
219
|
*/
|
|
218
220
|
logoScale: SheetLogoSize;
|
|
221
|
+
/**
|
|
222
|
+
* Ausgaben des Belegs (`data.outputs`, nur `getReceipt` unter `/v3`): die
|
|
223
|
+
* neuesten 20, neueste zuerst. Fehlt, wenn die Antwort keine Liste traegt
|
|
224
|
+
* (Verkauf, `/api`). Gelesen nach [ReceiptOutput]; ein kaputter Eintrag
|
|
225
|
+
* faellt weg, der Beleg bleibt lesbar.
|
|
226
|
+
*/
|
|
227
|
+
outputs?: ReceiptOutput[];
|
|
219
228
|
}
|
|
220
229
|
/**
|
|
221
230
|
* Das Zeilenmodell zum Drucken und Anzeigen eines Belegs aus einer Antwort.
|
|
@@ -402,6 +411,80 @@ export interface SendReceiptEmailResult {
|
|
|
402
411
|
* eine zweite Mail und zaehlt auf die Schleuse.
|
|
403
412
|
*/
|
|
404
413
|
export declare function sendReceiptEmail(transport: InternerTransport, options: SendReceiptEmailOptions): Promise<SendReceiptEmailResult>;
|
|
414
|
+
/**
|
|
415
|
+
* Eine Ausgabe, wie die Kasse sie puffert und meldet: ein Druck oder ein
|
|
416
|
+
* Teilen des Belegs. Siehe [logReceiptOutputs].
|
|
417
|
+
*/
|
|
418
|
+
export interface ReceiptOutputEntry {
|
|
419
|
+
/**
|
|
420
|
+
* Idempotenzschluessel des Eintrags, am Geraet beim Puffern vergeben und
|
|
421
|
+
* beim Nachsenden unveraendert: ein zweites Melden legt keinen zweiten
|
|
422
|
+
* Eintrag an. 8–64 Zeichen `[A-Za-z0-9_-]` (Regel des Servers); ein anderer
|
|
423
|
+
* Schluessel wirft vor dem Senden.
|
|
424
|
+
*/
|
|
425
|
+
key: string;
|
|
426
|
+
/** Beleg in der Kasse der Anmeldung; ein Beleg einer anderen Kasse ist `receipt_not_found`. */
|
|
427
|
+
receiptId: string;
|
|
428
|
+
/** `print` (Erstdruck), `reprint` (Duplikat, gedruckt mit `markAsDuplicate`), `link_shared`, `pdf_shared`. */
|
|
429
|
+
kind: ReceiptOutputLogKind;
|
|
430
|
+
/**
|
|
431
|
+
* Zeitpunkt am Geraet: Millisekunden seit 1970 oder ISO 8601 **mit Zone**
|
|
432
|
+
* (`new Date().toISOString()`); Text ohne Zone wirft vor dem Senden. Eine
|
|
433
|
+
* falsch gehende Geraeteuhr lehnt der Server nicht ab: er klemmt die Zeit auf
|
|
434
|
+
* Belegzeit bis Eingang.
|
|
435
|
+
*/
|
|
436
|
+
at: number | string;
|
|
437
|
+
/**
|
|
438
|
+
* Ergebnis eines Drucks: `ok`, `failed` (sicher nicht gedruckt) oder
|
|
439
|
+
* `unclear` (Ausgang offen). Pflicht bei `print` und `reprint` (sonst lehnt
|
|
440
|
+
* der Server den Eintrag mit `validation` ab); beim Teilen ohne Angabe `ok`.
|
|
441
|
+
*/
|
|
442
|
+
result?: ReceiptOutputResult;
|
|
443
|
+
}
|
|
444
|
+
/** Eingabe von [logReceiptOutputs]. Die Kasse bindet die Anmeldung (wie bei [sendReceiptEmail]). */
|
|
445
|
+
export interface LogReceiptOutputsOptions {
|
|
446
|
+
/** 1–50 Eintraege ([RECEIPT_OUTPUT_ENTRIES_MAX]); ein groesserer Puffer geht in mehreren Aufrufen hinaus. */
|
|
447
|
+
entries: ReceiptOutputEntry[];
|
|
448
|
+
}
|
|
449
|
+
/** Ein abgelehnter Eintrag: dauerhaft, aus dem Puffer nehmen und nicht noch einmal senden. */
|
|
450
|
+
export interface RejectedReceiptOutput {
|
|
451
|
+
key: string;
|
|
452
|
+
/** Aus [RECEIPT_OUTPUT_ENTRY_ERROR_CODES]; ein Code, den das Paket nicht kennt, bleibt lesbar. */
|
|
453
|
+
code: ReceiptOutputEntryErrorCode | (string & {});
|
|
454
|
+
}
|
|
455
|
+
/** Antwort von [logReceiptOutputs]. */
|
|
456
|
+
export interface LogReceiptOutputsResult {
|
|
457
|
+
/** Angenommene Eintraege, auch die schon frueher gemeldeten (gleicher Schluessel). */
|
|
458
|
+
accepted: number;
|
|
459
|
+
rejected: RejectedReceiptOutput[];
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Meldet Drucke und das Teilen eines Belegs an das Protokoll „Ausgaben“
|
|
463
|
+
* (Endpunkt `logReceiptOutputs`, nur ueber den Kassenweg `/api/v3`; mit
|
|
464
|
+
* `registerUserAuth` und mit `apiKeyAuth`). Registrierkassen-Erlass
|
|
465
|
+
* BMF-AV Nr. 2/2026, Abschnitt 4.2: die Belegerteilung ist zu dokumentieren.
|
|
466
|
+
* Der Beleg selbst bleibt unberuehrt; das Protokoll steht nie im DEP.
|
|
467
|
+
*
|
|
468
|
+
* **Ein Eintrag scheitert nie die anderen.** Der Server nimmt jeden Eintrag
|
|
469
|
+
* einzeln an oder lehnt ihn mit Code ab (`rejected`, Codes
|
|
470
|
+
* [RECEIPT_OUTPUT_ENTRY_ERROR_CODES]); nach einer Erfolgsantwort ist jeder
|
|
471
|
+
* gesendete Eintrag erledigt. Die Kasse puffert die Eintraege (offline,
|
|
472
|
+
* Neustart) und sendet sie spaeter; der Puffer blockiert nie Druck oder Teilen.
|
|
473
|
+
*
|
|
474
|
+
* **Wiederholen ist gefahrlos:** jeder Eintrag traegt seinen Schluessel. Bei
|
|
475
|
+
* unklarem Ausgang (`outcome: 'unknown'`) dieselben Eintraege mit denselben
|
|
476
|
+
* Schluesseln noch einmal senden.
|
|
477
|
+
*
|
|
478
|
+
* **Vor dem Senden abgewiesen** wird nur, was die ganze Anfrage scheitern
|
|
479
|
+
* liesse oder ohne Netz sicher falsch ist: keine oder mehr als 50 Eintraege,
|
|
480
|
+
* ein unbekanntes Feld (oben oder im Eintrag), ein fehlender Beleg, ein
|
|
481
|
+
* Schluessel ausserhalb der Regel des Servers, eine Art oder ein Ergebnis
|
|
482
|
+
* ausserhalb des Katalogs, eine Zeit, die weder ganze Millisekunden noch
|
|
483
|
+
* ISO 8601 mit Zone ist. `email` und `opened` gehen hinaus und kommen als
|
|
484
|
+
* `invalid_output_kind` zurueck: so verwirft der Puffer genau diesen Eintrag.
|
|
485
|
+
* Fehler der ganzen Anfrage: [RECEIPT_OUTPUT_ERROR_CODES].
|
|
486
|
+
*/
|
|
487
|
+
export declare function logReceiptOutputs(transport: InternerTransport, options: LogReceiptOutputsOptions): Promise<LogReceiptOutputsResult>;
|
|
405
488
|
/**
|
|
406
489
|
* Prueft die Gutschein-Kombination eines Belegs und liefert den ersten
|
|
407
490
|
* Regelverstoss als Text (oder `null`) — Zwilling von
|
|
@@ -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',
|