# I need to allow the editing and deletion of invoices

**URL:** <https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169>\
**Category:** Maintaining my Dolibarr\
**Tags:** Help\
**Created:** [May 22, 2026, 7:13am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169 "2026-05-22T07:13:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![TuHao](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/f19dbf/32.png) [@TuHao](https://www.dolibarr.org/forum/u/TuHao)\
**Post date:** [May 22, 2026, 7:13am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/1 "2026-05-22T07:13:47Z")

</div>

![Snipaste_2026-05-22_15-09-33](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/4/444e43107933d3a8d44839b3ebfb85d87cd581cb.jpeg)

I need to allow the editing and deletion of invoices. The following two options are set in Other Setup

INVOICE\_CAN\_ALWAYS\_BE\_REMOVED

INVOICE\_CAN\_BE\_EDITED\_EVEN\_IF\_PAYMENT\_DONE

Why is there no effect at all? Was there a mistake in the Settings somewhere?

---

<div class="post-metadata">

**Author:** ![TuHao](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/f19dbf/32.png) [@TuHao](https://www.dolibarr.org/forum/u/TuHao)\
**Post date:** [May 22, 2026, 7:20am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/2 "2026-05-22T07:20:04Z")

</div>

I have a lot of empty and invalid invoices now. There is nothing in them. I want to delete them, but I can’t

 ![Snipaste_2026-05-22_15-17-26](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/9/98024b7c9cb26e6e06a5e2a12f4e2a59259ef8c2.jpeg)

---

<div class="post-metadata">

**Author:** ![saikatkoley](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/saikatkoley/32/8716_2.png) [@saikatkoley](https://www.dolibarr.org/forum/u/saikatkoley)\
**Post date:** [May 22, 2026, 9:38am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/3 "2026-05-22T09:38:43Z")

</div>

Hi @TuHao

I will suggest you check the code once, where the code for this button is written, so from there you will get an idea of what permission or logic needs to be satisfied to enable this button.

**Thanks & Regards  
Saikat Koley  
Software Developer(Dolibarr)  
Call/WhatsApp : +919903256573  
Email : [saikatkoley@hotmail.com](mailto:saikatkoley@hotmail.com)  
 [https://www.linkedin.com/in/saikatkoley/](https://www.linkedin.com/in/saikatkoley/)**

---

<div class="post-metadata">

**Author:** ![TuHao](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/f19dbf/32.png) [@TuHao](https://www.dolibarr.org/forum/u/TuHao)\
**Post date:** [May 22, 2026, 9:57am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/4 "2026-05-22T09:57:27Z")

</div>

Where should I look at the code?

I’m not quite sure. Could you elaborate on it? Thank you

---

<div class="post-metadata">

**Author:** ![saikatkoley](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/saikatkoley/32/8716_2.png) [@saikatkoley](https://www.dolibarr.org/forum/u/saikatkoley)\
**Post date:** [May 22, 2026, 10:10am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/5 "2026-05-22T10:10:59Z")

</div>

Hi @TuHao

Check the URL, which page is it referring to, then go there and check. That’s it. If you are not a developer, then I don’t think it would be easy for you to try. I am not sure how familiar you are with Dolibarr development.

**Thanks & Regards  
Saikat Koley  
Software Developer(Dolibarr)  
Call/WhatsApp : +919903256573  
Email : [saikatkoley@hotmail.com](mailto:saikatkoley@hotmail.com)  
 [https://www.linkedin.com/in/saikatkoley/](https://www.linkedin.com/in/saikatkoley/)**

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [May 22, 2026, 10:22am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/6 "2026-05-22T10:22:21Z")

</div>

@TuHao here’s what I did

I got the dolibarr git cloned to my mac laptop, and then I used `grep` in the terminal to find all lines with `INVOICE_CAN_`

And I found that it seems like at least in the develop branch, the setting you need to use is `INVOICE_CAN_NEVER_BE_REMOVED` and the value should be 0 to remove the invoice.

If you invoices have payments, you might want to use `INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED`

You don’t write which dolibarr version you run, and I hope it is not develop.

---

<div class="post-metadata">

**Author:** ![TuHao](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/f19dbf/32.png) [@TuHao](https://www.dolibarr.org/forum/u/TuHao)\
**Post date:** [May 26, 2026, 3:20am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/7 "2026-05-26T03:20:27Z")

</div>

![Snipaste_2026-05-26_11-18-05](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/0/0b130c0539adfc2d9328285a473dd69c6a17170b.jpeg)

Hello, I have filled in both of these items, but it still hasn’t had any effect. I still can’t delete the invoice

Is it necessary to restart the server for it to take effect?

@jonbendtsen

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [May 26, 2026, 5:33am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/8 "2026-05-26T05:33:28Z")

</div>

@TuHao which dolibarr version are you running?

---

<div class="post-metadata">

**Author:** ![TuHao](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/f19dbf/32.png) [@TuHao](https://www.dolibarr.org/forum/u/TuHao)\
**Post date:** [May 26, 2026, 6:36am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/9 "2026-05-26T06:36:15Z")

</div>

> [@jonbendtsen](#):
>
> which dolibarr version are you running?

23.0.1 Version

---

<div class="post-metadata">

**Author:** ![TuHao](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/f19dbf/32.png) [@TuHao](https://www.dolibarr.org/forum/u/TuHao)\
**Post date:** [May 27, 2026, 3:51am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/10 "2026-05-27T03:51:49Z")

</div>

Hello, may I ask if this function cannot be used in the version I’m currently using?

If there is really no other way, then I can only use “phpMyAdmin” to delete those few pieces of data

@jonbendtsen

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [May 27, 2026, 7:04am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/11 "2026-05-27T07:04:59Z")

</div>

sorry @TuHao I have not had time to look at it yet

---

<div class="post-metadata">

**Author:** ![TuHao](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/t/f19dbf/32.png) [@TuHao](https://www.dolibarr.org/forum/u/TuHao)\
**Post date:** [May 29, 2026, 7:33am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/12 "2026-05-29T07:33:43Z")

</div>

Hello, have you found any good solutions?

thank you

@jonbendtsen

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [May 29, 2026, 9:10am UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/13 "2026-05-29T09:10:23Z")

</div>

sorry @TuHao I have not, and I am not being able to for at least a week. This weekend I am organizing a large dance event, which is what I use Dolibarr for, so I wont have time until next week, and before that I need to do the life things that this dance event has postponed.

You can find the source code on github, find the relevant file that matches the url you’re looking at and then you ask some AI to analyse how to use this variables to achieve what you want.

That is where I’d start, and then also read the code myself.

---

<div class="post-metadata">

**Author:** ![MuhammadAli.Dev](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/3d9bf3/32.png) [@MuhammadAli.Dev](https://www.dolibarr.org/forum/u/MuhammadAli.Dev)\
**Post date:** [June 21, 2026, 6:50pm UTC](https://www.dolibarr.org/forum/t/i-need-to-allow-the-editing-and-deletion-of-invoices/31169/14 "2026-06-21T18:50:59Z")

</div>

Hi @TuHao — this is a two-part problem in v23 that catches a lot of people: the constants AND the permissions both need to line up.

**Step 1 — Check user permissions first**  
Go to _Home \> Users & Groups \> [your user] \> Permissions \> Invoices_. There are separate permissions for deleting **draft** invoices and deleting **validated** invoices. Even with the right constants set, if “Delete” isn’t explicitly checked for validated invoices the button stays greyed out.

**Step 2 — The right constants in v23**  
In _Home \> Setup \> Other setup_, set:

- `INVOICE_CAN_ALWAYS_BE_REMOVED` = **1**
- Make sure `INVOICE_CAN_NEVER_BE_REMOVED` is **not set** (or explicitly 0)

No server restart needed — takes effect on next page load.

**Step 3 — Invoice status matters**  
A validated (status = 1) invoice with no payment can be cancelled back to draft first (_Actions \> Cancel_), then deleted as a draft. That path always works regardless of constants.

**For your empty/invalid invoices specifically:** if they have no lines and no payments, cancel → delete is the cleanest route and avoids any database surgery.

Let me know which step resolves it — happy to dig further if the permissions check doesn’t fix it.

— Ali — Dolibarr AI Consultant / [SiliconBlaze.com](http://SiliconBlaze.com)
