User Tools

Site Tools


en:printing_coupons

Differences

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

Link to this comparison view

Next revision
Previous revision
en:printing_coupons [2013/09/15 21:49]
admin created
en:printing_coupons [2013/09/16 10:17] (current)
Line 9: Line 9:
 You’ll remember we’re generating coupon entities when a ticket is paid. We created this rule for this task. You’ll remember we’re generating coupon entities when a ticket is paid. We created this rule for this task.
  
-<IMG>+{{:​en:​promotions:​coupons34.jpg?​700|}}
  
-When an order state changes to Coupon Paid” we’re executing Coupon Creating actions. ​+When an order state changes to ''​Coupon Paid'' ​we’re executing Coupon Creating actions. ​
  
-SambaPOS Rule System have a Value Looper” feature that can be used to trigger multiple events. ​To generate ​multiple coupons we’ll read order quantity, pass it as a parameter to value looper and let it create multiple coupons. Let’s do it. +SambaPOS Rule System have a ''​Value Looper'' ​feature that can be used to trigger multiple events. ​For generating ​multiple coupons we’ll read order quantity, pass it as a parameter to value looper and let it create multiple coupons. Let’s do it. 
  
-First we need to create the Loop Values” action.+First we need to create the ''​Loop Values'' ​action.
  
-<IMG>+{{:​en:​promotions:​coupons35.jpg?​700|}}
  
-When called Loop Values action triggers ​Value Looped” event multiple times. Values parameter used to configure the loop. We can split values with comma and define ranges with brackets.+When called Loop Values action triggers ​''​Value Looped'' ​event multiple times. Values parameter used to configure the loop. We can split values with comma and define ranges with brackets.
  
   * If Values parameter is 100 it triggers Value Looped event once and passes 100 value to the event. ​   * If Values parameter is 100 it triggers Value Looped event once and passes 100 value to the event. ​
Line 25: Line 25:
   * If Values is (100) it triggers Value Looped event 100 times and passes each value to the event.   * If Values is (100) it triggers Value Looped event 100 times and passes each value to the event.
   * If value is a range like (50-100) it works from 50 to 100.    * If value is a range like (50-100) it works from 50 to 100. 
 +  * If value is a file path it loads lines form file and executes them one by one.
  
-So we need to pass Quantity in brackets. To be able to generate 5 coupons Values ​parameter ​should be (5). For this reason we’ll define [:Quantity] parameter in brackets. ​+So we need to pass Quantity in brackets. To be able to generate 5 coupons ​''​Values''​ Parameter ​should be (5). For this reason we’ll define [:Quantity] parameter in brackets. ​
  
 Now we’ll create “Value Looped” Rule. Now we’ll create “Value Looped” Rule.
  
-<IMG>+{{:​en:​promotions:​coupons36.jpg?​700|}}
  
-This rule does just the same thing as Create Coupon when Coupon Paid” rule. Creates ​a coupon and update it’s Menu Item name. +This rule does just the same thing as ''​Create Coupon when Coupon Paid'' ​rule. It creates ​a coupon and update it’s Menu Item name. 
  
-On next step we’ll modify ​Create Coupon when Coupon Paid” rule to trigger ​Generate Coupons” action instead of generating coupons. Edit this rule, remove existing actions and add Generate Coupons action.+On next step we’ll modify ​''​Create Coupon when Coupon Paid'' ​rule to trigger ​''​Generate Coupons'' ​action instead of generating coupons. Edit this rule, remove existing actions and add Generate Coupons action.
  
-<IMG>+{{:​en:​promotions:​coupons37.jpg?​700|}}
  
 After this modification if we sell 5 Coffee Coupons on a single order line it should generate 5 coupons. ​ After this modification if we sell 5 Coffee Coupons on a single order line it should generate 5 coupons. ​
Line 52: Line 53:
 ^{ENTITY STATE:​X}|Prints entity state| ^{ENTITY STATE:​X}|Prints entity state|
  
-So a sample printer template ​might be something like that.+So a sample printer template ​can be something like that.
  
