Waiter Screen / Ready Orders

Start by showing the waiters entity screen and the widget settings.

here is the widget sir


Hi sir here is action and rules and the script also

function getTaskbyIdentifier(taskType,ident,field) {
// getTaskbyIdentifier(‘KD Task GUI - Food’,‘27751-Qure Burger.Burger-12837-j9tXI2XMRkq7Q446SFfroQ’)
taskType = typeof taskType===‘undefined’ ? ‘’ : taskType;
ident = typeof ident===‘undefined’ ? ‘’ : ident;
field = typeof field===‘undefined’ ? ‘name’ : field;

if (taskType==’’ || ident==’’) {
return false;
}

var qry = ‘{task:getTask(taskType:"’+taskType+’",identifier:"’+ident+’"){id,name,identifier,content}}’;
var r = gql.Exec(qry);
r = JSON.parse®;
var task = r.data.task;

//dlg.ShowMessage("tt:"+taskType+"\rid:"+ident+"\rname:"+task.name);

return task[field];
}

function addTask(taskType,name,content,ident,color,taskTypeOld) {
// addTask(‘KD Waiter - Food’,’’,‘blah’,‘27751-Qure Burger.Burger-12837-j9tXI2XMRkq7Q446SFfroQ’,’#FFFFFF00’)
taskType = typeof taskType===‘undefined’ ? ‘’ : taskType;
taskTypeOld = typeof taskTypeOld===‘undefined’ ? ‘’ : taskTypeOld;
taskTypeOld = taskTypeOld==’’ ? ‘KD Task GUI - Food’ : taskTypeOld;
ident = typeof ident===‘undefined’ ? ‘’ : ident;
name = typeof name===‘undefined’ || name==’’ ? getTaskbyIdentifier(taskTypeOld,ident,‘name’) : name;
color = typeof color===‘undefined’ ? ‘’ : color;

var oldContent = getTaskbyIdentifier(taskTypeOld,ident,‘content’);
oldContent = oldContent.replace(/"/g,"’");
oldContent = oldContent.replace(/\r\n/g,’<!rn>’);
content = oldContent + ‘<!rn>’ + content;

//dlg.ShowMessage("tt:"+taskType+"\rid:"+ident+"\rname:"+name+"\rcontent:"+content);

if (taskType==’’ || name==’’) {
return false;
}

var qry=‘mutation m {addTask (task:{taskType:"’+taskType+’",name:"’+name+’",content:"’+content+’",isCompleted:false,identifier:"’+ident+’",customData:[{name:“Color”,value:"’+color+’"}]}){id,name,isCompleted,content,identifier,customData{name,value}}}’;
var r = gql.Exec(qry);
r = JSON.parse®;
var task = r.data.addTask;

return task.name;
}

function updateTask(taskType,name,ident,color,content) {
// updateTask(‘KD Waiter - Food’,’’,‘27755-Poutine-12841-swifCxkYVk6UDrmcd0JUmg’,’#FFFFFF00’)
taskType = typeof taskType===‘undefined’ ? ‘’ : taskType;
ident = typeof ident===‘undefined’ ? ‘’ : ident;
name = typeof name===‘undefined’ || name==’’ ? getTaskbyIdentifier(taskType,ident,‘name’) : name;
color = typeof color===‘undefined’ ? ‘’ : color;
content = typeof content===‘undefined’ ? ‘’ : content;

//dlg.ShowMessage("tt:"+taskType+"\rid:"+ident+"\rname:"+name+"\rcontent:"+content);

if (taskType==’’ || name==’’) {
return false;
}

var qry=‘mutation m {updateTask (taskType:"’+taskType+’",identifier:"’+ident+’",task:{taskType:"’+taskType+’",isCompleted:false,identifier:"’+ident+’",customData:[{name:“Color”,value:"’+color+’"}]}){id,name,isCompleted,content,identifier,customData{name,value}}}’;
var r = gql.Exec(qry);
r = JSON.parse®;
var task = r.data.updateTask;

return task.name;
}






You have several mistakes that I can seee right off the bat for example Task complete commands you have a less than sign? What did you expect that to do? Also in your template you have [Content] I am fairly sure that is not accurate as well.

ok sir can u help me how to do this please

No I wont do it for you but didnt you follow a guide?

i mean help me sir please

What exactly are you wanting me to do?

sir i want ur help sir when we complete the order from kitchen screen then next it shuld appear on waiter screen same then waiter will check and mark complete this this i want sir

Ok so first go back to the tutoriaal you used and fix all your typos and mistakes. I wont build this just to help you I dont have the time or desire for this. You need to do the work. I am not trying to be mean but it sounds like you may need to hire some paid help.

ok sir i will check again tutorial

Hi sir i check everything of tutorial it is same

Kendash suggested at least one mistake in your command on entity screen widget…

i removed the content from widget and check sir but that did not work

Hi sir i have follow the setup again for this tutorial and it is working for food screen i mean food display products fire to waiter display when i mark complete but drink display product dont fire to waiter display please help sir and i have attach gif file of this sir

Hi sir i did the screen and i have uploaded gif file u can see that but there is one more thing has to be done sir waiter display is not same as kitchen display product is single single in waiter display not in one table like kitchen display

I tried to set my waiter screen as QMcKay mentioned here - Once a task is completed, fire an Autommation command with the order’s Id as a parameter and print another task.
I thought it’s going to work the same way as the KD task print but I’m struggling with passing the Id from the rule to the Execute task print job action.
It ‘works’ but it doesn’t know which order I’m reffering to so instead of printing the data it prints the printer template itself.

I tried the solution suggested here and it works but as it uses the same template as KD I cannot customize it. I would like to only have Product name - Table/Customer name on my waiter screen.

Thank you,
stroodl

For those who might find it useful: I have updated the @QMcKay scripts so that it also duplicates the Custom Data. I use it to prepare data for the Waiter Screen in a custom value because I struggled with formating the same task content for both Kitchen Display and Waiter Screen

function getTaskbyIdentifier(taskType,ident,field) {
  // getTaskbyIdentifier('KD Task GUI - Food','27751-Qure Burger.Burger-12837-j9tXI2XMRkq7Q446SFfroQ')
  taskType = typeof taskType==='undefined' ? '' : taskType;
  ident    = typeof ident==='undefined' ? '' : ident;
  field    = typeof field==='undefined' ? 'name' : field;

  if (taskType=='' || ident=='') {
   return false;
  }
  
  var qry = '{task:getTask(taskType:"'+taskType+'",identifier:"'+ident+'"){customData{name,value},content,id,name,identifier}}';
  var r = gql.Exec(qry);
  r = JSON.parse(r);
  var task = r.data.task;
  
  //dlg.ShowMessage("tt:"+taskType+"\rid:"+ident+"\rname:"+task.name);

  return task[field];
}

function addTask(taskType,name,content,ident,color,taskTypeOld) {
  // addTask('KD Waiter - Food','','blah','27751-Qure Burger.Burger-12837-j9tXI2XMRkq7Q446SFfroQ','#FFFFFF00')
  taskType  = typeof taskType==='undefined' ? '' : taskType;
  taskTypeOld = typeof taskTypeOld==='undefined' ? '' : taskTypeOld;
  taskTypeOld = taskTypeOld=='' ? 'KD Task GUI - Food' : taskTypeOld;
  ident    = typeof ident==='undefined' ? '' : ident;
  name     = typeof name==='undefined' || name=='' ? getTaskbyIdentifier(taskTypeOld,ident,'name') : name;
  color    = typeof color==='undefined' ? '' : color;

  var oldContent = getTaskbyIdentifier(taskTypeOld,ident,'content');
  var customData = getTaskbyIdentifier(taskTypeOld,ident,'customData');

  oldContent = oldContent.replace(/"/g,"'"); // replace double-quotes so they do not make GQL error
  oldContent = oldContent.replace(/\r\n/g,'<br/>'); // replace linefeeds so they do not make GQL error
  content = oldContent + '<br/>' + content;

  //dlg.ShowMessage("tt:"+taskType+"\rid:"+ident+"\rname:"+name+"\rcontent:"+content);
  
  if (taskType=='' || name=='') {
    return false;
  }
  
  var qry='mutation m {addTask (task:{taskType:"'+taskType+'",name:"'+name+'",content:"'+content+'",isCompleted:false,identifier:"'+ident+'"';
  
  qry+= ',customData:[';
            if (customData) {
                for (var d=0; d<customData.length; d++) {
                    qry+= (d==0 ? '' : ',');
                    qry+= '{name:"'+customData[d].name+'",value:"'+customData[d].value+'"}';
                }
            }
            qry+= ']';
  qry+='}){id,name,isCompleted,content,identifier,customData{name,value}}}';
  
  //return qry;
  
  var r = gql.Exec(qry);
  r = JSON.parse(r);
  var task = r.data.addTask;
  
  return task.name;
}
3 Likes

Hi,

I try to setup, a waiter screen with ready order, without succes.
Kitchen Display GUI - Food and Kitchen Display GUI - Drink work, however no item on KD Waiter Display GUI - Food

MY TASK TYPE:
Screenshot 2021-03-08 at 17.19.02

ENTITY SCREEN:

ACTION:

RULES:

SCRIPTS:

WIDGETS:

What I miss? Maybe it’s the widget name.

Thank you
Cordaliss

Can anyone please share how to print out KD Waiter - Food in Entity Screens?

Any one kindly to compile the needed steps from beginning into end?, Right now it’s really sparse

[Edit]

A bug in the SambaPOS v5.3.0++ and above.