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

Micros 3700 timestamps

Status
Not open for further replies.

DrZogg

Programmer
Jan 29, 2010
438
AU
Hi,
Not really a problem, just thought I would start a thread.

I have a client that runs a pool hall and needs to be prompted once table hire has expired. I have added a slim 728*228 pixel KDS to the workstation display configuration (all workstations have that inherent in their licence) with the screen. I needed to kick a "future order" to the KDS. The basic SQL there is:

update micros.chk_dtl
set autofire_time = #time to fire,
ob_delayed_check = 'T'
where chk_num = #chknum;

This will be a SIM script with the time to fire based on the time hired for the table. The reason for this thread is the lack of info online about time calculations. The solution is this: If you add 1 to a timestamp, you get the now + 1 day. So minutes are broken down to decimals of 1. Table here:

Minutes Decimal Time
=============================================
15 0.010416667
30 0.020833333
45 0.03125
60 0.041666667
90 0.0625
120 0.083333333
180 0.125
240 0.166666667
300 0.208333333
360 0.25
1440 1

So to kick off a table reminder to the TS KDS in 2 hours, the SQL becomes:

update micros.chk_dtl
set autofire_time = 0.083333333 + (current timestamp),
ob_delayed_check = 'T'
where chk_num = @cknum;

 
What account are you using to connect to the database from the SIM?
 
Hi.
My difficulties are mainly about workflow. I want the order to look like the KDS printing is "delayed", while on another level doing my time calculation in the DBMS because it is so accurate. I will explain them.

Key points A:
* All transactions are Fast txns
* All are done on a table object and settled, never sent & picked up.
* If made into a Delayed Order, there is a modal "ORDER WILL BE FIRED" popup I would rather not have
* If NOT a delayed order, and adding Preparation Time to the MI's they still fire straight away.
* Have been writing CKNUM & decimal time value for the time purchased into CHK_INFO_DTL (SaveChkInfo). The purpose to easily add the decimal time to the CHK_DTL calculation later via stored procedure or system service.


Here is an idea of the SIM. SIM, SQL etc its not hard, the hard stuff is always controlling workflow. & hiding complexity.


RetainGlobalVar
UseISLTimeOuts
SetSignOnLeft
Prorate

//----------------------------- Global Interface Variables -------------------------------

Var strVersion : A26 = "Version 1.0.0.1 01/09/2011"
Var strIFPrompt : A255

Var hSYSUTILSDLL : N12
Var hSYSCALLDLL : N12
Var nSU_LOG_3700d_Only : N1 = 3

Var bConStatus : N9

Var bTrue : N1 = 1
Var bFalse : N1 = 0
Var bRES32 : N1
Var nActiveEnvironment : N1


//------------------------------ User Definable Variables --------------------------------

Var strModuleName : A100 = "Timed Order Fire"
Var strProcessName : A100 = "Timed Order Fire"
Var bDebug : N1 = 0

Var strCheckID : A20
Var strTime : A20
Var nSendKey : N9 = 100

Var strAutoFire_time : A20 = ""
Var strob_delayed_check : A1 = "T"

//------------------------------ MI NAVIGATION VARS --------------------------------
var i :N6 //iteration

//------------------------------ MENU ITEMS AS DIGITAL TIME ------------------------------

var mi1_num :N12 = 1001 //Menu Item 1, 30 Minutes
var mi2_num :N12 = 1002 //Menu Item 2, 45 Minutes
var mi3_num :N12 = 1003 //Menu Item 3, 60 Minutes
var mi4_num :N12 = 1004 //Menu Item 4, 90 Minutes
var mi5_num :N12 = 1005 //Menu Item 5, 120 Minutes
var mi6_num :N12 = 1006 //Menu Item 6, 180 Minutes
var mi7_num :N12 = 1007 //Menu Item 7, 240 Minutes
var mi8_num :N12 = 1008 //Menu Item 8, 300 Minutes
var mi9_num :N12 = 1009 //Menu Item 9, 360 Minutes
var mi10_num :N12 = 1010 //Menu Item 10
var mi11_num :N12 = 1011 //Menu Item 11
var mi12_num :N12 = 1012 //Menu Item 12
var mi13_num :N12 = 1013 //Menu Item 13
var mi14_num :N12 = 1014 //Menu Item 14
var mi15_num :N12 = 1015 //Menu Item 15

var mi1_name :A12 = ".020833333" // 30 minutes DECIMAL time
var mi2_name :A12 = ".03125"
var mi3_name :A12 = ".041666667"
var mi4_name :A12 = ".0625"
var mi5_name :A12 = ".08333333"
var mi6_name :A12 = ".125"
var mi7_name :A12 = ".1666666"
var mi8_name :A12 = ".20833333"
var mi9_name :A12 = ".25"
var mi10_name :A12 = " "
var mi11_name :A12 = " "
var mi12_name :A12 = " "
var mi13_name :A12 = " "
var mi14_name :A12 = " "
var mi15_name :A12 = " "



//****************************************************************************************
//************************************ Script Events *************************************
//****************************************************************************************

//****************************************************************************************
//************************************ Event FINAL TENDER *******************************
//****************************************************************************************

Event final_tender
//Event Inq : 1


Call CheckForBSM
Call CheckForSAR

If @EMPLOPT[4] <> 1 Then
ExitWithError "You Are Not Privileged To Use This Option !!!"
EndIf
SaveChkInfo @cknum ,",", strTime
EndEvent


//****************************************************************************************
//************************************ Event MENU ITEMS *******************************
//****************************************************************************************

Event MI : *

for i = 1 to @numdtlt
if @dtl_type = "M" AND @dtl_ttl > 0

if @dtl_object = mi1_num
strTime = mi1_name
endif
if @dtl_object = mi2_num
strTime = mi2_name
endif
if @dtl_object = mi3_num
strTime = mi3_name
endif
if @dtl_object = mi4_num
strTime = mi4_name
endif
if @dtl_object = mi5_num
strTime = mi5_name
endif
if @dtl_object = mi6_num
strTime = mi6_name
endif
if @dtl_object = mi7_num
strTime = mi7_name
endif
if @dtl_object = mi8_num
strTime = mi8_name
endif
if @dtl_object = mi9_num
strTime = mi9_name
endif
if @dtl_object = mi10_num
strTime = mi10_name
endif
if @dtl_object = mi11_num
strTime = mi11_name
endif
if @dtl_object = mi12_num
strTime = mi12_name
endif
if @dtl_object = mi13_num
strTime = mi13_name
endif
if @dtl_object = mi14_num
strTime = mi14_name
endif
if @dtl_object = mi15_num
strTime = mi10_name
endif
//Add the Delayed Order to the check.
//Update to correct later where timecalc is easier

LoadKyBdMacro MakeKeys("0000"), Key(1,458851) ,MakeKeys("")
else
endif
endfor
EndEvent


===============================================================
So. Maybe passing values to an external program & updating the CHK_DTL after it is settled is an option, but then I come back to the firing of the items on KDS straight away.
Actually, will look at adding the future order values to the DTL item rather than the check, see if I get a different outcome.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top