Waiter Screen / Ready Orders

#21

Do you know what part is giving you trouble? You can show all of them if you like yes.

0 Likes

#22

sure sir i will give

0 Likes

#23

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

0 Likes

#24

here is the widget sir


0 Likes

#25

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;
}






0 Likes

#26

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.

0 Likes

#27

ok sir can u help me how to do this please

0 Likes

#28

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

0 Likes

#29

i mean help me sir please

0 Likes

#30

What exactly are you wanting me to do?

0 Likes

#31

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

0 Likes

#32

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.

0 Likes

#33

ok sir i will check again tutorial

0 Likes

#34

Hi sir i check everything of tutorial it is same

0 Likes

#35

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

0 Likes

#36

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

0 Likes

#37

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

0 Likes

#38

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

0 Likes

#39

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

0 Likes

#40

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;
}
2 Likes