Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mdiago/VeriFactu/llms.txt
Use this file to discover all available pages before exploring further.
InvoiceFix resubmits an invoice that was previously rejected by the AEAT. It extends InvoiceEntry but sets the Subsanacion = "S" flag on the RegistroAlta, telling the AEAT that this is a correction of a previously failed record rather than a brand-new invoice. All invoice data must match the original rejected submission exactly.
Namespace
VeriFactu.Business
Herencia
Constructor
InvoiceFix(Invoice invoice)
Creates a new fix/subsanation entry for the given invoice.
A fully populated
Invoice with the same data as the original rejected submission. All fields — InvoiceID, InvoiceDate, SellerID, SellerName, TaxItems, etc. — must match the original record. The constructor validates business rules and throws InvalidOperationException if any are violated.InvoiceFix-specific validation (from GetBusErrors()):
- A previously submitted file for this seller + year + invoice number must already exist on disk. Unlike
InvoiceEntry, which rejects duplicates,InvoiceFixrequires the original entry to be present. - All other
InvoiceEntryrules apply (SellerName required, TaxItems ≤ 12, etc.).
Comportamiento de subsanación
WhenSetRegistro() is called internally, InvoiceFix performs the normal RegistroAlta build (via the base class) and then sets:
Propiedades adicionales
Full path to the original (rejected) invoice XML file in the posted invoices directory:
{InvoicePostedPath}{EncodedInvoiceID}.xml.Path where the new fix XML will be stored. Includes a
.SUB. infix and a timestamp to avoid overwriting the original: {InvoicePostedPath}{EncodedInvoiceID}.SUB.yyyy.MM.dd.HH.mm.ss.ffff.xml.Path to the outbox chain record for this fix:
{InvoiceEntryPath}{InvoiceEntryID}.SUB.yyyy.MM.dd.HH.mm.ss.ffff.xml.Path to the AEAT response XML for this fix:
{ResponsesPath}{InvoiceEntryID}.SUB.yyyy.MM.dd.HH.mm.ss.ffff.xml.Status, CSV, ErrorCode, ErrorDescription, Posted, IsSent) are inherited from InvoiceEntry.
Ejemplo
Use
InvoiceFix only for records that were rejected by the AEAT (i.e. the original submission returned a non-Correcto status). For invoices that need to be corrected after successful acceptance, use a rectification invoice (TipoFactura.R1–R5) via a standard InvoiceEntry.