Members discount with selection at payment screen

Have just been asked for a last minute addition on a system going out tomorrow.
They sent two price lists (normal and members) however originally they were going to wait until their members system was finalized in how they wanted it to work.
Originally I was going to input members prices as a second price list for now however when using price lists I believe you need to logout/in again if selecting the price list within the ticket screen.
Was going to try and look to post apply the price list with a rule along the lines of select all and update order to change price list.
Although I haven’t tried yet they were wanting to have the button on the payment screen, would this still work? does select orders fire from payment screen?
My alternate plan was going to be a product tag for members discount and use a calculation selector to set a discount of the sum of the product tag for discount on the tickets orders.
Any suggestions for the best method.

Please note they are running V4.

Use price lists an apply price by using Update Order action’s Price Tag parameter. I didn’t understand the logic here but sounds like it will work.

Which bit seems wong?

Nothing seems wrong. Just didn’t understand it as I’ve didn’t encountered a case that needs updating order prices from payment screen. Even it works, on your further implementation you should always take into account prices might change at last minute.

It was just what they were asking but will work it out.

Their pricing structure limits the simple options as its not a fixed discount either value or % and varies on each product.
Second price list is defiantly the easiest from price side but was conserned about the need to logout and login to change the 'default price list however you have reminded me that it can be applied post ordering with update order action.

You don’t need to logoff to update price list.

Update Price Tag action specifically designed to:

  1. Change price list for all terminals.
  2. Activate for newly created tickets. If you’re creating a ticket it will activate after closing ticket. That makes people to think they should logoff.

So. Update Price Tag action have it’s own use cases, Update Order action have own.

2 Likes

Is there a tag to show the orders price list on ticket template?
Couldnt see anything which sounded right to show say HH as it does on the onscreen ticket.

SORRY - Just seen it (i think), {PRICE TAG} cant beleive I missed that…

Am trying to do this but updating an orders price list seems to cancel selected portion and revert do default/first portion size…
Thought to maybe add {PORTION} to the portion field to keep the same but causes a crash…
Any suggestions?

Cant find this anywhere in V4 or V5

Currently have rule with;
Select All Orders
Update Order – Price Tag = M (all other fields are blank)

Seems like that appears to you as Change Price List.

Does it displays an error message?

Its because of the select all orders, if I apply the same action to order added rule it works with the portion tag.
Presume issue is with mixed portions with all selected.
Error message was;

-----------------------------
[General Info]

Application: SambaPOS
Version:     4.1.82
Region:      en
DB:          SQ
Machine:     JTR-PC
User:        JTR
Date:        22/09/2015
Time:        19:22

User Explanation:

JTR said ""
-----------------------------

[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.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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 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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventsubject](TEventsubject eventArgs, String eventTopic, Boolean wait)
   at Samba.Presentation.Common.Services.ApplicationState.<NotifyEvent>b__9(ActionData x)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action`1 dataAction)
   at CallSite.Target(Closure , CallSite , Object , Action`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)
   at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
   at Samba.Modules.PosModule.TicketViewModel.ExecuteAutomationCommand(String automationCommandName, String automationCommandValue, String nextCommandValue, Boolean executeOnce, Boolean clearSelection)
   at Samba.Modules.PosModule.TicketViewModel.ExecuteAutomationCommand(AutomationCommand automationCommand, String selectedValue, String nextValue)
   at Samba.Modules.PosModule.TicketViewModel.OnExecuteAutomationCommand(CommandContainerButton obj)
   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.Primitives.ToggleButton.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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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.Threading.Dispatcher.Run()
   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.Domain
Stack Trace: at Samba.Domain.Models.Tickets.Order.UpdatePortion(MenuItemPortion portion, String priceTag, IEnumerable`1 taxTemplates)
   at Samba.Presentation.Services.Implementations.TicketModule.TicketService.UpdateOrderPrice(Order order, String portionName, String priceTag)
   at Samba.Modules.TicketModule.ActionProcessors.UpdateOrder.Process(ActionData actionData)
   at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData)
   at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData)
   at Samba.Modules.AutomationModule.AutomationModule.<OnInitialization>b__4(EventParameters`1 x)
   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]

Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.6.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.6.0
PresentationCore, Version=4.0.0.0
Stateless, Version=1.0.0.0
System.Core, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.6.0
EntityFramework, Version=4.4.0.0
System.Windows.Forms, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
PropertyTools, Version=2012.4.14.1

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

[System Info]

Operating System
-Microsoft Windows 7 Professional
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = 60
--FreePhysicalMemory = 2755912
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

Machine
-JTR-PC
--Manufacturer = Gigabyte Technology Co., Ltd.
--Model = To be filled by O.E.M.
--TotalPhysicalMemory = 8551956480
--UserName = JTR-PC\JTR

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

EDIT: its not even different portions its just having the all actions selected, even if all orders have same portion name it crashes.

Cant get this to work from within a POS for that session, definatly seems to require ticket close and open or logout/login even if change add orders then set to table and close the orders added to open ticket when price list changed use previous price list not the new one.

OK @JTRTech I’ve reproduced it. That will work fine on next update. You don’t need to select all (as it already runs for all orders when no orders are selected) or set {PORTION}. When no portion name set it will use actual portion for order.

Unfortunately this client is using V4 :frowning:
Even taking out select all have no effect on this (without portion tag) and changes all to first portion size
Understand price lists are probably not usually used this way.
As V4 am working around as they want to use price list for members discount rates,
Am going to make it ‘proactive’ with a ticket state for Price List = Members and set order added rule to update order to that price list with the portion tag as this works on individual order basis.

Just make it change price list when entity is member. Instead of using state.

They are not ‘registering’ members at this point.

Have got it working as I think they want for now.

Member price list on/off button that sets ticket state of price list = member and updates ticket title to members prices selected and order added rule to update order price list using {PORTION} tag.
Few other small rules to handle the de-selecting of members state on second press of button and clearing/resetting ticket title on ticket close and open (if price list state = members).

Works for now.

They have offered limited information on how they want to actually impliment the members side, be it swipe card etc. so will do for now.

Am struggling to work out how to use {PRICE TAG}.
Have tried putting in my printer template to highlight members ‘discounted’ orders as follows;

[ORDERS]
-- Default format for orders
<J00>{QUANTITY} x {NAME}|{PRICE TAG} £{LINE AMOUNT}
{ORDER TAGS}

My expectation was this would imitate the price list tag display as on the on-screen ticket but nothing is printed on order lines with the members price list tag which should be ‘M’

Just print your state.

Not all products have a members price though, only drinks, not food.

I’m surprised. {PRICE TAG} should just work. Is it possible to check database to see if tags stored and prices does not reset because of something?

Just to remind this is in V4.
Where should I check?
I tried both a submitted ticket and a new ticket and neither showed what I would have expected (the M price list tag next to price like on the on screen ticket)
Do you want a backup or me to check, which table should I look in?