个人所得税计算器

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>计算个税</title>
</head>

<body>
<script Language="JavaScript">
function FrontPage_Form1_Validator(theForm)
{
  var checkOK = "0123456789";
  var checkStr = theForm.money.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("月收入中只能输入数字。");
    return (false);
  }
 
  var checkOK = "0123456789";
  var checkStr = theForm.KCmoney.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("起征额中只能输入数字。");
    return (false);
  }
 
var basicm,totalmoney,cha,output;
totalmoney=theForm.money.value;
basicm=theForm.KCmoney.value;
cha=(totalmoney-basicm);
if (cha<=0) {output=0;}
if (cha>0&&cha<=500) {output=cha*0.05;}
if (cha>500&&cha<=2000) {output=cha*0.1-25;}
if (cha>2000&&cha<=5000) {output=cha*0.15-125;}
if (cha>5000&&cha<=20000) {output=cha*0.2-375;}
if (cha>20000&&cha<=40000) {output=cha*0.25-1375;}
if (cha>40000&&cha<=60000) {output=cha*0.30-3375;}
if (cha>60000&&cha<=80000) {output=cha*0.35-6375;}
if (cha>80000&&cha<=100000) {output=cha*0.4-10375;}
if (cha>100000&&cha>100000) {output=cha*0.45-15375;}
alert("应缴个人所得税额="+output+"元"+"\n"+"\n"+"依法纳税是每个公民应尽的义务!!");
return (false);
}
</script>
                  <form method="post" name="TaxForm">
<table width="300" border="1" cellspacing="0" cellpadding="2" bordercolor="#ffffff">
<tr>
<td height="26" align="center" scope="col" colspan="2" ><span class="shurukuang">个税计算器</span></td></tr>
  <tr>
    <td height="26" align="right" scope="col"><span class="shurukuang">您的月收入:</span></td>
    <td height="26" scope="col"><span class="shurukuang">
      <input class="inputs" name="Salary"  id="Salary"/>
    </span></td>
  </tr>
  <tr>
    <td height="26" align="right" scope="col"><span class="shurukuang">扣五险一金:</span></td>
    <td height="26" scope="col"><span class="shurukuang">
      <input class="inputs" name="gongji" />
    </span></td>
  </tr>
  <tr>
    <td height="26" align="right" scope="col"><span class="shurukuang">起征额:</span></td>
    <td height="26" scope="col"><span class="shurukuang">
      <input class="inputs" name="StartNum" readonly="readonly" value="3500" />
      </span></td>
  </tr>
  <tr>
    <td height="26" align="right"><span class="shurukuang">调整前应税:</span></td>
    <td height="26"><span class="shurukuang">
      <input class="inputs" name="output1" />
      </span></td>
  </tr>
  <tr>
    <td height="26" align="right"><span class="shurukuang">调整后应税:</span></td>
    <td height="26"><span class="shurukuang">
      <input class="inputs" name="output" />
    </span></td>
  </tr>
  <tr>
    <td height="26" align="right"><span class="shurukuang">差 额:</span></td>
    <td height="26"><span class="shurukuang">
      <input class="inputs" name="jieyu" readonly="readonly" />
    </span></td>
  </tr>
  <tr>
    <td height="26" align="right"> </td>
    <td height="26"> </td>
  </tr>
  <tr>
    <td height="26" colspan="2" align="center"><span class="tijiao">
      <input class="anniu" name="B1" onClick="calc()" type="button" value="计 算" />
      <input class="anniu" name="B2" type="reset" value="重 写" />
    </span></td>
    </tr>
</table>
<SCRIPT language=JavaScript>
function calc(){
	var Salary,gongji,StartNum,StartNumOld,cha,cha1,jieyu,output,output1
	Salary=document.TaxForm.Salary.value;
	if (Salary==""||isNaN(Salary)){
		document.getElementById("Salary").focus();
		alert("请在月收入中输入数字");
		return false
	}
	gongji=document.TaxForm.gongji.value;
	StartNum=3500;
	StartNumOld=2000;
	cha=(Salary-gongji-StartNum);
	if(Salary-gongji>83500){output=cha*0.45-13505;}
	else if(Salary-gongji>58500){output=cha*0.35-5505;}
	else if(Salary-gongji>38500){output=cha*0.3-2755;}
	else if(Salary-gongji>12500){output=cha*0.25-1005;}
	else if(Salary-gongji>8000){output=cha*0.20-555;}
	else if(Salary-gongji>5000){output=cha*0.10-105;}
	else if(Salary-gongji>3500){output=cha*0.03;}
	else{output=0;}
	cha1=(Salary-gongji-StartNumOld);
	if(cha1>100000){output1=cha1*0.45-15375;}
	else if(cha1>80000){output1=cha1*0.4-10375;}
	else if(cha1>60000){output1=cha1*0.35-6375;}
	else if(cha1>40000){output1=cha1*0.30-3375;}
	else if(cha1>20000){output1=cha1*0.25-1375;}
	else if(cha1>5000){output1=cha1*0.2-375;}
	else if(cha1>2000){output1=cha1*0.15-125;}
	else if(cha1>500){output1=cha1*0.1-25;}
	else if(cha1>0){output1=cha1*0.05;}
	else{output1=0;}
	jieyu=(output1-output);
	if (output1>0){
		document.TaxForm.output1.value=output1;
		document.TaxForm.output.value=output;
		document.TaxForm.jieyu.value=jieyu;
	}
	else{
		alert("不需要交纳个人所得税。")
	}
}
</SCRIPT>
</form>
</body>
</html>

posted @ 2011-09-02 09:23  徐一贺  阅读(670)  评论(0编辑  收藏  举报