[SOLVED] Help for the tutorial GC Sales & Redemption

Hi everybody …

I followed this tutorial

and i get this error:


[General Info]

Application: SambaPOS
Version: 4.1.82
Region: en
DB: SQ
Machine: SERVER-PC
User: Marios
Date: 9/12/2015
Time: 8:58 μμ

User Explanation:

Marios 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.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.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.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 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.b__9(ActionData x)
at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action1 dataAction) at CallSite.Target(Closure , CallSite , Object , Action1 )
at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action1 dataAction) at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action1 dataAction)
at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
at Samba.Presentation.Services.Implementations.TicketModule.TicketService.CloseTicket(Ticket ticket)
at Samba.Modules.PosModule.PosViewModel.CloseTicket()
at Samba.Modules.PosModule.PosViewModel.OnTicketEvent(EventParameters1 obj) at Microsoft.Practices.Prism.Events.EventSubscription1.InvokeAction(Action1 action, TPayload argument) at Microsoft.Practices.Prism.Events.EventSubscription1.<>c__DisplayClass2.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)

Inner Exception 2
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 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.b__9(ActionData x)
at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action1 dataAction) at CallSite.Target(Closure , CallSite , Object , Action1 )
at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action1 dataAction) at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action1 dataAction)
at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
at Samba.Presentation.Services.Implementations.TicketModule.TicketService.UpdateOrderStates(Ticket ticket, IList1 orders, String stateName, String currentState, Int32 groupOrder, String state, Int32 stateOrder, String stateValue) at Samba.Modules.TicketModule.ActionProcessors.UpdateOrderState.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(EventParameters1 x)
at Microsoft.Practices.Prism.Events.EventSubscription1.InvokeAction(Action1 action, TPayload argument)
at Microsoft.Practices.Prism.Events.EventSubscription1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments) at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments) at Microsoft.Practices.Prism.Events.CompositePresentationEvent1.Publish(TPayload payload)
at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

Inner Exception 3
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Samba.Services
Stack Trace: at Samba.Services.Implementations.AccountModule.AccountService.CreateTransactionDocument(Account selectedAccount, AccountTransactionDocumentType documentType, String description, Decimal amount, IEnumerable1 accounts) at Samba.Modules.AccountModule.ActionProcessors.CreateAccountTransactionDocument.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(EventParameters1 x)
at Microsoft.Practices.Prism.Events.EventSubscription1.InvokeAction(Action1 action, TPayload argument)
at Microsoft.Practices.Prism.Events.EventSubscription1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments) at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments) at Microsoft.Practices.Prism.Events.CompositePresentationEvent1.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 Ultimate
–CodeSet = 1253
–CSDVersion = Service Pack 1
–CurrentTimeZone = 120
–FreePhysicalMemory = 796752
–OSArchitecture = 32-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 1
–ServicePackMinorVersion = 0
–Version = 6.1.7601

Machine
-SERVER-PC
–Manufacturer = Gigabyte Technology Co., Ltd.
–Model = G31M-ES2L
–TotalPhysicalMemory = 3219636224
–UserName = SERVER-PC\Marios


Inner Exception 3
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Samba.Services
Stack Trace: at Samba.Services.Implementations.AccountModule.AccountService.CreateTransactionDocument(Account selectedAccount, AccountTransactionDocumentType documentType, String description, Decimal amount, IEnumerable1 accounts)

There is something wrong with the Rule that fires the Create Account Transaction Document Action.

Please look at this Tutorial…

Thank you for the quick response

I followed this tutorial but it seems that i cant make it work !!
I don’t know what i’m doing wrong …
I’m deleting everything right now and start from the scratch

Check closely these Actions…

Name: AC GC Purchase
Name: AC GC Redeem

And these Rules…

Name: RU GC Purchased & Printed
Event Name: Order State Updated

Name: RU GC Redeemed (update GC data)
Event Name: Payment Processed


1 Like

OK something i’m missing because 3 of them are not exists …

Update. I haven’t read all the comments…

Do you know if i can find this tutorial step by step …

That tutorial is step by step…

