My blog https://blog.csdn.net/zhangxingping/article/details/116346886 gives a detailed description of how a barcode scanner reads a barcode.
This blog gives you a general description of what happens in a supermarket when a barcode is read at the checkout.
- A supermarket has a database server which is used stores the information about the goods they are selling, including the descriptions, prices, numbers of stock items.
- The barcode uniquely identifies each item.
- When a barcode is scanned, its equivalent number is searched for in the stock database.
- The stock item is found by using the barcode number and the description and price are send back to the checkout and they are displayed on the monitor.
- The number of stock item is reduced by one each time the barcode is read.
- The new number is checked against the re-order level. If it is less than or equal to this value and the item is not re-ordered, more stock items are re-ordered automatically.
- An item is marked reordered to prevent the duplication of reorder each time a reorder is make.
The advantages of using barcodes:
To the management:
- easier and faster to find the price of each item.
- easier to update sales information
- allows for automatic stock control.
To the customer:
- quicker checkout queue. (Entering the numbers of goods that you purchase manually is slow and error-prone)
- quicker and correct charge. (The computer can do the calculation much faster and it does not make mistakes.)
- under the control of computer, an itemized bill can be given to the customer.