How to remove revisions from serial number after amend

Hello guys, how to remove revision’s after amend invoice i.e. i create invoice SINV-00003 after amending it saves as SINV-00003-1 i don’t want new copy of invoice just to update old one with same number (SINV-00003).

That is how the amended documents are saved by default. If you wish to have same id you might have to delete it and create a new one.

thanks kanchan, but is there any way (programmatically ) if i cancel the invoice it will become draft invoice. i studied framework & i see if the status of invoice (in database) is 0 that means it is draft invoice and status 1 menas submitted and status 2 means canceled , so if i changed status on click of cancel button the problem will solve but i dont know where is cancel button program is written.

Okay here’s how to do it.

Prerequisites:

  1. System admin access
  2. Hold other people from carrying out those transactions (Sales Invoice, Delivery Note…) that you are trying to amend.

To make it easy, let’s go with this example:

Let’s say you are trying to modify a Sales Invoice SINV-00123 and you don’t want the -1 appendage when you modify this invoice.

Step 1: Make a duplicate of the SINV-00123. It will have the latest series number, but leave it in the draft mode. Let’s say the latest series is SINV-00126. So the duplicated document with bear number SINV-00127. You can and should skip this step if you are generating the document in question from another document (like you are making the Sales Invoice from a Delivery Note or from a Sales Order).

Step 2: Now cancel and delete SINV-00123. Don’t just delete. Cancel and Delete.

Step 3: Now ask all people to stop making transactions for this document, till you finish this cycle.

Step 4: No go to the awesome bar and search for Naming Series. Go to the Update Series section. Use the series of the document you are trying to amend (SINV in our example) and update 1 less than the series number of the document you are working with (In our example you use 122 in the current value field). Click Update Series Number. Hit Refresh and clear cache.

Step 5: If you are recreating the document from another document (like from Delivery Note or Sales Order for Sale Invoice), go back to the document and make the document from the upstream document. Else you can go to the document you duplicated in Step 1 and Duplicate the document. Save the document. This document should now bear the series number you were looking for without the appendage -1. Confirm this. Repeat step 4 & 5 till you get it right.

Step 6: Delete the duplicated document (if you duplicated the document) in Step 1, Go to naming series and update the series with the current number (126 in our example). Hit refresh and you can now tell your team that they can proceed making those documents again.

Step 7: Now go back to the document you’d saved in draft in Step 5, and make all necessary changes and submit the document.

Congratulations, you now know how to hack the system so that you get the same series number.

Hope this helps.

Thanks

Jay

3 Likes

If you want you can adopt a simpler solution, you can have documents with suffix -1 but choose to print them (and make PDF) with same number.
In print format you have to edit Heading and place this code
{{ doc.name[:10] }}
Like this for example a Sales Invoice SI-00089-3 will be printed SI-00089. The advantage is that internally you can keep track of changes from the previous documents.
Credits @JoEz who solved this for me…

2 Likes

this isn’t working for me. I tried as u suggest.

Post change, save & reload

image

{{ doc.name.split(“-”)[:2]|join(“-”) }}

Hello @FinForce!
In my case the number is [:10] because my series are like this:
PO.YY.-.#####
I suggest you to use the same series as YY will automatically update itself every year and numbers will restart from zero, in my case I have PO18-00025 for example.
In your case you have to stop at the 8th number, so it would be {{ doc.name[:8] }}

1 Like