When you need to correct an invoice that has already undergone a previous correction, follow these steps:
Initial Invoice Creation (S1):
You create an invoice, let's refer to it as S1. During the review, you notice there is an error in this invoice, and that a correction is required according to the Invoicing Regulations in Spain.
First Corrective Invoice (R1):
To address the error, you create a corrective invoice, let's refer to it as R1. In the id field of R1, you include the identifier of the original invoice S1.
If you later discover another error in R1, that once again requires a correction by law, proceed to the next step.
Second Corrective Invoice (R2):
Create another corrective invoice, now referred to as R2. In the id field of R2, you must include the identifier of the first corrective invoice R1.
This process ensures that each correction is properly linked to the previous invoice.