I am making software that will allow the user to print a receipt. The receipt includes the receipt number and will use to track the receipt itself. But I can't decide whether I will reset the counter every 1st day of the month to start at 1, or just continue incrementing the numbers.
For example (continues increment);
Name: John Smith
Date: 10/01/2022
Receipt #: 0489479876
Or (reset the counter every month);
Name: John Smith
Date: 10/19/2022
Receipt #: 000000001
The receipt number is limited only to 9 digits and may reach the maximum value over years of use if continue incrementing. The good thing is this can be the unique id from the database table itself and I don't need to handle resetting the counter for it. Whereas when using the second option, I have to check the last receipt number from the database table within a month and manually increment the value. The good thing about the second option is that it's easy to track the receipt because it won't have multiple digits, especially to identify if there are duplicate receipt numbers (assuming there was a bug or something).
I'm not sure what could be the other cons and pros of each option but if I am more concerned about the user, I want it to be friendly as possible.
PS: I also have a QRCode in the receipt composed of a unique string that will identify each receipt. I can use this to quickly query the transaction in my database.
submitted by /u/seynalkim
[link] [comments]
from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/wZIrXgT