SambaPOS 5.3.6 Release

Not for now. Its only show your menu.

Can you help me with this error it? when i log out this error pop up

User Explanation:

User said “”

[Exception Info 1]

Top-level Exception
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Samba.Services
Stack Trace: at Samba.Services.ActionProcessors.PrinterModule.ExecutePrintJob.Process(ActionData actionData, RuleExecutionContext context) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\ActionProcessors\PrinterModule\ExecutePrintJob.cs:line 46
at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Common\RuleActionTypeRegistry.cs:line 39
at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData, RuleExecutionContext context) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\AutomationService.cs:line 42
at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.<>c__DisplayClass13_0.b__0() in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:line 76
at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke(Action callback)
at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeWith(AppState appState, RuleExecutionContext context) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\ActionDataBuilder.cs:line 84
at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithoutLogging(Object ruleData) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:line 125
at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\RuleExecutor.cs:line 62
at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, AppState appState) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Services\Implementations\AutomationModule\NotificationService.cs:line 26
at Samba.Presentation.Services.Implementations.AutomationModule.NotificationClient.NotifyEvent(String eventName, Object dataObject)
at Samba.Presentation.Services.Implementations.UserModule.UserService.LogoutUser(Boolean resetCache)
at Samba.Presentation.ClientLibrary.Modules.LoginModule.LoginModule.OnNavigate(String parameterName) in C:\Users\Vehbi\Documents\Source\Repos\sambapos-v5-pro\Samba.Presentation.ClientLibrary\Modules\LoginModule\LoginModule.cs:line 55
at Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass6.<.ctor>b__2(Object o)
at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)
at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


[Assembly Info]

mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Samba.Services, Version=5.3.7816.39267
Samba.Domain, Version=5.3.7816.39266
Samba.Infrastructure.Data, Version=5.3.7816.39266
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Presentation.Services, Version=5.3.7816.39270
System.Core, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v17.2, Version=17.2.13.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v17.2, Version=17.2.13.0
DevExpress.Xpf.Grid.v17.2.Core, Version=17.2.13.0
System.Xaml, Version=4.0.0.0
Samba.Infrastructure, Version=5.3.7816.39262
Microsoft.Practices.Prism, Version=4.0.0.0
System.Runtime.Serialization, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
DevExpress.Xpf.Core.v17.2, Version=17.2.13.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Samba.Persistance, Version=5.3.7816.39267
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=5.3.7816.39263
ReachFramework, Version=4.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
NCalc, Version=1.3.8.0
Microsoft.CSharp, Version=4.0.0.0
Omu.ValueInjecter, Version=2.3.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
DevExpress.Data.v17.2, Version=17.2.13.0
WindowsInput, Version=1.0.4.0


[System Info]

Operating System
-Microsoft Windows 10 Pro
–CodeSet = 1251
–CSDVersion =
–CurrentTimeZone = 180
–FreePhysicalMemory = 12977216
–OSArchitecture = 64-bit
–OSLanguage = 1049
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.18363

Machine
-PABLO
–Manufacturer = Acer
–Model = Veriton X4630G
–TotalPhysicalMemory = 17029283840
–UserName = PABLO\User

Can you please send db backup to support@sambapos.com

I’ve updated from 5.3.0 to 5.3.6 and my scripts stopped working.

If try to run the script using the “test” command in the script window (handler.functionname + parameters), it always says “XXX is not defined” where XXX is the handler.

Is there any solution please?

Thank you

We would need to see your script. To test you don’t use handler. You just use function.

It is just a script that duplicates a task. I would like to show you that it works great in 5.3.0 but I cant download the older version (I’m having 5.3.4 on my laptop and the script does not work here either). This is what I get:
image
How can I download an older version of sambapos please? Thank you

It would be good if we could see the script inside sambapos.

Ok, here it is:
It should duplicate a task. It is executed like this:
image

But the task is not duplicated, although it works great in 5.3.0. Here is the script:

function getTaskbyIdentifier(taskType,ident,field) {
  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) {
 
  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;
}

This is what I get when I try to test the script:

You were right that handler shall not be used in the test command but it still returns an error which says that data.addTask is null or is not an object.

Thank you

