This tutorial goes along with my Order Queue Tutorial found here:
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.
Step 1:
Insert this expression in the printer template portion of the ticket lister where it says ETA.
{CALL:Time.eta('{SETTING:{TICKET NO}}','{DATE:hh:mm}')}
Step 2:
Create an Execute Automation Command action as follows:
Create an Update Program Setting action as follows:
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:
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:
[=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:
function eta(e,t){
var time = t;
var eta = e;
if (time>eta){
return tag.Color('red',eta);
}
return eta;
}