The first sequence could be numbers.
The second can be strings made by using the value and pre-zero them
The third requiers a part as a string, followed by a pre-zero'd number
The fourth can be a number, but as wel treated as a fixed part plus (like 3)
The first is the easyest to implement; just a number.
But 2-4 do appear in the real world, and depend from accountants and their software.
It is impossible to foresee every possible combination (*) which have no real meaning for our purpose here
(*) i.e. long prefix-numbers or signs like in an accountants-office which pre-numbers with a customer's id
cus01-i000001, cus01-i000002, cus01-i000003 ...
The third case can be solved by setting a prefix in the preferences of the user. But the fourth has a prefix that changes after a while, here a year.
A good compromise seems
- to use a prefix which (length in chars) can be "set" by the use (and changed), and of which the chars are simply copied from the previous input. Let's keep the prefix short, use like one char "i", one char plus a sign "i-", "i.", up to four chars "INV-" or a year "2008", which will NOT automatically number on!
- to treat everything after the prefix as a number, which must be pre-filled with zeros.
- so settings needs: prefix length in chars: (4) and prefill zeroes to numberlength of : (6)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The serial number of the documents (invoices) can have a form like:
1, 2, 3, 4 ...10, 11, 12 ..
001, 002, 003, 004 ... 010, 011, 012 ...
I-001, I-002, I-003, I-004 ...I-010, I-011, I-012 ...
200800001, 200800002, 200800003, 200800004 ... 200800010, 200800011, 200800012 ...
The first sequence could be numbers.
The second can be strings made by using the value and pre-zero them
The third requiers a part as a string, followed by a pre-zero'd number
The fourth can be a number, but as wel treated as a fixed part plus (like 3)
The first is the easyest to implement; just a number.
But 2-4 do appear in the real world, and depend from accountants and their software.
It is impossible to foresee every possible combination (*) which have no real meaning for our purpose here
(*) i.e. long prefix-numbers or signs like in an accountants-office which pre-numbers with a customer's id
cus01-i000001, cus01-i000002, cus01-i000003 ...
The third case can be solved by setting a prefix in the preferences of the user. But the fourth has a prefix that changes after a while, here a year.
A good compromise seems
- to use a prefix which (length in chars) can be "set" by the use (and changed), and of which the chars are simply copied from the previous input. Let's keep the prefix short, use like one char "i", one char plus a sign "i-", "i.", up to four chars "INV-" or a year "2008", which will NOT automatically number on!
- to treat everything after the prefix as a number, which must be pre-filled with zeros.
- so settings needs: prefix length in chars: (4) and prefill zeroes to numberlength of : (6)