Closed N3Roaster closed 10 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.
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.
Database redesign planned for 2.0 fixes this. Probably not worth addressing until then.
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.