Order ready notification with Task editor

Hello, I setup Kitchen Display in SambaPOS4 with Ticket Lister and I can print a notification using a rule taking advantage of Update Order State when I push an automation command button in the Kitchen Display but I had some problems with it, I used a programmable button to erase the order, and it was sort by Last order but when a drink is ordered, that update the order of the ticket in Kitchen Display and is hard to use the mouse to erase the order, so I upgrade to SambaPOS5 and I follow this tutorial:

And everything is great but I want to print a message when an order is erase in the Task Editor but I don’t know how to do it because it doesn’t use an Automation Command Button and the State Order doesn’t change, if you know a way to do it I will be very greateful.

When a Task is Complete (erased?) you can fire Automation Commands. Look at the Task Editor Widget Settings, and add Automation Commands to the box called Task Complete Commands.

Within the Rule that handles your Automation Command, you can fire actions to print messages and change Order State.

Hello, thanks for your answer, I’ve done this:



But when I mark an order as complete, the ticket doesn’t change, but if I push the Automation Button in the ticket, the rule works, I think that the problem is when it tries to load the ticket but I don’t know how to solve it, thanks

Ok, so we need to pass a Command Value from the Widget as well.

You need to edit your Template so we can assign the Ticket Id to a Custom Field. We will name this Custom Field TID.

Then we can pass that Custom Field as the Command Value along with the Command Name from the Widget.

So in your Printer Template, add the following so that it will assign the {TICKET ID} to the TID Custom Field:

(TID={TICKET ID})

And in the Task Complete Commands section of the Task Editor Widget we will pass the TID along with the Command.

The syntax to pass a value with the command is:

CommandName:CommandValue
... or ...
CommandName:[CustomFieldName]

So we will use this:

Listo:[TID]

Now in your Rule, the [:CommandValue] will contain the value stored in TID, which is the Ticket Id.

3 Likes

You are brilliant!! That is perfect! Thank you!

Hello QMcKay,
I have a similar problem…
The automation command works, but in the task editor dont works. I dont know what i need to write in the “task complete commands” i think thats the problem…

You need to write in task complete commands Order Ready:[TID], add to your printer template (TID={TICKET ID}) and then add to at the top of your rule the action Load Ticket (you need to creat it) and write in Ticket Id [:CommandValue] as my screenshot

2 Likes

Ok thanks I will prove it… :slight_smile:

Haleluja it works :smiley: thanks a lot!

Helo, i have a other problem now,
when i put “order ready” button, the rule want to move the order in another place…

----------
[Exception Info 1]

Top-level Exception
Type:        System.Reflection.TargetInvocationException
Message:     Exception has been thrown by the target of an invocation.
Source:      mscorlib
Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   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)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()

Inner Exception 1
Type:        System.NullReferenceException
Message:     Object reference not set to an instance of an object.
Source:      Samba.Modules.PosModule
Stack Trace: at Samba.Modules.PosModule.PosViewModel.OnEntitySelectedForTicket(EventParameters`1 eventParameters)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)
   at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
   at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
   at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

-----------------------------

[Assembly Info]

mscorlib, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v14.1, Version=14.1.11.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.11.0
System, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.11.0
WindowsBase, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Domain, Version=1.0.0.0
System.Core, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
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
System.ComponentModel.Composition, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.11.0
Samba.Services, Version=1.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Stateless, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=1.0.0.0
ReachFramework, Version=4.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
Omu.ValueInjecter, Version=2.3.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0

I have the solution for that…
I need to put the “Close Ticket” Action in the Rule. Then works fine… :smiley:

2 Likes

Good finding! :slight_smile: All “load ticket” flows should end with “close ticket”.

2 Likes