# BR-FXEXT-CO-16

Source: https://xmlvalid.com/rules/BR-FXEXT-CO-16

> Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) + Rounding amount (BT-114) + Sum of Charge amount collected on behalf of a third party (BT-179).

- Level: error
- Rule sets: Factur-X EXTENDED rules 1.09.2
- Context: `//ram:SpecifiedTradeSettlementHeaderMonetarySummation`
- Test: `xs:decimal(ram:DuePayableAmount) = xs:decimal(sum(ram:GrandTotalAmount/xs:decimal(.))) - xs:decimal(sum(ram:TotalPrepaidAmount/xs:decimal(.))) + xs:decimal(sum(ram:RoundingAmount/xs:decimal(.))) + xs:decimal(sum(../ram:SpecifiedFinancialAdjustment/ram:ActualAmount/xs:decimal(.)))`

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