# FACTURAE-3.1.5.7

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

> TotalTaxOutputs (…) is not the sum of the tax and equivalence surcharge amounts in TaxesOutputs (…).

- 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: `abs($outputs - sum(for $t in *:TaxesOutputs/*:Tax return es:dec($t/*:TaxAmount/*:TotalAmount) + es:dec($t/*:EquivalenceSurchargeAmount/*:TotalAmount))) le 0.01`

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