Stop selling out of stock items

That’s the issue, in each case it return null :expressionless:

If they both return null then something else is wrong as how can a valid inventory query return null?
What’s the Russian bit after {NAME}? (Sorry if it not rusian, being a bit presumptive)
I’ve never delved to deep into inventory so not best one to help.

It is warehouse name. Локальный склад-Local warehouse

Run some tests twweking that expression. I would expect it to return something other than null if inventory were setup correctly and expression correct.
There are several name type {} expressions so try some of the others.
Maybe try hardcoding a name.
Also not sure if it would require inventory item to have exact name of product for you example to work. Don’t know if it would resolve inventory from order/product name like that is inventory item is named differently.

My bad, it seems, it is not retorning null. I put new rule constraint {REPORT INVENTORY:{NAME}:Warehouse name} in not null and this rule works, however i cannot see retuned value through show message action.

I have something similar in my experimental setup. It shows a popup message but never really tried cancelling orders though.

Does displaying [:MenuItemName] not work for you?

You have less than 15 on constraint of less than 5? :-p

1 Like

Haha, I noticed as I was taking the screen shot :sweat_smile:

Technically it’s not wrong lol

1 Like

No, MenuItemName does not help also :neutral_face:

Show us your constraints of the actions in that rule.

Use this expression to determine Inventory - Unsubmitted Orders

 [=TN('{REPORT INVENTORY:[:MenuItemName]:Локальный склад}')-TN('{TICKET ORDER QUANTITY TOTAL EXP:(MN=[:MenuItemName]) && (OS.Status=New)}')]

There is need to add multiple constraints. You only need to check LESS THAN 1.

Real time inventory calculation is an expensive operation. Try to use it for items that is really needed. Better use product tags to enable it for specific items. For example there is no need to track it for water. Water inventory will never drop below zero in a serious restaurant.

3 Likes

Null one was an attempt to bypass for producta without inventory configured.

Tried this but its not working when item remains 1 you ca still sell it multiple times

Use show message to check output as expected.
Is it including the orders being added in this automation? Should do but if not maybe need to add qty of added.

Normally, this function should be default one, without using any rules and actions. As it is one of the needed staff in most restaurants. Even with rules and actions, we cannot get what we want, still items can be sold when there is 0 in inventory stock. It’s funny, that such a good POS software doesn’t include that small function that was required so many times in forum.

It can’t be set by default as what if you don’t use inventory?

It should be possible, if it’s not working likely a configuration mistake.

I don’t meant that it should be enabled by default, no. Simply, there should be just a tick box where you can enable/disable it.

1 Like

Not configuration mistake. From the beginning SambaPOS doesn’t have actions to work properly with inventory stock. We have tried to build it with what we have, but still there are a lot of ways to circumvent that rules with inventory stocks.