Sold out stock per warehouse

I am trying to stop sales of stock when the quantity goes to zero. my challenge is the ware houses i have. how can I do this for other where houses which are also departments.

Few points.
Firstly a rule like that only works if only ever add 1 item at a time.
Adding 10x would be allowed with only 1 in stock as 1 would still be in stock when order added.
In regards department you would either need to make seperste rules and map to department or use a variable in place of the department name. Unfortunately I cannot make suggestion off top of my head as multi departments and inventory are two sections of samba I am not fluent in.

I would appreciate very much if you could suggest for me a better way to check that stock are not sold below zero. On separation and mapping, I have tried making a similar rule for the other warehouse but it does not get called. How do I ensure that the separate rules work.

You need to include the qty being added.
As I said it’s not an area I am fluent in but search the forum, this type of setup has been discussed used many times…

ok what of the rules

What of them?
Just an FYI this is a community forum rather than a free do it for you support line.
Search the forum, many topics on the subject.
Start by looking at an old emre post here to give you an idea of what I refer to regarding the stock vs added orders;

I would like to resolve the use of multi ware house first then I can look and those constrain for stopping below zero sales later as the more I read about it the more I get confused. So If someone can help me with the multi warehouse issue first because I think I am near on it.

Lets assume the rule above works but now I want to use it on more than one warehouse. I have created another rule for another department. My challenge is how do I enforce this rule to work on that department.

As said before can you not just use the rule mapping?

I have done that but there is something I am not getting correct. After creating the rules is there anything that you do to make it work?

Or does it mean that the action get consumed and can not act on two rules(order added to ticket).

I request that some who understand should help me here. There is this event order added to ticket, which triggers rule New order adding rule. Now I have added another rule to take care of the other warehouse that I have. I am using mapping to select how the event should be caught. Can some one help me understand how the event gets to the rules. coz even if I dont set mapping this rule is still not getting called.

Well start by dropping in an ask question or a show message action. Also if you put your{REPORT INVENTORY: expression in the question/message allong with a static value to represent each rule you can see which/if rule is triggering, what value is being returned by your constraint variable which helps debug and work out what is actually happening and why.

Hi Thanks for taking you time to assist me. I have reduced everything to very simple rules and actions and found that it works. I have also learnt how “if” is achieved in samba now. At least with this I can now start working on what you were telling me on the constrain no being perfect to stop selling of item bellow zero stock. I wish that after such engagements the final solution should be stated so that new people do not go inventing the wheel again.
like now I have known that an event can be used several times by making several rules that responds to that event.
Rules that respond to same even form and if section and samba classifies them together.

What most people dont realize is that this is a community forum not a SambaPOS support forum. So it is in actuality the community that would need to post these solutions and most of the time they just get what they want and leave and do not contribute.

While I may be working with SambaPOS now for the last 6 years I was just a community member and I always tried to do my share to contribute. The last year or so we have seen a decline in community involvement. Most members come here and treat this like a support forum which it isnt. We love our community but it is important that everyone understands this is not a support forum.

However we do have SambaPOS support staff that visit this forum and are more than willing to help with reasonable requests. Our entire team is passionate about SambaPOS and we love interacting with community.


I will also remind you that there are Resellers that frequent this forum and would be more than happy to assist you with a paid support.


Hello @OBON,

You can check linked document and adjust warehouse type according to your need.
It might give you an idea about what you want to achieve.