Help me, how i delete an customer invoice?
There’s a FAQ about it but it’s in French. So here’s the way in English :
- get the ID of your invoice (invoice is called “facture” in French). You can get this ID by going to the Invoice’s card, and check the address in your browser. For example
http://dolibarr.xxxxx.com/compta/facture.php?facid=29 the invoice ID is “29”
- connect to your database (via phpmyadmin or command line, for example)
- Type the following commands (replace INVOICE_ID by the ID you got earlier):
- DELETE FROM llx_facturedet WHERE fk_facture = INVOICE_ID;
- DELETE FROM llx_facture WHERE rowid = INVOICE_ID;
Your invoice should be deleted successfully.
Alban
When you have activate the bank module then you have to do some more.
step 1 : Delete in llx_paiement_facture --> fk_facture = Invoice_ID
step 2 : Delete in llx_paiement --> rowid = llx_paiement_facture --> rowid
step 3 : Delete in llx_facturedet --> fk_facture = Invoice_ID
step 4 : Delete in llx_facture --> rowid = Invoice_ID
The previous post used a very technical way to solve a very simple problem… Invoices only stop you from deletion if a transaction has been applied…
Click “Bank/Cash”
Click the name of the account the transaction was made (I.E. Bank A)
Click on the “Transactions” tab
Click on the trash can next to the transaction you need to delete
A new menu will appear*****
Select yes from the dropdown then click validate
Click on “Third Parties”
Click the name of the Third party who’s invoice you want to delete
Click on the “Customer” Tab up top
Click on the invoice number you want to delete
Click Reopen
Click on the date in the payments section
Verify the payments in this section are for this invoice only
Click delete then yes in the pop up
Click “third parties” > then the customer name > then customer tab again…
Click on the invoice in question
Click Delete!
Regards,
Kevin
Also,
you cannot delete an invoice if you changed the invoice mask afterwards (setup, modules, invoices, setup). You have to return the mask to the mask which generated the invoice number. That will unlock the erase number.
Bye
Jeeeees,
I had to remind myself of this.
Good I have left the last post cause I would never remember this.
Regards!
Hi, now in V20+ it is not posible to delete an invoice if there is a newest one.
The DELETE button has a the tooltip:
“Disable because invoice is not eraseble. Some invoice were recorder after this one and it will create holes in the counter”
Is it possible to allow deleting of invoices when new ones exist?
Would that be legal?
In Mexico, with electronic invoicing, the tax collection authority provides a UUID for each invoice, so the traditional serial number used for internal control doesn’t matter. So yes, it’s legal.
By the way, I found in the Setup->Other Setup page that the INVOICE_CAN_ALWAYS_BE_REMOVED works for this
This statement is false.
Under no circumstances are anyone allowed to erase an invoice not in Mexico not in any other country, especially with electronic invoicing…
What a shame! I’m realizing I’m a liar! I apologize for not explaining the context.
I didn’t think the purpose of this forum was to discuss matters unrelated to Dolibar (such as the legal context of electronic invoicing in Mexico), which is why I omitted the context.
A Dolibarr invoice has no legal or fiscal validity (at least in Mexico).
And I mean the information that Dolibarr generates for an invoice; just as Dolibarr is designed.
For a document to be legal, it needs to be “stamped” (the document is digitally signed and sent to the authority for registration).
Once the document is stamped, that document is legitimate.
Returning to the topic of deleting an invoice:
You can create many invoices in Dolibarr, but that does not imply that they have fiscal value. That is why there is no legal implication in deleting a Dolibarr invoice.
When an invoice is already stamped (it is legal), it has a UUID, and even if you delete the record in your system (Dolibarr), the invoice still exists; the tax collection authority has it registered.
That being said, the number Dolibarr assigns to invoices is practical for human reference, but it has no fiscal or legal value (in Mexico, serial numbers like IN250101-0001 are not mandatory and are not required).
So again… there is no legal or fiscal implication in deleting a record from the Dolibarr tables.
There are two cases:
- If the invoice is not stamped; it is simply a record that can be deleted.
- If the invoice is already stamped; even if you delete it from your database, the tax liability does not disappear. Deleting the record of a stamped invoice is not desirable, although it does not pose a major problem because the UUID allows you to recreate the information on that invoice (obtained from the official registry).
So, no matter what you do with the data in your Dolibarr, whatever you’ve declared to the authority never disappears. There are methods, which I won’t go into detail, for canceling documents with the authority.
I hope I’ve shed some light on this topic, which has little to do with the purpose of this forum.
The truly important thing in this forum is Dolibarr’s functionality.
With the constant:
INVOICE_CAN_ALWAYS_BE_REMOVED = 1
You can delete invoices even if some have been registered after the first one.
The use of the tools is the responsibility of the user; it is not the responsibility of the tool itself.
If deleting an invoice is not possible or permissible in your context, do not use this option.
By the way, if you’re looking for a custom module to stamp invoices in Dolibarr, look for VivesCloud; it’s a good option for basic electronic invoicing functionality in Mexico.
But don’t believe anything I say.
You have to read to learn. I speak from my ignorance and hope someone else finds it useful.
Hi @ASCI_Jose
I’m sorry you feel that way, i had no intention of insulting you when answering this but this is an erp forum for professionals and all information is critical cause business means money so this being an accounting software means that all info should be valid(no room for opinions when talking about laws). The truly important thing in this forum is to help users do their business.
Any functionality must abide to the laws.
So use of this constant is illegal to the majority of countries because in case of an audit the existence of validated and not stamped(in your case for example) or deleted invoices(although serial number is not required in Mexico still exists in the xml, you have to wonder why) points directly to the illegal practice of tax evasion!