Prototypes TallyP18 · Stock scanner
The server

What the stock server holds

Every operation the phones sent, in the order the server received them, read every 2 seconds. An operation’s time is the time it was made on the phone, corrected by the difference between the phone’s clock and the server’s.

MeasureCount
Items in the catalog0
Locations0
Operations received0
Stock rows changed0

Latest operations

ReceivedIdPhoneChangeMade on the phoneTime used

Every route

MethodRouteWhat it does
How Tally is built
  1. The phone keeps the whole catalog of 10,000 items in IndexedDB, so a scan finds its item with no network. A service worker keeps the app itself.
  2. The camera’s frames go to the browser’s BarcodeDetector where it has one. Where it does not, Tally reads the frames with its own EAN-13 reader: it takes rows of pixels across the middle, finds the guard bars, matches each digit’s four bars and spaces, and checks the last digit. A code counts when two frames read the same.
  3. Every change is an operation with an id made on the phone and the time it was made. It is stored on the phone first and sent when the network is there. The server stores each id once, so an operation sent twice counts once.
  4. The server works out the stock of an item at a location by replaying its operations in the order they were made. A count sets the level, and a receive, a pick or a move changes it. A count made offline therefore takes its place in time, and a pick made after it on another phone still counts.
  5. At every sync the phone sends its clock. The server corrects the times of the phone’s operations by the difference between the two clocks, so a phone with a wrong clock does not move its counts.
  6. The report shows each count beside the stock the server expected at the moment it was made.