If I could download the 5.3.0 I would also show you that it works flawlessly. I updated all PC’s in our restaurant from 5.3.0 to 5.3.6 and the waiter screen stopped working. After some troubleshooting I found out that the script does not work so I uninstalled Samba and returned to 5.3.0. It started working again.
The thing is that I won’t be in the kitchen at least till Saturday, I don’t have the 5.3.0 file and the download does not work :frowning:

then its not useful for us it should be take ordered

1 Like

@KryptonFactor has sent me an 5.3.0 installation file (thank you) so I can show you that it works in the older version.

As you can see, the script returns the Name as it should and it also makes a new entry to the database:

Of course it also works from the entity screen - when the cook marks an order as finished, it disappears from the kitchen screen and a new task appears on the waiter screen. It is not the case with 5.3.4 and later though :confused:

Could you please look into it?

Thank you, Ondra

That script uses addTask gql query, maybe it changed, you can see it by using gql ui helper thru your browser

thank you. How can I find out whether addTask query has changed? I’m sorry but I don’t know what “gql ui helper thru your browser” is and forum search did not help.

Any help would be much appreciated. Thank you

This post goes into detail how to configure everything:

We didnt change addTask mutation. But i will control this script.

Thank you very much. I tried simplifying the script as most of the code is not used in my case but it just does not work in releases after 5.3.0.

I’m also thinking about using the Add Task action instead of this script. Could it solve my issue? I would still need to use the getTaskbyIdentifier function though, but this one seems to work.

I wrote a new script to duplicate a task to become a waiter task:

function addWaiterTask(ident){

	var resp = gqlEXEC(getTask('Kitchen Task', ident));	
	
	resp = JSON.parse(resp);
	
	var task = resp.data!=null ? resp.data.task : null;
	
	var name = task.name;
	
	var customdata = task.customData;
	
	var content = customdata[1].value;
	
	//return addTask('Waiter Task',name,false,'','Waiter',content,'NULL', ident);
	
	gqlEXEC(addTask('Waiter Task',name,false,'','Waiter',content,'NULL', ident));

}

function getTask(taskType, ident) {
    var q = '';
        q+= '{task:getTask(';
        q+= 'taskType:"'+taskType+'"';
        q+= 'identifier:"'+ident+'"';
        q+= ')';
        q+= '{id,isCompleted,identifier,name,state,content,contentText,customData{name,value},stateLog{state,start,end},stateDuration{state,duration},startDate,endDate,userName}';
        q+= '}';
    return q;
};

function addTask(taskType,taskName,isCompleted,customData,userName,content,state,taskIdent) {
    var q = '';
        q+= 'mutation m{';
            q+= 'addTask(';
            q+= 'task:{';
            q+= 'taskType:"'+taskType+'"';
            q+= ',name:"'+taskName+'"';
            q+= ',isCompleted:'+isCompleted;
            q += ',identifier:"'+taskIdent+'"';
            q+= ',userName:"'+userName+'"';
            q+= typeof(content)==='undefined' ? '' : ',content:' + '"'+content+'"';
            q+= typeof(state)==='undefined' ? '' : ',state:' + '"'+state+'"';
            q+= ',customData:[';
            if (customData) {
                for (var d=0; d<customData.length; d++) {
                    q+= (d==0 ? '' : ',');
                    q+= '{name:"'+customData[d].name+'",value:"'+customData[d].value+'"}';
                }
            }
            q+= ']';
            q+= '}';
            q+= ')';
            q+= '{id,name,identifier,content,isCompleted,userName,customData{name,value}}';
        
        q+= '}';
    return q;
};


function gqlEXEC(query, callback) {
	//return query;
    var data = gql.Exec(query);
    var dobj = JSON.parse(data);
    return data;
   };

Works well in 5.3.0, does not work in 5.3.6. I believe there has to be an issue with the addTask mutation.

Icons from login and main screen disappeared and replaced with squares after upgrading to 5.3.6 for Sambapos installed on Windows 7

However, Icons are fine without any problem on windows 10

Any Idea how to fix it? for aesthetic reasons mainly.

Thank you in advance.

Yes you need to install the segoui font. It should prompt for that.

1 Like

Run the installer again and make sure you say yes at the very end where it asks if you want to replace the Segoe UI font. The version of Segoe UI font that comes with some versions of Windows is a cut down version and doesn’t include all the symbols.

1 Like