I am developing a web application, this application will need to generate receipt number for every confirmed transaction.
What is a good receipt number? I think a receipt number should not be just a running number generated by database, but it should have some meaning beyond just a unique running number.
Here is what I have come up with so far,
Format: EYY-ddd-XXXXXXX Example output: E13-146-0000001
E : It is just a to signify this receipt number was generated by my system. This value is always
YY : Is the current year the receipt was generated, so in this case it is
ddd : Is the day of the year,
146 is May 26 (in 2013).
XXXXXXX : Is a 7 digit running number, up to 9,999,999
So my system can generate up to 10 million unique receipt numbers daily until 2099.
What do you think? Is this sensible? Any suggestion is appreciated.
Judging from the comments so far, it looks like there is no specific 'pattern' or 'best practices' for receipt number. My intention in asking the question is to know whether there is specific best practises in generating the number that I should know about. Looks like I am free to use whatever pattern I feel sensible.
- As short as possible (that is why I didnt go for YYYYMMdd-XXXXXXX)
- Somewhat not to obvious (YYYMMdd is way to obvious).
- Should be fixed length. (Easier to detect if customer entered invalid receipt number)
- Can generate fairly large numbers (10 million a day seems sensible, though I doubt my system will be that popular)
- Can be made into QR code (so staff can scan and verify the number is valid)
- Someone mentions about error detection code like ISBN, seems good but I havent read it yet.