# DT-CIUS-PT-158

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

> The BT-92 must equal the multiplication between the Document level allowance base amount (BT-93) and the Document level allowance percentage (BT-94), 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:AllowanceCharge[cbc:ChargeIndicator = 'false'] | //cn:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = 'false']`
- Test: `(not(exists(xs:decimal(cbc:MultiplierFactorNumeric))) and not(exists(xs:decimal(cbc:BaseAmount)))) or (((xs:decimal(cbc:BaseAmount) * (xs:decimal(cbc:MultiplierFactorNumeric) div 100) * 10 * 10) div 100) <= (xs:decimal(cbc:Amount) + 1.00) and ((xs:decimal(cbc:BaseAmount) * (xs:decimal(cbc:MultiplierFactorNumeric) div 100) * 10 * 10) div 100) >= (xs:decimal(cbc:Amount) - 1.00))`

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