event Print_trailer : YUM_trailer
var Ord1: A40
var Ord2: A40
var Ord3: A40
var Chk_num: A4
var num1: A3
var num2: n1
var bigchar : a10
var normal : a2
var daily_text1: a40
var daily_text2: a40
num2 = @cknum % 10
if num2 = 0
daily_text1 = "Don't be a stranger"
daily_text2 = ""
elseif num2 = 1
daily_text1 = " Next time, "
daily_text2 = " stay longer, ok? "
elseif num2 = 2
daily_text1 = " Go well, "
daily_text2 = " see you soon "
elseif num2 = 3
daily_text1 = " You're always welcome, "
daily_text2 = " you know that "
elseif num2 = 4
daily_text1 = " It's been great seeing you "
daily_text2 = ""
elseif num2 = 5
daily_text1 = " Don't be a stranger"
daily_text2 = ""
elseif num2 = 6
daily_text1 = " Thanks for sharing"
daily_text2 = " a meal with us"
elseif num2 = 7
daily_text1 = " Miss you already"
daily_text2 = ""
else
daily_text1 = " Great company"
daily_text2 = " makes great food"
endif
// chr(13) - Linefeed after printing
// chr(29),chr(98),"1" - Turn printer font smoothing on
// chr(29),chr(33),"1" - Send the Large font
format bigchar as chr(29),chr(98),"1", chr(29),chr(33),"3"
format normal as @dwoff
format chk_num as @cknum
if len(@cknum) = 4
num1 = mid(chk_num,2,3)
Else
num1 = chk_num
EndIf
// On the next line is where we tell it how to print, you can change the stuff between the quotation marks
// on the Ord1 line, I'd suggest that you leave the Ord2 line alone
// We're also telling the first line to print in the standard MICROS "double wide" font
// The second line (Ord2) will be the guest check # in a 1/2" tall "smooth" font
format Ord1 as @dwon," Your Order #:",@dwoff
format Ord2 as bigchar, " ",num1, @dwoff
format Ord3 as @dwon," KFC SoGood",@dwoff
@trailer[1] = " "
@trailer[2] = "-------------------------------"
@trailer[3] = Ord1
@trailer[4] = " "
@trailer[5] = Ord2
@trailer[6] = "-------------------------------"
//@trailer[8] = " "
//@trailer[9] = Ord3
//@trailer[10] = " "
//@trailer[11] = "******************************"
//@trailer[12] = " "
//@trailer[13] = daily_text1
//@trailer[14] = daily_text2
//@trailer[15] = " "
//@trailer[16] = "******************************"
endevent
event Print_trailer : Fusion_trailer
var Ord1: A40
var Ord2: A40
var Ord3: A40
var Chk_num: A4
var num1: A3
var num2: n1
var bigchar : a10
var normal : a2
// chr(13) - Linefeed after printing
// chr(29),chr(98),"1" - Turn printer font smoothing on
// chr(29),chr(33),"1" - Send the Large font
format bigchar as chr(29),chr(98),"1", chr(29),chr(33),"1"
format normal as @dwoff
format chk_num as @cknum
if len(@cknum) = 4
num1 = mid(chk_num,2,3)
Else
num1 = chk_num
EndIf
// On the next line is where we tell it how to print, you can change the stuff between the quotation marks
// on the Ord1 line, I'd suggest that you leave the Ord2 line alone
// We're also telling the first line to print in the standard MICROS "double wide" font
// The second line (Ord2) will be the guest check # in a 1/2" tall "smooth" font
format Ord1 as @dwon," Your Order #:",@dwoff
format Ord2 as @dwon," ",num1, @dwoff
format Ord3 as @dwon," KFC SoGood",@dwoff
@trailer[1] = " "
@trailer[2] = "-------------------------------"
@trailer[3] = Ord1
@trailer[4] = " "
@trailer[5] = Ord2
@trailer[6] = "-------------------------------"
endevent
event Print_trailer : Survey_trailer
var hODBCDLL : N12 = 0
var constatus : N9
var sql_cmd : A2000
var store_id : A10
var trans_id : N4
var code : A32
var i : N3
var val0 : N3 = 0 // other Digits from left and mult Result by 2
var val1 : N3 = 0 // No of val Digits > 4
var val2 : N3 = 0 // all uncounted Digits
var val3 : N3 = 0 // sum from val0 to val2
var chkdig: N1 = 0 // sum to next number that ends in 0
var trim_val:N1
// = Check Digit = last Pos
// --------------------- Load SIMODBC.dll -------------------
if hODBCDLL = 0
DLLLoad hODBCDLL, "MDSSysUtilsProxy.dll"
endif
if hODBCDLL = 0
exitwitherror "Unable to Load MDSSysUtilsProxy.dll"
endif
// -----------------------------------------------------------
// Connect to micros 3700 database
//Get Store ID
DLLCALL_CDECL hODBCDLL, sqlIsConnectionOpen(ref constatus)
if constatus = 0
DLLCALL_CDECL hODBCDLL, sqlInitConnection("micros","ODBC;UID=custom;PWD=custom", "")
endif
//format sql_cmd as "SELECT user_defined_1 FROM micros.em_store_def WHERE Store_seq <> 1"
format sql_cmd as "SELECT user_dfn_3 FROM micros.rest_def"
DLLCALL_CDECL hODBCDLL, sqlGetRecordSet(sql_cmd)
sql_cmd = ""
DLLCALL_CDECL hODBCDLL, sqlGetLastErrorString(ref sql_cmd)
if (sql_cmd <> "")
ErrorMessage "Error From SQL -> ", sql_cmd
endif
sql_cmd = ""
DLLCALL_CDECL hODBCDLL, sqlGetFirst(ref sql_cmd)
split sql_cmd, ";" , store_id
//errormessage store_id
if sql_cmd = ""
exitwitherror "There Is No Matching Record"
endif
trim_val = len(store_id) -1
if trim_val < 1
trim_val = 5
endif
store_id = mid(store_id,2,trim_val)
Format code AS " ", store_id, "-", @Day{02}, @Month{02}, @Year{02}, "-",@Hour{02}, @minute{02},"-",@cknum % 100
@trailer[1] = " Stand a chance to Win "
@trailer[2] = " a 21 Piece Bucket "
@trailer[3] = " Visit [URL unfurl="true"]www.talk2kfckenya.com[/URL] "
@trailer[4] = " and complete the survey using "
@trailer[5] = " your unique code: "
@trailer[6] = code
@trailer[7] = " Terms & conditions apply. "
@trailer[8] = " Complete survey "
@trailer[9] = " within 7 days of purchase "
@trailer[10] = "--------------------------------"
endevent