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.
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
//-------------------------------------------------------------------------------------------------
// 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
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'"
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 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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.