@emre, is there a way to update this Product Tag using Actions/Rules so you wouldn’t need to go into Manage > Products > Product List > Product and modify the value manually? I don’t see an Action for Update Product Tag…
If it were possible, you could use numeric values instead, and each time the item is ordered, the value decreases, then your rule check becomes: if {ITEM TAG:Available} Equals 0 then Cancel Order.
You could even set the Product Tag to 10 on Work Period Started Event!
With disregard for actual Physical Inventory in a Warehouse, the following would work for simple control of Product Sales…
Work Period Started Event containing Action with [?Prompt] …
(optional) Action Update Program Setting with: [?How Many Soup are Available Today] to put value in {SETTING:Soups Available}
Action Update Product Tag with: [?How Many Soup are Available Today] to put value in {ITEM TAG:Available}
Rule for Order Added Event with Action Update Product Tag with: [=TN('{ITEM TAG:Available}')-1] to decrease count and with Constrained Action to Cancel Order when [=TN('{ITEM TAG:Available}')-1] == 0.
That would suffice for those types of products, where the number of bowls of onion soup is changed daily, and you’re not necessarily concerned with tracking Physical Inventory of onions.
In fact, now that I look at it, you wouldn’t even need a Product Tag at all, just a Program Setting alone would work. Although having the ability to update the Product Tag could still be useful… once {SETTING:Soups Available} becomes 0, update the Product Tag {ITEM TAG:Available} to No.
For actual Physical Inventory in a Warehouse (like Soda, Beer, Buns, etc), that is a different matter. There are no provisions currently built in to read Inventory counts for use in Rules, are there @emre?
We would need an Action to read the count of Inventory Items, something like Read Inventory Values with a parameter for Inventory Item Name, and have it return the Physical Quantity at the very least, or determine the Consumption on-the fly, which might be expensive.
@qmckay, how will you know what inventory items to count when you’re looking at an order?
I’m thinking this would really be great if it could be linked to predicted inventory and recipes.
Like if we could have an action read product availability which reads the recipe, calculates predicted inventory for the items in the recipe and calculates how many can be made of this recipe (or are available), and sets a program setting (like {:LastProductAvailability} or something).
The only thing is that the recipes will never be 100 percent accurate (and there’s wastage as well), so just having the system suggest to check the inventory (and then manually setting the product availability to no) when the Inventory prediction is approaching zero might be better than just automatically disabling the product. We could do this by putting margins in a product tag.
What we are talking about here has no relationship with inventory. Adding constraints production by using actual inventory numbers is not practical. You need to record all purchases immediately and also track all possible wastes and record them immediately too. It does not work such way in real life.
What requested here is we can sell 100 portions of onion soup in a day and when we sell 100 portions we won’t be able to sell more. It does not relates with if we have enough onion to produce more soup…
Though, if you read my post again, we don’t really need it - we can use a Program Setting instead, but it would still be nice to have the ability to use Product Tag directly.
But you could have an idea of how much you’re supposed to have left and check manually when you’re getting close, no?
In my business for example, there’s little waste and all purchases and waste have to be registered immediately, so most inventory numbers should never be off by more than a certain margin.
@pipo regarding original post I was talking about disallowing item sales by calculating how much items you can produce with your current inventory -on the fly-. For example disallowing hamburger sales because your ketchup inventory decreased below 0.
Tracking critical levels for individual inventory items is something different and it is in our to do list.