# Setting an ETA for Take Out orders

**URL:** <https://forum.sambapos.com/t/setting-an-eta-for-take-out-orders/16825>\
**Category:** V5 Tutorial\
**Created:** [January 21, 2018, 6:29pm UTC](https://forum.sambapos.com/t/setting-an-eta-for-take-out-orders/16825 "2018-01-21T18:29:35Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [January 21, 2018, 6:29pm UTC](https://forum.sambapos.com/t/setting-an-eta-for-take-out-orders/16825/1 "2018-01-21T18:29:35Z")

</div>

This tutorial goes along with my Order Queue Tutorial found here:

[https://forum.sambapos.com/t/simple-custom-order-queue-entity-screen-ticket-lister](https://forum.sambapos.com/t/simple-custom-order-queue-entity-screen-ticket-lister)

What this does is gives you a prompt to enter number of minutes it will take to cook the order so the TakeOut customer can get an accurate wait time. It prints the ETA date on ticket and on the order queue screen.

 ![image](https://forum.sambapos.com/uploads/default/original/3X/d/e/deee3ae7cfcfa0c3387275eed220b155852f1cee.png)

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

**Step 1:**

Insert this expression in the printer template portion of the ticket lister where it says ETA.

```auto
{CALL:Time.eta('{SETTING:{TICKET NO}}','{DATE:hh:mm}')}

```

**Step 2:**

_Create an Execute Automation Command action as follows:_

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

_Create an Update Program Setting action as follows:_

 ![image](https://forum.sambapos.com/uploads/default/original/3X/5/4/542ba8799f70ca154eb020714d58bdd508043e78.png)

**Step 3:**

Place your ETA Ask action in a Ticket Created rule no constraints required.

**Step 4:**

_Create an Automation Command Executed rule as follows:_

 ![image](https://forum.sambapos.com/uploads/default/original/3X/f/9/f990dc400b6abeba24fc22c51254db3d2dcd336d.png)  
NOTE: I have a constraint that prevents it from firing if a table is assigned but you can customize that how you like.

**Expression for the Set ETA For Order action:**

```auto
[=FD(ADS('{TICKET TIME}',TN('[?Cook Time(min);;;NOC]')*60),'hh:mm')]

```

**Step 5:**

_Add the following script to the Time Limit script I showed in the Order Queue tutorial:_

```auto
function eta(e,t){
	
  var time = t;
  var eta = e;
	
  if (time>eta){
	
  return tag.Color('red',eta);
	
}
	
  return eta;
	
}

```

 ![image](https://forum.sambapos.com/uploads/default/original/3X/8/f/8f90b8c4c516bece44593a65c17baa726b87ff88.png)

---

<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:** [January 21, 2018, 6:31pm UTC](https://forum.sambapos.com/t/setting-an-eta-for-take-out-orders/16825/2 "2018-01-21T18:31:29Z")

</div>

You can customize this flow however you like and I encourage you to play with it. The way I set it up was to only prompt for Take Out orders and not to prompt if it is a Table Order.

You could even create automation to delete the program setting once ticket is paid… I have not done this yet but plan to.

---

<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:** [January 21, 2018, 6:53pm UTC](https://forum.sambapos.com/t/setting-an-eta-for-take-out-orders/16825/3 "2018-01-21T18:53:23Z")

</div>

~~On the list to do next is some scripting to make the ETA time turn red if it is past due.~~

Tutorial Updated so ETA time turns red if it is passed due.
