# Ticket Order Count EXP Constraint

**URL:** <https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962>\
**Category:** V5 Question\
**Created:** [March 16, 2021, 5:27am UTC](https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962 "2021-03-16T05:27:03Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Posflow](https://forum.sambapos.com/user_avatar/forum.sambapos.com/posflow/32/63001_2.png) [@Posflow](https://forum.sambapos.com/u/Posflow)\
**Post date:** [March 18, 2021, 8:36am UTC](https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962/21 "2021-03-18T08:36:55Z")

</div>

@Jesse do you know whats the syntax for this expressions field in Select Orders Action? Its kind of semi-working, not sure which one of these expressions its picking up on

 ![image](https://forum.sambapos.com/uploads/default/original/3X/c/c/cca7abbb68e0b9a6d9b8ebbda70b77c88142bef8.png)

It was released back in 5.2.14

> [@SambaPOS 5.2.14 Release](https://forum.sambapos.com/t/sambapos-5-2-14-release/18392):
>
> [arrow_down](https://forum.sambapos.com/images/emoji/twitter/arrow_down.png?v=6) Download: [https://sambapos.com/?wpfb\_dl=203](https://sambapos.com/?wpfb_dl=203)[warning](https://forum.sambapos.com/images/emoji/twitter/warning.png?v=6) Don’t forget to create a backup before installing new releases. You’ll need a working backup if you need to rollback to previous version. What’s new in 5.2.14 Ticket / Order / Order Tag details printer tags added Logging for scale devices added. Auto select fixed for custom menu item buttons Printer tag for reading order tag quantites added Weight barcode checkdigit issue solved. Add more logging to scale device. Toggle order…

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [March 18, 2021, 11:30am UTC](https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962/22 "2021-03-18T11:30:25Z")

</div>

Whats the event?  
Expect its the MN part if your having issues.

---

<div class="post-metadata">

**Author:** ![Posflow](https://forum.sambapos.com/user_avatar/forum.sambapos.com/posflow/32/63001_2.png) [@Posflow](https://forum.sambapos.com/u/Posflow)\
**Post date:** [March 18, 2021, 12:20pm UTC](https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962/23 "2021-03-18T12:20:48Z")

</div>

Automation Command Executed event while the order is selected. Its almost as if expressions are doing only OR operation instead of AND. Because it does what its supposed to do but only when any one of these expressions is valid.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [March 18, 2021, 12:26pm UTC](https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962/24 "2021-03-18T12:26:05Z")

</div>

Predictable sugestions if not already, show message with those values to make sure expected returns.

When you say semi you mean its semi firing or semi selecting?

Whats %, i mean I know what your doing but not done that before and intregued on exactly what its doing?

---

<div class="post-metadata">

**Author:** ![Posflow](https://forum.sambapos.com/user_avatar/forum.sambapos.com/posflow/32/63001_2.png) [@Posflow](https://forum.sambapos.com/u/Posflow)\
**Post date:** [March 19, 2021, 5:09am UTC](https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962/25 "2021-03-19T05:09:11Z")

</div>

Basically I am automating Cancel Order. Its just extra quirks I want to polish out because I am too stubborn to let it slide 😅

When you order

1. 

```
1 x Glass

```

2. 

```
1 x Glass

```

3. 

```
1 x Glass FREE

```

So if I cancel say 2nd one, its supposed to automatically select gift one and update gift to null.

So then result would be

1 x Glass  
1 x Glass

> [@JTRTech](#):
>
> When you say semi you mean its semi firing or semi selecting?

Well the whole thing works when any of the expression is True.  
This is my expression…

```auto
(OS.Status=New) AND (OS.HHNumber=0) AND (MN={PRODUCT NAME})

```

BUT it behaves like its this, which is why I asked Jesse, maybe I am using wrong expressions or something.

```auto
(OS.Status=New) OR (OS.HHNumber=0) OR (MN={PRODUCT NAME})

```

@VehbiEmiroglu could you please tell me whats the right syntax for Select Orders Actions in the Expression Field

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [March 19, 2021, 10:10am UTC](https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962/26 "2021-03-19T10:10:54Z")

</div>

What happens if they have 6, 4 and 2 gift, and cancel one of paid ones?

---

<div class="post-metadata">

**Author:** ![Posflow](https://forum.sambapos.com/user_avatar/forum.sambapos.com/posflow/32/63001_2.png) [@Posflow](https://forum.sambapos.com/u/Posflow)\
**Post date:** [March 19, 2021, 1:44pm UTC](https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962/27 "2021-03-19T13:44:12Z")

</div>

Thats why I put to cancel just the New one, but it doesnt listen to the expression, it removes gift state to a Submitted order.

Say on ticket there is:  
1x Glass `Submitted`  
1x Glass `Submitted`  
1x Glass GIFT `Submitted`

* * *

1x Glass `New`  
1x Glass `New`

And I cancel last one, it will update GIFT order even though its submitted because its not listening to (OS.Status=New) expression.

It has a brain of its own haha

I think I hit a snag that wont go away without help from Devs, so for now I will put this cancelling thing for later and possibly use Adjust Order Price action.

I came to a point where I am putting in too much time into reinventing the wheel

Thanks for all your suggestions and help, if you want the DB and want to try it out yourself just hit me with a PM.

P.S. I might actually send you a message to give me some help with that Adjust Order Action if I hit another bump down the road. 😅

🙏 🙏 🙏 🙏

[Previous page](https://forum.sambapos.com/t/ticket-order-count-exp-constraint/23962.md?page=1)