-<IMG>+{{:​en:​promotions:​coupons38.jpg?​700|}}
  
-We’ll use this template when we need an immediate coupon print from our thermal ticket printer. <QR> tag is a new tag for V3 version. ​It prints a QR tag for data next to that tag. We also have <BAR> tag for printing 1D barcodes. Default format is Code 128  but you can use different formats by adding format as <​BAR39>​ for Code 39 or <​BAR13>​ for EAN13.+We’ll use this template when we need an immediate coupon print from our thermal ticket printer. <QR> tag is a new tag for V3 version. ​You can read more about [[Barcode Printing Tags]].
  
-This template prints this coupon.+The printer ​template prints this coupon.
  
-<IMG>+{{:​en:​promotions:​coupons39.jpg?​700|}}
  
-Now we need to decide when we’ll trigger this print. If you want to print it as soon as we generate the coupon we can create a Print Entity” action and execute it as soon as we create Coupon. So let’s see how we can do it.+Now we need to decide when we’ll trigger this print. If you want to print it as soon as we generate the coupon we can create a ''​Print Entity'' ​action and execute it as soon as we create Coupon. So let’s see how we can do it.
  
 ===== Printing Coupons ===== ===== Printing Coupons =====
  
-We’ll create a Print Entity” action.+We’ll create a ''​Print Entity'' ​action.
  
-<​IMG> ​+{{:​en:​promotions:​coupons40.jpg?​700|}}
  
 We’ll choose Printer and the Printer Template we recently created. We can pass Coupon Number so this action can load and print the entity but since we’ll execute it just after “Create Entity” action passing this parameter is not required. All entity related actions can locate new created entity when executed after “Create Entity” action. ​ We’ll choose Printer and the Printer Template we recently created. We can pass Coupon Number so this action can load and print the entity but since we’ll execute it just after “Create Entity” action passing this parameter is not required. All entity related actions can locate new created entity when executed after “Create Entity” action. ​
  
-Now we’ll modify ​Batch Generate Coupons” Rule and add this action there.+Now we’ll modify ​''​Batch Generate Coupons'' ​Rule and add this action there.
  
-<IMG>+{{:​en:​promotions:​coupons41.jpg?​700|}}
  
 So when we create a new Coupon we’ll also print that. So when we create a new Coupon we’ll also print that.
Line 82: Line 83:
 ===== Saving Coupon numbers to a Text File ===== ===== Saving Coupon numbers to a Text File =====
  
-Our first step will be generating a file name. We’ll use Update Program Setting” action.+Our first step will be generating a file name. We’ll use ''​Update Program Setting'' ​action.
  
-<IMG>+{{:​en:​promotions:​coupons42.jpg?​700|}}
  
 File name will be a random number under Coupons folder. The {RANDOM} tag generates a string based on current date and time so we can find it easily. The file will be generated under [MY Documents]\SambaPOS3\Coupons folder. Please notice we used / character instead of \ character while defining the file path.  File name will be a random number under Coupons folder. The {RANDOM} tag generates a string based on current date and time so we can find it easily. The file will be generated under [MY Documents]\SambaPOS3\Coupons folder. Please notice we used / character instead of \ character while defining the file path. 
  
-This action Stores generated File Path under Coupon File” setting so we can read it with {:Coupon File} tag. We can read all stored setting values with {:X} syntax.+This action Stores generated File Path under ''​Coupon File'' ​setting so we can read it with {:Coupon File} tag. We can read all stored setting values with {:X} syntax.
  
-We’ll execute this action just before we generate coupons so every batch coupons will stored another file. We’ll modify ​Create Coupon when Coupon Paid” Rule to call this action.+We’ll execute this action just before we generate coupons so every batch coupons will stored another file. We’ll modify ​''​Create Coupon when Coupon Paid'' ​Rule to call this action.
  
-<IMG>+{{:​en:​promotions:​coupons43.jpg?​700|}}
  
