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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISL script problem on Micros 3700

Status
Not open for further replies.

bardlehel

Programmer
Apr 15, 2018
2
US
I am working with a client's Micros 3700 system writing a custom ISL script. I am having issues with finding the proper global variables to read certain data. IN this version no INQ events fire. I am trying to read all of the data for the menu items, condiments and discounts in the current check. I able to catch the MI event and get the menu items. But I still cannot get any custom strings (typed in from the keyboard for a custom item) or the discount value. I am able to intercept the DSC event but don't know which global variable holds the values. Here is my script:

retainglobalvar
var dll_handle:N32


event inq : *
infomessage "test"
endevent


event signin
DLLCALL_CDECL dll_handle, cdshowcustomerdisplay ()
endevent

event init
DLLLoad dll_handle, "customerdisplay.dll"
endevent

event exit//signout
DLLFree dll_handle
endevent


event signout
DLLCall_CDECL dll_handle, cdsenddata (2,0," ",0," "," "," ")
endevent

event begin_check
DLLCALL_CDECL dll_handle, cdsetdisplaymode (1)
DLLCALL_CDECL dll_handle, cdsenddata (2,1," ",0, " ", " ", " ")
endevent


Event MI
var i:N3
var messagetype:N2
var item_name:A100
var prefix:A10




for i = 1 to @NUMDTLT // @NUMDTLR = Number of Detail Entries this Service Roun

if @DTL_TYPE = "M" // M = Menu Item; I = Check Information Detail; D = Discount Name; S = Service Charge; T = Tender Media; R = Reference Number; C = CA Detail

prefix = ""

infomessage @dtl_name



if @Dtl_is_cond = 1
messagetype = 1


if @Dtl_slvl = 2
infomessage "easy.."
elseif @Dtl_slvl = 3
prefix = "O/S "
elseif @Dtl_slvl = 4
item_name = "ADD "
elseif @Dtl_slvl = 4
prefix = "NO "
elseif @Dtl_slvl = 4
prefix = "EXTRA "
elseif @Dtl_slvl = 4
prefix = "N/C "
endif
else
messagetype = 0
endif

item_name = " "

if prefix = ""
item_name = @DTL_NAME
else
format item_name as prefix, @DTL_NAME
endif





DLLCall_CDECL dll_handle, cdsenddata (messagetype, i, item_name, @DTL_QTY, @dtl_ttl, @tax[1], "")
elseif @DTL_TYPE = "D"
infomessage "test"
infomessage @dtl_name
endif
endfor

EndEvent

event dsc
infomessage "discounts:"
infomessage @dsc[0]
infomessage @Numdsc

DLLCall_CDECL dll_handle, cdsenddata (3, 0, "", 0, "", "", @DSC);
endevent

event DSC_VOID
DLLCALL_CDECL dll_handle, cdsenddata (3,0," ",0, " ", " ", "0")
endevent

event MI_VOID
infomessage "void"
DLLCALL_CDECL dll_handle, cdsenddata (5,@obj," ",0, " ", " ", " ")
endevent
event MI_return
infomessage "void"
endevent


event mi_return
endevent


event repopen_check
endevent



event trans_cncl
DLLCALL_CDECL dll_handle, cdsetdisplaymode (1)
endevent

event void_check

endevent



event final_tender
DLLCALL_CDECL dll_handle, cdsenddata (4,0," ",0, @ttldue, " ",@Tndttl)
DLLCALL_CDECL dll_handle, cdsetdisplaymode (2)
endevent
 
I would suggest handling any changes to the check through the DTL_CHANGED event. Here is "the gist" of how we are handling something similar. I also send along what kind of event fired it that way the software can decide what to do with it. Some of our order confirmation displays clear when the order is service totaled (drive through) and some clear when final tendered, so it is nice to handle things like that.

Code:
EVENT DTL_CHANGED
[indent]CALL EVENT_FIRED("DTL_CHANGED")[/indent]
ENDEVENT

EVENT FINAL_TENDER
[indent]CALL EVENT_FIRED("FINAL_TENDER")[/indent]
ENDEVENT

EVENT TRANS_CNCEL
[indent]CALL EVENT_FIRED("TRANS_CNCL")[/indent]
ENDEVENT

EVENT BEGIN_CHECK
[indent]CALL EVENT_FIRED("BEGIN_CHECK")[/indent]
ENDEVENT

EVENT PICKUP_CHECK
[indent]CALL EVENT_FIRED("PICKUP_CHECK")[/indent]
ENDEVENT

EVENT TNDR
[indent]CALL EVENT_FIREED("TNDR")[/indent]
ENDEVENT

EVENT SRVC_TOTAL:*
[indent]CALL EVENT_FIRED("SRVC_TOTAL")[/indent]
ENDEVENT

SUB EVENT_FIRED(VAR EVENT_TYPE : N20)
[indent]CALL LOAD_DLL[/indent]
[indent]IF DLLHANDLE = 0[/indent]
[indent][indent]EXITCONTINUE[/indent][/indent]
[indent]ENDIF[/indent]
[indent]VAR ITEM_NAMES[999] : A40 //assuming max 999 lines of check detail - better ways to handle this like having some that pre-counts rather than initializing a max sized array, but this is quick and dirty[/indent]
[indent]VAR ITEM_TYPE[999] : A1 //M = menu item, T = tender, D = discount, S = service charge[/indent]
[indent]VAR ITEM_CNT[999] : N2[/indent]
[indent]VAR ITEM_AMT[999] : $12[/indent]
[indent]VAR COUNT : N9 = 0 //incrementing as I append data to my arrays[/indent]
[indent]//DO YOUR LOOP TO AGGREGATE THE DATA YOU NEED HERE[/indent]
[indent]DLLCALL_CDECL DLLHANDLE, UpdateOrderConfirmation(@WSID, EVENT_TYPE, COUNT, @TTLDUE, ITEM_NAMES[], ITEM_TYPE[], ITEM_CNT[], ITEM_AMT[])  [/indent]
ENDSUB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top