Originally Posted by
jadebox
Thanks for working on this module. It is a useful addition to Zen Cart. I'm considering using it to replace a stand-alone utility that I wrote years ago.
There is, however, the potential of a synchronization issue. For example, if an order for one or more of the products comes in while the admin is editing the quantities in the form then the quantity set when the form is submitted will not be correct.
A simple fix is to have the user enter a positive or negative number which is added to the existing product inventory in the SQL statement. I find this useful because it matches the workflow for handing off-site sales and incoming inventory where it is more natural to enter the amount of products sold or received.
A more robust fix would allow the user to enter either an absolute amount or a relative amount. For absolute quantities, you could include the current quantity for each product in hidden inputs in the form and when processing the updates add the difference to the quantity in the database.
When entering absolute quantities, there is the issue that there may be pending orders for some of the products. I don't think there's a right way to handle that situation (other than possibly displaying a warning message) because the software can't know if the products in the pending orders have been pulled from inventory or not.