Sales Invoice Creation
Before issuing the invoice (in the “editing” phase), if errors are detected while the invoice is being prepared, meaning during editing but before it has been issued, they are corrected directly before issuing it. Afterwards, when it is issued, it is assumed to be correct.
flowchart LR
Inicio((Invoice<br>Editing))
Fin((End))
Inicio -.-> P1
Inicio --> P2
P1[[Check invoice]] -.-> Inicio
P2[[Issue invoice]] --> Fin
Check Invoice
flowchart LR
Inicio((Start))
Fin((End))
Inicio --> T1
T1[Check invoice<br><i><a href="../../../api/invoicing/check-new-sales/">CheckNewSales</a></i>] --> QVal{Valid?}
QVal -->|Yes| Fin
QVal -->|No| TCorregir
TCorregir[Correct invoice] --> Fin
Issue Invoice
Invoices accepted by SDH are delivered to the administration using deferred delivery.
flowchart LR
Inicio((Start))
Fin((End))
Inicio --> T1
T1[Create<br><i><a href="../../../api/invoicing/new-sales/">NewSales</a></i>] --> TCheck
TCheck[Check invoice] --> Q1{Check<br>Valid?}
Q1 -->|Yes| Q2{New<br>Valid?}
Q1 -->|No| TCorregir
Q2 -->|Yes| TNormativa
Q2 -->|No| TCorregir
TCorregir[Correct invoice] --> Fin
TNormativa[<a href="../../invoice">Veri*Factu Billing Regulation</a>] --> PConsulta
PConsulta[[Check<br>invoice status]] --> Fin
Query Invoice Status
After the invoice is issued:
-
a) If errors detected after issuance are covered by the Billing Obligations Regulation (ROF), approved by Royal Decree 1619/2012, the invoice must be rectified following the ROF procedure corresponding to the type of error. This implies issuing one or more corrective invoices for the original erroneous invoice, using the RF field codes specified in Order HAC/1177/2024.
-
b) If the errors detected after issuance are not covered by the ROF, but affect fields of the billing record (RF) generated when issuing the invoice (that is, fields that are not visible on the printed invoice, i.e. internal fields, such as certain tax codifications), the original invoice must be corrected (specifically, its internal data) and a RF subsanation creation record must be generated for that invoice, already containing the new applicable information. These cases should be VERY RARE. With regard to the concept of subsanation, this occurs when an error is detected in some data of the RF whose correction does not require using the invoice rectification procedure defined in the ROF. In such cases, when invoice rectification is not required, it is sufficient to repair or correct the erroneous data contained in the original record by generating a new subsanation creation record (which will already include the correct data) and, where applicable, by submitting it again to the AEAT Electronic Office.
-
c) If errors detected after issuance are NOT covered by the ROF and do not affect any RF fields, the original invoice is corrected without generating any new RF.
-
d) If the entire invoice is considered incorrect or should not have been issued, and no ROF procedure applies (rectification or otherwise), it may be voided, generating an RF cancellation record.
These cases should also be very uncommon.
flowchart LR
Inicio((Start))
Fin((End))
Inicio --> QAnular{Cancel<br>invoice?}
QAnular -->|Yes| TAnular[<a href="../anulacion">Cancel invoice</a>]
QAnular -->|No| T1
TAnular --> Fin
T1[Query<br><i><a href="../../../api/invoicing/query-sales/">QuerySales</a></i>] --> QVal{Valid?}
QVal -->|Yes| Fin
QVal -->|No| QRectificar{Rectification?}
QRectificar -->|Yes| TRectificar[Issue<br>Corrective<br>Invoices]
QRectificar -->|No| TCorregir[Correct<br>Original invoice]
TRectificar --> Fin
TCorregir --> QSubsanar{Subsanation?}
QSubsanar -->|Yes| QSubsanarAlta{Subsanation<br>Type?}
QSubsanar -->|No| Fin
QSubsanarAlta -->|Yes| TSubsanarAlta[Corrective Creation<br><i><a href="../../../api/invoicing/correct-new-sales/">CorrectNewSales</a></i>]
QSubsanarAlta -->|No| TSubsanarModif[Corrective Modification<br><i><a href="../../../api/invoicing/correct-modify-sales/">CorrectModifySales</a></i>]
TSubsanarAlta --> T1
TSubsanarModif --> T1