N3Roaster / typica

Free software for coffee roasting operations.
https://typica.us
MIT License
26 stars 8 forks source link

Current Inventory Can Become Out of Sync with Ending Balance #114

Closed N3Roaster closed 10 years ago

N3Roaster commented 11 years ago

If an inventory adjustment transaction is sent to the database and then a use/loss/make/purchase transaction is sent with a timestamp earlier than the inventory adjustment transaction, the current inventory will not match the last balance value from item_history(). This can happen if the time on the computer running the database is changed to an earlier time after sending an inventory adjustment or by making an inventory adjustment during a roast.

There are several possible ways to address this issue, but whichever approach or combination of approaches is taken, it must be done very carefully to avoid preventing legitimate operations.

N3Roaster commented 11 years ago

This bug also occurs when sale transactions are entered on an item after an inventory transaction. The green coffee sale window should have its date selector replaced with date/time selector defaulting to the current time.

N3Roaster commented 10 years ago

Time of day is now present in the interface for adding green coffee sales. That is not enough of a change to close this bug. The present thinking is that a trigger function should detect out of order transactions and recalculate current inventory instead of performing a naive update. This should be combined with a warning when entering inventory transactions on items where there is an open batch.

N3Roaster commented 10 years ago

Database redesign planned for 2.0 fixes this. Probably not worth addressing until then.