Limiting number of Items Sold

A simple method to limit a Menu Item being sold beyond availability. This does not track actual Physical Inventory, but can be used for many cases such as a daily special for something like Soup.

FLOW:

In this example, we have defined 2 different soups, each with their own limited Quantity.

At start of Work Period we are prompted for Item Count: (we enter 10 and 15)

When 10 Onion soup have been ordered, we are prevented from ordering any more:

When 15 Tomato soup have been ordered, we are prevented from ordering any more:


SETUP

:exclamation: There is a catch with this simple Setup that you should be aware of:

You can not add a Soup, then select/highlight it, then use the +/- buttons to increase/decrease the Quantity

Action - Update Program Setting Item Count:

Setting Name: ItemCount_[:ItemName]
Setting Value: [:count]
Update Type: [:updateType]
Is Local: False


Action - Cancel Order:

Only Last Order: True


Action - Execute Automation Command:

Automation Command Name: [:AMCname]
Command Value: [:AMCvalue]
Delay: 0

:exclamation: All Rules need a Default Mapping

Rule - Work Period Started Set Item Count:

Event Name: Work Period Started

Execute Rule if: Matches
Custom Constraints: (none)

AC LI Update Program Setting Item Count:
Constraint: (none/blank)
ItemName: Onion Soup (this should exactly match the name of a Product)
count: [?How many Onion soup do we have today;;;ON]
updateType: Update

AC LI Update Program Setting Item Count:
Constraint: (none/blank)
ItemName: Tomato Soup (this should exactly match the name of a Product)
count: [?How many Tomato soup do we have today;;;ON]
updateType: Update


Rule - Order Added Decrease Item Count:

Event Name: Order Added to Ticket

Execute Rule if: Matches Any
Custom Constraints:
Menu Item Name Equals Onion Soup
Menu Item Name Equals Tomato Soup

AC LI Update Program Setting Item Count:
Constraint: (none)
ItemName: [:MenuItemName]
count: [=TN('{QUANTITY}')]
updateType: Decrease

AC LI ExecAMC:
Constraint: (none)
AMCname: LI Check Item Count
AMCvalue: [=TN('{SETTING:ItemCount_[:MenuItemName]}')]


Rule - RU LI Check Item Count

Event Name: Automation Command Executed

Execute Rule if: Matches
Custom Constraints:
Automation Command Name Equals LI Check Item Count
Command Value Less 0

MSG TEST: (this is a generic Show Message Action)
Constraint: (none)
MessageToDisplay: Not currently available: [:MenuItemName].\rYou ordered:{QUANTITY}\rWe have:[=TN('{SETTING:ItemCount_[:MenuItemName]}')+TN('{QUANTITY}')]\rCanceling Order.

AC LI Cancel Order:
Constraint: (none)


Rule - Order Cancelled Increase Item Count:

Event Name: Order Cancelled

Execute Rule if: Matches Any
Custom Constraints:
Menu Item Name Equals Onion Soup
Menu Item Name Equals Tomato Soup

AC LI Update Program Setting Item Count:
Constraint: (none/blank)
ItemName: [:MenuItemName]
count: [:Quantity]
updateType: Increase


DB Tools Import File:
LimitItemSales.zip (1.4 KB)

:exclamation: You will need to edit the Rules to contain your applicable Product Name(s).

4 Likes

If you prefer, instead of Work Period Started Event, you could set up an Automation Command button to set the Item Limits (or you could have both at the same time). This would be useful if the cook doesn’t come in until later, or if they decide to make more soup that night…

Flow:

Automation Command:

Rule:

2 Likes

(post deleted for clarity)

2 Likes

Where should i put this file?

You need to have the database tools module instslled first then you use this to import the file

1 Like

How could i add more AC LI Update Program Setting Item Count:? there are only 2 questions , i need more items.thanks

i mean more actions for more produts

In the Rule, click Select Actions.

In the Action chooser, on the left side, right-click and select Display All Values. Then scroll to the bottom of the list on the left… your previously-added actions will be there.

Choose the Actions you want to add to the Rule, namely: AC LI Update Program Setting Item Count

I don,t see the Display all Values ,

Thank you for your help ! i found it

One more question. ex. If i have only 1 onion soup in stock and i choose 3 x onion soups , sambapos allow me to choose 3 of it even its only 1 less , but if i choose 2 times 1 onion soups ,its appears the banner no more onion soups.

@greencyber, you’re correct. The setup is flawed in this manner. Give me some time to modify it to fix this problem.

ok,could you tell me when done?thanks

Add a new Action:

Modify this Rule:

Add a new Rule:

Message:

Not currently available: [:MenuItemName].\rYou ordered:{QUANTITY}\rWe have:[=TN('{SETTING:ItemCount_[:MenuItemName]}')+TN('{QUANTITY}')]\rCanceling Order.

Original Tutorial post has been modified to reflect these changes, and the DB Tools import file has been updated to contain these changes as well.

2 Likes

How can i paste this message?

Highlight the message text here in the forum, hit Ctrl-C to copy to clipboard.

Highlight the parameter cell in the Rule, hit Ctrl-V to paste clipboard contents.

Thank you, Do i have to map this rule?

Why should i have to set all the product quantity again every time ?should i fix some product quantity and change another?

This is not tied to actual inventory there is no way currently. So you need to tell it how much to start with.