-Click Select Actions” and add Create new file name” action just before ​Generate Coupons” action. You can change ​orders ​of actions by dragging them on Select Actions” window.+Click ''​Select Actions'' ​and add ''​Create new file name'' ​action just before ​''​Generate Coupons'' ​action. You can change ​sort order of actions by dragging them on ''​Select Actions'' ​window.
  
-You’ll remember ​Generate Coupons” action is a value looper that generates coupon entities. We’ll add lines to the text file in “Value Looped” event but before doing it we’ll create another action to add lines to text file.+You’ll remember ​''​Generate Coupons'' ​action is a value looper that generates coupon entities. We’ll add lines to the text file in “Value Looped” event but before doing it we’ll create another action to add lines to text file.
  
 We’ll create another action to append a line into the text file.  We’ll create another action to append a line into the text file. 
  
-<​IMG> ​+{{:​en:​promotions:​coupons44.jpg?​700|}}
  
-Add Line to Text File” action reads stored file path with {:Coupon File} and adds a line that contains a text defined with Text parameter. We configured Text parameter as a variable so we can send coupon number to this action. ​+''​Add Line to Text File'' ​action reads stored file path with {:Coupon File} and adds a line that contains a text defined with Text parameter. We configured Text parameter as a variable so we can send coupon number to this action. ​
  
 This action is also useful to generate log files. For example you can store every logins and logouts. ​ This action is also useful to generate log files. For example you can store every logins and logouts. ​
Line 108: Line 109:
 Instead of executing Coupon Printing action we’ll call this action. So let’s modify “Batch Generate Coupons” rule.  Instead of executing Coupon Printing action we’ll call this action. So let’s modify “Batch Generate Coupons” rule. 
  
-<IMG>+{{:​en:​promotions:​coupons45.jpg?​700|}}
  
-We replaced ​Print Coupon” action with Add Coupon to File. We’ll configure line format here. I want to print product name and coupon number. You can change it to add only coupon numbers. ​+We replaced ​''​Print Coupon'' ​action with ''​Add Coupon to File''​. We’ll configure line format here. I want to print product name and coupon number. You can change it to add only coupon numbers. ​
  
 Now switch to POS screen and sell 50 coffee coupons and settle ticket to test if file generates correctly or not.  Now switch to POS screen and sell 50 coffee coupons and settle ticket to test if file generates correctly or not. 
  
-<IMG>+{{:​en:​promotions:​coupons46.jpg?​700|}}
  
 I have all coupon numbers that generated on last batch in a single text file. Since we used current time as file names all new sales will generate new text file. We can use this file to print brochures, barcode tags or e-mail to customer. ​ I have all coupon numbers that generated on last batch in a single text file. Since we used current time as file names all new sales will generate new text file. We can use this file to print brochures, barcode tags or e-mail to customer. ​
  
 We can print coupons or store them in a text file. On next chapter we’ll see how to create Buy 6 Get 1 Free promotions. At the end of that chapter we’ll print promotion coupons immediately and when we sell coupons they’ll be stored in a text file. If you frequently sell small numbers of coupons and want to print them immediately you can switch back to immediate printing and create a specific ticket type called “Batch Coupon Sale”. So when you sell coupons through regular ticket it immediately prints coupons but when you sell through “Batch Coupon Sale” ticket it can create text file. Possibilities are endless... We can print coupons or store them in a text file. On next chapter we’ll see how to create Buy 6 Get 1 Free promotions. At the end of that chapter we’ll print promotion coupons immediately and when we sell coupons they’ll be stored in a text file. If you frequently sell small numbers of coupons and want to print them immediately you can switch back to immediate printing and create a specific ticket type called “Batch Coupon Sale”. So when you sell coupons through regular ticket it immediately prints coupons but when you sell through “Batch Coupon Sale” ticket it can create text file. Possibilities are endless...
 +
 +  * Back to [[Promotion Coupons Documentation]]
 +  * Next Topic > [[Tracking Coffee Purchases of Loyal Customers]]
en/printing_coupons.1379267383.txt.gz · Last modified: 2013/09/16 01:49 (external edit)