OK, so been tweeking the hotel setup recently and now the No Sale button on POS screen has stopped working and cannot work out why.
The button on nav screen still works.
Nav screen button
Ticket screen button
Both similar exc the name being prefixed with Nav.
Both of these trigger the custom confirm admin pin rule based on the command name containing ‘ConfirmAdminPin’
Both buttons trigger this prompt.
This is the script;
function canConfirmAdminPin(inputPin){
var userPinCheck = checkUserPin(inputPin);
var tabletPinCheck = checkTabletPin(inputPin);
if(userPinCheck != 0){
qry = "SELECT u.Name as UserName ,max(case when p.[Name] = 'CanConfirmAdminPin' then p.value end) as CanConfirmAdminPin ";
qry += "FROM [Users] u JOIN [UserRoles] r on r.Id = u.UserRole_Id JOIN [Permissions] p on r.id = p.UserRoleId ";
qry += "WHERE u.PinCode = '"+inputPin+"'";
qry += "GROUP BY u.Name";
var userQry = sql.Query(qry).Delimit('~').First;
} else if (tabletPinCheck != 0) {
var tabletPinSettingName = tabletPinUser(inputPin);
var tabletPinUserName = tabletPinSettingName.slice(1+tabletPinSettingName.indexOf('_'));
qry = "SELECT u.Name as UserName ,max(case when p.[Name] = 'CanConfirmAdminPin' then p.value end) as CanConfirmAdminPin ";
qry += "FROM [Users] u JOIN [UserRoles] r on r.Id = u.UserRole_Id JOIN [Permissions] p on r.id = p.UserRoleId ";
qry += "WHERE u.Name = '"+tabletPinUserName+"'";
qry += "GROUP BY u.Name";
var userQry = sql.Query(qry).Delimit('~').First;
} else {
return false
}
var userQryArray = userQry.split('~');
var userName = userQryArray[0];
var canConfirmAdminPin = userQryArray[1];
if (canConfirmAdminPin==0){
return userName
} else {
return false
}
}
That rule also takes the command value and uses it to trigger the requested admin command rule. and via the script will return in the new command value of either the user name (if they can confirm admin pin) for False if they cannot or pin is not found.
Both buttons trigger the same no sale rule below;
Both buttons show the dlg ask question however the POS screen button doesnt actually open the drawer. The nav screen one does.
Bother buttons should be triggering the same print job with following mapping.
I am stumpped as to why one works but the other doesnt.