So I have been using a code that I found on here (provided by Moregelen) to print all our open checks. The SIM I originally implemented worked fine unless we have more than 11 it throws up the 'Max Macro Keys' error which, again thanks to Moregelen, I found a workaround for. The code I use is below (removed the subs to save space as they work fine).
I can't seem to find the reference for what key(24, 16384) is or the proper way to use the @PMSSEQNUM function (manual is lacking in explanation) so I don't know if that is the problem with it not running or not. Does @PMSSEQNUM just cause the next event to be triggered?
The button I've placed on the manager screen is a PMS/SIM inquire set to the proper interface/scripts/etc and inquiry 1. Is that the proper way to invoke the script?
Any guidance would be appreciated.
Code:
retainglobalvar
var OpenChecks : N4
var sql_cmd : A2000
var print_tender : N4 = 403
//do not change
var sql_h : N12 = 0
event inq:1
Call LoadSQL
var OpenChecks : N4
format sql_cmd as "SELECT COUNT( chk_num ) ", "FROM micros.chk_dtl ", "WHERE chk_open = 'T'"
Call sql_query( sql_cmd )
OpenChecks = sql_cmd
format sql_cmd as "SELECT chk_num ", "FROM micros.chk_dtl ", "WHERE chk_open = 'T'"
Call sql_recordset( sql_cmd )
loadkybdmacro key(24, 16384 * 2 + @PMSSEQNUM)
endevent
event inq:2
if OpenChecks > 0
DLLCALL_CDECL sql_h, sqlGetNext( ref sql_cmd )
loadkybdmacro key(1, 327684), makekeys( sql_cmd ), @KEY_ENTER, @KEY_ENTER, key(9, print_tender), key(24, 16384 * 2 + @PMSSEQNUM)
OpenChecks = OpenChecks-1
endif
endevent
I can't seem to find the reference for what key(24, 16384) is or the proper way to use the @PMSSEQNUM function (manual is lacking in explanation) so I don't know if that is the problem with it not running or not. Does @PMSSEQNUM just cause the next event to be triggered?
The button I've placed on the manager screen is a PMS/SIM inquire set to the proper interface/scripts/etc and inquiry 1. Is that the proper way to invoke the script?
Any guidance would be appreciated.