# \[SOLVED\] Help for the tutorial GC Sales & Redemption

**URL:** <https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471>\
**Category:** Version 4\
**Created:** [December 9, 2015, 9:01pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471 "2015-12-09T21:01:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 9, 2015, 9:01pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/1 "2015-12-09T21:01:55Z")

</div>

Hi everybody ..

I followed this tutorial

> [@GC Sales & Redemption](http://forum.sambapos.com/t/gc-sales-redemption/1413):
>
> Does anyone have a working implementation for Selling & Redeeming variable-value Gift Certificates? For example… Select Gift Certificate (GC) Product (open price). Enter the value of the GC that the customer wants to purchase ($10, $20, $30, etc). Settle the ticket - customer pays for the GC using Cash or Credit Card. Gift Certificate Prints containing Value and Control Code. On another day, a person returns, and they have a GC (say for a value of $20). They order some food and drink, it…

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(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.CloseTicket(Ticket ticket)  
at Samba.Modules.PosModule.PosViewModel.CloseTicket()  
at Samba.Modules.PosModule.PosViewModel.OnTicketEvent(EventParameters`1 obj) at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument) at Microsoft.Practices.Prism.Events.EventSubscription`1.\<\>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(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.UpdateOrderStates(Ticket ticket, IList`1 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(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)

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, IEnumerable`1 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(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 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

* * *

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 9, 2015, 9:33pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/2 "2015-12-09T21:33:36Z")

</div>

> 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…

> [@Gift Certificate Sales & Redemption](http://forum.sambapos.com/t/gift-certificate-sales-redemption/1539):
>
> Gift Certificate Sales & Redemption This is a working implementation for Selling & Redeeming variable-value Gift Certificates (GCs) that are tracked under their own individual GC Account and 2 “GC Balance” Accounts called “GC Purchases” and “GC Redemptions”. GC Sale: Customer comes in to purchase a Gift Certificate (GC). Enter the value of the GC that the customer wants to purchase into the NUMBERPAD ($10, $20, etc). Select GC Product (open price). Settle the ticket - customer pays for the G…

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 9, 2015, 9:36pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/3 "2015-12-09T21:36:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 9, 2015, 9:39pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/4 "2015-12-09T21:39:28Z")

</div>

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

* * *

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 9, 2015, 10:01pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/5 "2015-12-09T22:01:43Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 9, 2015, 10:17pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/6 "2015-12-09T22:17:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 9, 2015, 10:21pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/7 "2015-12-09T22:21:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 9, 2015, 10:22pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/8 "2015-12-09T22:22:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 9, 2015, 10:31pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/9 "2015-12-09T22:31:14Z")

</div>

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

This is the Question - do not read this.

> [@GC Sales & Redemption](http://forum.sambapos.com/t/gc-sales-redemption/1413):
>
> Does anyone have a working implementation for Selling & Redeeming variable-value Gift Certificates? For example… Select Gift Certificate (GC) Product (open price). Enter the value of the GC that the customer wants to purchase ($10, $20, $30, etc). Settle the ticket - customer pays for the GC using Cash or Credit Card. Gift Certificate Prints containing Value and Control Code. On another day, a person returns, and they have a GC (say for a value of $20). They order some food and drink, it…

This is the Tutorial - read this.

> [@Gift Certificate Sales & Redemption](http://forum.sambapos.com/t/gift-certificate-sales-redemption/1539):
>
> Gift Certificate Sales & Redemption This is a working implementation for Selling & Redeeming variable-value Gift Certificates (GCs) that are tracked under their own individual GC Account and 2 “GC Balance” Accounts called “GC Purchases” and “GC Redemptions”. GC Sale: Customer comes in to purchase a Gift Certificate (GC). Enter the value of the GC that the customer wants to purchase into the NUMBERPAD ($10, $20, etc). Select GC Product (open price). Settle the ticket - customer pays for the G…

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 9, 2015, 10:56pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/10 "2015-12-09T22:56:35Z")

</div>

Aha now we are doing something …

I haven’t seen this tutorial …

Thank you

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 10, 2015, 3:44pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/11 "2015-12-10T15:44:49Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 10, 2015, 4:44pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/12 "2015-12-10T16:44:59Z")

</div>

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…

> [@Gift Certificates search doesn't work](http://forum.sambapos.com/t/gift-certificates-search-doesnt-work/8472):
>
> I am following @QMcKay [tutorials](http://forum.sambapos.com/t/gift-certificate-sales-redemption/1539) for gift certificates, after entered a gift certificate name started by GC20 and entered a balance, when i am searching at the “Gift Certificates” Entity screen i could not found a match for the gift certificate that i have entered before My Gift Certificates Entity screen : The created Gift Certficates already appear when iam restarting sambapos :

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 10, 2015, 9:28pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/13 "2015-12-10T21:28:36Z")

</div>

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(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.CloseTicket(Ticket ticket)  
> at Samba.Modules.PosModule.PosViewModel.CloseTicket()  
> at Samba.Modules.PosModule.PosViewModel.OnTicketEvent(EventParameters`1 obj) at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument) at Microsoft.Practices.Prism.Events.EventSubscription`1.\<\>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(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.UpdateOrderStates(Ticket ticket, IList`1 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(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)

> 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, IEnumerable`1 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(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 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

> * * *

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 10, 2015, 9:55pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/14 "2015-12-10T21:55:23Z")

</div>

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

 ![](https://forum.sambapos.com/uploads/default/original/3X/4/b/4b3d8958cdb56748e31419f59481587af95945c4.PNG)

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 11, 2015, 6:56pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/15 "2015-12-11T18:56:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 11, 2015, 7:34pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/16 "2015-12-11T19:34:38Z")

</div>

> [@marios](#):
>
> Inner Exception 3Type: System.NullReferenceExceptionMessage: Object reference not set to an instance of an object.Source: Samba.ServicesStack Trace: at Samba.Services.Implementations.AccountModule.AccountService.CreateTransactionDocument(Account selectedAccount, AccountTransactionDocumentType documentType, String description, Decimal amount, IEnumerable1 accounts)

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.

> [@marios](#):
>
> Gift Certificate button is disable, balance is always 0

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

> [@marios](#):
>
> prints a Ticket Template instead the GC Template

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.

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 11, 2015, 8:34pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/17 "2015-12-11T20:34:37Z")

</div>

QMcKay

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

---

<div class="post-metadata">

**Author:** ![marios](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@marios](https://forum.sambapos.com/u/marios)\
**Post date:** [December 11, 2015, 9:18pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/18 "2015-12-11T21:18:20Z")

</div>

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

 ![](https://forum.sambapos.com/uploads/default/original/3X/4/a/4a9adccb7f204fbd91635c58eb704eec381e1988.PNG)

The Account has Balance

 ![](https://forum.sambapos.com/uploads/default/original/3X/c/c/cc64fb0af58535fdf8cb1503610cb8de1a9080af.PNG)  
 ![](https://forum.sambapos.com/uploads/default/original/3X/0/a/0accb8b4b5f821549902d5777bcc465b2de9bc78.PNG)

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 12, 2015, 3:06am UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/19 "2015-12-12T03:06:41Z")

</div>

> [@marios](#):
>
> I search again and everything seems right …

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.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 12, 2015, 3:09pm UTC](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471/20 "2015-12-12T15:09:27Z")

</div>

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:

![](https://forum.sambapos.com/uploads/default/original/3X/2/d/2d075eea51b8b91427ccd77ad4d516bbc14622fb.png)

> ##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:

 ![](https://forum.sambapos.com/uploads/default/original/3X/9/d/9da51426f4e1c2b65ba91e898076122caefa7a8f.png)

> ##GC Purchased & Printed##

| **Rule Name:** | `GC Purchased & Printed` |
| **Event Name:** | `Order State Updated` |

_Custom Constraint List:_

| **Execute Rule if:** | `Matches All` |

| `State Name` | **_Equals_** | `Certificate` |
| `State` | **_Equals_** | `Printed` |

##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]` |

* * *

[Next page](https://forum.sambapos.com/t/solved-help-for-the-tutorial-gc-sales-redemption/8471.md?page=2)
