Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event Tmed didn't responding in Simphony

Status
Not open for further replies.

9Coder

IS-IT--Management
Apr 16, 2019
53
ID
Hi, im newbie in ISL

i was trying to test event tmed function, but seems it's doesn't respond to anything even tho the related tender key was pressed during transactions. Below it's just the simple script that I've just tested

event tmed : 17

waitforclear "test"

endevent

see, it just showing the messages only, but when I pressed the tender key 17 nothing appeared.

I've already enabled options "Use ISL TMED Procedure Instead of PMS Interface" in tender media module,

- Reload DB done
- restart service host done

still, event tmed didn't get triggered at all

Appreciate, your fast response
 
hi,
if you are going to use legacy tmed events, you need to make the following configuration changes as well, in EMC:
1. you need to add an interface record
2. You need to link this interface to each RVC, Setup->RVC Parameters->Interfaces
3. And for your Extension Application you will need to choose the same interface

If you are going to use the new event subscription style, the above is not necessary, however, if you do use that, you wont be able to perform txmsg from your script.

Hope this helps
 
@codexPOSed already try it then reload database + restart servicehost, still event did not get triggered.
 
In the extension application setup, for your isl script, do you have “main isl script” option bit set?
 
@codexPOSed yes, already set it up from the beginning, still no result. have you tried the script? does it work for you?
 
I honestly don’t think it’s the script. There is something missing in your setup. Can you post the screenshots from EMC for each of the steps I described?
 
Did you configure a servicehost on the Service Host tab of the Interface?

Specialist in creating custom applications for the Micros POS range: 3700, 9700, Simphony FE, Simphony. SIM Scripts, Data Exports, Simphony extension applications, API Creation and integration. If you need anything please contact me via my website
 
@codexPOSed @CathalMF i found the issue, there's another active ISL that somehow prevent event tmed on my script. And what surprisingly was MF_ENH.isl from Enhanced IFC Simphony 2.6. If I was deactivated the extensions app for Opera that contains MF_ENH.isl, event tmed on my custom script was triggered normally - if I activated again, the event tmed didn't get triggered at all. Could you guys help me to find which part of the MF_ENH.isl script(I attached the entire script below) that prevent another event tmed from different ISL files?