Few things to remember its Case sensitive so if something is caps it should be caps. Spelling must be accurate. IF yours looks different in ANY way then you probably messed up somewhere. Follow it exact be sure spelling is accurate and its all case sensitive. Do not rename anything until you get it working use the same naming scheme as tutorial.

Finally remember to always map rules with default mapping.

This is a very complex tutorial it would be easy to make a simple small mistake that can break the entire thing. Something like spelling or forgetting to watch case sensitivity can break it.

1 Like

Thank you very much …
i’ll try it again and let you know …

It is a good practice to do these complex tutorials they will get you familiar with the inner workings of what Drives SambaPOS. You will eventually understand it all and it will be easy if you do more tutorials like that.

1 Like

Follow the Tutorial, not the Question - they are 2 different things…

This is the Question - do not read this.

This is the Tutorial - read this.

1 Like

Aha now we are doing something …

I haven’t seen this tutorial …

Thank you

1 Like

Hi everything is in potion double checked …

I can’t create Gift inside POS screen only from Gift Certificates page.
In Entities i can see the Gift but when i search for it nothing came up …

Can I use a little bit of your help please ?

Sounds similar to the issue Prodigy was having. Your GC Entities are being created, but their State is not being updated to “Purchased”, which is the filter criteria for the GC Entity Search Screen…

I had an error in Rule - GC Purchased & Printed i changed it and now gives me this Report


[General Info]

Application: SambaPOS
Version: 4.1.82
Region: en
DB: SQ
Machine: SERVER-PC
User: Marios
Date: 10/12/2015
Time: 9:26 μμ

User Explanation:

Marios 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.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.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.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 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.b__9(ActionData x)
at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action1 dataAction) at CallSite.Target(Closure , CallSite , Object , Action1 )
at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action1 dataAction) at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action1 dataAction)
at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
at Samba.Presentation.Services.Implementations.TicketModule.TicketService.CloseTicket(Ticket ticket)
at Samba.Modules.PosModule.PosViewModel.CloseTicket()
at Samba.Modules.PosModule.PosViewModel.OnTicketEvent(EventParameters1 obj) at Microsoft.Practices.Prism.Events.EventSubscription1.InvokeAction(Action1 action, TPayload argument) at Microsoft.Practices.Prism.Events.EventSubscription1.<>c__DisplayClass2.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)

Inner Exception 2
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 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.b__9(ActionData x)
at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action1 dataAction) at CallSite.Target(Closure , CallSite , Object , Action1 )
at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action1 dataAction) at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action1 dataAction)
at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
at Samba.Presentation.Services.Implementations.TicketModule.TicketService.UpdateOrderStates(Ticket ticket, IList1 orders, String stateName, String currentState, Int32 groupOrder, String state, Int32 stateOrder, String stateValue) at Samba.Modules.TicketModule.ActionProcessors.UpdateOrderState.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(EventParameters1 x)
at Microsoft.Practices.Prism.Events.EventSubscription1.InvokeAction(Action1 action, TPayload argument)
at Microsoft.Practices.Prism.Events.EventSubscription1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments) at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments) at Microsoft.Practices.Prism.Events.CompositePresentationEvent1.Publish(TPayload payload)
at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

Inner Exception 3
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Samba.Services
Stack Trace: at Samba.Services.Implementations.AccountModule.AccountService.CreateTransactionDocument(Account selectedAccount, AccountTransactionDocumentType documentType, String description, Decimal amount, IEnumerable1 accounts) at Samba.Modules.AccountModule.ActionProcessors.CreateAccountTransactionDocument.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(EventParameters1 x)
at Microsoft.Practices.Prism.Events.EventSubscription1.InvokeAction(Action1 action, TPayload argument)
at Microsoft.Practices.Prism.Events.EventSubscription1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments) at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments) at Microsoft.Practices.Prism.Events.CompositePresentationEvent1.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 Ultimate
–CodeSet = 1253
–CSDVersion = Service Pack 1
–CurrentTimeZone = 120
–FreePhysicalMemory = 1212060
–OSArchitecture = 32-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 1
–ServicePackMinorVersion = 0
–Version = 6.1.7601

Machine
-SERVER-PC
–Manufacturer = Gigabyte Technology Co., Ltd.
–Model = G31M-ES2L
–TotalPhysicalMemory = 3219636224
–UserName = SERVER-PC\Marios


