Feature Requests
Share ideas, discuss and vote on requests from other users in community

Prevent invoices from being changed

Fredrik G shared this idea 7 years ago

Once an invoice has been "issued" accounting practice in some countries does not allow for the invoice to be modified.

I know from a technical perspective that it's almost always possible to change a invoice as long as it's stored electronically, however lawmakers are not technical people and certain leeway is generally accepted in the implementation of this law. Usually the legal system accepts as a good enough solution a system that does not facilitate the change, even if it does not make it completely impossible.

Today's implementation of invoicing in WHMCS however does not just facilitate the changing of sent invoices, it actually makes it itself. Client data needs to be stored with the invoice data, today the invoice data just points to the client ID, if the client data is changed then so is the invoice data for historical invoices. This is not ok.

The usual implementation is system is to have a "invoice sent to client flag" and once that is set the invoice is saved in it's total and can not be changed easily though the system. Some system enables you to "uncheck" the flag and then change the invoice.

I know there are some workaround for this by saving the PDFs of the invoices in a 3rd place or by using the fixed PDF data plugin available as a addon, but they are workarounds and does not solve the basic problem in the system.

Comments (22)


I made a short investigation about this with a friend at PWC and even in England this behaviour isn´t legal. If you need to change an invoice you need to issue debt notes or credit notes, the regulations are nearly the same as in Germany. So you simply can´t just delete invoice items. In England you need to add the original invoice number to the credit note and the date of the original invoice. Nearly the same as in Germany, but we also need to declare for which item the credit note ("correction invoice") is issued.

Currently if an invoice is cancelled, we use a hook to detect that and when the invoice is unpaid, we automatically issue a refund/credit note/correction invoice. That´s ok for us. But if we have more than 1 item and the item in question is simply deleted, we have no chance to be aware of it, right? Or does anybody know a possibility to detect and correct?

Invoicing the way it is, may be ok for proforma invoicing, but we need to get a FAST solution if used with real invoicing.

As a developer I have an imagination what that means for the dev team. Sleepless nights. This will not be an easy task and means to say goodbye to product/automation/invoice linking and go straight to credit/debit notes handling with even more work to invest into automation handling.

I´m willing to contribute a workaround module to the community, if we at least get a chance to catch the deleted items when deletion occurs. Currently investigating how this can be done in detail.

But please consider this request and take it as serious as it is.


There is possibly a VERY SIMPLE SOLUTION. Because only real invoices are affected, WHMCS could implement a new setting: "Don´t touch invoices?"

If set, invoice items will no longer be deleted from invoices, instead a credit note is issued.

Bamm - that easy.

Then it could work like this (no proforma invoicing):

Invoice created with several items


Client cancel one of the products just invoiced.


Client get credit note (new invoice with status refund) for the cancelled item automatically.

This is easy to do - but only for WHMCS devs.

3rd party hook/module would fail, as we can´t detect nor prevent invoiceitem deletion.

Another solution I´am testing right now is much more radical:

We do not need any prepaid invoicing at all, so we just could remove the automation settings from the invoiceitems completely at the time an invoice has been created (not the first invoice, only subsequent invoices). At this time, we manually set nextduedate and nextinvoicedate at the tblhosting table according to the products to prevent reinvoicing. This would have the effect, that on product cancellation it is not possible for WHMCS to delete the invoiceitem any longer as it is no longer bound to a product ID and thus can´t be found. Therefore the invoice remains untouched, while the product can still be cancelled whenever the client wants to.

This is maybe only possible, if you do not need automation (action when an invoice is paid). Most would need this at least for domain renewal. We have a reverse contract (our domains always renew until cancelled, so we do not need to care about this)

I do not recommend to do so to anybody as this is really a radical cut which can bring some unwanted results.

So please WHMCS.... do the simple thing and don´t touch invoices anymore.


This situation of invoices being altered automatically is doing my head in. I agree with Michael that automatically creating a credit note would be a good solution to this, but even just leaving the invoice as-is would be better, we can handle creating credit notes manually but these undetectable removals of line items opens us up to potential legal trouble.