I don't understand how this works, but shouldn't it be as simple as NumAvailable = NumIn - NumSold - NumDamaged?
NumSold and NumIn are ofc eady to keep track of, and NumDamaged could just be like a portable barcode scanning device that the staff scans with whenever putting away a broken item.
If the world were a deterministic computer system, yes.
It is not.
For instance, NumIn would indicate how many received at the store, no? But what then?
It needs to physically exist somewhere. The display? Overflowing onto the overhead? Overflowing onto the next overhead over? Pushed to the back of the overhead behind something else? Kept in the back because there's no room anywhere?
A lot of stores used to do things like close for part of a day to do inventory. I assume there is still some syncing up during the night or whatever. But I also assume that, as with many things, many stores have probably been willing to trade off a degree of accuracy for reduced costs.
NumSold and NumIn are ofc eady to keep track of, and NumDamaged could just be like a portable barcode scanning device that the staff scans with whenever putting away a broken item.