Update:
I manage to search for the ticket so far Ok
Whebn i try to collect a ticket ther button Gift Certificate button is disable, balance is always 0 and printer. prints a Ticket Template instead the GC Template

It seems i can’t make it work …
If could someone give me a hint …

The error indicates something wrong with one of the following:

Transaction Document Type
Transaction Type
Account Type
Account

This could mean one or more are missing, or they are incorrectly configured. It could also mean the Action for Create Account Transaction Document is improperly configured.

The Transaction Type is not configured properly, or the GC Account has no funds.

The Execute Print Job Action might be set up wrong, or the Print Job itself is not configured properly.


Most of the Tutorials I create a rather complex and detailed. This can make it difficult for people to implement them when they do not have a fundamental understanding of how Automation works.

Suffice it to say:

It is very important to pay attention to every detail.

Syntax is nearly always cAse-SensiTivE.
White-space around parameters or variables can break things.
Punctuation and operators ([=:{}] etc.) are very important.
Rule Constraints (Matches, Matches All, etc.) must be followed.
Entity Types, Entities, Account Types, Accounts, Tx Types, Doc Types, etc could be named differently in your setup, and this will break things too.

With Tutorials of this complexity, it is difficult to guess where something has gone wrong in your implementation.

On top of that, if you made a mistake in your Action, you cannot simply fix the Action and expect it to work. You must remove the Action from any Rules it is in, save the Rule, then add the Action again and save the Rule.

Also, the order of the Actions in the Rule is not random. They must be in the order presented.

Remember:

You are not the first to implement this. Many before you have set this up and it does work if done properly.

I understand, it is difficult sometimes, but the detail is important, so take your time. And if you need to, delete everything to do with GC and start over.

QMcKay

thank you for the responce at least now i have a start point to search.
I let you know soon
Thanks again :smile:

I delete and create everything from scratch , now i can create GC i can found them and i can import them in a ticket.
The only problem is that the Gift Certificate button is again disable and as i can figure out the balance is always 0 even though the ballance has credits …

I search again and everything seems right …
As you can see in screenshot the GC is in the Ticket

The Account has Balance


Something is not right or it would work. You have missed something and sometimes its hard to notice what you missed. Go back through and check everything.

That is the best hint we can provide. The tutorial works its proven to work so you have made a mistake somewhere. We do not know what mistake you made.

1 Like

Your GC Entity Screen indicates the GC has a balance, but the Account Details for the GC shows 0 balance. This is why you cannot use it to pay for products.

So even though the Entity and Account exist, and the Entity Custom Data field named GCBalance shows a value, the Account itself is empty.

Check the Action that adds funds to the Account:

##GC Purchase##

Action Name: GC Purchase
Action Type: Create Account Transaction Document
###Parameters:###
Account Transaction Document Name: GC Purchase Doc
Account Name: [:Account Name]
Description: GC Credit Account [[:CertNum]]
Amount: [:Amount]

Check the Rule that invokes that Action:

##GC Purchased & Printed##

Rule Name: GC Purchased & Printed
Event Name: Order State Updated
Custom Constraint List:
Execute Rule if: Matches All
State NameEqualsCertificate
StateEqualsPrinted

##Actions:##

GC Create

Constraint: (none)

Certificate Number: [=Helper.GetUniqueString()][=Order.Price]
GC Purchase

Constraint: (none)

Account Name: [=Data.Get("AccountName")]
CertNum: [=Data.Get("AccountName")]
Amount: [=Order.Price]
GC Print

Constraint: (none)

DocumentId: [=Data.Get("DocumentId")]
GC Balance Update

Constraint: (none)

CertNum: [=Data.Get("AccountName")]
Bal: [=Order.Price]
GC Update State GCStatus

Constraint: (none)

CertNum: [=Data.Get("AccountName")]
Current GCStatus:
New GCStatus: Purchased
GC Add Line to Text File

Constraint: [=1+2]>[=2+2]

sometext: {DATE} {TIME}, [=Data.Get("AccountName")] ([=Order.Price]), Purchased, Balance [=Order.Price]