# \[Question\] Split ticket based on Positions

**URL:** <https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509>\
**Category:** V5 Question\
**Created:** [September 17, 2016, 8:46pm UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509 "2016-09-17T20:46:18Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![sukasem](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@sukasem](https://forum.sambapos.com/u/sukasem)\
**Post date:** [September 22, 2016, 11:57pm UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/21 "2016-09-22T23:57:25Z")

</div>

Simpler way is add 20 execute print jobs (using Order State Name: Position and Order State: 1 to 20) lol no loop needed. I think 20 ppl in one ticket is too many already. It is way too long in order screen. Normally I break it up around 12 seats.

BTW: I think should change this to V5 Question section.

---

<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:** [September 23, 2016, 12:19am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/22 "2016-09-23T00:19:20Z")

</div>

Fair shout on the print action.  
Not sure agree on the to many people…  
Agree on the category @Hasa do you want to change or do you disagree?

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [September 28, 2016, 4:06am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/23 "2016-09-28T04:06:01Z")

</div>

Hey I like your idea. Can you please show me how you did the setup of the video you showed above. Also some help with setting up the automatic split please since I honestly have no skill in that advanced of a setup. @JTRTech thanks

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 5, 2016, 3:20am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/24 "2016-10-05T03:20:57Z")

</div>

Hey can you please show me how to set that up. I honestly have been trying for the last hour but can figure out how to setup the rule to grab the position buttons value and set that to state to apply for the next order added.

I will learn alot from it if you can show me? thanks @JTRTech

---

<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:** [October 5, 2016, 3:28am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/25 "2016-10-05T03:28:05Z")

</div>

