Sorted it! thanks a lot, ill have a go at formatting it now (well copy yours and tweak )
When it converts it to red it ignores right alignment. The memory thing was my mistake I accidently screwed up the jscript and it went into an infinite cycle causing samba to run out of memory and crash. That was a novice mistake I fixed that.
The only issue I have and I can call this done is the minutes when converted to red after 15 min it loses all justification formatting.
OK I thought you’re referring to the memory issue. I’ll check that.
By the way @emre just thought I would let you know that:
<block left,top,right,bottom>
Worked great it now shows correctly. Thanks!
Had to do this:
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>';
}
Kind of odd but it works!
Hi guys.
Is there any tutorial for possible New Ticket Lister formats And how to use it?
I really like the way it looks.
@kendash Can you please share the last ticket lister template that you made? I tried to copy this to my templat but it comes out different and I don’t understand how to get this working.
Thanks
You all should read the V5 Feature Compilation Topic …
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/>
Have you tried putting that tag in the template directly? In other words: don’t use the CALL:X and don’t use a script. If you still see no results for the minutes, did you rename any of your State Groups?
Do any of your Scripts work properly when used with CALL:x ?
Check the block setting. 276 might be too many pixels for your screen. I use 30" screen. Is the numbers running off screen?
So did you get it working? BTW me and @QMcKay had that same issue early on in testing when he first introduced Script Debugger
Yes i did. probably was my problem too.
Thanks.
I really like this new lister format. And I love that it changes color. I think there are a lot of people that will like this.
Dear @kendash
Can you show an example of how to change colors more than once. 10 min= green 20 min=orange 30 min=red etc…?
Can we change the ticket background color after certain time?
Thanks.