botserver/templates/default.gbai/default.gbdialog/bot.vbs.gbignore

78 lines
1.8 KiB
Text
Raw Normal View History

2024-04-20 17:24:00 -03:00
' General Bots Copyright (c) pragmatismo.cloud. All rights reserved. Licensed under the AGPL-3.0.
' Rules from http://jsfiddle.net/roderick/dym05hsy
talk "How many installments do you want to pay your Credit?"
hear installments
2018-12-02 19:59:27 -02:00
if installments > 60 then
talk "The maximum number of payments is 60"
2018-12-02 19:59:27 -02:00
else
talk "What is the amount requested?"
2020-08-26 17:50:42 -03:00
hear amount
2020-08-26 17:50:42 -03:00
if amount >100000 then
talk "We are sorry, we can only accept proposals bellow 100k"
else
talk "What is the best due date?"
hear dueDate
interestRate = 0
adjustment = 0
if installments < 12 then
interestRate = 1.60
adjustment = 0.09748
end if
if installments > 12 and installments < 18 then
interestRate = 1.66
adjustment = 0.06869
end if
if installments > 18 and installments < 36 then
interestRate = 1.64
adjustment = 0.05397
end if
if installments > 36 and installments < 48 then
interestRate = 1.62
adjustment = 0.03931
end if
if installments > 48 and installments < 60 then
interestRate = 1.70
adjustment = 0.03270
end if
if installments = 60 then
interestRate = 1.79
adjustment = 0.02916
end if
if installments > 60 then
talk "The maximum number of payments is 60"
end if
nInstallments = parseInt(installments)
2020-08-26 17:50:42 -03:00
vamount = parseFloat(amount)
initialPayment = vamount * 0.3 ' 30% of the value
tac = 800
adjustment = 1.3
2020-08-26 17:50:42 -03:00
totalValue = amount - initialPayment + tac
paymentValue = totalValue * adjustment
finalValue = paymentValue * nInstallments + initialPayment
talk "Congratulations! Your credit analysis is **done**:"
talk "First payment: **" + initialPayment + "**"
talk "Payment value: **" + paymentValue + "**"
talk "Interest Rate: **" + interestRate + "%**"
talk "Total Value: **" + totalValue + "**"
talk "Final Value: **" + finalValue + "**"
2018-12-02 19:59:27 -02:00
end if
end if