# PEPPOL-EN16931-R053

Source: https://xmlvalid.com/rules/PEPPOL-EN16931-R053

> Only one tax total with tax subtotals MUST be provided.

- Level: error
- Rule sets: Peppol BIS Billing 3.0 rules 3.0.21, XRechnung 3.0 rules (UBL) 2.6.0
- Context: `ubl-creditnote:CreditNote | ubl-invoice:Invoice`
- Test: `count(cac:TaxTotal[cac:TaxSubtotal]) = 1`

> No more than one tax total amount must be provided where currency id equals document currency code.

- Level: error
- Rule sets: XRechnung 3.0 rules (CII) 2.6.0
- Context: `ram:ApplicableHeaderTradeSettlement`
- Test: `count(ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $documentCurrencyCode]) <=1`

## Why it fails

- There is no `cac:TaxTotal` with `cac:TaxSubtotal`, or there are several: one per VAT rate instead of one with a subtotal per rate.

## How to fix it

- Write a single `cac:TaxTotal` with the total VAT amount and one `cac:TaxSubtotal` for each VAT category and rate.

Validate a document against these rules: https://xmlvalid.com/validate
