Hey all!
Here is the deal. Right now I stuck a script inside the status.htm file that when a customer is loaded, a MsgBox will pop up saying that the customer is expired if the CustomDate1 (rewards member date) field is equal to todays date or earlier (which is what we need). The only problem is, when I click ok, the box continues to show up, and will not go away, and I know its because the TimerID interval keeps firing it.
Of course, the novice, obvious solution would be, if I click ok (If vbOK) to clearInterval.(TimerID), but the only problem with that now, is that when we load up another customer for another sale, the status.htm does not get updated.
I created another Function to try to get past it, but it is not working.
Here is the VBS code I am working with:
<object id="qsBridge" style="left: 0px; top: 0px" height="0" width="0" classid="clsid:44C4C3AC-D0F1-11D2-919D-006008C88FC3"
viewastext>
<param name="_ExtentX" value="26">
<param name="_ExtentY" value="26">
</object>
<script language="VBScript">
<!--
Dim TimerID
dim RHRewardsInfo
dim tablScrollStyleDim myDateString
myDateString = Date()
Dim confirmMsg
Function displayVariables
Dim QSRules
Set QSRules = qsBridge.RequestQSRules()
Set RHRewardsInfo=CreateObject("RetailHero.RMS.AddIns.HeroPoints30.POS.Info")If Not QSRules Is Nothing Then
If QSRules.Transaction.Customer.Loaded Then
txtCustomer.innerText= QSRules.Transaction.Customer.Name
txtAccount.innerText = QSRules.Transaction.Customer.AccountNumber
txtAddress.innerText = QSRules.Transaction.Customer.HomeAddress.StreetAddress
txtExpDate.innerText = QSRules.Transaction.Customer.CustomDate1
txtMember.innerText = RHRewardsInfo.CheckCustomerExceptionList(QSRules.Transaction.Customer.AccountNumber)
txtAvailablePoints.innerText=RHRewardsInfo.GetCustomerPoints(QSRules.Transaction.Customer.AccountNumber)
txtTransactionSubtotal.innerText=FormatCurrency(QSRules.Transaction.SubTotal)
txtDiscountableSubtotal.innerText=FormatCurrency(RHRewardsInfo.GetSubTotalDiscountable(QSRules.Session))
txtTotalSavings.innerText= "$" & QSRules.Transaction.Customer.TotalSavings & ".00"
GetPointsSchedule.innerHTML=RHRewardsInfo.GetPointsSchedule
tablScrollStyle="height: 120px; overflow: scroll"
tableScroll.style.cssText="height: 120px; overflow: auto"
else
txtCustomer.innerText="Load customer"
txtAccount.innerHTML = " "
txtAddress.innerHTML = " "
txtExpDate.innerHTML = " "
txtMember.innerHTML = " "
txtAvailablePoints.innerHTML=" "
txtTransactionSubtotal.innerHTML=" "
txtDiscountableSubtotal.innerHTML=" "
GetPointsSchedule.innerHTML=" "
End If
End ifEnd function
function displayError
Dim QSRules
Set QSRules = qsBridge.RequestQSRules()
If Not QSRules Is Nothing Then
If QSRules.Transaction.Customer.Loaded Then
olieDate = QSRules.Transaction.Customer.CustomDate1
If olieDate <= myDateString Then
confirmMsg = MsgBox("Customer rewards has expired, renew?",4,"Rewards Expired")
If confirmMsg = vbYes Then
TimerID2 = window.setInterval("displayError()", 10000)
End If
End If
End If
End If
end functionFunction doStartup()
displayVariables
displayError
TimerID = window.setInterval("displayVariables()", 1000)
TimerID2 = window.setInterval("displayError()", 1000)
End Function//-->
</script>
I need your help, please..
Thanks in advance!
*This post is locked for comments