# HAP1650-6a

Source: https://xmlvalid.com/rules/HAP1650-6a

> In an invoice in euros, a line's TotalCost (…) must be Quantity × UnitPriceWithoutTax rounded to cents (…), its GrossAmount (…) TotalCost - discounts + charges (…), and its other amounts rounded to cents….

- 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/*:Items/*:InvoiceLine`
- Test: `not($euro) or ($cost = es:round($product) and es:dec(*:GrossAmount) = $gross and (every $a in $amounts satisfies es:cents($a)))`

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