Code:
// Simphony2 MF Enh.IFC 2.60.6
//--------------------------------------------------------------------------------
// Copyright 2005 by Micros-Fidelio GmbH, all rights reserved
// Copyright 2005 by Micros Systems, Inc, all rights reserved
// All Copyright notices contained within this source code must
// retain and can not be removed or modified.
//--------------------------------------------------------------------------------
NetImport from "McrsExtDialogsML.dll"
const INTERNAL_VERSION     : A    = "2.60.6"
const mic_fo_iface_num     : A12  = System.String.Format( "FOUX2 {0}", INTERNAL_VERSION)
const mic_fo_iface_date    : A8   = "31.01.14"
const mic_fo_iface_text    : A40  = "Micros Systems Inc. Columbia MD USA"
const ContentCfgName       : A    = "EnhIFC_Config"
const DataExtName          : A    = "RoomCharge"
const TRUE                 : N5 = 1
const FALSE                : N5 = 0
const RoomInqKey           : N5 = 1
const RestrRoomInqKey      : N5 = 2
const ShortInqKey          : N5 = 5
const InfoLineInqKey       : N5 = 6
const ViewReservKey        : N5 = 7
const ExtendedInqKey       : N5 = 8
const FODiscountInqKey     : N5 = 10
const TechInfoInqKey       : N5 = 911
UseISLtimeouts
@TRACE = 0
RetainGlobalVar
var DEFAULT_EVENT_win1_name : A20 = "Unknown Event"
var DEFAULT_EVENT_win1_1    : A40 = "*** ERROR: Unknown event received ***"
var DEFAULT_EVENT_win1_2    : A34 = "The event in question is "
var display_list_and_check_messages_win1_1   : A30 = "*** Guest has message(s). ***"
var display_list_and_check_messages_win_msg1 : A35 = "Press [OK] to print messages"
var display_list_and_check_messages_win_msg2 : A30 = "Press [Cancel] to continue"
var display_list_and_check_messages_win_msg3 : A30 = "Press [Clear] to continue"
var print_msg_win1_name : A30 = "Display and Print"
var print_msg_prompt1   : A20 = "Printing receipt."
var print_msg_win2_1    : A40 = "*** There is no list to display ***"
var create_msg_win1_name : A30 = "Enter max. 8 Lines of Message-Information. Press [SAVE] when done"
var create_msg_win1_1    : A6  = "Line "
var create_msg_input1    : A12 = "Enter line "
var create_msg_input2    : A5  = " info"
var create_msg_input3    : A64  = "No Guest-Message entered, abort?"
var create_msg_input4    : A64  = "Confirm Guest-Message"
var create_loc_win_name  : A32 = "Enter max. 8 Lines of Locator-Information. Press [SAVE] when done"
var create_loc_win_1     : A10 = "Minutes: "
var create_loc_input1    : A30 = "Enter Locator-Duration in minutes. Press [SAVE] when done"
var create_loc_win_2     : A6  = "Line "
var create_loc_input2    : A12 = "Enter line "
var create_loc_input3    : A5  = " info"
var create_loc_input4    : A64  = "No Guest-Locator entered, abort?"
var create_loc_input5    : A64  = "Confirm Guest-Locator"
var check_fo_iface_ver_error1    : A30 = "Invalid version response"
var check_fo_iface_ver_error2    : A99 = "Time Out while sending message, check FO Server, IFC or cables"
var check_fo_iface_ver_win1_name : A30 = "Interface Version Mismatch"
var check_fo_iface_ver_win1_1    : A40 = "Micros Version        Fidelio Version"
var check_fo_iface_ver_win1_2    : A40 = "--------------        ---------------"
var display_version_win_name   : A30 = "Fidelio Isl Scripts Version"
var display_fo_version_text    : A30 = "Front office isl version"
var display_input_error_win1_name : A20 = "Data Entry Error"
var display_input_error_win1_1    : A44 = "You may not leave any input fields blank"
var display_input_error_2         : A40 = "Magnetic card is the wrong type"
var display_input_error_3         : A40 = "Magnetic cards not supported here"
var display_input_quest_1         : A30 = "Post to Backup Tender ?"
var tmed_16_input1   : A36 = "Guest Posting, enter name or room #"
var inq_1_win_name   : A30 = "Reservation Query"
var inq_1_win_1      : A20 = "Name or number: "
var inq_1_win_input1 : A30 = "Enter guest information"
var FO_87_RES_LIST_win1_name : A20 = "Reservation Query"
var FO_87_RES_LIST_win1_1    : A45 = "No guest found"
var FO_87_RES_LIST_input1    : A30 = "Select Guest Entry"
var FO_87_RES_LIST_win2_name : A20 = "Select Guest Entry"
var FO_87_RES_LIST_win3_name : A20 = "Guest Selected"
var FO_87_RES_DETAIL_win1_name : A20 = "Reservation Query"
var FO_87_RES_DETAIL_win1_1    : A45 = "ERROR: Invalid reservation data from FO"
var FO_87_RES_DETAIL_input1    : A30 = "Reservation Detail"
var FO_87_RES_DETAIL_win2_name : A20 = "Reservation Detail"
var FO_87_GST_DETAIL_win1_name : A20 = "Guest Detail"
var FO_87_GST_DETAIL_win1_1    : A45 = "ERROR: Invalid guest data from FO"
var FO_87_GST_DETAIL_input1    : A30 = "Guest Profile"
var FO_87_GST_DETAIL_win2_name : A20 = "Guest Profile"
var GuestNameTitle             : A10 = "Guest Name"
var VOIDGuestNameTitle         : A25 = "VOID-Payment:Guest Name"
var ConfirmGuestPrompt         : A30 = "Is this the correct guest?"
var GuestListTitle             : A15 = "Guest List"
var SelectGuestPrompt          : A20 = "Select guest"
var RoomInputLabel             : A15 = "Room#     : "
var GuestInputLabel            : A15 = "Guest-Name: "
var MagCardError               : A40 = "Keyboard Entries not allowed"
var TmedVoidError2             : A64 = "You cannot overtender a Room-Charge!"
var InfoLineError1             : A60 = "Unable to update Check Info-Lines. Possible wrong setup"
var InfoLineError2             : A60 = "Previous Info-Lines exist, cannot store any new values"
var RestrPostingError1         : A60 = "Input returned multiple guest, selection not permitted"
var RestrPostingError2         : A60 = "Input does not match Room# or Guest-Name, declined"
var RestrPostingError3         : A60 = "Please enter at least 3 character for Guest-Name"
var SimphonyNoDSC        : N1 = 0
var gbl_message_status   : A1
var gbl_first_pass       : N5
var gbl_room_inq_type    : A1
var gbl_res_data         : A30
var gbl_res_room         : A8
var gbl_guest_id         : A30
var gbl_guest_sel        : A40
var gbl_guest_last_name  : A20
var gbl_guest_num        : N2
var gbl_shortinq_type    : N1
var gbl_use_infoline     : N1
var gbl_fo_iface_chkd    : N1
var gbl_setup_read       : N1
var gbl_call_oem         : N1
var gbl_dsc_svc_itmzr    : N1
var gbl_allow_msr_enh    : N1
var gbl_fid_ifc_version  : A20
var gbl_log_buffer       : A5000
var gbl_McrsExtDlgsVer   : A
var debug_script         : N5
var Track2Field          : N2
var PackageCodeIFC       : N2
var SendAllDtls          : N2
var package_info[2]      : A30
var UseBackupTMed        : N2
var UseFull_DSVC         : N2
var UseSI_NET_DSC        : N2
var SKIP_INFO_LINE       : N2
var MagneticCardOnly     : N2
var MagCardOnlyExclRVC   : A90
var Restricted_Posting   : N2
var Restr_Posting_Empl   : N5
var LocValidMinutes      : N5
var LocUseRVCName        : N2
var SupressGuestMsg      : N2
var SupressNonFORef      : N2
var ReverseGst           : N2
var NoConfirmGuest       : N2
var POST_CASHIER         : N2
var POST_64TAXES         : N2
var CKDATAFullCharRange  : N2
event inq : RoomInqKey
prompt "Please wait...."
gbl_room_inq_type = " "
call RoomInqProc
endevent
event inq : RestrRoomInqKey
prompt "Please wait...."
gbl_room_inq_type = "R"
call RoomInqProc
endevent
event inq : ViewReservKey
gbl_room_inq_type = "V"
call RoomInqProc
endevent
event rxmsg : _timeout
call Check_Backup_Tmed
endevent
event inq : 3
call PackageProc
endevent
event inq : 4
call PackageOpenCheck
endevent
event inq: FODiscountInqKey
call DiscInqProc
endevent
event pickup_check
if PackageCodeIFC = 1
var dtl_count          : N5
var MLvl               : N2
for dtl_count = 1 to @numdtlt
if @dtl_type[dtl_count] = "I"
if (mid(@dtl_name[dtl_count], 1, 2) = "R:") AND (instr(3, @dtl_name[dtl_count], "|") > 0)
MLvl = mid(@dtl_name[dtl_count], instr(3, @dtl_name[dtl_count], "|") + 1, 1)
LoadKybdMacro makekeys(MLvl), 11:623
endif
endif
endfor
endif
endevent
event rxmsg : FO_87_RES_LIST
call FoResListProc
endevent
event rxmsg : FO_87_RES_DETAIL
call FoResDetailProc
endevent
event rxmsg : FO_87_GST_DETAIL
call FoGstDetailProc
endevent
event rxmsg : FO_87_GST_MESSAGE
call FoGstMessageProc
endevent
event rxmsg : FO_87_GST_LOCATOR
call FoGstLocatorProc
endevent
event final_tender
call FinalTenderProc
endevent
event tmed : *
call TmedProc
endevent
event rxmsg : IFC_CHG_PST
call IfcChgPstProc
if gbl_call_oem = TRUE
call oem_tmed
endif
endevent
event rxmsg : IFC_GST_SEL
call IfcGstSelProc
endevent
event inq : ShortInqKey
waitprompt "Please wait...."
gbl_shortinq_type = 0
call ShortInqProc
endevent
event inq: InfoLineInqKey
prompt "Please wait...."
gbl_shortinq_type = 1
call ShortInqProc
endevent
event inq: ExtendedInqKey
prompt "Please wait...."
gbl_shortinq_type = 2
call ShortInqProc
endevent
event inq: TechInfoInqKey
call display_tech_info
endevent
event rxmsg : IFC_GST_INQ
call IfcGstInqProc
endevent
event rxmsg : IFC_GST_MSG
call IfcGstMsg
endevent
event rxmsg : PRINT_MSG
call PrintMsgProc
endevent
event rxmsg : FO_87_IFC_ERROR
call FoIfcErrProc
endevent
event rxmsg : FO_87_DONE
call FoDoneProc
endevent
event rxmsg : *
var dum_txt : A70
rxmsg dum_txt
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, dum_txt
call rxmsg_2log("UNKOWN EVENT", gbl_log_buffer)
endif
window 4, 60, DEFAULT_EVENT_win1_name
display 2, @center, DEFAULT_EVENT_win1_1
display 3, @center, DEFAULT_EVENT_win1_2, @rxmsg
waitforclear
endevent
sub PackageProc
call read_setup()
if PackageCodeIFC = 0
errormessage "Not allowed with PackageCode Interface switched OFF"
exitcancel
endif
if @CKNUM <> 0
errormessage "Not allowed with Transaction in progress"
exitcancel
endif
var room_num      : N4
var room_name     : A10
var done          : N5 = FALSE
var WinText[9]    : A30
var list_size     : N5
var list[100]     : A40
var usr_response  : N1
var usr_selection : N3
var Room_type[3]  : A3
var i             : N3
var PackageCovers : N4
var PackageTable  : N4
var PackageCode   : A5
var MsgVerifyPos  : N2
var MsgChildPos   : N2 = 1
var MsgAdultPos   : N2 = 2
var MsgPckgePos   : N2 = 6
WinText[1]   = "Room Number          :"
WinText[2]   = "Number of Covers     :"
WinText[3]   = "Table Number         :"
Room_type[1] = ""
Room_type[2] = "PX"
Room_type[3] = "PY"
PackageCovers = 0
PackageTable  = 0
while done <> TRUE
window 6, 60, "Begin Table"
display 2, 2, WinText[1]
display 3, 2, WinText[2]
display 4, 2, WinText[3]
displayinput 2, 25, room_num, inq_1_win_input1
displayinput 3, 25, PackageCovers, "Enter Number of Covers"
displayinput 4, 25, PackageTable, "Enter Table Number"
windowinput
if (room_num < 1) OR (PackageCovers < 1) OR (PackageTable < 1)
call display_input_error()
else
done = TRUE
endif
endwhile
done = FALSE
i   = 1
for i = 1 to 3
format room_name as room_type[i], room_num
txmsg "IFC_GST_INQ", room_name
getrxmsg "Please wait -- sending message"
if @rxmsg <> "IFC_GST_INQ"
errormessage "Invalid Response received : ", @rxmsg
exitcancel
endif
rxmsg gbl_message_status, list_size, list[]
if list_size = 1
if (trim(list[1]) <> "ROOM VACANT") AND (trim(list[1]) <> "INVALID ROOM")
window 3, 40, "Is this the correct guest?"
display 2, 2, list[1]
GetEnterOrClear usr_response, "Press Enter(YES) or Clear(NO)"
if usr_response = 1
done = TRUE
break
endif
endif
else
if list_size > 12
window 12, 45, "Choose a Guest:"
else
window list_size, 45, "Choose a Guest:"
endif
window list_size + 1, 40, "Choose a Guest:"
list[list_size + 1] = "NONE OF THE ABOVE"
call enh_listinput(list_size + 1, list[], usr_response, "Choose a Guest:", 0)
if guest_number < 1
exitcancel
endif
if usr_response <= list_size
done = TRUE
break
endif
endif
endfor
if done = FALSE
errormessage "Room Number not found"
exitcancel
endif
MsgVerifyPos = instr(1, list[usr_response], "|")
if MsgVerifyPos < 1
errormessage "Invalid response format. Can not continue ..."
exitcancel
endif
i = mid(list[usr_response], MsgVerifyPos - MsgAdultPos, 1)
i = i + mid(list[usr_response], MsgVerifyPos - MsgChildPos, 1)
if(PackageCovers > i)
errormessage "No. of Covers Exceeded, Actual No. of Guests in Room ", i
exitcancel
endif
var FD       : N5
var fname    : A60
var fline    : A200
var f_str1   : A200
var f_str2   : A100
var MLvl     : N2
PackageCode = mid(list[usr_response], MsgVerifyPos - MsgPckgePos, 4)
f_str1 = trim(PackageCode)
if len(f_str1) = 0
errormessage "PackageCode is empty. Can not continue ..."
exitcancel
endif
PackageCode = f_str1
UpperCase PackageCode
if (@WSSUBTYPE = 2) or (@WSSUBTYPE = 3)
if @OS_PLATFORM = 1
format fname as "\CF\POSClient\SIM\fid_parm.ini"
else
format fname as "fid_parm.ini"
endif
elseif @WSSUBTYPE = 1
format fname as "\Application\Micros\SIM\fid_parm.ini"
else
errormessage "Unsupported Client Type:", @WSSUBTYPE
exitcancel
endif
fopen fd, fname, read, LOCAL
if fd = 0
errormessage "Can not read setup (fid_parm.ini): ", @FILE_ERRSTR
exitcancel
endif
done = FALSE
while not feof(FD)
fread fd, fline
split fline, "=", f_str1, f_str2
UpperCase f_str2
if trim(f_str2) = PackageCode
done = TRUE
break
endif
endwhile
fclose fd
if done = FALSE
errormessage "PackageCode '", PackageCode, "' not found. Can not continue ..."
exitcancel
endif
MLvl = mid(f_str1, 5, 1)
package_info[1] = mid(list[usr_response], 1, MsgVerifyPos)
format package_info[2] as "R:", room_name, "|", MLvl
i = 900 + (20 * @PMSLINK) + 3
LoadKybdMacro makekeys(PackageTable), 11:401, makekeys(PackageCovers), 11:523, makekeys(MLvl), 11:623, 11:i
endsub
sub DiscInqProc
call read_setup()
if @CKNUM = 0
errormessage "Not allowed with NO Transaction in progress"
exitcancel
endif
var room_name     : A30
var done          : N5 = FALSE
var list_size     : N5
var list[100]     : A40
var usr_response  : N3
var i             : N3
var FO_DISCOUNT   : N4
var MsgVerifyPos  : N2
input room_name, inq_1_win_input1
txmsg "IFC_GST_INQ", room_name
getrxmsg "Please wait -- sending message"
if @rxmsg <> "IFC_GST_INQ"
if @rxmsg = "_timeout"
errormessage check_fo_iface_ver_error2
else
errormessage "Invalid Response received : ", @rxmsg
endif
exitcancel
endif
rxmsg gbl_message_status, list_size, list[]
if list_size = 1
if (trim(list[1]) <> "ROOM VACANT") AND (trim(list[1]) <> "INVALID ROOM") AND (instr(1, list[1], "|") > 0)
window 4, 40
displayinverse 1, @CENTER, "Is this the correct guest?"
display 3, 2, list[1]
GetEnterOrClear usr_response, "Press Enter(YES) or Clear(NO)"
if usr_response = 0
exitcancel
endif
else
errormessage trim(list[1])
exitcancel
endif
else
if list_size > 12
window 12, 45, "Choose a Guest:"
else
window list_size, 45, "Choose a Guest:"
endif
call enh_listinput(list_size, list[], usr_response, "Choose a Guest:", 0)
if usr_response < 1
exitcancel
endif
if usr_response > list_size
exitcancel
endif
endif
MsgVerifyPos = instr(1, list[usr_response], "|")
if MsgVerifyPos < 1
errormessage "Invalid response format. Can not continue ..."
exitcancel
endif
FO_DISCOUNT = mid(list[usr_response], MsgVerifyPos - 3, 3)
i = instr(1, list[usr_response], "/")
if i > 1
room_name = mid(list[usr_response], 1, i - 1)
else
room_name = mid(list[usr_response], 1, MsgVerifyPos - 3)
endif
call FoExtPrgDsc(FO_DISCOUNT, room_name)
endsub
sub PackageOpenCheck
savechkinfo package_info[1]
savechkinfo package_info[2]
endsub
sub RoomInqProc
call read_setup()
call check_fo_iface_ver()
lvar guest_id : A30 = ""
lvar done : N5 = FALSE
while done <> TRUE
if TRACK2FIELD = 2
input guest_id { M2, 2, 1, 19 }, inq_1_win_input1
else
input guest_id { M2, 1, 1, 19 }, inq_1_win_input1
endif
if len(guest_id) < 1
call display_input_error()
elseif guest_id = "/VER"
call display_version_number(mic_fo_iface_num)
elseif @MAGSTATUS = "Y"
if mid(guest_id, 1, 3) = ":<>"
errormessage display_input_error_2
exitcancel
else
if gbl_allow_msr_enh = FALSE
errormessage display_input_error_3
exitcancel
else
if mid(guest_id, 1, 1) = ";"
format guest_id as mid(guest_id, 2, len(guest_id) - 1)
endif
if mid(guest_id, len(guest_id), 1) = "?"
format guest_id as mid(guest_id, 1, len(guest_id) - 1)
endif
done = TRUE
endif
endif
else
done = TRUE
endif
endwhile
txmsg "FO_FI_RES_QUERY", guest_id
call txmsg_2log("")
waitforrxmsg
endsub
sub FoResListProc
lvar MAX_RES_LIST            : N5 = 200
lvar reservation             : A30
lvar res_room                : A4
lvar res_header              : A78
lvar res_id[MAX_RES_LIST]    : A30
lvar res_desc[MAX_RES_LIST]  : A72
lvar res_flags[MAX_RES_LIST] : A2
lvar res_list_size           : N5
lvar res_choice              : N5 = 1
lvar i                       : N5
lvar num_min                 : N5 = 1
lvar num_msg_lines           : N5 = 1
lvar num_loc_lines           : N5 = 1
lvar msg_lines[8]            : A55
lvar loc_lines[4]            : A30
lvar obj_McrsExtDialogs     : object
lvar guestFunctionsStyle    : N
lvar guestHasMessage        : N
lvar guestHasLocator        : N
lvar guestFuncSelected      : N
lvar aHtmlTextBase          : A
lvar htmlMode               : A
rxmsg res_header, res_list_size, res_id[] : res_desc[] : res_flags[]
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, res_header, res_list_size
for i = 1 to res_list_size
format gbl_log_buffer, chr(28) as gbl_log_buffer, res_id[i], res_desc[i], res_flags[i]
endfor
call rxmsg_2log("", gbl_log_buffer)
endif
if res_list_size = 0
window 3, 50, FO_87_RES_LIST_win1_name
display 2, @center, FO_87_RES_LIST_win1_1
waitforclear
exitcancel
endif
if @OpsContext.DisplayType <> "HTML"
if obj_McrsExtDialogs = @NULL
obj_McrsExtDialogs = new McrsExtDialogs.clMcrsDialogs()
gbl_McrsExtDlgsVer = obj_McrsExtDialogs.assemblyVersion()
endif
if res_list_size > 1
i = obj_McrsExtDialogs.SelectionListInit(System.String.Format("Simphony Enhanced Interface V.{0}", INTERNAL_VERSION), FO_87_RES_LIST_input1)
if (i = 0)
call msg_2log("FoResListProc", "SelectionListInit returned FAILURE")
errormessage "Internal Error, unable to continue"
exitcancel
endif
obj_McrsExtDialogs.SelectionListAddColumn(res_header)
obj_McrsExtDialogs.SelectionListAddColumn("...")
for i = 1 to res_list_size
obj_McrsExtDialogs.SelectionListAddData(0, res_desc[i])
obj_McrsExtDialogs.SelectionListAddData(1, res_flags[i])
endfor
res_choice = obj_McrsExtDialogs.SelectionListShow()
if res_choice < 0
exitcancel
endif
res_choice = res_choice + 1
reservation = res_id[res_choice]
res_room = mid(res_desc[res_choice], 1, 4)
else
reservation = res_id[1]
res_room = mid(res_desc[1], 1, 4)
endif
gbl_res_data = reservation
gbl_res_room = res_room
if gbl_room_inq_type = "V"
txmsg "FO_FI_RES_DETAIL", reservation
call txmsg_2log("Resv.View")
waitforrxmsg
endif
guestFunctionsStyle = 0
if gbl_room_inq_type = "R"
guestFunctionsStyle = 1
endif
i = obj_McrsExtDialogs.GuestFunctionsInit(System.String.Format("Simphony Enhanced Interface V.{0}", INTERNAL_VERSION), FO_87_RES_LIST_win3_name, guestFunctionsStyle)
if (i = 0)
call msg_2log("FoResListProc", "GuestFunctionsInit returned FAILURE")
errormessage "Internal Error, unable to continue"
exitcancel
endif
guestHasMessage = instr(1, res_flags[res_choice], "M")
guestHasLocator = instr(1, res_flags[res_choice], "L")
obj_McrsExtDialogs.GuestFunctionsSetGuestLables(guestHasMessage, guestHasLocator)
obj_McrsExtDialogs.GuestFunctionsAddData(res_header, res_desc[res_choice])
guestFuncSelected = obj_McrsExtDialogs.GuestFunctionsShow()
else
format aHtmlTextBase as res_header, "^"
for i = 1 to res_list_size
format aHtmlTextBase as aHtmlTextBase, res_id[i], "*", res_desc[i], "^"
endfor
if res_list_size > 1
htmlMode = "list"
else
htmlMode = "single"
endif
lvar html                   : A
lvar htmlResponse           : A
lvar htmlInqResult          : A
html = @DataStore.ReadExtensionApplicationContentTextByNameKey( @OpsContext.RvcID, @ApplicationName, "html" )
if html <> ""
htmlResponse = @OpsContext.RaiseBrowserDialog( html, "guestsList", aHtmlTextBase )
split htmlResponse, ":", htmlInqResult, reservation
if reservation = 0
guestFuncSelected = 0
else
if (htmlInqResult = "gst_rsv")
guestFuncSelected = 1
elseif (htmlInqResult = "gst_dtl")
guestFuncSelected = 2
else
format gbl_log_buffer as "Unknown HTML Inq Result: '", htmlInqResult, "' reservation: ", reservation
call rxmsg_2log("", gbl_log_buffer)
guestFuncSelected = 0
endif
endif
else
errormessage "Application Content HTML was NOT found!"
exitcancel
endif
reservation = res_id[res_choice]
res_room = mid(res_desc[res_choice], 1, 4)
endif
if guestFuncSelected = 0
exitcancel
elseif guestFuncSelected = 1
txmsg "FO_FI_RES_DETAIL", reservation
call txmsg_2log("")
waitforrxmsg
elseif guestFuncSelected = 2
txmsg "FO_FI_GST_DETAIL", reservation
call txmsg_2log("")
waitforrxmsg
elseif guestFuncSelected = 3
txmsg "FO_FI_GST_MESSAGE", reservation
call txmsg_2log("")
waitforrxmsg
elseif guestFuncSelected = 4
txmsg "FO_FI_GST_LOCATOR", reservation
call txmsg_2log("")
waitforrxmsg
elseif guestFuncSelected = 5
call create_msg(num_msg_lines, msg_lines[])
if (num_msg_lines > 0)
txmsg "FO_FI_GST_NEW_MESSAGE", reservation,num_msg_lines,msg_lines[]
call txmsg_2log("")
else
txmsg "FO_FI_RES_QUERY", gbl_res_room
call txmsg_2log("")
endif
waitforrxmsg
elseif guestFuncSelected = 6
call create_loc(num_min, num_loc_lines, loc_lines[])
if (num_loc_lines > 0)
txmsg "FO_FI_GST_NEW_LOCATOR", reservation,num_min,num_loc_lines,loc_lines[]
call txmsg_2log("")
else
txmsg "FO_FI_RES_QUERY", gbl_res_room
call txmsg_2log("")
endif
waitforrxmsg
endif
endsub
sub FoResDetailProc
lvar MAX_LIST_SIZE           : N5 = 200
lvar res_desc[MAX_LIST_SIZE] : A78
lvar res_list_size           : N5
lvar res_choice              : N5 = 1
lvar i                       : N5
lvar aHtmlTextBase           : A
rxmsg res_list_size, res_desc[]
if @OpsContext.DisplayType = "HTML"
for i = 1 to res_list_size
format aHtmlTextBase, "^" as aHtmlTextBase, res_desc[i]
endfor
endif
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, res_list_size
for i = 1 to res_list_size
format gbl_log_buffer, chr(28) as gbl_log_buffer, res_desc[i]
endfor
call rxmsg_2log("", gbl_log_buffer)
endif
if res_list_size < 1
window 3, 30, mid(FO_87_RES_DETAIL_win1_name, 1, 30)
display 2, @center, mid(FO_87_RES_DETAIL_win1_1, 1, 30)
waitforclear
exitcancel
endif
if @OpsContext.DisplayType <> "HTML"
call enh_listinput(res_list_size, res_desc[], res_choice, FO_87_RES_DETAIL_input1, 1)
if (gbl_room_inq_type = "V")
gbl_room_inq_type = ""
exitcancel
endif
txmsg "FO_FI_RES_QUERY", gbl_res_room
call txmsg_2log("")
waitforrxmsg
else
lvar html:A = @DataStore.ReadExtensionApplicationContentTextByNameKey( @OpsContext.RvcID, @ApplicationName, "html" )
if html <> ""
lvar response:A = @OpsContext.RaiseBrowserDialog( html, "guestsDetails", aHtmlTextBase )
else
errormessage "Application Content HTML was NOT found!"
exitcancel
endif
endif
endsub
sub FoGstDetailProc
lvar MAX_LIST_SIZE           : N5 = 200
lvar res_desc[MAX_LIST_SIZE] : A78
lvar res_list_size           : N5
lvar res_choice              : N5 = 1
lvar i                       : N5
lvar aHtmlTextBase           : A
rxmsg res_list_size, res_desc[]
if @OpsContext.DisplayType = "HTML"
for i = 1 to res_list_size
format aHtmlTextBase, "^" as aHtmlTextBase, res_desc[i]
endfor
endif
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, res_list_size
for i = 1 to res_list_size
format gbl_log_buffer, chr(28) as gbl_log_buffer, res_desc[i]
endfor
call rxmsg_2log("", gbl_log_buffer)
endif
if res_list_size < 1
window 3, 30, mid(FO_87_GST_DETAIL_win1_name, 1, 30)
display 2, @center, mid(FO_87_GST_DETAIL_win1_1, 1, 30)
waitforclear
exitcancel
endif
if @OpsContext.DisplayType <> "HTML"
call enh_listinput(res_list_size, res_desc[], res_choice, FO_87_GST_DETAIL_input1, 1)
txmsg "FO_FI_RES_QUERY", gbl_res_room
call txmsg_2log("")
waitforrxmsg
else
lvar html:A = @DataStore.ReadExtensionApplicationContentTextByNameKey( @OpsContext.RvcID, @ApplicationName, "html" )
if html <> ""
lvar response:A = @OpsContext.RaiseBrowserDialog( html, "guestsDetails", aHtmlTextBase )
else
errormessage "Application Content HTML was NOT found!"
exitcancel
endif
endif
endsub
sub FoGstMessageProc
lvar list_size : N5
lvar list[200] : A70
lvar i         : N5
rxmsg list_size, list[]
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, list_size
for i = 1 to list_size
format gbl_log_buffer, chr(28) as gbl_log_buffer, list[i]
endfor
call rxmsg_2log("", gbl_log_buffer)
endif
call print_msg(list_size, list[])
txmsg "FO_FI_RES_QUERY", gbl_res_room
call txmsg_2log("")
waitforrxmsg
endsub
sub FoGstLocatorProc
lvar  list_size : N5
lvar  list[200] : A32
lvar i         : N5
rxmsg list_size, list[]
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, list_size
for i = 1 to list_size
format gbl_log_buffer, chr(28) as gbl_log_buffer, list[i]
endfor
call rxmsg_2log("", gbl_log_buffer)
endif
call print_msg(list_size, list[])
txmsg "FO_FI_RES_QUERY", gbl_res_room
call txmsg_2log("")
waitforrxmsg
endsub
sub FinalTenderProc
var contains_pms_posts : N1 = FALSE
var has_valid_pms_link : N1 = FALSE
var RoomCharge         : N5
var date               : A8
var time               : A8
var path               : A2
var index              : N2
var indexNFO           : N2
var dtl_count          : N5
var pms_obj_num        : N9
var send_check         : N1
lvar asc_ck_data        : A32767
if @trainingmode <> 0
exitcontinue
endif
for dtl_count = 1 to @numdtlt
if @dtl_type[dtl_count] = "T" and @dtl_pmslink[dtl_count] > 0
has_valid_pms_link = TRUE
pms_obj_num = @dtl_objnum[dtl_count]
call check_room_tmed( RoomCharge, pms_obj_num )
if RoomCharge = TRUE AND @numdtlt >= (dtl_count + 1)
contains_pms_posts = TRUE
if @dtl_type[dtl_count + 1] = "R" and mid ( @dtl_name[dtl_count + 1], 18, 1 ) = "*"
index = mid ( @dtl_name[dtl_count+1], 19, 1 )
if index < 2 or index > 9
index = 0
endif
endif
break
elseif @numdtlt >= (dtl_count + 1)
if @dtl_type[dtl_count + 1] = "R" and mid ( @dtl_name[dtl_count + 1], 18, 1 ) = "*"
indexNFO = mid ( @dtl_name[dtl_count+1], 19, 1 )
if indexNFO < 2 or indexNFO > 9
indexNFO = 0
endif
endif
endif
endif
endfor
if debug_script > 9
SETSIGNONLEFT
for dtl_count = 1 to @NUMDTLT
gbl_log_buffer = ""
if @DTL_TYPE[dtl_count] = "I"
if trim(@DTL_NAME[dtl_count]) <> ""
format gbl_log_buffer as @DTL_TYPE[dtl_count], "|",      dtl_count{3}, "|",              " "{>4}, "|",                   @DTL_NAME[dtl_count]{<16}, "|"
endif
else
if @DTL_TYPE[dtl_count] <> "?"
format gbl_log_buffer as @DTL_TYPE[dtl_count], "|",      dtl_count{3}, "|",              @DTL_QTY[dtl_count]{>+4}, "|",  @DTL_NAME[dtl_count]{<16}, "|", @DTL_TTL[dtl_count]{>10}, "|",  @DTL_STATUS[dtl_count], "|",    @DTL_DSCI[dtl_count], "|",      @DTL_SVCI[dtl_count], "|",      @DTL_TYPEDEF[dtl_count]
endif
endif
if gbl_log_buffer <> ""
call msg_2log("CHK DETAILS", gbl_log_buffer)
endif
endfor
endif
send_check = FALSE
if contains_pms_posts = TRUE
send_check = TRUE
elseif SendAllDtls = TRUE AND has_valid_pms_link = TRUE
send_check = TRUE
if (index = 0) and (indexNFO > 0)
index = indexNFO
endif
endif
if send_check = TRUE
format gbl_log_buffer as "@CheckData Length:", len(@CheckData)
call msg_2log("FinalTenderProc", gbl_log_buffer)
if len(@CheckData) > 5
asc_ck_data = @CheckData
call MakePrintable(asc_ck_data, FALSE)
else
call msg_2log("FinalTenderProc", "Length @CheckData LT 5")
call alt_CheckData(asc_ck_data)
endif
format gbl_log_buffer as "asc_ck_data:", len(asc_ck_data)
call msg_2log("FinalTenderProc", gbl_log_buffer)
call format_chk_opn_date(date)
call format_chk_opn_time(time)
if index > 1
format path as "P",index
txmsg path, "FO_FI_FINAL_TENDER", date, time, @rvc, @cknum, asc_ck_data
else
txmsg "FO_FI_FINAL_TENDER", date, time, @rvc, @cknum, asc_ck_data
endif
call txmsg_2log("FinalTender")
waitforrxmsg
endif
endsub
sub TmedProc
var date            : A8
var time            : A8
var guest_id        : A30
var tx_message      : A800
var i               : N5
var j               : N5
var RoomCharge      : N5
var dtl             : N2
var change_dtl      : N5
var GuestCount      : N5
var dtl_count       : N5
var tnd_amnt        : $12
var change_amnt     : $12
var sales_itm[16]   : $12
var dscnt_itm[16]   : $12
var svcch_itm[16]   : $12
var tmp_si_itm[16]  : $12
var sales_tax[8]    : $12
var dsc_ttl         : $12
var info_found      : N1
if @trainingmode <> 0
exitcontinue
endif
if @TNDTTL = 0 AND @DSC = 0 AND @SVC = 0 AND @AUTOSVC = 0
exitcontinue
endif
call read_setup()
call check_fo_iface_ver()
i = @TMDNUM
call check_room_tmed ( RoomCharge, i )
if RoomCharge = TRUE
if @CHANGE <> 0
if @VOIDSTATUS <> "Y"
errormessage TmedVoidError2
exitcancel
endif
endif
if PackageCodeIFC = 1
i = 0
for dtl_count = 1 to @numdtlt
if @dtl_type[dtl_count] = "I"
if (mid(@dtl_name[dtl_count], 1, 2) = "R:") AND (instr(3, @dtl_name[dtl_count], "|") > 0)
i = 1
endif
endif
endfor
if i = 0
errormessage "Can not continue, this is not a Hotel Guest"
exitcancel
endif
endif
if @VOIDSTATUS <> "Y"
if SKIP_INFO_LINE <> 1
info_found = 0
lvar infoDtl       : object
lvar infoGuestName : A
for i = 0 to (@OpsContext.CheckDetail.Count - 1)
infoDtl = @OpsContext.CheckDetail[i]
if (infoDtl.DetailType = 22) and (infoDtl.VoidLink = 0)
if mid(infoDtl.Name, 1, 1) = "~"
info_found = 1
infoGuestName = infoDtl.Name
break
endif
endif
endfor
if gbl_use_infoline = 1
gbl_use_infoline = 0
info_found = 0
endif
guest_id = ""
if (info_found = 1)
if (trim(infoGuestName) <> "") and (mid(infoGuestName, 1, 1) = "~")
j = instr(1, infoGuestName, "/")
if j = 0
guest_id = trim(mid(infoGuestName, 2, 23))
else
guest_id = trim(mid(infoGuestName, 2, j - 2))
endif
format gbl_log_buffer as "Obtained Guest from Check-Info Lines [", infoGuestName, "][", guest_id, "]"
call msg_2log("TMED FO", gbl_log_buffer)
gbl_use_infoline = 1
endif
endif
endif
else
if gbl_use_infoline = 0
for dtl_count = 1 to @numdtlt
if @dtl_type[dtl_count] = "T"
if (@DTL_OBJNUM[dtl_count] = @TMDNUM) and    (bit(@DTL_STATUS[dtl_count], 10) = 0) and ((@dtl_ttl[dtl_count] * -1) = @TNDTTL)
if dtl_count < @numdtlt
if @dtl_type[dtl_count + 1] = "R"
j = instr(1, @DTL_NAME[dtl_count + 1], "/")
if j = 0
guest_id = trim(mid(@DTL_NAME[dtl_count + 1], 1, 23))
else
guest_id = trim(mid(@DTL_NAME[dtl_count + 1], 1, j - 1))
endif
gbl_use_infoline = 1
endif
endif
endif
endif
endfor
else
gbl_use_infoline = 0
endif
endif
if guest_id = ""
var iTmp[20] : N9
var iRvcIdx  : N9
var iEmplOpt : N5
iRvcIdx  = 0
iEmplOpt = 0
if Restricted_Posting = 1
if (Restr_Posting_Empl > 0) and (Restr_Posting_Empl <= 8)
iEmplOpt = @EMPLOPT[ Restr_Posting_Empl]
endif
endif
if iEmplOpt = 1
window 4, 50
Display 2, 1, RoomInputLabel
Display 3, 1, GuestInputLabel
displayinput 2, len(RoomInputLabel) + 1, guest_id, "Enter Room#"
displayinput 3, len(GuestInputLabel) + 1, gbl_guest_last_name, "Enter Guest Last-Name"
windowinput
if (len(guest_id) < 1) or (len(gbl_guest_last_name) < 1)
call display_input_error()
exitcancel
else
if (len(gbl_guest_last_name) < 3)
errormessage RestrPostingError3
exitcancel
endif
endif
else
if TRACK2FIELD = 2
input guest_id { M2, 2, 1, 19 }, tmed_16_input1
else
input guest_id { M2, 1, 1, 19 }, tmed_16_input1
endif
if len(guest_id) < 1
call display_input_error()
exitcancel
endif
endif
if @MAGSTATUS = "Y"
if mid(guest_id, 1, 3) = ":<>"
errormessage display_input_error_2
exitcancel
endif
if mid(guest_id, 1, 1) = ";"
format guest_id as mid(guest_id, 2, len(guest_id) - 1)
endif
if mid(guest_id, len(guest_id), 1) = "?"
format guest_id as mid(guest_id, 1, len(guest_id) - 1)
endif
else
if MagneticCardOnly = 1
cleararray iTmp
iRvcIdx = 0
split MagCardOnlyExclRVC, ",", #20, iTmp[]
for j = 1 to 20
if iTmp[j] = @RVC
iRvcIdx = @RVC
break
endif
endfor
if iRvcIdx = 0
errormessage MagCardError
exitcancel
endif
endif
endif
endif
gbl_guest_id = guest_id
txmsg "IFC_CHG_PST", guest_id, @TMDNUM
call txmsg_2log("")
waitforrxmsg
else
if @VOIDSTATUS = "Y"
change_dtl = 0
for dtl = @NUMDTLT to 1 step -1
if @DTL_TYPE[dtl] = "T"
if bit(@DTL_STATUS[dtl],  6) = 1 AND bit(@DTL_STATUS[dtl],  7) = 0 AND bit(@DTL_STATUS[dtl],  8) = 1 AND bit(@DTL_STATUS[dtl],  5) = 0 AND bit(@DTL_STATUS[dtl], 10) = 0
change_amnt = (@DTL_TTL[dtl] * -1)
change_dtl  = dtl
break
endif
endif
endfor
format gbl_log_buffer as "RVC:", @RVC, " CHK", @CKNUM, " TNDTTL:", @TNDTTL, " CHANGE:", change_amnt, " TMDNUM:", @TMDNUM, " CHANGE DTL:", change_dtl
call msg_2log("TMED Non-FO, VOID", gbl_log_buffer)
tnd_amnt = @TNDTTL + change_amnt
else
format gbl_log_buffer as "RVC:" , @RVC, " CHK", @CKNUM, " TNDTTL:", @TNDTTL, " CHANGE:", @CHANGE, " TMDNUM:", @TMDNUM
call msg_2log("TMED Non-FO", gbl_log_buffer)
tnd_amnt = @TNDTTL - @CHANGE
endif
call TransmitPosting(" ", tnd_amnt, " ", " ", " ", FALSE, @TMDNUM)
endif
endsub
sub IfcChgPstProc
var status          : A1
var message         : A30
lvar temp_tndttl     : A
var list[2]         : A40
var list_size       : N5
var RoomCharge      : N5
var i               : N5
rxmsg gbl_message_status, status, message, temp_tndttl
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, gbl_message_status, status, message, temp_tndttl
call rxmsg_2log("", gbl_log_buffer)
endif
format gbl_log_buffer as "STATUS:" , status, " MESSAGE:", message, " MESSAGE_STATUS:", gbl_message_status
call msg_2log("FO POSTING ANSWER", gbl_log_buffer)
if status = "P"
gbl_use_infoline = 0
i = @TMDNUM
call check_room_tmed ( RoomCharge, i )
if RoomCharge = TRUE
saverefinfo message
else
if SupressNonFORef = 0
saverefinfo message
endif
endif
endif
if status = "D"
errormessage message
exitcancel
endif
if status = "E"
errormessage message
exitcancel
endif
if SupressGuestMsg = 0
list[1] = message
list_size = 1
call display_list_and_check_messages (list_size, list[], FALSE )
endif
endsub
sub IfcGstSelProc
var date            : A8
var time            : A8
var list[100]       : A40
var list_eht[100]   : A30
var response_id     : A20
var guest_id        : A30
var sel_num         : A10
var winTitle        : A40
var list_size       : N5
var guest_number    : N5
var tnd_amnt        : $12
var svc_amnt        : $12
var tx_message      : A800
var sales_itm[16]   : $12
var dscnt_itm[16]   : $12
var svcch_itm[16]   : $12
var tmp_si_itm[16]  : $12
var sales_tax[8]    : $12
var dsc_ttl         : $12
var GuestCount      : N5
var i               : N5
var j               : N5
var misc            : A1
var key_press       : key
var sTmp[4]         : A40
var iEmplOpt        : N5
rxmsg guest_id, response_id, list_size, list[]
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, guest_id, response_id, list_size
for i = 1 to list_size
format gbl_log_buffer, chr(28) as gbl_log_buffer, list[i]
endfor
call rxmsg_2log("", gbl_log_buffer)
endif
iEmplOpt = 0
if Restricted_Posting = 1
if (Restr_Posting_Empl > 0) and (Restr_Posting_Empl <= 8)
iEmplOpt = @EMPLOPT[ Restr_Posting_Empl]
endif
endif
if list_size = 1
if iEmplOpt = 1
split list[1], "/", sTmp[1], sTmp[2]
if sTmp[1] = gbl_guest_id
j = len(gbl_guest_last_name)
if j > 10
J = 10
endif
if mid(sTmp[2], 1, j) <> mid(gbl_guest_last_name, 1, j)
errormessage RestrPostingError2
exitcancel
endif
else
errormessage RestrPostingError2
exitcancel
endif
endif
if (NoConfirmGuest = 0) OR (@VOIDSTATUS = "Y")
if @VOIDSTATUS = "N"
winTitle = GuestNameTitle
else
winTitle = VOIDGuestNameTitle
endif
window 3, 45, winTitle
display 2, @center, list[1]
waitforconfirm ConfirmGuestPrompt
endif
guest_number = 1
else
if iEmplOpt = 1
errormessage RestrPostingError1
exitcancel
endif
Window 15,80, GuestListTitle
ListInputEx 1, 1, list_size, list, guest_number, SelectGuestPrompt
if guest_number < 1
exitcancel
endif
endif
gbl_guest_num = guest_number
format sel_num as "S",guest_number
tnd_amnt = @TNDTTL
if response_id = "IFC_CHG_PST"
gbl_first_pass = 0
gbl_guest_sel = list[ guest_number ]
call TransmitPosting(response_id, tnd_amnt, guest_id, list[ guest_number ], sel_num, TRUE, @TMDNUM)
else
gbl_first_pass = 0
txmsg response_id, guest_id, list[ guest_number ], sel_num
call txmsg_2log("")
waitforrxmsg
endif
endsub
sub ShortInqProc
lvar guest_id : A30
if gbl_shortinq_type = 1
if SKIP_INFO_LINE = 1
errormessage "Info Line update disabled in Setup..."
exitcancel
endif
if @CKNUM = 0
errormessage "No open check...."
exitcancel
endif
endif
call read_setup()
if PackageCodeIFC <> 0
errormessage "Not allowed with PackageCode Interface switched ON"
exitcancel
endif
if TRACK2FIELD = 2
input guest_id { M2, 2, 1, 19 }, "Guest inquiry, enter name or room #"
else
input guest_id { M2, 1, 1, 19 }, "Guest inquiry, enter name or room #"
endif
gbl_guest_id = guest_id
gbl_first_pass = 0
if @MAGSTATUS = "Y"
if mid(guest_id, 1, 3) = ":<>"
errormessage display_input_error_2
exitcancel
endif
if mid(guest_id, 1, 1) = ";"
format guest_id as mid(guest_id, 2, len(guest_id) - 1)
endif
if mid(guest_id, len(guest_id), 1) = "?"
format guest_id as mid(guest_id, 1, len(guest_id) - 1)
endif
else
if gbl_shortinq_type = 2
var sTemp : A40
format sTemp as "I/", guest_id
guest_id = mid(sTemp, 1, varsize(guest_id))
endif
endif
txmsg "IFC_GST_INQ", guest_id
call txmsg_2log("FO")
waitforrxmsg
endsub
sub IfcGstInqProc
lvar list_size       : N
var  list[100]       : A
lvar guest_number    : N5
var  RC              : N5
lvar i               : N5
rxmsg gbl_message_status, list_size, list[]
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, gbl_message_status, list_size
for i = 1 to list_size
format gbl_log_buffer, chr(28) as gbl_log_buffer, list[i]
endfor
call rxmsg_2log("", gbl_log_buffer)
endif
gbl_guest_sel = ""
gbl_guest_num = 0
if gbl_shortinq_type <> 1
call display_list_and_check_messages(list_size, list[], TRUE )
else
if list_size = 1
window 3, 45, GuestNameTitle
display 2, @center, list[1]
waitforconfirm ConfirmGuestPrompt
guest_number = 1
else
if list_size > 12
window 12, 80, GuestListTitle
else
window list_size, 80, GuestListTitle
endif
listinput 1, 1, list_size, list, guest_number, SelectGuestPrompt
endif
if guest_number = 0
exitcancel
endif
call append_ChkInfo(list[guest_number], RC)
if RC = 0
errormessage(InfoLineError1)
endif
if RC < 0
errormessage(InfoLineError2)
endif
endif
endsub
sub IfcGstMsg
lvar action    : A1
lvar list[100] : A40
lvar list_size : N5
lvar i         : N5
rxmsg action, list_size, list[]
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, action, list_size
for i = 1 to list_size
format gbl_log_buffer, chr(28) as gbl_log_buffer, list[i]
endfor
call rxmsg_2log("", gbl_log_buffer)
endif
if action = "P"
startprint @rcpt
listprint list_size, list
endprint
else
window 15, 40
listdisplay 1, 1, list_size, list
waitforclear
endif
endsub
sub read_setup()
lvar i             : N5
lvar skipLine      : N1
var sValue         : A20
var fname          : A99
var fline[99]      : A200
var f_str1         : A200
var f_str2         : A100
if gbl_setup_read = TRUE
return
endif
lvar xContent     : object
lvar settings     : A
try
xContent = @DataStore.ReadContentByName(@OpsContext.RvcID, ContentCfgName)
if xContent <> @NULL
settings = System.Text.Encoding.Unicode.GetString(xContent.ContentData.DataBlob, 0, xContent.ContentData.DataBlob.Length)
else
LogPlainSystemMessage("read_setup ReadContentByName returned NULL")
errormessage "Cannot read content [", ContentCfgName, "]. Will continue with Default settings"
endif
catch ex
LogPlainSystemMessage(System.String.Format( "Exception in read_setup ReadContentByName [{0}] : [{1}]", ex.Message, ex.Details))
errormessage "Fatal Error reading content [", ContentCfgName, "]. Will continue with Default settings"
endtry
SendAllDtls        = 0
PackageCodeIFC    = 0
UseBackupTMed     = 0
Track2Field       = 1
MagneticCardOnly  = 0
debug_script      = 1
ReverseGst        = 0
NoConfirmGuest    = 0
split settings, chr(10), #99, fline[]
for i = 1 to arraysize(fLine)
skipLine = 0
if trim(fline[i]) = ""
skipLine = 1
elseif mid(trim(fline[i]), 1, 1) = "#"
skipLine = 1
endif
if skipLine = 0
f_str2 = ""
split fline[i], "=", f_str1, f_str2
call advtrim(f_str2)
uppercase f_str1
if trim(f_str1) = "DEBUG_ON"
debug_script = trim(f_str2)
call msg_2log("SETUP DEBUG_ON", debug_script)
elseif trim(f_str1) = "REVERSEGST"
ReverseGst = trim(f_str2)
call msg_2log("SETUP REVERSEGST", ReverseGst)
elseif trim(f_str1) = "SENDALLDTLS"
SendAllDtls = trim(f_str2)
call msg_2log("SETUP SENDALLDTLS", SendAllDtls)
elseif trim(f_str1) = "SUPPRESSGSTMSG"
SupressGuestMsg = trim(f_str2)
call msg_2log("SETUP SUPPRESSGSTMSG", SupressGuestMsg)
elseif trim(f_str1) = "SUPPRESSNFOREF"
SupressNonFORef = trim(f_str2)
call msg_2log("SETUP SUPPRESSNFOREF", SupressNonFORef)
elseif trim(f_str1) = "PACKAGECODEIFC"
PackageCodeIFC = trim(f_str2)
call msg_2log("SETUP PACKAGECODEIFC", PackageCodeIFC)
elseif trim(f_str1) = "USEBACKUPTMED"
UseBackupTMed = trim(f_str2)
call msg_2log("SETUP USEBACKUPTMED", UseBackupTMed)
elseif trim(f_str1) = "NO_CONFIRM_GST"
NoConfirmGuest = trim(f_str2)
call msg_2log("SETUP NO_CONFIRM_GST", NoConfirmGuest)
elseif trim(f_str1) = "FULL_DSVC"
UseFull_DSVC = trim(f_str2)
call msg_2log("SETUP FULL_DSVC", UseFull_DSVC)
elseif trim(f_str1) = "SI_NET_DSC"
UseSI_NET_DSC = trim(f_str2)
call msg_2log("SETUP SI_NET_DSC", UseSI_NET_DSC)
elseif trim(f_str1) = "POST_CASHIER"
POST_CASHIER = trim(f_str2)
call msg_2log("SETUP POST_CASHIER", POST_CASHIER)
elseif trim(f_str1) = "POST_64TAXES"
POST_64TAXES = trim(f_str2)
call msg_2log("SETUP POST_64TAXES", POST_64TAXES)
elseif trim(f_str1) = "RESTRICTED_POSTING"
Restricted_Posting = trim(f_str2)
call msg_2log("SETUP RESTRICTED_POSTING", Restricted_Posting)
elseif trim(f_str1) = "RESTR_POSTING_EMPL"
Restr_Posting_Empl =  trim(f_str2)
call msg_2log("SETUP RESTR_POSTING_EMPL", Restr_Posting_Empl)
elseif trim(f_str1) = "SKIP_INFO_LINE"
SKIP_INFO_LINE = trim(f_str2)
call msg_2log("SETUP SKIP_INFO_LINE", SKIP_INFO_LINE)
elseif trim(f_str1) = "MAGCARDONLY"
MagneticCardOnly = trim(f_str2)
call msg_2log("SETUP MAGCARDONLY", MagneticCardOnly)
elseif trim(f_str1) = "MAGCARDOVRWRT"
MagCardOnlyExclRVC =  mid(trim(f_str2), 1, varsize(MagCardOnlyExclRVC))
call msg_2log("SETUP MAGCARDOVRWRT", MagCardOnlyExclRVC)
elseif trim(f_str1) = "TRACK2FIELD"
Track2Field = trim(f_str2)
call msg_2log("SETUP TRACK2FIELD", Track2Field)
elseif trim(f_str1) = "LOCVALIDMIN"
LocValidMinutes = trim(f_str2)
call msg_2log("SETUP LOCVALIDMIN", LocValidMinutes)
elseif trim(f_str1) = "RVCNAMELOC"
LocUseRVCName = trim(f_str2)
call msg_2log("SETUP RVCNAMELOC", LocUseRVCName)
elseif trim(f_str1) = "CKDATAFullCharRange"
CKDATAFullCharRange = trim(f_str2)
call msg_2log("SETUP CKDATAFullCharRange", CKDATAFullCharRange)
endif
endif
endfor
format gbl_log_buffer as @PLATFORM, ",", @VERSION, ",", mic_fo_iface_num, ",", mic_fo_iface_date
call msg_2log("@PLATFORM, @VERSION, ISL VER.", gbl_log_buffer)
gbl_setup_read = TRUE
endsub
sub update_tax_and_sales(ref sales_itm[], ref sales_tax[], ref dscnt_itm[], ref svcch_itm[])
lvar i               : N5
lvar net_sales       : $12
lvar grs_sales       : $12
lvar dsc_amnt        : $12
lvar dsc_net_amnt    : $12
lvar dsc_tmp_amnt    : $12
lvar svc_tmp_amnt    : $12
lvar svc_amnt        : $12
lvar DiffApplied     : N1
lvar MaxTaxNum       : N
ClearArray dscnt_itm
if gbl_dsc_svc_itmzr = TRUE
dsc_tmp_amnt = 0.00
for i = 1 to 16
dscnt_itm[i] = @SI_DSC[i]
dsc_tmp_amnt = dsc_tmp_amnt + dscnt_itm[i]
endfor
endif
ProRate
for i = 1 to 16
sales_itm[i] = @si[i]
endfor
MaxTaxNum = 8
if POST_64TAXES > 0
MaxTaxNum = 64
endif
for i = 1 to MaxTaxNum
sales_tax[i] = @tax[i]
endfor
dsc_amnt = @DSC
if gbl_dsc_svc_itmzr = TRUE
if dsc_amnt <> 0.00
format gbl_log_buffer as "Prorated @DSC:", dsc_amnt, "; BaseCurrency Decimal-Places:", @OpsContext.CurrentBaseCurrencyDp
call msg_2log("ProRate DSC", gbl_log_buffer)
for i = 1 to 16
format gbl_log_buffer as "before prorate dsc[", i{02}, "]:", dscnt_itm[i]{<8}
call run_prorate(dsc_tmp_amnt, dsc_amnt, dscnt_itm[i], dscnt_itm[i])
format gbl_log_buffer as gbl_log_buffer, " AFTER  prorate:", dscnt_itm[i]
call msg_2log("ProRate DSC", gbl_log_buffer)
endfor
endif
dsc_tmp_amnt = 0.00
for i = 1 to 16
dsc_tmp_amnt = dsc_tmp_amnt + dscnt_itm[i]
endfor
if (dsc_amnt <> 0.00) or (dsc_tmp_amnt  <> 0.00)
format gbl_log_buffer as "Prorated Sum DSC, SUM DTL:", dsc_tmp_amnt, " @DSC:", dsc_amnt
call msg_2log("ProRate DSC", gbl_log_buffer)
if dsc_amnt <> dsc_tmp_amnt
DiffApplied = 0
for i = 1 to 16
if dscnt_itm[i] <> 0
dscnt_itm[i] = dscnt_itm[i] + (dsc_amnt - dsc_tmp_amnt)
format gbl_log_buffer as "Adjusted DSC ", i{02}, " to ", dscnt_itm[i]
call msg_2log("ProRate DSC", gbl_log_buffer)
DiffApplied = 1
break
endif
endfor
if DiffApplied = 0
dscnt_itm[1] = dscnt_itm[1] + (dsc_amnt - dsc_tmp_amnt)
format gbl_log_buffer as "Adjusted Default DSC ", i{02}, " to ", dscnt_itm[1]
call msg_2log("ProRate DSC", gbl_log_buffer)
endif
endif
endif
endif
endsub
sub msg_2log(var remark: A, var msg: A)
if (debug_script > 0)
LogPlainSystemMessage(System.String.Format( "Enhanced IFC: {0} | {1}", remark, msg))
endif
endsub
sub txmsg_2log(var logMsg: A)
if (debug_script > 9)
LogPlainSystemMessage(System.String.Format( "Enhanced IFC: TXMSG |{0} [{1}]", logMsg, @PMSBUFFER))
endif
endsub
sub rxmsg_2log(var remark: A, var msg: A)
if (debug_script > 9)
LogPlainSystemMessage(System.String.Format( "Enhanced IFC: RXMSG |{0} [{1}]", remark, msg))
endif
endsub
sub display_tech_info
lvar buffer   : A50
if @OpsContext.DisplayType <> "HTML"
lvar obj_McrsExtDialogs     : object
if gbl_McrsExtDlgsVer = ""
if obj_McrsExtDialogs = @NULL
obj_McrsExtDialogs = new McrsExtDialogs.clMcrsDialogs()
gbl_McrsExtDlgsVer = obj_McrsExtDialogs.assemblyVersion()
endif
endif
buffer = " Tech.Info (XAML)"
else
gbl_McrsExtDlgsVer = "N/A"
buffer = " Tech.Info (HTML)"
endif
window 10, 50, buffer
display 1, 1, "@PLATFORM  : ", @PLATFORM{<10},  " @VERSION : ", @VERSION
display 2, 1, "@WSID      : ", @WSID{<10},      " IP       : ", @OpsContext.IPaddress
display 3, 1, "PMS NUMBER : ", @PMSNUMBER{<10}, " @PmsLink : ", @PMSLINK
if @WSSUBTYPE = 1
buffer = "Mobile Micros"
elseif @WSSUBTYPE = 2
buffer = "Workstation Client"
elseif @WSSUBTYPE = 3
buffer = "POSAPI Client"
else
buffer = "SUBTYPE:", @WSSUBTYPE
endif
if @OS_Platform = 1
format buffer as buffer, " on WindowsCE (", @OS_Platform, ")"
elseif @OS_Platform = 3
format buffer as buffer, " on Win32 (", @OS_Platform, ")"
else
format buffer as buffer, " on OS_Platform (", @OS_Platform, ")"
endif
display 4, 1, mid(buffer, 1, 50)
display 5, 1, "McrsExtDialogs Version : ", gbl_McrsExtDlgsVer
displayinverse 7, 1, "ISL Version: ", mic_fo_iface_num, " ", mic_fo_iface_date
if trim(gbl_fid_ifc_version) <> ""
displayinverse 8, 1, "IFC Version: ", gbl_fid_ifc_version
endif
WaitForClear
endsub
sub run_prorate(var grs_sales : $12, var grs_tender : $12, var itemizer_in : $12, ref itemizer_out)
var fGRS_SALES           : $15
var fGRS_TENDER          : $15
var fITEMIZER_IN         : $15
var fITEMIZER_OUT        : $15
lvar decimal_point        : N1
decimal_point = @OpsContext.CurrentBaseCurrencyDp
fGRS_SALES   = ToInteger(grs_sales)
fGRS_TENDER  = ToInteger(grs_tender)
fITEMIZER_IN = ToInteger(itemizer_in)
fGRS_TENDER = fGRS_TENDER * 100
if ( fGRS_SALES = 0)
fITEMIZER_OUT = fITEMIZER_IN
elseif fGRS_SALES = fGRS_TENDER
fITEMIZER_OUT = fITEMIZER_IN
else
if decimal_point < 1
fGRS_TENDER = fGRS_TENDER * 100
fITEMIZER_OUT = (fITEMIZER_IN * (fGRS_TENDER / fGRS_SALES))
if debug_script = 991
format gbl_log_buffer as "ZERO DEC. GRS_SALES/GRS_TND/ITMZ_IN/ITMZ_OUT:", fGRS_SALES, "/", fGRS_TENDER, "/", fITEMIZER_IN, "/", fITEMIZER_OUT
call msg_2log("run_prorate::1", gbl_log_buffer)
endif
if fITEMIZER_OUT <> 0
fITEMIZER_OUT = (fITEMIZER_OUT / 100)
if debug_script = 991
format gbl_log_buffer as "ZERO DEC. ITMZ_OUT:", fITEMIZER_OUT
call msg_2log("run_prorate::2", gbl_log_buffer)
endif
endif
else
fITEMIZER_OUT = (fITEMIZER_IN * (fGRS_TENDER / fGRS_SALES))
endif
endif
if fITEMIZER_OUT <> 0
if decimal_point = 2
fITEMIZER_OUT = (fITEMIZER_OUT / 10000)
elseif decimal_point = 1
fITEMIZER_OUT = (fITEMIZER_OUT / 1000)
elseif decimal_point = 3
fITEMIZER_OUT = (fITEMIZER_OUT / 100000)
else
fITEMIZER_OUT = (fITEMIZER_OUT / 100)
if debug_script = 991
format gbl_log_buffer as "ZERO DEC. ITMZ_OUT:", fITEMIZER_OUT
call msg_2log("run_prorate::3", gbl_log_buffer)
endif
endif
endif
itemizer_out = fITEMIZER_OUT
if debug_script = 997
window 9, 40
display 1, 1, "grs_sales:    ", grs_sales, " ", fGRS_SALES
display 2, 1, "grs_tender:   ", grs_tender, " ", fGRS_TENDER
display 3, 1, "itemizer_in:  ", itemizer_in, " ", fITEMIZER_IN
display 4, 1, "fITEMIZER_OUT:     ", fITEMIZER_OUT
display 6, 1, "itemizer_out: ", itemizer_out
waitforclear
endif
endsub
sub append_ChkInfo(var InfoLine : A99, ref iResult)
lvar old_info_line[30] : A24
lvar iNumTtl           : N5
lvar iNumOld           : N5
lvar i                 : N5
lvar rvcParm           : object
lvar dtl               : object
iNumOld = 0
iNumTtl = 0
try
rvcParm = @DataStore.ReadRevenueCenterParameter(@OpsContext.RvcID)
if (rvcParm <> @NULL)
iNumTtl = rvcParm.Format.InformationLines
endif
catch ex
LogPlainSystemMessage(System.String.Format( "Exception in append_ChkInfo ReadRevenueCenterParameter [{0}] : [{1}]", ex.Message, ex.Details))
iNumTtl = 0
endtry
for i = 0 to (@OpsContext.CheckDetail.Count - 1)
dtl = @OpsContext.CheckDetail[i]
if dtl.DetailType = 22
if mid(dtl.Name, 1, 1) <> "~"
iNumOld = iNumOld + 1
old_info_line[iNumOld] = @DTL_NAME[i]
endif
endif
endfor
if iNumTtl < 1
iResult = 0
return
endif
if iNumOld > 0
iResult = -1
return
endif
ClearChkInfo
if iNumOld < iNumTtl
saveChkInfo "~", InfoLine
iResult = 1
else
iResult = 0
endif
endsub
sub alt_CheckData(ref check_data)
var dtl      : N9
var sLine    : A50
var sTemp    : A50
var n        : N2
check_data = ""
if @TBLNUM <> 0
if trim(@TBLID) = ""
format sLine as "Tbl ", @TBLNUM, "/", @GRPNUM
else
format sLine as "Tbl ", @TBLID, "/", @GRPNUM
endif
else
sLine = " "
endif
format sLine as sLine{<13}, "Chk ", @CKNUM{<5}
format sTemp as "Gst ", @GST
format sLine as sLine, sTemp{>10}
format check_data as @RVC, "/", @CKEMP, chr(10), "--------------------------------", chr(10), sLine, chr(10), @CHK_OPEN_TIME{=32}, chr(10), "--------------------------------", chr(10)
for dtl = 1 to @NUMDTLT
if bit(@DTL_STATUS[dtl], 10) = 0
if @DTL_TYPE[dtl] = "M"
if @dtl_ttl[dtl] < 0
n = 10
else
n = 9
endif
format sLine as @dtl_qty[dtl]{+}
format sTemp as @DTL_NAME[dtl]
format check_data as check_data, sLine{>3}, " ", sTemp{<16}, @DTL_TTL[dtl]{>(n)}
if bit(@DTL_STATUS[dtl], 5) = 1
format check_data as check_data, " V"
endif
if bit(@DTL_STATUS[dtl], 4) = 1
format check_data as check_data, " R"
endif
format check_data as check_data, chr(10)
elseif @DTL_TYPE[dtl] = "R"
format check_data as check_data, " "{>3}, " ", @DTL_NAME[dtl]{<16}, chr(10)
elseif (@DTL_TYPE[dtl] = "D") or (@DTL_TYPE[dtl] = "S")
if @dtl_ttl[dtl] < 0
n = 10
else
n = 9
endif
format sLine as @dtl_qty[dtl]{+}
format sTemp as @DTL_NAME[dtl]
format check_data as check_data, sLine{>3}, " ", sTemp{<16}, @DTL_TTL[dtl]{>(n)}
if bit(@DTL_STATUS[dtl], 5) = 1
format check_data as check_data, " V"
endif
format check_data as check_data, chr(10)
elseif @DTL_TYPE[dtl] = "T"
if @dtl_ttl[dtl] < 0
n = 10
else
n = 9
endif
format sTemp as @DTL_NAME[dtl]
format check_data as check_data, " "{>3}, " ", sTemp{<16}, @DTL_TTL[dtl]{>(n)}
if bit(@DTL_STATUS[dtl], 5) = 1
format check_data as check_data, " V"
endif
if (bit(@DTL_STATUS[dtl], 6) = 1) and (bit(@DTL_STATUS[dtl], 8) = 1)
format check_data as check_data, " C"
endif
format check_data as check_data, chr(10)
endif
endif
endfor
format sLine as "--------------------------------"
sTemp = @TREMP
mid(sLine, (10 - len(sTemp)), len(sTemp)) = sTemp
mid(sLine, 10, 13) = " Check Closed"
format check_data as check_data, sLine, chr(10)
format sLine as "--------------------------------"
format sTemp as @MONTH{02}, "/", @DAY{02}, "/", (@YEAR % 100){02}, " ", @HOUR{02}, ":", @MINUTE{02}, ":", @SECOND{02}
mid(sLine, 8, len(sTemp)) = sTemp
format check_data as check_data, sLine, chr(10)
endsub
sub MakePrintable(ref dest_str, var ReplaceLF : N1)
var i          : N5
var asc_val    : N3
var iSkipThis  : N1
for asc_val = 1 to 31
iSkipThis = 0
if (ReplaceLF = FALSE) AND (asc_val = 10)
iSkipThis = 1
endif
if iSkipThis = 0
i = instr(1, dest_str, chr(asc_val))
while i > 0
mid(dest_str, i, 1) = " "
i = instr(1, dest_str, chr(asc_val))
endwhile
endif
endfor
endsub
sub display_list_and_check_messages ( var list_size : N5, ref TheList[], var wait_for_clear : N5)
var window_rows : N5
var answer      : N5
var column      : N5
var sel_num     : A10
var temp        : N5
if list_size = 1
column = @center
else
column = 2
endif
if list_size > 9
list_size = 9
endif
window_rows = 3 + list_size
if gbl_guest_num > 0
format sel_num as "S", gbl_guest_num
else
sel_num = ""
endif
if (gbl_message_status = "Y")
window_rows = window_rows + 3
endif
window window_rows, 40, "Information"
listdisplay 2, column, list_size, TheList
if (gbl_message_status = "Y")
ExitOnCancel
display list_size + 3, @center, display_list_and_check_messages_win1_1
display list_size + 4, @center, display_list_and_check_messages_win_msg1
display list_size + 5, @center, display_list_and_check_messages_win_msg2
waitforconfirm display_list_and_check_messages_win_msg1
gbl_first_pass = 0
txmsg "IFC_GST_MSG", gbl_guest_id, gbl_guest_sel, sel_num
call txmsg_2log("FO")
waitforrxmsg
else
if wait_for_clear = TRUE
waitforclear display_list_and_check_messages_win_msg3
endif
endif
endsub
sub enh_listinput(var list_size : N5, ref TheList[], ref UserInput, var SelectPrompt : A99, var ListStyle : N1)
if @OpsContext.DisplayType = "HTML"
return
endif
lvar i                      : N5
lvar obj_McrsExtDialogs     : object
if list_size < 1
errormessage "Invalid List-Size in enh_listinput()"
exitcancel
endif
if obj_McrsExtDialogs = @NULL
obj_McrsExtDialogs = new McrsExtDialogs.clMcrsDialogs()
gbl_McrsExtDlgsVer = obj_McrsExtDialogs.assemblyVersion()
endif
if ListStyle = 0
Window 15,80, SelectPrompt
ListInputEx 1, 1, list_size, TheList, UserInput, SelectPrompt
if UserInput < 1
exitcancel
endif
return
elseif ListStyle = 1
i = obj_McrsExtDialogs.DisplayListInit(System.String.Format("Simphony Enhanced Interface V.{0}", INTERNAL_VERSION), SelectPrompt, 0)
else
i = obj_McrsExtDialogs.DisplayListInit(System.String.Format("Simphony Enhanced Interface V.{0}", INTERNAL_VERSION), SelectPrompt, 1)
endif
if (i = 0)
call msg_2log("FoResListProc", "DisplayListInit returned FAILURE")
errormessage "Internal Error, unable to continue"
exitcancel
endif
for i = 1 to list_size
obj_McrsExtDialogs.DisplayListAddData(TheList[i])
endfor
UserInput = obj_McrsExtDialogs.DisplayListShow()
if (ListStyle = 2) and (UserInput = 2)
startprint @rcpt
listprint list_size, list
endprint
elseif (UserInput = 0)
exitcancel
endif
endsub
sub format_chk_opn_date(ref dateStr)
lvar i         : N3
lvar sDate     : A15
lvar nMonth    : N3
lvar nDay      : N3
lvar nYear     : N4
i = instr(1, @CHK_OPEN_TIME, " ")
sDate  = mid(@CHK_OPEN_TIME, 1, i)
nMonth = mid(Sdate, 1, 2)
nDay   = mid(Sdate, 4, 2)
nYear  = mid(Sdate, 7, 2)
nYear = nYear + 2000
format dateStr as nYear{04}, nMonth{02}, nDay{02}
endsub
sub format_chk_opn_time(ref timeStr)
lvar i         : N3
i   = instr(1, @CHK_OPEN_TIME, " ")
timeStr = mid(@CHK_OPEN_TIME, i + 1, 8)
endsub
sub print_msg(ref list_size, ref list[])
lvar i            : N3
var choice       : N3
if list_size > 0
for i = 1 to list_size
call MakePrintable(list[i], TRUE)
endfor
call enh_listinput(list_size, list[], choice, print_msg_win1_name, 2)
else
errormessage print_msg_win2_1
exitcancel
endif
endsub
sub create_msg(ref num_msg_lines, ref msg_lines[])
lvar i        : N5 = 1
lvar usr_resp : N3
num_msg_lines = 0
ContinueOnCancel
forever
window 10, 65, create_msg_win1_name
for i = 1 to 8
display i+1, 2, create_msg_win1_1, i,": "
displayinput i+1, 10, msg_lines[i], create_msg_input1, i, create_msg_input2
endfor
WindowEditWithSave
if @INPUTSTATUS = 0
num_msg_lines = 0
break
endif
for i = 1 to 8
if len(msg_lines[i]) > 0
num_msg_lines = i
endif
endfor
if (num_msg_lines = 0)
GetEnterOrClear usr_resp, create_msg_input3
if usr_resp = 1
break
endif
else
Window 8, 65, create_msg_input4
for i = 1 to num_msg_lines
display i, 1, msg_lines[i]
endfor
waitforconfirm create_msg_input4
break
endif
WindowClose
endfor
ExitOnCancel
endsub
sub create_loc(ref num_min, ref num_msg_lines, ref msg_lines[])
lvar i            : N5 = 1
lvar loc_lines[4] : A30
lvar numEntry     : object
call read_setup()
if LocUseRVCName > 0
loc_lines[1] = mid(trim(@RVC_NAME), 1, 30)
endif
if LocValidMinutes > 0
num_min = LocValidMinutes
endif
ContinueOnCancel
window 1, 65, create_loc_input1
displayinput 1, 1, num_min, create_loc_input1
WindowEditWithSave
if @INPUTSTATUS = 0
num_msg_lines = 0
return
endif
forever
window 4, 65, create_loc_win_name
for i = 1 to 4
displayinput i, 1, loc_lines[i], create_loc_input2, i, create_loc_input3
endfor
WindowEditWithSave
if @INPUTSTATUS = 0
num_msg_lines = 0
break
endif
for i = 1 to 4
if len(loc_lines[i]) > 0
num_msg_lines = i
msg_lines[i] = loc_lines[i]
endif
endfor
if (num_msg_lines = 0)
GetEnterOrClear create_loc_input4
if usr_resp = 1
break
endif
else
Window 4, 65, create_loc_input5
for i = 1 to num_msg_lines
display i, 1, loc_lines[i]
endfor
waitforconfirm create_loc_input5
break
endif
WindowClose
endfor
ExitOnCancel
endsub
sub check_room_tmed (ref RoomCharge, ref tmednum)
lvar dbObject    : object
lvar extDataVal  : A
RoomCharge = FALSE
try
dbObject  = @DataStore.ReadTenderMediaByNum(tmednum)
if dbObject = @null
LogPlainSystemMessage(System.String.Format( "ReadTenderMediaByNum: [Object not found] for TMED {0}", tmednum))
return
endif
try
extDataVal = @DataStore.ReadExtensionDataValue("TENDER_MEDIA", DataExtName, dbObject.TendMedID.Value)
if extDataVal <> ""
RoomCharge = System.Convert.ToBoolean(extDataVal)
LogPlainSystemMessage(System.String.Format( "RoomCharge ExtensionDataValue [{0}] found for TMED {1}", extDataVal, tmednum))
else
LogPlainSystemMessage(System.String.Format( "RoomCharge ExtensionData [{0}] NOT found for TMED {1}", DataExtName, tmednum))
RoomCharge = FALSE
endif
catch ex
LogPlainSystemMessage(System.String.Format( "Exception in RoomCharge ExtensionDataValue [{0}] : [{1}]", ex.Message, ex.Details))
endtry
catch ex
RoomCharge = FALSE
LogPlainSystemMessage(System.String.Format( "Exception in check_room_tmed() [{0}] : [{1}]", ex.Message, ex.Details))
endtry
endsub
sub check_fo_iface_ver()
if gbl_fo_iface_chkd = TRUE
return
endif
var fid_fo_iface_num  : A16
var fid_fo_iface_date : A8
var fid_fo_iface_text : A50
var fid_sub_num : A7
var mic_sub_num : A7
var FD : N5
txmsg "FO_FI_VERSION", mic_fo_iface_num,mic_fo_iface_date,mic_fo_iface_text
call txmsg_2log("VERSION-CHECK")
getrxmsg
if @rxmsg = "FO_87_VERSION_ERROR"
rxmsg fid_fo_iface_text
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, fid_fo_iface_text
call rxmsg_2log("", gbl_log_buffer)
endif
errormessage fid_fo_iface_text
exitcancel
endif
if @rxmsg <> "FO_87_VERSION"
if @rxmsg = "_timeout"
format gbl_log_buffer as "EVENT:" , @EVENTTYPE, "; EVENT-ID:", @EVENTID
call msg_2log("FO TIMEOUT (VERSION CHECK)!!", gbl_log_buffer)
errormessage check_fo_iface_ver_error2
if @EventType = "TMED" AND UseBackupTMed <> 0
WaitForConfirm display_input_quest_1
UseBackupTender
exitcontinue
else
exitcancel
endif
else
format gbl_log_buffer as "EVENT:" , @EVENTTYPE, "; EVENT-ID:", @EVENTID, "; RXMSG:", @rxmsg
call msg_2log("FO UNKOWN RESPONSE (VERSION CHECK)!!", gbl_log_buffer)
errormessage check_fo_iface_ver_error1
exitcancel
endif
endif
rxmsg fid_fo_iface_num,  fid_fo_iface_date, fid_fo_iface_text, gbl_fid_ifc_version
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, fid_fo_iface_num, fid_fo_iface_date, fid_fo_iface_text, gbl_fid_ifc_version
call rxmsg_2log("", gbl_log_buffer)
endif
if trim(gbl_fid_ifc_version) <> ""
format gbl_log_buffer as "IFC8 responded with Version", gbl_fid_ifc_version
call msg_2log("VERSION CHECK", gbl_log_buffer)
endif
gbl_allow_msr_enh = FALSE
if mid(gbl_fid_ifc_version, 1, 1) = "8"
gbl_allow_msr_enh = TRUE
endif
gbl_dsc_svc_itmzr = FALSE
if UseFull_DSVC > 0
gbl_dsc_svc_itmzr = FALSE
if trim(gbl_fid_ifc_version) <> ""
gbl_dsc_svc_itmzr = TRUE
else
errormessage "IFC does not support Full DSC & SVC, feature disabled!"
endif
else
gbl_dsc_svc_itmzr = FALSE
endif
fid_sub_num = mid(fid_fo_iface_num, 1, 5)
mic_sub_num = mid(mic_fo_iface_num, 1, 5)
if fid_sub_num <> mic_sub_num
window 10, 50, check_fo_iface_ver_win1_name
display 2, 6, check_fo_iface_ver_win1_1
display 3, 6, check_fo_iface_ver_win1_2
display 4, 6, " "{<3}, mic_fo_iface_num{<8}, " "{<14}, fid_fo_iface_num{<8}
display 5, 6, " "{<3}, mic_fo_iface_date{<8}, " "{<14}, fid_fo_iface_date{<8}
display 7, 4, check_fo_iface_ver_win1_3
display 9, 4, "1. ", fid_fo_iface_text
display 10, 4, "2. ", mic_fo_iface_text
waitforclear
exitcancel
else
gbl_fo_iface_chkd = TRUE
endif
endsub
sub display_version_number(ref version)
window 3, 50, display_version_win_name
if mid(version,1,2) = "FO"
display 1, 2, display_fo_version_text, ": ", mid(version, 6, 8), " (", mic_fo_iface_date, ")"
if gbl_dsc_svc_itmzr = TRUE
display 3, 2, "Enh. DSC&SVC Itemizer ON, IFC Version: ", mid(gbl_fid_ifc_version, 1, 8)
endif
endif
errorbeep
waitforclear
endsub
sub display_input_error()
window 3, 50, display_input_error_win1_name
display 2, 2, display_input_error_win1_1
errorbeep
waitforclear
windowClose
endsub
sub PrintMsgProc
lvar i : N5
rxmsg list_size, list[]
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, list_size
for i = 1 to list_size
format gbl_log_buffer, chr(28) as @rxmsg, gbl_log_buffer, list[i]
endfor
call rxmsg_2log("", gbl_log_buffer)
endif
startprint @rcpt
listprint list_size, list
endprint
endsub
sub FoIfcErrProc
lvar message : A70
rxmsg message
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, message
call rxmsg_2log("", gbl_log_buffer)
endif
errormessage message
if (@EVENTTYPE = "TMED")
exitcancel
endif
endsub
sub Check_Backup_Tmed
format gbl_log_buffer as "EVENT:" , @EVENTTYPE, "; EVENT-ID:", @EVENTID
call msg_2log("FO TIMEOUT!!", gbl_log_buffer)
if @EventType <> "FINAL_TENDER"
errormessage check_fo_iface_ver_error2
else
exitcontinue
endif
if @EventType = "TMED" AND UseBackupTMed <> 0
WaitForConfirm display_input_quest_1
UseBackupTender
exitcontinue
else
exitcancel
endif
endsub
sub FoDoneProc
lvar pms_txt : A70
rxmsg pms_txt
if (debug_script > 9)
format gbl_log_buffer, chr(28) as @rxmsg, pms_txt
call rxmsg_2log("", gbl_log_buffer)
endif
endsub
sub advtrim(ref sText)
var sTemp : A999
var j     : N3
j = instr( 1, sTemp, chr(10))
if j = 0
j = instr(1, sText, chr(13))
endif
if j > 0
sTemp = mid( sText, 1, j - 1 )
else
stemp = stext
endif
sText = sTemp
endsub
sub TransmitPosting(var sEventName : A32, var TENDER_AMOUNT : $12, var sInfoEntered : A30, var sGuestName : A40, var sSelection : A10, var iIsRoomCharge : N1, var tmed_number : N9)
lvar date            : A8
lvar time            : A8
lvar sales_itm[16]   : $12
lvar dscnt_itm[16]   : $12
lvar svcch_itm[16]   : $12
lvar tmp_si_itm[16]  : $12
lvar sales_tax[64]   : $12
lvar dsc_ttl         : $12
lvar tx_message      : A
lvar GuestCount      : N5
lvar log_remark      : A
call format_chk_opn_date(date)
call format_chk_o
 
it looks like they are catching all the tmed events with event tmed:*. so they might be Cancelling the tmed event not giving your script to catch your event tmed.

it feels like you can avoid this by creating a new interface record and linking your script to that (As i described in my first post). That way the scripts won't interfere with each other. Unless of course your tmed event needs to communicate with Opera as well.
 
@codexPOSed I will definitely try it, thanks
 
@codexPOSed it's doesn't work either even using & linked it to different interface record.
 
hmmm, i have it setup like that and working in my lab. Hard to pinpoint the issue without really seeing how things are setup.

Can you post all the related configuration screen shots here? or if you'd like, you can arrange a remote session for me to check it out.
 
@codexPOSed I think a remote session will be great. Could you please share your available time?
 
@codexPOSed done, just waiting for your response
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top