Ashutosh1234
Technical User
Hi All
We are migrating from Micros V1 to Micros version 2 where few elements of the ISL script are not working or not available and micros pos is showing error not available on this verison
The script was written to calculate correct service charge amount on the initiated payment amount and then call the Credit card payment method
Example : if the check is for $100 and we are doing a partial payment of $20 on that check the below will calculate service charge @ 1.2% on $20 and not on $100
the below are lines are where the error is coming up. Can someone please point me at the right direction
// The below key is calling the event inquiry 2 which is below //
LoadKyBdMacro Key(11, 1001) //
And
Event Inq : 2
LoadKyBdMacro MakeKeys(dFinalCCAmount),Key(11, 1061)
Below is full script
RetainGlobalVar
// Prorate
Var bTrue : N1 = 1
Var bFalse : N1 = 0
Var bRES32 : N1
Var bTesting : N1 = 0
Var nSurchargeItem : N9 = 1020
Var dSurchargeAmount : $12
Var dCCAmount : $12
Var dFinalCCAmount : $12
Var errNothingToPay : A40 = "Nothing on check to pay"
//*********************************************************************************************************************
//**************************************************** Event Inq : 1 **************************************************
//************************************* Apply CC Surcharge And Call CC Amount Entry ***********************************
//*********************************************************************************************************************
Event Inq : 1
if (@TTLDUE = 0)
exitwitherror errNothingToPay
endif
Var nCnt : N9
Var dItemTotal : $12
Var dDiscTotal : $12
Var dSvcTotal : $12
Var dTMedTotal : $12
Var dCheckTotal : $12
Var dSurchargePercent : $12
Var dCCPercent : $12
Var dSurchargeAmount : $12
Var dCCAmount : $12
Var strCCAmount : A20
Var bSurchargeFound : N1
Var nDtlCnt : N9
dItemTotal = 0.00
dDiscTotal = 0.00
dSvcTotal = 0.00
dTMedTotal = 0.00
dCheckTotal = 0.00
If Len(@USERENTRY) = 0 Then
//ExitWithError "You Must Enter An Amount First !!!"
dccAmount = @TTLDUE
Else
If @USERENTRY = 0 Then
//ExitWithError "Zero Is Not A Valid Amount !!!"
dccAmount = @TTLDUE
else
strCCAmount = @USERENTRY
If Instr(1, strCCAmount, ".") = 0 Then
If Len(strCCAmount) = 1 Then
Format strCCAmount As "." , "0", @USERENTRY
Else
Format strCCAmount As Mid(@USERENTRY, 1, ((Len(@USERENTRY) - 2))), ".", Mid(@USERENTRY, (Len(@USERENTRY) - 1), 2)
EndIf
EndIf
dCCAmount = strCCAmount
EndIf
EndIf
dCCPercent = 1.2
var tmpAmount : $12 = dCCAmount
Call roundAmount(tmpAmount)
if (tmpAmount <> dCCAmount)
ExitWithError "Amount must be round"
endif
dSurchargeAmount = ((dCCAmount * dCCPercent) / 100)
Call roundAmount(dSurchargeAmount)
If dCCPercent <> 0 Then
// LoadKyBdMacro Key(1, nSurchargeItem), MakeKeys(dSurchargeAmount), @KEY_ENTER
LoadKyBdMacro Key(5, 3), MakeKeys(dSurchargeAmount), @KEY_ENTER
EndIf
dFinalCCAmount = (dCCAmount + dSurchargeAmount)
if (bTesting)
waitforconfirm "surcharge amount: " , dSurchargeAmount
waitforconfirm "final amount: " , dFinalCCAmount
EndIf
// The below key is calling the event inquiry 2 which is below //
LoadKyBdMacro Key(11, 1001) //
EndEvent
sub roundAmount(ref calcTtl)
var nDelta : N1
var bigInt : N12
bigInt = ToInteger(calcTtl)
nDelta = bigInt % 10
if (nDelta > 0) and (nDelta <> 5)
if nDelta < 3
bigInt = bigInt - nDelta
elseif nDelta < 5
bigInt = bigInt + (5 - nDelta)
elseif nDelta < 8
bigInt = bigInt - (nDelta - 5)
else
bigInt = bigInt + (10 - nDelta)
endif
calcTtl = bigInt
calcTtl = (calcTtl / 100)
endif
endsub
//*********************************************************************************************************************
//**************************************************** Event Inq : 2 **************************************************
//************************************* Enter Credit Card Amount And Call MPG CC Pay **********************************
//*********************************************************************************************************************
Event Inq : 2
LoadKyBdMacro MakeKeys(dFinalCCAmount),Key(11, 1061)
EndEvent
We are migrating from Micros V1 to Micros version 2 where few elements of the ISL script are not working or not available and micros pos is showing error not available on this verison
The script was written to calculate correct service charge amount on the initiated payment amount and then call the Credit card payment method
Example : if the check is for $100 and we are doing a partial payment of $20 on that check the below will calculate service charge @ 1.2% on $20 and not on $100
the below are lines are where the error is coming up. Can someone please point me at the right direction
// The below key is calling the event inquiry 2 which is below //
LoadKyBdMacro Key(11, 1001) //
And
Event Inq : 2
LoadKyBdMacro MakeKeys(dFinalCCAmount),Key(11, 1061)
Below is full script
RetainGlobalVar
// Prorate
Var bTrue : N1 = 1
Var bFalse : N1 = 0
Var bRES32 : N1
Var bTesting : N1 = 0
Var nSurchargeItem : N9 = 1020
Var dSurchargeAmount : $12
Var dCCAmount : $12
Var dFinalCCAmount : $12
Var errNothingToPay : A40 = "Nothing on check to pay"
//*********************************************************************************************************************
//**************************************************** Event Inq : 1 **************************************************
//************************************* Apply CC Surcharge And Call CC Amount Entry ***********************************
//*********************************************************************************************************************
Event Inq : 1
if (@TTLDUE = 0)
exitwitherror errNothingToPay
endif
Var nCnt : N9
Var dItemTotal : $12
Var dDiscTotal : $12
Var dSvcTotal : $12
Var dTMedTotal : $12
Var dCheckTotal : $12
Var dSurchargePercent : $12
Var dCCPercent : $12
Var dSurchargeAmount : $12
Var dCCAmount : $12
Var strCCAmount : A20
Var bSurchargeFound : N1
Var nDtlCnt : N9
dItemTotal = 0.00
dDiscTotal = 0.00
dSvcTotal = 0.00
dTMedTotal = 0.00
dCheckTotal = 0.00
If Len(@USERENTRY) = 0 Then
//ExitWithError "You Must Enter An Amount First !!!"
dccAmount = @TTLDUE
Else
If @USERENTRY = 0 Then
//ExitWithError "Zero Is Not A Valid Amount !!!"
dccAmount = @TTLDUE
else
strCCAmount = @USERENTRY
If Instr(1, strCCAmount, ".") = 0 Then
If Len(strCCAmount) = 1 Then
Format strCCAmount As "." , "0", @USERENTRY
Else
Format strCCAmount As Mid(@USERENTRY, 1, ((Len(@USERENTRY) - 2))), ".", Mid(@USERENTRY, (Len(@USERENTRY) - 1), 2)
EndIf
EndIf
dCCAmount = strCCAmount
EndIf
EndIf
dCCPercent = 1.2
var tmpAmount : $12 = dCCAmount
Call roundAmount(tmpAmount)
if (tmpAmount <> dCCAmount)
ExitWithError "Amount must be round"
endif
dSurchargeAmount = ((dCCAmount * dCCPercent) / 100)
Call roundAmount(dSurchargeAmount)
If dCCPercent <> 0 Then
// LoadKyBdMacro Key(1, nSurchargeItem), MakeKeys(dSurchargeAmount), @KEY_ENTER
LoadKyBdMacro Key(5, 3), MakeKeys(dSurchargeAmount), @KEY_ENTER
EndIf
dFinalCCAmount = (dCCAmount + dSurchargeAmount)
if (bTesting)
waitforconfirm "surcharge amount: " , dSurchargeAmount
waitforconfirm "final amount: " , dFinalCCAmount
EndIf
// The below key is calling the event inquiry 2 which is below //
LoadKyBdMacro Key(11, 1001) //
EndEvent
sub roundAmount(ref calcTtl)
var nDelta : N1
var bigInt : N12
bigInt = ToInteger(calcTtl)
nDelta = bigInt % 10
if (nDelta > 0) and (nDelta <> 5)
if nDelta < 3
bigInt = bigInt - nDelta
elseif nDelta < 5
bigInt = bigInt + (5 - nDelta)
elseif nDelta < 8
bigInt = bigInt - (nDelta - 5)
else
bigInt = bigInt + (10 - nDelta)
endif
calcTtl = bigInt
calcTtl = (calcTtl / 100)
endif
endsub
//*********************************************************************************************************************
//**************************************************** Event Inq : 2 **************************************************
//************************************* Enter Credit Card Amount And Call MPG CC Pay **********************************
//*********************************************************************************************************************
Event Inq : 2
LoadKyBdMacro MakeKeys(dFinalCCAmount),Key(11, 1061)
EndEvent