User Tools

Site Tools


en:preparing_sambapos_to_sell_coffee_coupons

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:preparing_sambapos_to_sell_coffee_coupons [2013/09/15 18:15]
admin [Adding Create Coupon Action]
en:preparing_sambapos_to_sell_coffee_coupons [2013/09/16 11:45] (current)
Line 1: Line 1:
 ====== Preparing SambaPOS to Sell Coffee Coupons ====== ====== Preparing SambaPOS to Sell Coffee Coupons ======
  
-{{:​en:​promotions:​Coupons1.jpg?​150 |}} 
 Promotion Coupon is an entity that we use to enter free items to tickets. This is a well formatted random number. We can print this number as a barcode or QR Tag. When this number is scanned on a SambaPOS terminal it will add related product into the ticket as a gift product. When redeemed we’ll update coupon status so it can’t be used multiple times. ​ Promotion Coupon is an entity that we use to enter free items to tickets. This is a well formatted random number. We can print this number as a barcode or QR Tag. When this number is scanned on a SambaPOS terminal it will add related product into the ticket as a gift product. When redeemed we’ll update coupon status so it can’t be used multiple times. ​
  
 After finishing this chapter you can create coupons and sell them through a ticket. For example you can sell 100 coffee coupons with a discounted price. That can be a company that wishes to give coffee coupons to  their personnel. ​ After finishing this chapter you can create coupons and sell them through a ticket. For example you can sell 100 coffee coupons with a discounted price. That can be a company that wishes to give coffee coupons to  their personnel. ​
- 
-On next chapter we’ll see how to record sales on a customer card and give free coupons for 6 coffee purchases. 
  
 ===== Creating Coupon Entity ===== ===== Creating Coupon Entity =====
Line 77: Line 74:
 {{:​en:​promotions:​Coupons9.jpg?​700|}} {{:​en:​promotions:​Coupons9.jpg?​700|}}
  
-Entity Type Name is ''​Coupons''​ since we need to create a coupon entity. Entity name should be ''​CP{RANDOMC:​8}''​. {RANDOMC:8} tag is a [[Random Number Generator Tag]] that generates a 8 digit random number with check digit. So it becomes 9 digits. We also want to prefix Coupon Numbers with CP letters to be able to understand this random number is a coupon number. Finally Custom Data field contains ''​Redeemed=No''​ value to define default Redeemed field value.+Entity Type Name is ''​Coupons''​ since we need to create a coupon entity. Entity name should be ''​CP{RANDOMC:​8}''​. {RANDOMC:8} tag is a [[Random Number Generator Tag|Random Number Generator Tag]] that generates a 8 digit random number with check digit. So it becomes 9 digits. We also want to prefix Coupon Numbers with CP letters to be able to understand this random number is a coupon number. Finally Custom Data field contains ''​Redeemed=No''​ value to define default Redeemed field value.
  
 We’re ready to create rules that creates Coupons when ''​Coffee Coupon Product''​ sold. We’re ready to create rules that creates Coupons when ''​Coffee Coupon Product''​ sold.
 +
 +===== Adding Coffee Coupon Order Handling Rules =====
 +
 +When we first add Coffee Coupon order in a ticket its order state should be Coupon Ordered. We’ll create a rule to configure this.
 +
 +{{:​en:​promotions:​coupons10.jpg?​700|}}
 +
 +We’ll handle ''​Order Added to Ticket''​ event and execute this rule if Menu Item Group Code Equals to ''​Coupons''​ value. If you didn’t do so change ''​Coffee Coupon''​ product’s Group Code to ''​Coupons''​ so this rule will handle it. New coupons under this product group will just work without changes.
 +
 +When it detects a Coupon it executes two actions.
 +
 +  - Calls ''​Update Coupon Product Order State''​ action to update order state as ''​Coupon Ordered''​.
 +  - Calls ''​Update Coupon Product Menu Item Name''​ action to send Coupon Product Tag value to Order State as the Coupon Menu Item Name.
 +
 +<WRAP center round tip 60%>
 +Don’t forget adding a map to rules to enable them. If there is no mapping they won’t work and listed as gray color. For the simplicity of this documentation we won't mention it anymore but all rules needs a mapping.
 +</​WRAP>​
 +
 +As a result of this configuration order state values should update correctly when we add a Coffee Coupon product into a ticket. ​
 +
 +{{:​en:​promotions:​coupons11.jpg?​700|}}
 +
 +Coupon Ordered and Coffee values displays correctly. Now we know this order should generate a coupon, not paid yet and generates a coupon for Coffee.
 +
 +When we full settle the ticket ''​Coupon Ordered''​ value should change to ''​Coupon Paid''​. Now we’ll handle ''​Ticket Close''​ event to check if ticket is paid. In fact there is already a rule for this named as “Ticket Payment Check” but for this tutorial we’ll create new Rule. 
 +
 +===== Handling Payment to update Order states =====
 + 
 +We’ll create a new rule for ''​Before Ticket Closing''​ event to check if ticket is paid or not. 
 +
 +{{:​en:​promotions:​coupons12.jpg?​700|}}
 +
 +While closing the ticket if ''​Remaining Amount''​ is 0 we’ll update order states to ''​Coupon Paid''​ where order state equals to ''​Coupon Ordered''​.
 +
 +So create a new ticket now, add Coffee Coupon product and settle that ticket. When you open this ticket from ticket explorer, Order State of the Coffee Coupon product should be “Coupon Paid”. ​
 +
 +Our customer bought a Breakfast, one coffee and a coffee coupon. As you can see order state changed to ''​Coupon Paid''​. Other order states didn’t changed since we set the ''​Current State''​ for the action. It only changed for orders that already have “Coupon Ordered” state.
 +
 +{{:​en:​promotions:​coupons13.jpg?​700|}}
 +
 +Getting state handling in SambaPOS is important to create a flawless workflow for your business. Feel free to ask any questions on our forums so we can update our documentation to give more details about them.
 +
 +===== Creating Coupons =====
 +
 +As the order state changes from ''​Coupon Ordered''​ to ''​Coupon Paid''​ we’ll create the Coupon Entity. To be able to handle it we’ll create a rule for ''​Order State Updated''​ event.
 +
 +{{:​en:​promotions:​coupons14.jpg?​700|}}
 +
 +I’ve created two constraints to determine ordered Coupon is paid. If constraints are true it executes ''​Create Coupon''​ action to create a coupon entity. After creating that it executes second action to update coupon’s menu item name. As you have noticed I’m reading ''​Menu Item Name''​ from Order State by using ''​{ORDER STATE:​X}''​ tag. You’ll remember we are using same tag in printer templates to print order states. ​
 +
 +To test this rule sell another Coffee Coupon and check if a Coupon Entity created or not. 
 +
 +{{:​en:​promotions:​coupons15.jpg?​700|}}
 +
 +This is what SambaPOS generated for me. Coupon Number, Redeemed value and Menu Item Name all correctly updated. Expiration date is empty so this coupon never expires. We’ll handle expiration topic on further documentation.
 +
 +  * Back to [[Promotion Coupons Documentation]]
 +  * Next Topic > [[Redeeming Coupons]]
 +
en/preparing_sambapos_to_sell_coffee_coupons.1379254511.txt.gz · Last modified: 2013/09/15 22:15 (external edit)