Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
6295 Visualizzazioni

Hi All, Using V6.1 on windows I basically want to design a class or function in an existing module, probably the stock module, that would allow the system to create production lot number based on the current date and number of production lot that has been created on that day. I have written a code that I think would do the job but I do not know where exactly to put it. The python code is below which is quite simple. This is to make tracking of product even easier for the company and employees

currentid=None;

#currentid='1130206'

if currentid==None or currentid=='':

   currentid='1'+time.strftime('%y%d%m')

else:

   idpart=currentid[0:-6];

datepart=currentid[1:];

#print (idpart)

#print (datepart)

idpartint=int(idpart)

if time.strftime('%y%d%m')==datepart:

    currentid=str(idpartint+1)+datepart

else:

    currentid='1'+time.strftime('%y%d%m')

#print (currentid)

prodt_lot = currentid

the series should look something like 1132205,2132205...x132205 for the 22May2013 then the next day should start from 1 again looking like this 1132305,2132305...x132305 etc as oppose to the current seven digit number e.g 0000007 generated by the system

Thank you.
Can anyone help please?

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
giu 23
11446
1
lug 16
4014
0
mar 15
4858
2
set 25
536
1
ago 25
507