| West Wind Web Store |
| How Inventory works |
Inventory is managed only for items marked as Physical
The wws_items table has a Physical field which determines whether inventory is updated for an item when an invoice is saved.
Inventory is updated only when an invoice is saved
While orders are being entered inventory is not updated in any way until you call the Save method of the Invoice object. This triggers a sequence of events that first removes all lineitems from the invoice and puts items back into inventory, then takes them all out again and adds it back to the invoice resulting in accurate inventory counts. Note that this can lead to potential stock shortages especially on the Web when items are near 0 stock counts and multiple people are putting the same item into their shopping baskets.
Inventory stock checks are not necessarily automatic
If you use cLineItems::AddLineItem() an inventory check will be performed automatically. But if you create lineitems on the fly and add them to the invoice lineitem array no implicit checks are performed. You can use the cItem::CheckStock and cItem::UpdateInventoryCount().
Another approach might be to directly interface with your existing inventory management when orders are placed. So you could override the routines that handle the inventory checking and updates (cLineItems and cItem classes).
Finally for non-physical product businesses or companies that sell only a handful of products that will never be out of stock simply turn off the physical flag on all items and allow orders to be placed without any regard to inventory levels.
Last Updated: 5/31/2003 |
Send topic feedback