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

MICROS 3700 ClockIn SIM Event

Status
Not open for further replies.

Moregelen

Programmer
Sep 10, 2012
1,222
US
Does anyone know how to access which employee clocked in from inside the Clock In event?
 
Nope, but if you figure it out, please post the solution. I dead-ended on that a while ago.
 
I did find a solution but it isn't pretty. I had to create two custom tables (actually, only one... the second table is something I'm using for the SIM itself. I could have made it an interface, but it just seemed easier to create a custom table on the micros database) and float certain data I need to make comparisons in it. If you want I can tell you my ugly solution; so far so good. I even did a test where we had 14 employees and from two different workstations we signed in one after the other. So far the only real glitch I can think of happening is if two employees sign in at the same time from two locations the SIM might flip flop who is who; will let you know if I see that happen. The SIM prints a meal chit (checking to make sure they haven't already printed one for the day, hence the second table) when they clock in.
 
Does this help?

var hODBCDLL : N12 = 0
var emp_lname : A16
var emp_fname : A12

var versie : A20 = "v1.0"
var updated : A50 = "01-01-2013"
var upd_by : A50 = "yourname "
var ISLName : A20 = "Clock In SIM"

//-------------------------------------------------------------------------------------------------
// 27-01-2006 Creation SIM File
//-------------------------------------------------------------------------------------------------

RetainGlobalVar
//-------------------------------------------------------------------------------------------------
// Event Inq: 1
// Event for clock in/out different employees
// it will check for a valid jobcode in the database and clocks in the employee on it's
// primairy job
//-------------------------------------------------------------------------------------------------
EVENT INQ: 1

If @UserEntry <> ""

call LookUpEmployee ( @UserEntry )

endif

ENDEVENT

//-------------------------------------------------------------------------------------------------
// Event CLOCKIN
// Event when the employee is clocked in
//-------------------------------------------------------------------------------------------------
EVENT CLOCKIN

InfoMessage "Welcome", "Welcome on the job ", emp_fname, " ", emp_lname

ENDEVENT

//-------------------------------------------------------------------------------------------------
// Event CLOCKOUT
// Event when the employee is clocked out
//-------------------------------------------------------------------------------------------------
EVENT CLOCKOUT

InfoMessage "Bye Bye", "Thanks for your efforts ", emp_fname, " ", emp_lname, ". See you next time"

ENDEVENT

//-------------------------------------------------------------------------------------------------
// Event Inq: 999
// Event Version Control
//-------------------------------------------------------------------------------------------------
EVENT INQ: 999

window 5, 50

Display 1, @Center, "ISL File Information: ", ISLName
Display 2, @Center, "------------------------------------------------"
Display 3, 2, "Version : ", versie
Display 4, 2, "Last updated : ", updated
Display 5, 2, "Updated by : ", upd_by
WaitForClear "Press Clear to continue"

WindowClear

ENDEVENT

//-------------------------------------------------------------------------------------------------
// SUB LookUpEmployee
// Search for ID and checks for a valid jobcode
//-------------------------------------------------------------------------------------------------
SUB LookUpEmployee (var UserEntry: N20)
var constatus : N9
var sql_cmd : A2000
var sLine : A100
var SEQ : N12
var ID : N10
var clock_in_key : key


clock_in_key = key(1, 655368)

if (@instandalonemode <> 1) or (@inbackupmode <> 1)
//-----------------------------------------------------------------
// WS4 and HHT only ...
//-----------------------------------------------------------------
//if (@WSTYPE = 2) or (@WSTYPE = 3)
// -------------------------------- Load SimODBC dll ---------------------------------
if hODBCDLL = 0
DLLLoad hODBCDLL, "MDSSysUtilsProxy.dll"
endif

if hODBCDLL = 0
exitwitherror "Failed to load MDSSysUtilsProxy.dll"
endif
//------------------------------------------------------------------------------------
// Connect to micros 3700 database
DLLCALL_CDECL hODBCDLL, sqlIsConnectionOpen(ref constatus)
if constatus = 0
DLLCALL_CDECL hODBCDLL, sqlInitConnection("micros","ODBC;UID=custom;PWD=custom", "")
endif


//Check if the employee exists in the database
format sql_cmd as "select emp_seq, ID, last_name, first_name from micros.emp_def ", "where obj_num = ", UserEntry

DLLCALL_CDECL hODBCDLL, sqlGetRecordSet(sql_cmd)

DLLCALL_CDECL hODBCDLL, sqlGetLastErrorString(ref sql_cmd)

if (sql_cmd <> "")
window 10, 70
display 1, 5, mid(sql_cmd, 1, 60)
display 2, 5, mid(sql_cmd, 61, 60)
display 3, 5, mid(sql_cmd, 121, 60)
ErrorMessage "Error from SQL"
else
DLLCALL_CDECL hODBCDLL, sqlGetFirst(ref sql_cmd)
if sql_cmd = ""
ErrorMessage "No employee in database with number: ", CHR(13), UserEntry
ExitCancel
else
while sql_cmd <> ""
splitQ sql_cmd, ";", SEQ, ID, emp_lname, emp_fname
DLLCALL_CDECL hODBCDLL, sqlGetNext(ref sql_cmd)
endwhile
endif
endif

//Checks if the employee has jobcodes and if so, then clock in with the primairy job
format sql_cmd as "SELECT * FROM micros.job_rate_def", " where emp_seq = ", SEQ, " and ob_primary_job = 'T'", " and ob_inactive = 'F'"

DLLCALL_CDECL hODBCDLL, sqlGetRecordSet(sql_cmd)

DLLCALL_CDECL hODBCDLL, sqlGetLastErrorString(ref sql_cmd)

if (sql_cmd <> "")
window 10, 70
display 1, 5, mid(sql_cmd, 1, 60)
display 2, 5, mid(sql_cmd, 61, 60)
display 3, 5, mid(sql_cmd, 121, 60)
ErrorMessage "Error from SQL"
else
DLLCALL_CDECL hODBCDLL, sqlGetFirst(ref sql_cmd)
if sql_cmd = ""
ErrorMessage "No jobcode for employee: ", CHR(13), emp_fname, " ", emp_lname
ExitCancel
else
while sql_cmd <> ""
loadkybdmacro clock_in_key, makekeys( ID ), @Key_Enter, @Key_Enter, @Key_Enter
DLLCALL_CDECL hODBCDLL, sqlGetNext(ref sql_cmd)
endwhile
endif
endif

else

ErrorMessage "POS Operations in Standalone/Backup Mode", "No connection with the database possible"

endif

ENDSUB
 
Thanks, I looked at that and it isn't quite what I needed. There are about 70 locations which already had an interface defined but not in use. We have vigilix on every site so it's not hard to tell it to upload the isl to each site with a single small script; doing it this way would require logging into each site and modifying the touchscreens. I did get it working though, but thanks for the help!
 
I have done this a few times.

I start by replacing the clock in/out button with a SIM button that obtains the employee number/mag swipe and stores it in a global variable on the workstation. Then I call the clock in/out event myself using loadkybdmacro. Then when/if the event clockin gets called I already have the employee in the global variable. I do double check though by making a call to the time card detail table to ensure that the latest clock event correlates to the person I detected.

Like your method it's not a shining example of best practice but it does the trick fairly reliably.
 
I went with just the database check; the reason being that I could drop the SIM through a Vigilex agent to overwrite an existing interface without having to modify touchscreens at over 80 something sites. Much more convenient. I haven't had time yet but I really hope a lot of these things are addressed in Smphony 2; it seems like they are (and I love the access to xaml) but there isn't enough demand to play around with it.
 
Would like to learn more of Simphony, I am old school. Haven't touched it yet. Seen it, and have done significant customization on myMicros, but nothing on Simphony.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top