经典 ASP - 需要帮助更新印花税计算器百分比

Classic ASP - Need Help Updating Stamp Duty Calculator Percentages

有人要求我更新印花税计算器百分比,但上面写的是 asp,我以前从未真正使用过它。我已经更新了百分比,但是当我计算数字时,它似乎偏离了大约 100 英镑到 1000 英镑。

http://www.stampdutycalculator.org.uk/计算器的总数应该是这样的。

http://smart-search.mobi/cal_test/purchase.asp这是我正在做的。

http://www.moneysavingexpert.com/mortgages/stamp-duty 正确的数值和百分比。

这是结果应该是什么的一些示例。

如果输入 125000 英镑,则应显示 0 英镑印花税(这个有效)

如果输入 185000 英镑,则应显示 1200 英镑印花税(为我显示 1295 英镑)

如果输入 275000 英镑,则应显示 3750 英镑的印花税(为我显示 3850 英镑)

如果输入 937500 英镑,则应显示 37500 英镑的印花税(这个有效)

如果输入 2100000 英镑,则应显示 165750 英镑印花税(为我显示 165900 英镑)


新费率是:

£0 - £125,000 0%,

125,001 英镑 - 250,000 英镑 2%,

250,001 英镑 - 925,000 英镑 5%,

925,001 英镑 - 150 万英镑 10%,

超过 150 万英镑 12%

<%
dim a, b, c, d, e, f, g, h, i, j, k, l, z, x, y, w, v
x = request("leasehold")
y = request("newbuild")
a = request("PurchasePrice")
CurrencySymbol ="£"
if x=yes then w=150
if y=yes then v=150
if a>=0 then b=775-w-v
if a>=100001 then b=800-w-v 'A = PurchasePrice | B = Legal Fees'
if a>=150001 then b=850-w-v
if a>=200001 then b=900-w-v
if a>=250001 then b=975-w-v
if a>=300001 then b=1050-w-v
if a>=400001 then b=1150-w-v
if a>=500001 then b=1275-w-v
if a>=600001 then b=1400-w-v
if a>=700001 then b=0
if b=0 then aa="Please Call to Discuss"


'***PRECENTS ARE HERE******'
if a>=125000 then d=a*0     '0%'
if a>=185000 then d=a*0.007 '0.7%
if a>=250000 then d=a*0.014 '1.4%'
if a>=510000 then d=a*0.03 '3.0%'
if a>=937500 then d=a*0.04 '4.0%'
if a>=2100000 then d=a*0.079 '7.9%'
'*******************'

if a>=0 then f=40        'Land Registry Fee ?'
if a>=50001 then f=70
if a>=80001 then f=120
if a>=100001 then f=190
if a>=200001 then f=270
if a>=500001 then f=540
g = 30
e = 160
c = FormatNumber((b*120/100-b),2) 'V.A.T ?'
h = FormatNumber((g*120/100-g),2)
l = formatnumber((b),2)
m = formatnumber((g),2)
n = formatnumber((f),2)
o = formatnumber((e),2)
p = formatnumber((c),2)
q = formatnumber((d),2)
r = formatnumber((h),2)
k = b+c
i = d+e+f+g+h
j = k+i
s = formatnumber((k),2)
t = formatnumber((i),2)
u = formatnumber((j),2)
v = formatnumber((a),2)
%>

它是经典的 asp,而不是 asp.net,它使用 VBScript 作为服务器端脚本语言

我假设你的数学是正确的。

您还没有用 end if 关闭任何 if 语句,我很惊讶这不会抛出错误消息。这是正确语法的示例。

if a>=700001 then b=0 end if

如果您要检查文本字符串的值,则需要使用引号 - 例如

if x="yes" then w=150 end if

最后,我在 purcase.asp 上对您的表单进行了查看源代码。我注意到您的租赁和新建复选框的值属性都是 "off"。显然它们需要 "yes" 来对应 asp

中的 Request() 语句

编辑

鉴于您在此处提供的费率,这是我要编写的代码。

<%
a = Clng(Request("a"))
if a<=125000 Then d=(a*0)
Elseif a>125000 And a<=250000 then d=(a*0.02)  
Elseif a>250000 And a<=925000 then d=(a*0.05)
Elseif a>925000 And a<=1500000 then d=(a*0.1)
Elseif a>1500000 then d=(a*0.12)
End if
Response.write d
%>

编辑 2 - 如果我正确理解新的印花税规则,我会这样做。请注意,57,500 英镑、33,750 英镑和 2,500 英镑分别是您在 10%、5% 和 2% 范围内支付的最高金额。

<%
a = Clng(Request("a"))
if a<=125000 Then d=0
Elseif a>125000 And a<=250000 then d=((a-125000)*0.02)  
Elseif a>250000 And a<=925000 then d=2500+((a-250000)*0.05)
Elseif a>925000 And a<=1500000 then d=33750+2500+((a-925000)*0.1)
Elseif a>1500000 then d=57500+33750+2500+((a-1500000)*0.12)
End if
Response.write d
%>