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 ​
import type { VatCategoryIndex } from '@facturometro/validator';
const standardRated = (index: VatCategoryIndex) => index.subtotals.length > 0;Properties ​
docAllowances ​
readonlydocAllowances: readonlyHit<UncheckedAllowanceCharge,unknown>[]
Defined in: packages/validator/src/engine/view.ts:110
Document level allowances whose tax category has the code.
docCharges ​
readonlydocCharges: readonlyHit<UncheckedAllowanceCharge,unknown>[]
Defined in: packages/validator/src/engine/view.ts:112
Document level charges whose tax category has the code.
lines ​
readonlylines: readonlyHit<UncheckedLine,unknown>[]
Defined in: packages/validator/src/engine/view.ts:114
Lines whose classified tax category has the code.
subtotals ​
readonlysubtotals: readonlyHit<UncheckedTaxSubtotal,unknown>[]
Defined in: packages/validator/src/engine/view.ts:116
VAT breakdown subtotals whose tax category has the code.
unreadable ​
readonlyunreadable: readonlystring[]
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.