Auto numbering/auto increament doctype

i create doctype and i have field image, and i want make auto increament with field number from to number to with status active, and i will call running number in sales invoice doctype

i hope someone can help me create script…
thanks

What is your usecase??
Explain More In details…