Facturae validation rules of the Spanish public sector
27 rules, version Orden HAP/1650/2015, Facturae 3.2.x description of 6 June 2017, published by xmlvalid, after the validation rules of Orden HAP/1650/2015 (anexo II) and the formulas of the Facturae format (MIT, source). Checked with Facturae 3.2.2 .
- FACTURAE-1.5.2 InvoicesCount (…) is not the number of invoices in the file (…).
- FACTURAE-1.5.3 TotalInvoicesAmount (…) is not the sum of the invoices' InvoiceTotal (…).
- FACTURAE-1.5.4 The batch's TotalOutstandingAmount (…) is not the sum of the invoices' TotalOutstandingAmount (…).
- FACTURAE-1.5.5 The batch's TotalExecutableAmount (…) is not the sum of the invoices' TotalExecutableAmount (…).
- FACTURAE-3.1.5.1 TotalGrossAmount (…) is not the sum of the lines' GrossAmount (…).
- FACTURAE-3.1.5.4 TotalGeneralDiscounts (…) is not the sum of the GeneralDiscounts (…).
- FACTURAE-3.1.5.5 TotalGeneralSurcharges (…) is not the sum of the GeneralSurcharges (…).
- FACTURAE-3.1.5.7 TotalTaxOutputs (…) is not the sum of the tax and equivalence surcharge amounts in TaxesOutputs (…).
- FACTURAE-3.1.5.14 TotalOutstandingAmount (…) must be InvoiceTotal - (subsidies + TotalPaymentsOnAccount) (…).
- FACTURAE-3.1.5.15 TotalPaymentsOnAccount (…) is not the sum of the PaymentOnAccountAmount (…).
- FACTURAE-3.1.5.17 TotalExecutableAmount (…) must be TotalOutstandingAmount - amounts withheld - payment in kind + TotalReimbursableExpenses + TotalFinancialExpenses (…).
- FACTURAE-3.1.6.1.17 TotalCost (…) is not Quantity × UnitPriceWithoutTax (…).
- FACTURAE-3.1.6.1.20 GrossAmount (…) is not TotalCost - DiscountAmount + ChargeAmount (…).
- HAP1650-3a The invoice number (InvoiceNumber) is empty.
- HAP1650-4b A corrective invoice (InvoiceClass …) needs Corrective with the correction method….
- HAP1650-5b The …'s NIF (…) doesn't follow the rules a Spanish NIF is formed by: its check character doesn't match.
- HAP1650-5d The … is a person (Individual), so Name and FirstSurname must not be empty.
- HAP1650-5e The … is a legal entity, so CorporateName must not be empty.
- HAP1650-5f The assignee's tax number (FactoringAssignmentData/Assignee) is the seller's (…); they must differ.
- 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….
- HAP1650-6b In an invoice in euros, TotalGrossAmount (…) must be the sum of the lines' GrossAmount (…), and every amount must be rounded to cents….
- HAP1650-6d TotalGrossAmountBeforeTaxes is positive, so TotalTaxesWithheld may not be negative (…).
- HAP1650-6e TotalGrossAmountBeforeTaxes (…) must be TotalGrossAmount - TotalGeneralDiscounts + TotalGeneralSurcharges (…).
- HAP1650-6f InvoiceTotal (…) must be TotalGrossAmountBeforeTaxes + TotalTaxOutputs - TotalTaxesWithheld (…).
- HAP1650-8a The buyer is a public administration (NIF …), so its administrative centres must give all three DIR3 codes: the accounting office (01), the managing body (02) and the processing unit (03)….
- HAP1650-9b The line's description (ItemDescription) is empty.
- XV-ES-01 how to fixA Spanish NIF has no valid check character, so the AEAT won't find it in its census ('…' in BuyerParty/TaxIdentificationNumber).