It just uses a program setting value.  
Order added --\> set position state using setting value  
 ![](https://forum.sambapos.com/uploads/default/original/3X/2/e/2eae5bbe1006bca6671410aaa81c38d61e642984.png)  
State name etc in action but would normally put as a [:xxx] in generic rule but was in rush.

Position button pressed --\> increase program setting value

 ![](https://forum.sambapos.com/uploads/default/original/3X/4/1/41ac1f593c5538a5f7e2a3bf178feb9934af7d73.png)

Close ticket --\> reset program setting to 1  
 ![](https://forum.sambapos.com/uploads/default/original/3X/9/e/9e18625673a89e8b16192650b4d69936eac20b73.png)

Might be better option for resetting than close but was only example.

The button header just uses the setting value as it is now;  
 ![](https://forum.sambapos.com/uploads/default/original/3X/3/6/36d055e90d09e5a9142dfcac7ebf34d8eab9d3c6.png)

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [October 5, 2016, 3:30am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/26 "2016-10-05T03:30:37Z")

</div>

Can I see your state real quick also please? @JTRTech

And your action

---

<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:** [October 5, 2016, 3:32am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/27 "2016-10-05T03:32:43Z")

</div>

![](https://forum.sambapos.com/uploads/default/original/3X/e/b/ebcd8c7e8e4a2d28937dc760e6bf5af28f9a2486.png)

my preference would still be the [:xxx] method like this;

![](https://forum.sambapos.com/uploads/default/original/3X/a/f/af8a0208608205e321fd1371807f5a5ad6e0487b.png)

and have state name in the rule rather than action… makes admin easier and more visable

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [March 5, 2017, 2:05am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/28 "2017-03-05T02:05:02Z")

</div>

So im finally trying to accomplish a split tickets based on positions solution. Im trying to wrap my head around it but getting kinda confused 😕

My proffered flow:  
Every order has a SeatPosition State assigned… (ex 1, 2, 3, 4)

AC Button “Split All” is pressed.

Automatically all orders with state SeatPosition “1” are put into one ticket  
all orders with state SeatPosition “2” are put into another ticket  
and etc

Samba navigates to Ticket Lister Screen.

I got the part to assign positions done. I know that I need to somehow use value looper to loop through all orders and read the SeatPosition Value and move it to the new ticket. This is where im stuck.

Any little piece of help or advice or spiritual guidance is greatly appreaciated haha 🙂

 ![](https://forum.sambapos.com/uploads/default/original/3X/3/b/3bf5dd4f98f04a45c7f891d3206f883b8b8cdea5.gif)

---

<div class="post-metadata">

**Author:** ![markjw](https://forum.sambapos.com/user_avatar/forum.sambapos.com/markjw/32/9942_2.png) [@markjw](https://forum.sambapos.com/u/markjw)\
**Post date:** [March 5, 2017, 2:24am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/29 "2017-03-05T02:24:56Z")

</div>

Will this not do what you need… ?

> [@Split bill, Take Order and Pay by Seat, All in one ticket](https://forum.sambapos.com/t/split-bill-take-order-and-pay-by-seat-all-in-one-ticket/13643):
>
> I’ve been using this method for a while and I just redesign it to reduce button. HOW IT WORKS: Release Notes: Jan 6, 2017 - V0 Initial release Need @emre help with TICKET ORDER EXACT TOTAL (version 5.1.61) to work with tax and calculation. I still can’t get tax to include in EXACT TOTAL.

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [March 5, 2017, 2:29am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/30 "2017-03-05T02:29:13Z")

</div>

I somehow completely missed that tutorial. Wow thanks I’ll look at that now and come back if I have questions.

---

<div class="post-metadata">

**Author:** ![markjw](https://forum.sambapos.com/user_avatar/forum.sambapos.com/markjw/32/9942_2.png) [@markjw](https://forum.sambapos.com/u/markjw)\
**Post date:** [March 5, 2017, 2:31am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/31 "2017-03-05T02:31:08Z")

</div>

That tutorial didn’t exist when you asked this question originally, and it might not have came up in search now depending on what you searched for. I just remembered it when I saw what you were trying to do. 🙂

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [March 5, 2017, 2:33am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/32 "2017-03-05T02:33:38Z")

</div>

Okay I just looked at it and it’s a great tutorial that I can maybe learn off of by it doesn’t split tickets like I’m trying to. I’m using my setup for dine in restaurants so customers need the bill before they pay unlike his setup. I think my setup is very ideal for dine in restaurants if I can figure it out

Also there are so many scenarios that his setup doesn’t cover,

Combine positions 1 & 3 together then print bill as one ticket etc.

My setup flow will be really easy IMO  
All tickets will be split based on positions then in ticket lister screen employee can easily merge and print however they want. I can use Qcmcay’s tutorial on putting print all bills button in ticket lister screen. All I need help with is splitting all orders based on their position

---

<div class="post-metadata">

**Author:** ![markjw](https://forum.sambapos.com/user_avatar/forum.sambapos.com/markjw/32/9942_2.png) [@markjw](https://forum.sambapos.com/u/markjw)\
**Post date:** [March 5, 2017, 2:40am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/33 "2017-03-05T02:40:32Z")

</div>

Here is something else that may help (it’s also not what you are looking for but possibly get some ideas):

> [@Advanced Split Payments - New Way to Split Payments for Customers at Ticket Screen instead of Settle Screen](https://forum.sambapos.com/t/advanced-split-payments-new-way-to-split-payments-for-customers-at-ticket-screen-instead-of-settle-screen/7133):
>
> exclamation Always remember to backup your database first before trying new tutorials This tutorial will show an alternative method for splitting payments. This method lets you select orders from ticket screen and press settle it will automatically move those orders to a new ticket allow you to settle them and then return to previous ticket. Optional Configuration Task https://gist.githubusercontent.com/kendash/ea4bae48924e4281066c/raw/arrow_right_hook Copy the URL and navigate to…

---

<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 5, 2017, 11:00am UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/34 "2017-03-05T11:00:39Z")

</div>

You would need to loop the position values maybe using the loop action and a report expression to get a list on the position states on orders of the origional ticket.

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [March 5, 2017, 10:27pm UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/35 "2017-03-05T22:27:01Z")

</div>

To be honest I have been trying to figure this out but having no progress. Any help is greatly appreciated.

I now understand how the loop values works but its not helping me figure out how to use it towards my solution.

I think im understanding a way I can approach this.

Loop all orders in ticket to find highest position value. Then create some kind of jscript function that looks through each order and splits them based on position value and tags ticket with the position.

---

<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 5, 2017, 10:52pm UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/36 "2017-03-05T22:52:42Z")

</div>

Loop execute automation command where the command value is the position number and the rule for it selects the orders with that position state and moves the orders to new ticket.  
You might need to use a local program setting value to store the origional ticket I’d in order to reopen/load the ticket for each loop and move orders finishes on the new ticket.

Split command rule

- save ticket I’d in local setting
- loop value with expression to list position numbers

Loop value execute command rule

- open/load ticket using local setting value for ticket ID
- select orders with position state of command value
- move orders
- clock ticket

Something like that…

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [March 5, 2017, 10:56pm UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/37 "2017-03-05T22:56:27Z")

</div>

How do i select an order with a PositionState value = 2 for example?

Also if you find the free time id love to see an example of this - loop value with expression to list position numbers  
Im getting stuck on how to read each order 1 by 1 and read its position state.

Sorry this is all new stuff to me as I never learned advanced automation. Exciting stuff though. Appreciate your help

---

<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 5, 2017, 11:05pm UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/38 "2017-03-05T23:05:36Z")

</div>

Lol, I’ve never actually used the loop expression, typically used scripts in times when it was an option…

Select orders action has a state field I’m sure…

So you use the loop expression like an ask question to trigger a seperate rule feeding in the value for the position number.

---

<div class="post-metadata">

**Author:** ![Hasa](https://forum.sambapos.com/user_avatar/forum.sambapos.com/hasa/32/50950_2.png) [@Hasa](https://forum.sambapos.com/u/Hasa)\
**Post date:** [March 5, 2017, 11:06pm UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/39 "2017-03-05T23:06:53Z")

</div>

Select Orders action has a order state field but not value field.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [March 5, 2017, 11:13pm UTC](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509/40 "2017-03-05T23:13:58Z")

</div>

I am using a loop in my combo setup. Thing is if your splitting tickets with loop you will need a way to automate loading tickets etc.

More than likely you would have to use constraints looking for specific positions… positions being states.

[Previous page](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509.md?page=1)

[Next page](https://forum.sambapos.com/t/question-split-ticket-based-on-positions/12509.md?page=3)
