# DT-CIUS-PT-164

Source: https://xmlvalid.com/rules/DT-CIUS-PT-164

> Invoice total VAT amount (BT-110) = Σ VAT category tax amount (BT-117), with an acceptance range of 1.00 € (it does not mean that this tolerance is accepted by the customer).

- Level: error
- Rule sets: CIUS-PT rules (Portugal, UBL) 2.1.1
- Context: `//ubl:Invoice/cac:TaxTotal | //cn:CreditNote/cac:TaxTotal`
- Test: `((round((sum(cac:TaxSubtotal/xs:decimal(cbc:TaxAmount)) * 10 * 10)) div 100) <= (xs:decimal(child::cbc:TaxAmount) + 1.00) and (round((sum(cac:TaxSubtotal/xs:decimal(cbc:TaxAmount)) * 10 * 10)) div 100) >= (xs:decimal(child::cbc:TaxAmount) - 1.00)) or not(cac:TaxSubtotal)`

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