# BR-DEX-09

Source: https://xmlvalid.com/rules/BR-DEX-09

> Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) - Paid amount (BT-113) + Rounding amount (BT-114) + Σ Third party payment amount (BT-DEX-002).

- Level: error
- Rule sets: XRechnung 3.0 rules (UBL) 2.6.0
- Context: `cac:LegalMonetaryTotal[$isExtension]`
- Test: `(round((xs:decimal(cbc:PayableAmount) - $payableroundingamount) * 10 * 10) div 100) = (round((xs:decimal(cbc:TaxInclusiveAmount) - $prepaidamount + $thirdpartyprepaidamount) * 10 * 10) div 100)`

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