# Rectifying an invoice or a ticket and configuring its numbering

> How to rectify an invoice or ticket already issued from the order, what the rectification pattern is and what to do when Lueira asks you to create it.

## What this guide solves

When you make a mistake on an invoice or ticket you have already issued (an amount, a customer, a line item), it is not edited or deleted: it is **rectified**. Lueira generates a new document, with the same data as the original but with the amounts in negative, and links it to the original so that the numbering stays sequential.

This guide explains:

- how to rectify a document from the order;
- what the **rectification pattern** is and why Lueira asks you for it the first time;
- what happens to the original document, to the payments and to the numbering after rectifying.

💡 **The short answer:** open the order, click **Rectify** in the **Invoicing** block and, if it is the first time, create the numbering pattern for rectifying documents when Lueira asks you.

## Before you start: the rectification pattern

Each document type has its own numbering, which is configured in **Settings > Document numbering**. Rectifying documents do not share the invoice numbering: they have their own type (**Rectifying invoice** and **Rectifying ticket**) and their own pattern.

![List of Document numbering patterns with Tickets, Proforma invoice, Quotes, Invoices and Rectifying invoices](https://d2dt24o6fh81m6.cloudfront.net/images/6790fbec-43bf-43a9-8f0f-44d1718b46b3.jpg)

If you have never rectified before, your account has no rectification pattern. You can create it in two ways:

### Option A: when you rectify (the most convenient)

When you click **Rectify** for the first time, Lueira shows you the **Configure rectification pattern** window and lets you create the pattern right there. You will see it in the next step.

### Option B: beforehand, from Settings

1. Go to **Settings > Document numbering** and click **Add numbering pattern**.
2. In **Document type** choose **Rectifying invoice** (or **Rectifying ticket**).

![Document type dropdown with Invoice, Rectifying invoice, Ticket, Rectifying ticket, Quote and Proforma](https://d2dt24o6fh81m6.cloudfront.net/images/f05fe302-09c2-4cee-911d-c1b1f6299e3e.jpg)

1. Type the **Name** (for example, "Rectifying invoices"), the **Pattern** (for example, **R[YYYY][XXXX]**, which generates R20260001, R20260002…) and the **Next number**.
2. Save. Then, edit the **Invoices** pattern and choose this pattern in the **Rectification pattern** field.

![Add numbering pattern window with the fields Name, Document type, Pattern, Next number, Continuous numbering and Rectification pattern](https://d2dt24o6fh81m6.cloudfront.net/images/8e16dda6-faeb-4630-9238-cc7e771f2747.jpg)

📌 **How a pattern is written:**

- **[X], [XX], [XXX]…** is the sequential number: F[XXX] gives F001, F002…
- **[YYYY]** or **[YY]** inserts the year automatically.
- **Next number** is the number that will be assigned to the next document. In the list of patterns you will always see which one is next.
- **Continuous numbering:** if you use the year in the pattern, the numbering starts again at 1 every 1 January. Turn this switch on if you do not want it to reset. More information in [Managing document numbering at the turn of the year](lueira-guide:6cfdef17-e00a-4721-91e9-3f864a12578a?locale=en).

## How to rectify an invoice or a ticket

1. Open the order from **Orders** (or from **Orders > Documents**, by clicking its reference).
2. In the right-hand column, in the **Invoicing** block, find the document and click **Rectify**.

![Invoicing block of an order with the Download, Facturae, Send, Print and Rectify buttons](https://d2dt24o6fh81m6.cloudfront.net/images/a354bdba-3968-46cd-8b6b-2d9ac0b1af6d.jpg)

1. **If it is the first time**, **Configure rectification pattern** appears: "This document's numbering pattern has no associated rectification pattern. Select an existing one or create a new one to continue".

![Empty Configure rectification pattern window](https://d2dt24o6fh81m6.cloudfront.net/images/b61437f0-1aa3-44ba-8f0f-44d1718b46b3.jpg)

1. Fill in the **Name**, the **Format** (for example, R[YYYY][XXXX]) and the **Next number** (normally 1) and click **Confirm and continue**. If you already have a rectification pattern, this window does not appear and you go straight to the next step.

![Rectification pattern window filled in with Rectifying invoices and R[YYYY][XXXX]](https://d2dt24o6fh81m6.cloudfront.net/images/28dd91cb-796c-40a9-a1a7-87fb36b4f4e9.jpg)

1. Lueira shows you the **preview of the rectifying invoice**: the new number, the number of the **original invoice** and the total in negative. Choose the **Rectification date**: it cannot be earlier than the date of the original document or later than today.
2. Click **Rectify**.

![Rectify document window with the negative preview and the date selector](https://d2dt24o6fh81m6.cloudfront.net/images/776e7614-9ab3-43f7-a98b-be514496b146.jpg)

⚠️ **This action cannot be undone.** Lueira warns you in the window itself. Check the preview before confirming.

Tickets are rectified in the same way; their pattern is of type **Rectifying ticket**.

## What happens after rectifying

In the order's **Invoicing** block you now see:

- the original document marked in red as **Rectified**, without the Rectify button (a document can only be rectified once);
- below it, the **rectifying invoice** with its number (for example, 1 | R20260001), with the **Download** and **Print** buttons.

![Invoicing block with the original invoice marked as Rectified and the rectifying invoice below](https://d2dt24o6fh81m6.cloudfront.net/images/37947d74-bdf2-42a1-b246-7b6a480397d7.jpg)

In **Settings > Document numbering**, the rectifying invoices pattern moves on to the next number.

### What rectifying does NOT do

- **It does not refund the customer.** The rectifying invoice cancels the document, but it does not touch the order's payments. If the customer has already paid and you want to refund the amount, use **Refund** in the order's **Payments** block.
- **It does not correct the original document:** it generates a new one in negative. If what you want is to issue the correct invoice, issue a new invoice afterwards with the **+** button of the Invoicing block.

## What to do if…

### …I can't find the Rectify button

The button is in the order's **Invoicing** block, next to each issued invoice or ticket. It does not appear if the document **has already been rectified** (you will see the **Rectified** mark and the rectifying invoice below it). If what you are looking for is a document you have not issued yet, it must first be issued with the **+** button of that same block.

### …Lueira asks me for a rectification pattern

This is normal the first time: your account does not yet have numbering for rectifying documents. Create the pattern in that window (name, format such as R[YYYY][XXXX] and next number 1) and continue with the process. Later documents will use that pattern automatically.

### …I can't choose the date I want

The date of the rectifying invoice cannot be earlier than that of the original document or later than today.

### …I want the numbering not to reset every year

Edit the pattern in **Settings > Document numbering** and turn on **Continuous numbering**. Without it, a pattern with the year ([YYYY]) starts again at 1 on 1 January.

### …I made a mistake when rectifying

A rectification cannot be undone. Contact Lueira support from the help chat, giving the order reference and the number of the rectifying invoice, and we will tell you how to proceed.

🔒 **Important:** if you write to support, do not include passwords, signing keys or your bank details in the chat; we do not need them to help you with this topic.

## Related articles

- [Invoicing: Tickets, invoices and quotes in orders](lueira-guide:5ecb5f2c-1a22-4163-bf33-c2a79ad61477?locale=en)
- [Managing document numbering at the turn of the year](lueira-guide:6cfdef17-e00a-4721-91e9-3f864a12578a?locale=en)
- [Verifactu and TicketBAI in Lueira](lueira-guide:67c7d72c-c920-4265-98ad-a7dabdffa92f?locale=en)

Source: https://help.lueira.com/en/articles/rectificar-una-factura-o-un-ticket-y-configurar-su-numeracion
