Aan huis, Bij ons
Hulp Nodig?
0471 84 89 83
Prestashop – How to delete invoice and fix invoice counter

What can you do with a fraudulent order or some other test order that you wish to delete from you prestashop… By fiscal law, all invoices should counter up, by 1 digit at a time. So remove an invoice, without fixing the invoice number means that you will be missing 1 invoice. Prestashop does not offer any feature to delete 1 invoice. Since we recently suffered from a fraude order, that we managed to cancel at the very last moment, we want to share this with other shop keepers.

So this small tutorial will teach you how to delete invoice and fix invoice counter, just by deleting the invoice from your database.

1Back-up your database

Be for trying to attempt anything in your database, please back it up with the DB-Backup tool from prestashop backoffice. Takes 10 seconds and you are safe!!!! In case you fail, just import the database with your PhpMyAdmin importer.


2Find and delete the invoice in PhpMyAdmin

First we must know the invoice number from prestashop that we want to delete. Check out the Orders tab and find out which invoice you want to delete. Copy that number. Then go to your phpmyadmin page and click the main database from your prestashop. Then on the top click search like the image below.

Prestashop - How to delete invoice and fix invoice counter

If you have are in the search tab, paste the invoice number, select all the database tables and then click START. After that you should see the results and it will show you 2 tables with where the invoice is found. Click on both the links Explore which I have marked yellow. See example below:

Prestashop - How to delete invoice and fix invoice counter 2

In the new tab with the result result, which you have to open for both found records…. you have to double check if this is the invoice you want to remove. If so, tick the checkbox and then the delete link. Make sure you remove the invoice in the 2 tables like i mentioned before!!! So check it out in ps_orders and ps_order_invoice.

Prestashop - How to delete invoice and fix invoice counter 3

3Check the result

To see if the counter has been reset, go to Orders > Invoices and see the item Invoice number. It will show you what the next invoice will be. See example below:

Prestashop - How to delete invoice and fix invoice counter 4

4What if a newer invoice came in before deleting?

Let’s say that just before you wanted to delete this invoice, another order came in… Well the only thing do to is to change the invoice number(s) from the newest one. Since you deleted 1 invoice, you will have to reduce the newest invoices with 1. To do so, use the database search function again in phpmyadmin and locate the newest invoices that you want to correct. Just replace the invoice number with the correct one AND do it always for the 2 tables: ps_orders and ps_order_invoice.

Questions? Just use the comment form.

3 thoughts on “Prestashop – How to delete invoice and fix invoice counter

  1. Adam

    14 oktober 20162 jaar ago


    for delete invoices and set couter for invoces numbers, you can you this module:

  2. Horia

    29 mei 20189 maanden ago

    Actually, this procedure is still considered illegal. YOu should not temper with the invoices. If you have a cancelled order, you can also cancel the invoice. You just have to add a “CANCELED” watermark on top of the original invoice.

    1. Vanhims

      29 mei 20189 maanden ago

      Altering invoices is indeed illegal, this also includes removing invoices from the bookkeeping. But this article is not about altering invoices nor a procedure how to do such operations.
      I created this page to help people remove for example : test orders from the database. This can be useful if you want to test your checkout without using sandbox payments. There is a need for this, if you google it… So, I still hope people find this helpfull in case you will ever need it!

Leave Comments

*Required Field

custom IT
powered by Google
14:41 05 Nov 18
Zeer snelle en correcte samenwerking omtrent een complexe materie om onze website te beveiligen met SSL certificaten. Duidelijke uitleg met een sterke kennis van zaken. Zeker een aanbeveling voor bedrijfswebsites.
Ward Devos
Ward Devos
18:12 01 Nov 18
Met wouter kan goed worden samengewerkt, hij heeft enorm veel geduld getoond tijdens ons project. Dat word geapprecieerd aangezien ik daar zelf om vroeg omwille van persoonlijke issues en mijn andere projecten. Ik kijk uit naar eventuele samenwerking in de toekomst.
Peter Hanse
Peter Hanse
09:38 19 Oct 18
Zeer tevreden over Custom IT, sinds enkele jaren onze leverancier voor PC’s. Altijd correcte en snelle service. PC’s op maat, zowel performance als budget, met kennis van zake en passie. Een echte aanrader!
16:46 17 Oct 18
Echt bij toeval nam ik contact op met It Customs ivm windows 7 ; onthaal was echt prima : vriendelijk en gedienstig. Elke vraag werd met evenveel kennis beantwoord. De aankopen (Windows 7 en Windows 10) die ik deed werden perfect afgehandeld, zowel qua levering als qua veilige betaling. It Customs is echt een aanrader ! De service is echt uitstekend. Eens klant bij It Customs blijf je klant, want zo'n service is ver te zoeken. Dikke proficiat aan It Customs. Een zeer tevreden klant.
Heni Nugraheni
Heni Nugraheni
16:17 07 Aug 18
I bought a new pc at customit. They offered a nice computer, exactly what i wished for and its was also right on budget. Just letting know im happy with the service!
Next Reviews

Heeft u ons nodig?

Wenst u graag een herstelling te plannen, offerte of project bespreken? Eenvoudig en snel online aanvragen. Afspraken zijn zo geregeld.