Need some clarification on Change Ticket Type action

When you use the action to change ticket type it seems that it will not actually change until the ticket is closed. Is this correct?

You cannot actually change it in middle of ticket its cached to change on close? Is there a method to force it to think it is a different ticket type before you close the ticket?

You’re likely correct in your assumption @Jesse.

Sounds like the same type of scenario we discussed when trying to change Price Definition in the middle of a Ticket. So we were attempting to Close, change definition, then reopen.

Yeah I tested it extensively last night. So now I am presented with 2 options. 1. Create a new ticket (which I do not mind doing for what it is I am doing) 2. Figure out a way to close the ticket then immediately reopen it and automate that process to 1 button. I will show you what I am doing in a few minutes its quite complicated so will take me a bit to show you the flow.

Ideally I would prefer the Create New ticket method… but I need it automated and I need the new ticket to be created with a different ticket type and I want the previous order copied to it. Create new ticket with Clone ticket works but it also clones ticket type. I just need order cloned.

EDIT: To do what I want I may have to just modify original ticket… let it change type on payment and after payment use transaction documents to move the money correctly.

It is involving tax btw. I have created an entire accounting system for my refunds… but instead of just creating a new ticket and adding items like traditional I am attempting a workaround to build it where it will use the original ticket… convert it to Refund Ticket type and use the new accounting process when I press Refund. It works except for the Tax templates they are calculated on the Live ticket and will not update after ticket closed.

So I am thinking I can just make a transaction that manually moves the tax from Tax 1 to Refund Tax 1 on ticket close.

The reason I want it to work this way is because I will be using a barcode on the receipts and when a return comes in my employees will pull up returns by scanning the barcode. THis happens on a Returns Custom Entity Screen using a Task Editor widget. So I want it to use the original ticket.

I am fairly confident I can get it to work using queued Transactions in the accounting. Sorry if I have confused anyone some of the way i discover the flow of what I am doing is when I am in conversation with you guys.

Just to clear up some confustion:

This question was originally asked because I am still working on my refund system for my retail business. My food business is setup pretty much. Here is how I want my retail return system to work:

Employee navigates to custome entity screen Refunds:
Employee enters ticket ID or scans bar code on bottem of receipt into a Task Editor widget. It will load the ticket.
Employee performs the returns and settles with the refund payment type.
On payment processed it changes Ticket Type to Refund if it was a full ticket refund if it was just a single order change it only changes the ticket tag and order tags.
I am have gotten everything working except tax. Tax apparently is figured during the live ticket and when ticket type is changed to refund ticket… it processes tax on ticket type not payment button So to work around this I am going to attempt using Account Transactions triggered by payment processed with constraints to ensure it only operates on returns.

I plan use ONE entity screen with a task editor widget and somautomation command buttons to build a service desk type system. Command buttons to tell the task editor what type of command to generate depending on if employee presses Lookup and Reprint receipt or preses return item command buttons. I am also going to attempt to use it as a way to scan merchandise into inventory.

OK so if we recalculate tax when ticket type changes does it solves your problem?

It would, is that possible to setup now? Or does it need a new action? I looked for something to do that and couldn’t find it.

Let me understand something. Are you changing an existing ticket’s type or are you creating a new ticket for refunds.

Changing existing for whole ticket refunds. It worked fine because settling it with the refund payment type got all the accounting right except it used wrong tax because tax was figured on ticket type and looks like its figured before payment processed.

Did you tried executing update order action with a Tax Template setting? When there are no selected orders it should update all order’s tax templates…

It will do that even if mapping is set to specific type? Maybe set it to no mapping for refund tax?

Since you specifically set a tax template name it should override mapping but honestly I did not tested it for such use. As I can remember it was implemented to toggle tax free orders.

Ii will try it when I get home if it works it will complete my return system setup I will share it when done its pretty neat and allows me to create a method to handle returns without using main menu or ticket viewer

I saw that option but I thought mapping prevented it. I should have tried anyway.

It is kind of working. I am getting a crash after pressing payment button. But I believe it is my error somewhere with a rule. I am looking through it now.

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

Application: SambaPOS
Version:     4.1.48
Region:      en
DB:          SQ
Machine:     MANCOW2
User:        Jesse
Date:        8/18/2014
Time:        12:28 AM

User Explanation:

Jesse 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__7(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.Presentation.Services.Implementations.TicketModule.TicketService.AddPayment(Ticket ticket, PaymentType paymentType, Account account, Decimal amount, Decimal tenderedAmount)
   at Samba.Modules.PaymentModule.PaymentEditor.UpdateTicketPayment(PaymentType paymentType, ChangePaymentType changeTemplate, Decimal paymentDueAmount, Decimal paidAmount, Decimal tenderedAmount)
   at Samba.Modules.PaymentModule.PaymentEditorViewModel.SubmitPaymentAmount(PaymentType paymentType, ChangePaymentType changeTemplate, Decimal paymentDueAmount, Decimal tenderedAmount)
   at Samba.Modules.PaymentModule.PaymentEditorViewModel.SubmitPayment(PaymentType paymentType)
   at Samba.Modules.PaymentModule.PaymentEditorViewModel.OnMakePayment(PaymentType paymentType)
   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.InvalidOperationException
Message:     Sequence contains no matching element
Source:      System.Core
Stack Trace: at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at Samba.Domain.Models.Tickets.Ticket.Recalculate()
   at Samba.Presentation.Services.Implementations.TicketModule.TicketService.RecalculateTicket(Ticket ticket)
   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__2(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.5.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.5.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
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
DevExpress.Xpf.Core.v14.1, Version=14.1.5.0
PropertyTools, Version=2012.4.14.1

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

[System Info]

Operating System
-Microsoft Windows 8.1 Pro
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -300
--FreePhysicalMemory = 10541236
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 6.3.9600

Can you set two tax templates in the action like Tax1,Tax2? I have two taxes that are applied and I need both changed… maybe that is causing the crash?
EDIT: Its not the two taxes. I am not sure what is causing it now.

I could not get it to work. If I could map the Tax Templates to a Payment Type that would fix it. Any way you could add a Payment Type map for Tax Templates? I cannot see how it would break any current function but it would add a more flexible use for the Tax Templates. Mapping it to Payment Type should allow it to still show the correct tax on the ticket screen but it wouldn’t process until you hit payment. You could still use it the way it is today by simply mapping it to a ticket type and mapping Payment type as *

Am I thinking correct on this or no?

HOLY COW i got it to work! That took alot of thinking and a ridiculous amount of workarounds but its working. I had to make 2 NEW sets of tax templates one with value of 0 and a new one for my refund tax. I had to update order to the 0 tax and then update it again to the refund tax… apparently if you do not update it to 0 tax first it will still process both tax templates. Its working flawlessly now I will be writing a few tutorials to show how its done.

I also created a total ticket non tax system for tracking NoTax sales Tickets in accounting screen.

lol sorry for late reply. I bet it incorrectly updates both tax accounts :slight_smile: I’m working on it and that will correctly update taxes when ticket type changed or tax template changed for order. That will be available on next update.

I knew you were going to say that :stuck_out_tongue: After I finally figured out a ridiculous workaround you fix it lol. It will work a lot better that way however so I am looking forward to it.

New update released. Can you let me know if it works fine or not?