Prototypes TallyP18 · Stock scanner
Report

Stock report

What the phones sent, read every 2 seconds. A count shows the stock the server expected at the moment the count was made, so a count made offline an hour ago is compared with the stock of an hour ago.

Counts, newest first

ItemLocationCountedExpectedDifferenceStock nowCounted byArrived

Stock below zero

ItemLocationStock

Phones

PhoneLast syncClock against the serverChanges sent

Latest changes

MadePhoneChangeItemLocation
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.