Skip to main content

Immutability and Logging

Why Immutability

RD 1007/2023 requires that every Computerized Invoicing System (SIF) in Spain guarantee the integrity of tax records. This means that issued invoices cannot be modified or deleted.

Frihet implements immutability at the database and interface level. Tax records are automatically protected without user intervention.

Invoices That Cannot Be Deleted

Invoices with status Sent, Paid, or Overdue cannot be deleted. Only drafts allow deletion.

To cancel an already issued invoice:

  1. Open the invoice
  2. Click on More optionsCancel invoice
  3. The invoice changes to Cancelled status
  4. A CANCELLATION hash is generated and recorded in the chain

The document remains visible in the record. It does not disappear.

Locked Fields

Once an invoice has a calculated hash (verifactu.hash), the following fields become read-only:

  • Invoice number
  • Issue date
  • Client (name and NIF)
  • Invoice lines (description, quantity, price, tax rate)
  • IRPF type
  • VAT regime
  • Type of operation

These fields are locked both in the interface and in database rules. It is not possible to modify them by any means.

tip

To correct an already issued invoice, create a corrective invoice linked to the original.

Gapless Sequential Numbering

Numbering is generated on the server using an atomic counter. It does not depend on the client or the browser.

  • Each series has its own independent counter
  • It is not possible to create gaps in the numbering
  • The number is assigned at the time of creation, not manually
  • The numbering pattern is configurable (see Series and Numbering)

Audit Log

Each invoice maintains an audit log that is automatically generated. The following actions are recorded:

  • Document creation
  • Field modifications (before locking)
  • Status changes
  • Cancellation

Each log entry includes: date/time, user, action performed, and modified fields.

The audit log is immutable. Log entries cannot be edited or deleted.

Cancellation vs. Deletion

ActionWhenWhat happens
DeleteDrafts onlyThe document is deleted
CancelIssued invoices"Cancelled" status, CANCELLATION hash, document remains in record
CorrectInvoices with errorsA new corrective invoice linked to the original is created

Previous: VeriFactu | Next: Quarterly Tax Forms