# DT-CIUS-PT-170

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

> The BT-146 must equal the grossPrice (Item gross price) minus the discount (Item price discount), 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: `cac:InvoiceLine/cac:Price | cac:CreditNoteLine/cac:Price`
- Test: `(not(exists(cac:AllowanceCharge/xs:decimal(cbc:BaseAmount))) and not(exists(cac:AllowanceCharge/xs:decimal(cbc:Amount)))) or ((cac:AllowanceCharge/xs:decimal(cbc:BaseAmount) - (cac:AllowanceCharge/xs:decimal(cbc:Amount))) <= (xs:decimal(cbc:PriceAmount) + 1.00) and (cac:AllowanceCharge/xs:decimal(cbc:BaseAmount) - (cac:AllowanceCharge/xs:decimal(cbc:Amount))) >= (xs:decimal(cbc:PriceAmount) - 1.00))`

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