Different Serial Number for each company

he , i’am trying to get different serial number for each company created in erpnext but i can’t, kindly support

do you mean naming series of the doctype entries ?

yes, like serial number for journal entries in one company to be different than the JV number of other company

i have more than one company , i need each one to have its own serial number for (JV, SALES INVOICES)

So there are two ways of doing this:

  1. Via Python (autoname function)
  2. Via Custom field

I’ll tell you about the second one because I don’t want you to get into custom apps if you don’t need it.

Okay. First you need a custom field called Naming Series of type select with all the naming series you want. Also, it is highly likely that there already exists such a field. This is how you proceed. I’ll give you an example of Journal Entry. From that doctype, click on Customize Form and make these changes and click on update

When you open a new doc, you will be able to select what naming series you would like to select:

here are some entries. check the entry series on the right side.

This is the simplest possible solution with no code. A more smarter solution would be to use a custom script and check before saving if the Company name is AYS Computers set the naming series to be AYS-.YYYY.-####, or if it is Rocket Sales then set it to the RSC series.



This can be managed using custom feild and naming series.

Also @root13F has described you in brief.Please go through it

thanks Dear , I know how to update the serial but i need to link it to specific company not to be selected which mean each company linked with it’s own serial ,

You’ll then need a custom script to set it before it is saved for the first time.

thanks dear , actually i need to link the company with specific serial , if i have more than 15 company i need each one to be linked with it’s own serial .

i understand that and that is why I was suggesting a custom script which will check what company it is and then set the naming series according to the company and the doctype. However, if we write a custom script, then we ought to do it for every single doctype the companies use. hence there has to be a better way.

In your case,the solution is to use a naming series to company mapping. Sort of configuration. I’ll help you out once i get my hands on a system. However it seems you may have to write one script for each doctype but lets see how it turns out. the only advantage will be that you won’t have to write lots of line. simple fetch.

thanks for your kind support
,waiting your reply

@root13F any update Dear

try this solution : Multi Company Naming Series · Issue #15720 · frappe/erpnext · GitHub
It suites me

1 Like