# FACTURAE-3.1.5.15

Source: https://xmlvalid.com/rules/FACTURAE-3.1.5.15

> TotalPaymentsOnAccount (…) is not the sum of the PaymentOnAccountAmount (…).

- Level: error
- Rule sets: Facturae validation rules of the Spanish public sector Orden HAP/1650/2015, Facturae 3.2.x description of 6 June 2017
- Context: `/*:Facturae/*:Invoices/*:Invoice`
- Test: `not($totals/*:PaymentsOnAccount) or abs(es:dec($totals/*:TotalPaymentsOnAccount) - sum(for $p in $totals/*:PaymentsOnAccount/*:PaymentOnAccount return es:dec($p/*:PaymentOnAccountAmount))) le 0.01`

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