To start with here is the code:
Expand|Select|Wrap|Line Numbers
- Public Function Paymentget (s12MoRate)
- strCompanyCode = objXML.selectSingleNode("policy/companyCode").text
- strState = objXML.selectSingleNode("policy/insured/state").text
- set rsDownPayment = getCache("down_payment")
- dim tempPremium, totalTaxes
- totalTaxes = 0
- tempPremium = s12MoRate
- ' calculate the taxes so they can be front loaded in the payment schedule
- dim TaxCov
- for each TaxCov in objXml.selectNodes("//coverage[manOptSwitch='T']")
- taxRate = cdbl(TaxCov.selectSingleNode("../rate/coverage[@covCode = '" & TaxCov.selectSingleNode("coverageCode").text & "']/twelveMonth").text)
- tempPremium = tempPremium - taxRate
- totalTaxes = totalTaxes + taxRate
- next
- ' CLR - new filter as of 12/25/02 for new payplan table structure
- set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "a01_company = '" & objLogic.Company & "' or a01_company = '99'")
- set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "a02_state = '" & objLogic.BikeState & "' or a02_state = 'ZZ'")
- set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "min_premium <= " & tempPremium & " and b80_userline = '" & objLogic.userline & "' and profile = '" & objLogic.profile & "'")
- dim minimumPct
- dim payment
- dim installmentfee
- ' initialize payment percentage, amount, and fee to be full pay parameters as default
- minimumPct = 1
- payment = tempPremium
- installmentfee = 0
- ' now loop through available plans, and get the minimum that they can get in the policy
- while not rsDownPayment.eof
- if cdbl(rsDownPayment("m84_instpct")) < cdbl(minimumPct) then
- minimumPct = cdbl(rsDownPayment("m84_instpct"))
- payment = cdbl(rsDownPayment("m84_instpct")) * tempPremium
- installmentfee = rsDownPayment("first_installment_fee")
- end if
- rsDownPayment.MoveNext
- wend
- Paymentget = cdbl(payment) + cdbl(installmentFee) + cdbl(totalTaxes)
- End Function
- I have a few questions for the asp guru’s out there:
- Just a brief summary…this function works fine until the value of s12MoRate is less than 999. If it is more than 999 than the value for the Payment (s12MoRate) is 0, which is not right.
- I am not good at asp & was wondering on how to debug the application starting from checking what value does s12MoRate has??
- Than how do I check the value for the following?
- set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "a01_company = '" & objLogic.Company & "' or a01_company = '99'")
- set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "a02_state = '" & objLogic.BikeState & "' or a02_state = 'ZZ'")
- set rsDownPayment = applyFilterAndReloadRecordset(rsDownPayment, "min_premium <= " & tempPremium & " and b80_userline = '" & objLogic.userline & "' and profile = '" & objLogic.profile & "'")
- Than check does the while loop execute and what value does payment gets (payment = cdbl(rsDownPayment("m84_instpct")) * tempPremium)??
Mod iam_clint
Any help is appreciated ASAP…thanks a lot for yr time…bye