4.31. Gift Certificates Sales and Redemption Implementation
In this document, it will be explained how to apply Gift Certificate Implementation.
How It Works?
You can either scan the barcode via barcode reader or enter the number of Gift Certificate manually into numberpad. Also you can click on Select Gift Certificate button and enter its number manually into search field.
1. Adding Necessary Components
1.1. Adding GC Product
1.2. Adding GC Product into Menu
1.3. Adding Account Types
1.4. Adding Accounts
1.5. Adding Account Screens
1.6. Adding Transaction Types
1.7. Adding Document Types
1.8. Adding Payment Type
1.9. Adding Entity States
1.10. Adding Entity Type
1.11. Adding Entities
1.12. Adding Entity Screens
1.13. Editing Ticket Type
1.14. Adding Ticket Tags
1.15. Adding Printing Template
1.16. Adding Print Job
2. Adding Actions
2.1. Adding Display Ticket Action
2.2. Adding Account Transaction Document Action-Purchase
2.3. Adding Account Transaction Document Action-Redeem
2.4. Adding Update Order Transaction Type Action
2.5. Adding Update Order State Action
2.6. Adding Create Entity Action
2.7. Adding Print Account Transaction Document Action
2.8. Adding Update Entity Data Action- Balance
2.9. Adding Update Entity State Action
2.10. Adding Add Line to Text File Action
2.11. Update Ticket Tag Action-GCN
2.12. Update Ticket Tag Action-GCB
2.13. Search and Select Entity via Numberpad Action
2.14. Change Entity to Invalid Action
3. Adding Rules
3.1. Adding Order Added to Ticket Rule
3.2. Adding Update Order States Before Ticket Closing Rule
3.3. Adding Order States Updated Purchased and Printed Rule
3.4. Adding Select Numpad Rule
3.5. Adding Redeeming GC Rule
1. Adding Necessary Components
1.1. Adding GC Product
Go to Main Menu > Manage > Products > Product List > here click on Add Product.
Product Name: Gift Certificate
Group Code: Gift Certificates
Portion: Normal
Multiplier: 1
Price: 0,00
After completing necessary editings, click on Save button.
1.2. Adding GC Product into Menu
Go to Main Menu > Manage > Products > Menu List > Menu > here click on Add Missing Categories and accept the confirmation.
After completing necessary editings, click on Save button.
1.3. Adding Account Types
1.3.1. Adding GC Accounts
Go to Main Menu > Manage > Accounts > Account Types > here click on Add Account Type.
Name: GC Accounts
Filter Type: All
Rules: Credit
After completing necessary editings, click on Save button.
1.3.2. Adding GC Balances
Go to Main Menu > Manage > Accounts > Account Types > here click on Add Account Type.
Name: GC Balances
Filter Type: All
Rules: Default
After completing necessary editings, click on Save button.
1.4. Adding Accounts
1.4.1. Adding Purchases Account
Go to Main Menu > Manage > Accounts > Accounts > here click on Add Account.
Account Name: GC Purchases
Account Type: GC Balances
After completing necessary editings, click on Save button.
1.4.2. Adding Redemptions Account
Go to Main Menu > Manage > Accounts > Accounts > here click on Add Account.
Account Name: GC Redemptions
Account Type: GC Balances
After completing necessary editings, click on Save button.
1.4.3. Adding Funds Account
Go to Main Menu > Manage > Accounts > Accounts > here click on Add Account.
Account Name: GC Funds
Account Type: Payment Accounts
After completing necessary editings, click on Save button.
1.4.4. Adding ZZGC2000 Account
Go to Main Menu > Manage > Accounts > Accounts > here click on Add Account.
Account Name: ZZGC2000
Account Type: GC Accounts
After completing necessary editings, click on Save button.
1.5. Adding / Editing Account Screens
1.5.1. Adding Gift Certificate Account Screen
Go to Main Menu > Manage > Accounts > Account Screens > here click on Add Account Screen.
Name: Gift Certificates
Filter Type: All
Display As Tree: Should be selected.
Account Type: Add GC Balances and GC Accounts into Selected Account Types section by clicking on Select button and check the boxes as shown in the above image.
After completing necessary editings, click on Save button.
1.5.2. Editing General Account Screen
Go to Main Menu > Manage > Accounts > Account Screens > here click on General Account Screen.
Filter Type: Work Period
Display As Tree: Should be selected.
Account Type: Add GC Balances and GC Accounts into Selected Account Types section by clicking on Select button and check the boxes as shown in the above image.
After completing necessary editings, click on Save button.
1.6. Adding Transaction Types
1.6.1. Adding GC Credit Transaction Type
Go to Main Menu > Manage > Accounts > Transaction Types > here click on Add Transaction Type.
Account Transaction Type Name: GC Credit Transaction
Source Account Type (Debit): GC Accounts
Target Account Type (Credit): Payment Accounts
Default Source Account: Blank
Default Target Account: GC Funds
After completing necessary editings, click on Save button.
1.6.2. Adding GC Debit Transaction Type
Go to Main Menu > Manage > Accounts > Transaction Types > here click on Add Transaction Type.
Account Transaction Type Name: GC Debit Transaction
Source Account Type (Debit): Payment Accounts
Target Account Type (Credit): GC Balances
Default Source Account: GC Funds
Default Target Account: GC Redemptions
After completing necessary editings, click on Save button.
1.6.3. Adding GC Purchase Transaction Type
Go to Main Menu > Manage > Accounts > Transaction Types > here click on Add Transaction Type.
Account Transaction Type Name: GC Purchase Transaction
Source Account Type (Debit): GC Balances
Target Account Type (Credit): Receivable Accounts
Default Source Account: GC Purchases
Default Target Account: Receivables
After completing necessary editings, click on Save button.
1.6.4. Adding GC Redemptions Transaction Type
Go to Main Menu > Manage > Accounts > Transaction Types > here click on Add Transaction Type.
Account Transaction Type Name: GC Redemptions Transaction
Source Account Type (Debit): Receivable Accounts
Target Account Type (Credit): GC Accounts
Default Source Account: Receivables
Default Target Account: Blank
After completing necessary editings, click on Save button.
NOTE: At this point, you need to restart SambaPOS V5 Pro.
1.7. Adding Document Types
1.7.1. Adding GC Purchase Document Type
Go to Main Menu > Manage > Accounts > Document Types > here click on Add Document Type.
General Settings Section;
Name: GC Purchase Doc
Button Color: Purple
Account Type: GC Accounts
Document Type: Add GC Credit Transaction by clicking on Add Account Transaction Type
Mappings Section;
Add a row by clicking on Add button and configure settings as shown in the image below.
After completing necessary editings, click on Save button.
1.7.2. Adding GC Redemption Document Type
Go to Main Menu > Manage > Accounts > Document Types > here click on Add Document Type.
General Settings Section;
Name: GC Redemption Doc
Button Color: Purple
Account Type: GC Balances
Document Type: Add GC Debit Transaction by clicking on Add Account Transaction Type
Mappings Section;
Add a row by clicking on Add button and configure settings as shown in the image below.
After completing necessary editings, click on Save button.
1.8. Adding Gift Certificate Payment Type
Go to Main Menu > Manage > Tickets > Payment Types > here click on Add Payment Type.
General Settings Section;
Template Name: Gift Certificate
Account Transaction Type: GC Redemptions Transaction
Button Color: Purple
Mappings Section;
Add a row by clicking on Add button and configure settings as shown in the image below.
After completing necessary editings, click on Save button.
1.9. Adding Entity States
1.9.1. Adding Purchased Entity State
Go to Main Menu > Manage > Settings > States > here click on Add State.
Name: Purchased
State Name: GCStatus
State Type: Entity State
Color: LightGreen
Show on End of Day Report: Must be selected.
Show on Product Report: Must be selected.
Show on Ticket: Must be selected.
After completing necessary editings, click on Save button.
1.9.2. Adding Redeemed Entity State
Go to Main Menu > Manage > Settings > States > here click on Add State.
Name: Redeemed
State Name: GCStatus
State Type: Entity State
Color: DarkRed
Show on End of Day Report: Must be selected.
Show on Product Report: Must be selected.
Show on Ticket: Must be selected.
After completing necessary editings, click on Save button.
1.10. Adding Gift Certificate Entity Type
Go to Main Menu > Manage > Entities > Entity Types > here click on Add Entity Type.
General Settings Section;
Name: Gift Certificates
Entity Name: Gift Certificate
Custom Fields Section;
Add two Custom Fields by clicking on Add Custom Field and configure the settings as shown above image.
Accounting Section;
Account Type: GC Accounts
Account Template Name: [Name]
After completing necessary editings, click on Save button.
1.11. Adding GC Dummy ZZGC2000 Entity
Go to Main Menu > Manage > Entities > Entities > here click on Add Entity.
Entity Type: Gift Certificate
Name: ZZGC2000
GC Balance: 0
Account: ZZGC2000
After completing necessary editings, click on Save button.
1.12. Adding Entity Screen
Go to Main Menu > Manage > Entities > Entity Screens > here click on Add Entity Screen.
General Settings Section;
Name: Gift Certificates
Ticket Type: Ticket
View Mode: Search
Appearance Section;
Background Color: Purple
Entity List Section;
Entity Type: Gift Certificates
State Filter: Purchased
Mappings Section;
Add a row by clicking on Add button and configure settings as shown in the image below.
After completing necessary editings, click on Save button.
1.13. Editing Ticket Type
Go to Main Menu > Manage > Tickets > Ticket Types > Ticket > here move Gift Certificate Entity Type into Selected Entity Types List.
After completing necessary editings, click on Save button.
1.14. Adding Ticket Tags
1.14.1. Adding Gift Certificate Name (GCN) Ticket Tag
Go to Main Menu > Manage > Tickets > Ticket Tags > here click on Add Ticket Tag.
After completing necessary editings, click on Save button.
1.14.2. Adding Gift Certificate Balance (GCB) Ticket Tag
Go to Main Menu > Manage > Tickets > Ticket Tags > here click on Add Ticket Tag.
After completing necessary editings, click on Save button.
1.15. Adding Printing Template
Go to Main Menu > Manage > Printing > Printer Templates > here click on Add Printer Template.
Template Name: GC Template
Merge Lines: Don’t Merge
Copy below code group and paste it into Template field;
[LAYOUT] -- General layout |
When you purchase the Gift Certificate product, printer will give you a paper like above.
After completing necessary editings, click on Save button.
1.16. Adding Print Job
Go to Main Menu > Manage > Printing > Print Jobs > here click on Add Print Job.
Print Job Name: Print GC
Printing Content: All Lines
Printer: Ticket Printer
Printer Template: GC Template
After completing necessary editings, click on Save button.
2. Adding Actions
2.1. Adding Display Ticket Action
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Display Ticket
Action Type: Display Ticket
Ticket Id: [:TicketId]
After completing necessary editings, click on Save button.
2.2. Adding Account Transaction Document Action-Purchase
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
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]
After completing necessary editings, click on Save button.
2.3. Adding Account Transaction Document Action-Redeem
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Redeem
Action Type: Create Account Transaction Document
Parameters:
Account Transaction Document Name: GC Redemption Doc
Account Name: [:Account Name]
Description: GC Debit Account [[:CertNum]]
Amount: [:Amount]
After completing necessary editings, click on Save button.
2.4. Adding Update Order Transaction Type Action
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Update Transaction Type
Action Type: Update Order
Account Transaction Type: GC Purchase Transaction
After completing necessary editings, click on Save button.
2.5. Adding Update Order State Action
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Update Order State
Action Type: Update Order State
Parameters:
State Name: Certificate
Group Order: 3
Current State: [:Current State]
State: [:State]
State Order: 3
After completing necessary editings, click on Save button.
2.6. Adding Create Entity Action
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Create Entity
Action Type: Create Entity
Entity Type Name: Gift Certificates
Entity Name: GC[:Certificate Number]
Create Account: True
After completing necessary editings, click on Save button.
2.7. Adding Print Account Transaction Document Action
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Print
Action Type: Print Account Transaction Document
Parameters:
Document Id: [:DocumentId]
Printer Name: Ticket Printer
Printer Template Name: GC Template
After completing necessary editings, click on Save button.
2.8. Adding Update Entity Data Action-Balance
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Balance Update Entity Data
Action Type: Update Entity Data
Parameters:
Entity Type Name: Gift Certificates
Entity Name: [:CertNum]
Field Name: GCBalance
Field Value: [:Bal]
After completing necessary editings, click on Save button.
2.9. Adding Update Entity State Action
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Update Entity State GCStatus
Action Type: Update Entity State
Parameters:
Entity Type Name: Gift Certificates
Entity Name: [:CertNum]
Entity State Name: GCStatus
Current State: [:Current GCStatus]
Entity State: [:New GCStatus]
After completing necessary editings, click on Save button.
2.10. Adding Add Line to Text File Action
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Add Line to Text File
Action Type: Add Line to Text File
File Path: C:\D\Programs\POS\SALES\GC\Gift_Certificates_Transactions.txt
Text: [:sometext]
After completing necessary editings, click on Save button.
2.11. Update Ticket Tag Action-GCN
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Update Ticket Tags GCN
Action Type: Update Ticket Tag
Parameters:
Tag Name: GCN
Tag Value: [:GCN]
After completing necessary editings, click on Save button.
2.12. Update Ticket Tag Action-GCB
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Update Ticket Tags GCB
Action Type: Update Ticket Tag
Parameters:
Tag Name: GCB
Tag Value: [:GCB]
After completing necessary editings, click on Save button.
2.13. Search and Select Entity via Numberpad Action
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Select NUMPAD
Action Type: Change Ticket Entity
Parameters:
Can Create Ticket: True
Entity Type Name: Gift Certificates
Entity Name: [:SearchValue]
After completing necessary editings, click on Save button.
2.14. Change Entity to Invalid Action
Go to Main Menu > Manage > Automation > Actions > here click on Add Action.
Action Name: GC-Entity Change to Invalid
Action Type: Change Ticket Entity
Parameters:
Can Create Ticket: False
Entity Type Name: Gift Certificates
Entity Name: ZZGC2000
After completing necessary editings, click on Save button.
3. Adding Rules
3.1. Adding Order Added to Ticket Rule
Go to Main Menu > Manage > Automation > Rules > here click on Add Rule.
Rule Name: GC-Update New
Event Name: Order Added to Ticket
Execute Rule If: Matches
Add Custom Constraint:
Menu Item Group Code|Equals|Gift Certificates
Select Actions:
Action-1: GC-Update Order State
State: Ordered
Action-2: Update Order Gift State
State: Locked
Action-3: GC-Update Transaction Type
After completing necessary editings, click on Save button.
3.2. Adding Update Order States Before Ticket Closing Rule
Go to Main Menu > Manage > Automation > Rules > here click on Add Rule.
Rule Name: GC-Update Order States
Event Name: Before Ticket Closing
Execute Rule If: Matches
Add Custom Constraint:
Remaining Amount|Equals|0
Select Actions:
Action: GC-Update Order State
Current State: Ordered
State: Printed
After completing necessary editings, click on Save button.
3.3. Adding Order States Updated Purchased and Printed Rule
Go to Main Menu > Manage > Automation > Rules > here click on Add Rule.
Rule Name: GC-Purchased and Printed
Event Name: Order State Updated
Execute Rule If: Matches All
Add Custom Constraint:
State Name|Equals|Certificate
State|Equals|Printed
Select Actions:
Action-1: GC-Create Entity
Certificate Number:[=Helper.GetUniqueString()][=Order.Price]
Action-2: GC-Purchase
Account Name:[=Data.Get("AccountName")]
CertNum:[=Data.Get("AccountName")]
Amount:[=Order.Price]
Action-3: GC-Print
DocumentId:[=Data.Get("DocumentId")]
Action-4: GC-Balance Update Entity Data
CertNum:[=Data.Get("AccountName")]
Bal:[=Order.Price]
Action-5: GC-Update Entity State GCStatus
CertNum:[=Data.Get("AccountName")]
New GCStatus: Purchased
Action-6: GC-Add Line to Text File
Sometext:{DATE} {TIME}, [=Data.Get("AccountName")] ([=Order.Price]), Purchased, Balance [=Order.Price]
After completing necessary editings, click on Save button.
3.4. Adding Select Numpad Rule
Go to Main Menu > Manage > Automation > Rules > here click on Add Rule.
Rule Name: GC-Select NUMPAD
Event Name: Numberpad Value Entered
Execute Rule If: Matches
Add Custom Constraint:
Numberpad Value|Starts|GC20
Select Actions:
Action-1: GC-Select NumPAD
Search Value: [:NumberpadValue]
Action-2: GC-Display Ticket
After completing necessary editings, click on Save button.
3.5. Adding Redeeming GC Rule
Go to Main Menu > Manage > Automation > Rules > here click on Add Rule.
Rule Name: GC-Redeemed Update GC Data
Event Name: Payment Processed
Execute Rule If: Matches All
Add Custom Constraint:
Payment Type Name|Equals|Gift Certificate
{ENTITY NAME:Gift Certificate}|Starts|GC20
[=-1*TN('{ENTITY BALANCE:Gift Certificate}')]
|Greater|0
Select Actions:
Action-1: GC-Balance Update Entity Data
CertNum:{ENTITY NAME:Gift Certificate}
Bal:[=-1*TN('{ENTITY BALANCE:Gift Certificate}')-[:ProcessedAmount]]
Action-2: GC-Redeem
Account Name: GC Redemptions
CertNum: {ENTITY NAME:Gift Certificate}
Amount: [:ProcessedAmount]
Action-3: GC-Update Entity State GCStatus
Constraint:[=-1*TN('{ENTITY BALANCE:Gift Certificate}')-[:ProcessedAmount]]<=0
CertNum: {ENTITY NAME:Gift Certificate}
Current GCStatus: Purchased
New GCStatus: Redeemed
Action-4: GC-Add Line to Text File
Sometext:{DATE} {TIME}, {ENTITY NAME:Gift Certificate} ([=-1*TN('{ENTITY BALANCE:Gift Certificate}')]), Redeemed [:ProcessedAmount], New Balance [=-1*TN('{ENTITY BALANCE:Gift Certificate}')-[:ProcessedAmount]]
Action-5: GC-Update Ticket Tags GCN
GCN: {ENTITY NAME:Gift Certificate}
Action-6: GC-Update Ticket Tags GCB
GCB:[=-1*TN('{ENTITY BALANCE:Gift Certificate}')-[:ProcessedAmount]]
Action-7: Entity Change to Invalid
Constraint:[=-1*TN('{ENTITY BALANCE:Gift Certificate}')-[:ProcessedAmount]]<=0
Action-8: Display Payment Screen
Constraint: [:RemainingAmount]>0
Action-9: Close Ticket
Constraint: [:RemainingAmount]<=0
After completing necessary editings, click on Save button.