Update Sales Invoice name with a new naming_series on submission

Dear Members,

We have a requirement where the Sales Invoice name needs to be changed when it is submitted from draft.

Eg: When new invoice was made, the name was generated with a naming series. When its submitted it name needs to be updated with another naming series.

Use Case:
A Invoice created with name LMN005 - not submitted yet
Another Invoice created with name LMN006 - not submitted yet
Deleted LMN005
Third invoice created with name LMN007

In this case, the sequence LMN005 goes missing

To overcome above, We need to have different naming series for draft & submitted invoices. So even if the submitted invoices are cancelled, we have record of the sequence as submitted invoice when cancelled are not deleted from db.

Please suggest a solution, thanks in advance.

Other accounting programs have the concept of a voided transaction which sets its accounting value to 0, but leaves the transactions with all its items, details, etc. existing. This allows prohibiting deletion of invoices while permitting the occasional use cases a generated transaction must be undone.

In your use case, rather than deleting LMN005 you would just void it. We do it, but setting all values to 0 and submitting.

Thats a great idea. Thanks.

Also is there a way to maintain different series for Draft & Submitted invoices?