本文整理自网络,侵删。
//代码有点老,可以调整最新的算法
function IncomeTaxCalc(const AValues: double): double;
var
overPays: double;
begin // 个人所得税计算函数
{
按2011年9月1日的最新政策 起征点 3500元
全月应纳税额不超过1500元 3% 0
全月应纳税额超过1500元至4500元 10% 105
全月应纳税额超过4500元至9000元 20% 555
全月应纳税额超过9000元至35000元 25% 1005
全月应纳税额超过35000元至55000元 30% 2755
全月应纳税额超过55000元至80000元 35% 5505
全月应纳税额超过80000元 45% 13505
}
overPays := AValues - 5000;
if overPays <= 0 then result := 0;
if (overPays > 0 ) and (overPays <= 1500) then result := overPays * 0.03 - 0;
if (overPays > 1500) and (overPays <= 4500) then result := overPays * 0.1 - 105;
if (overPays > 4500) and (overPays <= 9000) then result := overPays * 0.2 - 555;
if (overPays > 9000) and (overPays <= 35000) then result := overPays * 0.25 - 1005;
if (overPays > 35000) and (overPays <= 55000) then result := overPays * 0.3 - 2755;
if (overPays > 55000) and (overPays <= 80000) then result := overPays * 0.35 - 5505;
if (overPays > 80000) then result := overPays * 0.45 - 13505;
end;
function ArcIncomeTaxCalc(const AValues: double): double;
begin
{
0 45
45 345
345 1245
12457745
774513745
1374522495
22495 +∞
}
if AValues <= 0 then
begin
result := 0; // 不交个税时无法反算工资
Exit;
end;
if (AValues > 0) and (AValues <= 45) then result := 3500 + (AValues + 0) / 0.03;
if (AValues > 45) and (AValues <= 345) then result := 3500 + (AValues + 105) / 0.1;
if (AValues > 345) and (AValues <= 1245) then result := 3500 + (AValues + 555) / 0.2;
if (AValues > 1245) and (AValues <= 7745) then result := 3500 + (AValues + 1005) / 0.25;
if (AValues > 7745) and (AValues <= 13745) then result := 3500 + (AValues + 2755) / 0.3;
if (AValues > 13745) and (AValues <= 22495) then result := 3500 + (AValues + 5505) / 0.35;
if (AValues > 22495) then result := 3500 + (AValues + 13505) / 0.45;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ShowMessage(floattostr(IncomeTaxCalc(13500)));
ShowMessage(floattostr(ArcIncomeTaxCalc(1200)));
end;
相关阅读 >>
Delphi 请求时间,为当前时间,数值为1970-01-01以来的毫秒数
如何在Delphi中禁用关于“返回值...可能未定义”的警告?
Delphi randomfrom 随机返回字符串数组avalues中的一个元素
更多相关阅读请进入《Delphi》频道 >>