@pizzaeilat4
Here is the script:
Goes into Automation > Scripts
Name it whatever you want but for handler put tlister
function min(minutes)
{
var test = minutes;
if (test>10){
return '<R><block 276,0,0,0><color Red>' + test + ' min.</color></block>';
}
return '<L><block 276,0,0,0>' + test + ' min.</block>';
}
The format for Ticket Lister widget:
<J><block 30><color #AA00FF00>{TICKET NO} </color></block>
<L><size 12><block 10>
{ORDERS}
<L></block></size>
{CALL:tlister.min('{TICKET STATE MINUTES:Status}')}
[ORDERS]
<J>{QUANTITY} {NAME} | {PRICE}<br/>
Finally the rest of the settings for widget:
To adjust the timer for when orders turn red you simply change this line:
if (test>10){
Put whatever time you want the example shows after 10 minutes it turns red.
BTW You should rename var test I just used test for quick testing Something more fitting might be
var min = minutes;
You could also rename the function because min isnt the most fitting but it really doesnt matter as it works with whatever you put there. Just bad programming habits.
I would probably rename it to this:
function latetimer(minutes)
{
var min = minutes;
if (min>10){
return '<R><block 276,0,0,0><color Red>' + min + ' min.</color></block>';
}
return '<L><block 276,0,0,0>' + min + ' min.</block>';
}
Then the format portion of widget would be:
<J><block 30><color #AA00FF00>{TICKET NO} </color></block>
<L><size 12><block 10>
{ORDERS}
<L></block></size>
{CALL:tlister.latetimer('{TICKET STATE MINUTES:Status}')}
[ORDERS]
<J>{QUANTITY} {NAME} | {PRICE}<br/>