Skip to content

Documentation / @facturometro/einvoice / VatCategoryIndex

Interface: VatCategoryIndex ​

Defined in: packages/validator/src/engine/view.ts:108

Everything in a document that carries a given VAT category code: the VAT breakdown subtotals, the lines (through their item's classified tax category) and the document level allowances and charges (CEN boolean reading of cbc:ChargeIndicator).

Example ​

ts
import type { VatCategoryIndex } from '@facturometro/validator';

const standardRated = (index: VatCategoryIndex) => index.subtotals.length > 0;

Properties ​

docAllowances ​

readonly docAllowances: readonly Hit<UncheckedAllowanceCharge, unknown>[]

Defined in: packages/validator/src/engine/view.ts:110

Document level allowances whose tax category has the code.


docCharges ​

readonly docCharges: readonly Hit<UncheckedAllowanceCharge, unknown>[]

Defined in: packages/validator/src/engine/view.ts:112

Document level charges whose tax category has the code.


lines ​

readonly lines: readonly Hit<UncheckedLine, unknown>[]

Defined in: packages/validator/src/engine/view.ts:114

Lines whose classified tax category has the code.


subtotals ​

readonly subtotals: readonly Hit<UncheckedTaxSubtotal, unknown>[]

Defined in: packages/validator/src/engine/view.ts:116

VAT breakdown subtotals whose tax category has the code.


unreadable ​

readonly unreadable: readonly string[]

Defined in: packages/validator/src/engine/view.ts:125

The texts of the cbc:ChargeIndicators of document level allowances or charges whose tax category has the code but which are in neither list because the text is not an xs:boolean. The index excludes them, like the view's default AllowanceChargeSelection, so rules that count categories or test one allowance or charge still run; a rule that sums the lists (the BR-*-08 VAT sums) throws a LexicalError for the first of these instead, and the engine skips that test.

MIT licensed. Specification artefacts belong to OpenPEPPOL, CEN and OASIS.