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!

Print Micros Currency Conversion Rate 1

Status
Not open for further replies.

JosueICR

IS-IT--Management
Jan 12, 2009
45
MX

Hi Guys, i need an advice on how to print the actual currency conversion rate on each check that use a differnt currency than the default.

I found the following sentence on Micros Res Help

If a line in a header or trailer begins with "@@", followed by an ISL event name, the system replaces that line during printing with one or more lines of information that are returned by the ISL event. For example, a trailer definition may look like this:

Could work or there is an easy way to accomplish this ?
 
Yes, you can capture the converion rate from the DB, and print it on the bottom of the check. Is this something that will happen on every check?
 
Hi Mike

We need to print the conversion rate only on checks that will be tendered with a different currency than default, so there is another condition that needs to be accomplished, if this tender media(Dollar) is on the check print then print the currency conversion.

I have a couple of ideas to do this :

1.- From the trailer call an Isl event that looks if the dollar tender media exist on the current check, if true prints the conversion rate.

2.- Associate a Sim Event to a touchscreen botton linked to the dollar tender media, the event will extract the conversion rate from the DB and then print the conversion rate on the current check.

What option do you suggest?

 
I would go with the print trailer event. Does the tender have a unique number?
 

The tender media will be Dollars (object number 109) in pos configurator.

Mike could you please provide more detail on how to execute this script, i put the reference @@Hap_Hr on Sales|Descriptors with no success

event print_header: Hap_Hr
if @hour >= 16 AND @hour <18
@header[1]= " HAPPY HOUR"
@header[2]=" ALL DRINKS $1.00"
endif
endevent

I created a sim that include the event Print_header, then i created an interface with the numeber 11 that is the same as pms11.isl that contains the event print_header. Micros help is very basic.



Thanks
 
Finally i have a solution, i created a SIM to complete this requierement

Thanks MIke for your guide.

Josue R.



/////////////////////////////////////////// VARIABLES GLOBALES /////////////////////////////////////////



Var SqlStr : A2056 = ""
Var SqlStr1 : A2056 = ""
Var tc_obj_num : N10 = 1
Var tc_nombre : A15 = "Dolares"
Var Tipo_Cambio : $10 = 0

Var hODBCDLL : N12 = 0


event print_trailer: Hap_Hr

var cnt : n3
var mi_mlvl [ @numdtlt ] : n1
var mi_slvl [ @numdtlt ] : n1
var mi_obj[ @numdtlt ] : n5
var mi_cnt : n3 = 0
VAR Concatena_TC : A50 //Concatena Texto y Numero del Tipo de Cambio


if @cknum = 0
exitwitherror "Begin a check and try again"
endif
for cnt = 1 to @numdtlt
if @dtl_type[ cnt ] = "T"
mi_cnt = mi_cnt + 1
// mi_obj[ mi_cnt ] = @dtl_objnum[ cnt ]
// mi_mlvl[ mi_cnt ] = @dtl_mlvl[ cnt ]
// mi_slvl[ mi_cnt ] = @dtl_slvl[ cnt ]

if @dtl_objnum[ cnt ] = 21
// infomessage "Esta Orden Contiene", @Dtl_Ttl[cnt], "Dolares"
call Procesa_Consulta_Tipo_Cambio
FORMAT Concatena_TC AS " Tipo de Cambio : ", Tipo_Cambio

//@header[1]=Tipo_Cambio
@trailer[1]=" "
@trailer[2]="********************************"
@trailer[3]="Corresponsal Cambiario : HSBC "
@trailer[4]=" C O M P R A E N U S D "
@trailer[5]=Concatena_TC
@trailer[6]="********************************"
@trailer[7]=" "
break
//@dtl_objnum[ cnt ]
endif

//infomessage "Tender number", @dtl_objnum[ cnt ]
//waitforenter

endif
endfor



endevent



Sub Procesa_Consulta_Tipo_Cambio

SqlStr = ""


/// Crea sentencia SQl para recuperar ventas x cajero ////////


Format SqlStr as "SELECT conversion_rate FROM micros.currency_def "
Format SqlStr as SqlStr, "WHERE obj_num = ", tc_obj_num

Call Load_ODBC_DLL
Call ConnectDB

DLLCALL_CDECL hODBCDLL, sqlGetRecordSet(SqlStr)


SqlStr1 = ""
DLLCALL_CDECL hODBCDLL, sqlGetLastErrorString(Ref SqlStr1)
IF (SqlStr1 <> "")
Call UnloadDLL
Window 12,78
display 1,1, mid(Trim(sqlstr1), 1,75)
display 2,1, mid(Trim(sqlstr1), 76,75)
display 3,1, mid(Trim(sqlstr1), 151,75)
display 4,1, mid(Trim(sqlstr1), 226,75)
display 5,1, mid(Trim(sqlstr1), 301,75)
waitforenter
windowclose


ExitWithError "Error: ", SqlStr1
ENDIF
SqlStr1 = ""
DLLCALL_CDECL hODBCDLL, sqlGetFirst(Ref SqlStr1)
IF SqlStr1 = ""
// venta = 0
//WaitForenter "No tiene Datos"
ELSE
IF Len(Trim(SqlStr1)) > 0 Then
// Waitforenter sqlstr1
// Split SqlStr1, ";", Emp_last_name,Emp_First_name
Tipo_Cambio = SqlStr1
// WaitForenter sqlstr1
ENDIF

ENDIF
EndSub



//////////////////////// CARGA LIBRERIAS PARA ODBCCONECTA A BD MICROS

Sub Load_ODBC_DLL

IF hODBCDLL = 0
IF @WSTYPE = 3
DLLLoad hODBCDLL, "\cf\micros\bin\MDSSysUtilsProxy.dll"
ELSE
DLLLoad hODBCDLL, "..\bin\MDSSysUtilsProxy.dll"
ENDIF
ENDIF
IF hODBCDLL = 0
ExitWithError "No se Puede Cargar DLL (MDSSysUtilsProxy.DLL)"
ENDIF
EndSub


//////////////////////// CONECTA A BD MICROS ////////////////////////////////////////////////////////
Sub ConnectDB
Var Status : N1
DLLCALL_CDECL hODBCDLL, sqlIsConnectionOpen(Ref Status)
// IF Status = 0
DLLCALL_CDECL hODBCDLL, sqlInitConnection("micros","ODBC;UID=dba;PWD=micros", "")
// ELSE
// InfoMessage "ODBC", "Base de Datos Conectada(...)"
// ENDIF
Endsub





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top