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

Print all open checks SIM not functioning 1

Status
Not open for further replies.

SvenRizzo

IS-IT--Management
Aug 9, 2020
29
0
0
US
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).

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.
 
key(24, 16384 * 2 + @PMSSEQNUM)

This is a calculation of how to call a SIM Inquiry from another SIM.

So in this case its 16384 which is the base number. It will always be 16384.
* 2 which is the SIM inquiry number ( Event Inq : 2 ). If it was Event Inq : 3 then the calculation would be key(24, 16384 * 3 + @PMSSEQNUM)
+ @PMSSEQNUM is the database primary key for the current SIM script as defined in the micros.interface_def table. If you wanted to call an inquiry in another SIM then you replace this number with the sequence number of the other interface. If you were calling sim inquiry 3 another script that was configured at interface sequence number 25 then the calculation would be key(24, 16384 * 3 + 25)

When finding the pms sequence number you either perform a database lookup from the SIM script, or you hard code it into the script, or you have some configuration file which is read from the script.


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top