最新个人所得税计算器C#版 源码2012-2013
2012-09-13 15:08
246 查看
由于项目需要计算个税,自己就根据最新税法以及税率表,写了计算个人所得税的C#版代码,贴出来,指高手指正不足之处。
演示地址:http://www.9aicai.com/
代码如下:
1、TaxInfo.cs
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
/// <summary>
///TaxInfo 个人所得税详细信息
///版本:1.0
///官网:http://www.9aicai.com
///名称:爱财个人所得税计算器(C#版) 2012-2013
/// </summary>
public class TaxInfo
{
public TaxInfo()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
/// <summary>
/// 工资收入
/// </summary>
public decimal Income
{
set;
get;
}
/// <summary>
/// 纳税人员类型,是否外籍人士
/// </summary>
public bool IsForeign
{
set;
get;
}
/// <summary>
/// 五险一金
/// </summary>
public decimal Golds
{
set;
get;
}
/// <summary>
/// 个人所得税起征点
/// </summary>
public decimal StartPoint
{
set;
get;
}
/// <summary>
/// 应纳税所得额
/// </summary>
public decimal TaxableIncome
{
set;
get;
}
/// <summary>
/// 适用税率
/// </summary>
public decimal Rate
{
set;
get;
}
/// <summary>
/// 速算扣除数
/// </summary>
public decimal Deduct
{
set;
get;
}
/// <summary>
/// 应纳税额
/// </summary>
public decimal Tax
{
set;
get;
}
/// <summary>
/// 税后收入
/// </summary>
public decimal IncomeAfterTax
{
set;
get;
}
}
2、TaxManager.cs
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
/// <summary>
///TaxManager 个人所得税的计算处理
///版本:1.0
///官网:http://www.9aicai.com
///名称:爱财个人所得税计算器(C#版) 2012-2013
/// </summary>
public class TaxManager
{
public TaxManager()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
/// <summary>
/// 计算个人所得税
/// </summary>
/// <param name="income">工资收入</param>
/// <param name="golds">五险一金</param>
/// <param name="isForeign">是否是外籍人员</param>
/// <returns>个人所得税计算结果</returns>
public static TaxInfo Calc(decimal income, decimal golds, bool isForeign)
{
TaxInfo taxInfo = new TaxInfo();
taxInfo.Income = income;
taxInfo.Golds = golds;
taxInfo.IsForeign = isForeign;
//国内人员与外籍人员的起征点是不一样的,
taxInfo.StartPoint = taxInfo.IsForeign ? 4800 : 3500;
taxInfo.TaxableIncome = taxInfo.Income - taxInfo.Golds - taxInfo.StartPoint;
decimal rate, deduct;
//不需要纳税,应纳税额小于等于0
if (taxInfo.TaxableIncome <= 0)
{
taxInfo.Rate = 0;
taxInfo.Deduct = 0;
taxInfo.Tax = 0;
taxInfo.IncomeAfterTax = taxInfo.Income;
}//下面是需要纳税部分
else
{
//获取对应的税率与速算扣除数
getRateAndDeduct(taxInfo.TaxableIncome, out rate, out deduct);
taxInfo.Rate = rate;
taxInfo.Deduct = deduct;
taxInfo.Tax = taxInfo.TaxableIncome * taxInfo.Rate - taxInfo.Deduct;
taxInfo.IncomeAfterTax = taxInfo.Income - taxInfo.Golds - taxInfo.Tax;
}
return taxInfo;
}
/// <summary>
/// 获取对应的税率与速算扣除数,采用最新七级超额累进个人所得税税率表
/// </summary>
/// <param name="taxableIncome">应纳税所得额</param>
/// <param name="rate">适用税率</param>
/// <param name="deduct">速算扣除数</param>
private static void getRateAndDeduct(decimal taxableIncome, out decimal rate, out decimal deduct)
{
if (taxableIncome <= 1500)
{
rate = 3; deduct = 0;
}
else if (taxableIncome > 1500 && taxableIncome <= 4500)
{
rate = 10; deduct = 105;
}
else if (taxableIncome > 4500 && taxableIncome <= 9000)
{
rate = 20; deduct = 555;
}
else if (taxableIncome > 9000 && taxableIncome <= 35000)
{
rate = 25; deduct = 1005;
}
else if (taxableIncome > 35000 && taxableIncome <= 55000)
{
rate = 30; deduct = 2755;
}
else if (taxableIncome > 55000 && taxableIncome <= 80000)
{
rate = 35; deduct = 5505;
}
else
{
rate = 45; deduct = 13505;
}
}
}
演示地址:http://www.9aicai.com/
代码如下:
1、TaxInfo.cs
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
/// <summary>
///TaxInfo 个人所得税详细信息
///版本:1.0
///官网:http://www.9aicai.com
///名称:爱财个人所得税计算器(C#版) 2012-2013
/// </summary>
public class TaxInfo
{
public TaxInfo()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
/// <summary>
/// 工资收入
/// </summary>
public decimal Income
{
set;
get;
}
/// <summary>
/// 纳税人员类型,是否外籍人士
/// </summary>
public bool IsForeign
{
set;
get;
}
/// <summary>
/// 五险一金
/// </summary>
public decimal Golds
{
set;
get;
}
/// <summary>
/// 个人所得税起征点
/// </summary>
public decimal StartPoint
{
set;
get;
}
/// <summary>
/// 应纳税所得额
/// </summary>
public decimal TaxableIncome
{
set;
get;
}
/// <summary>
/// 适用税率
/// </summary>
public decimal Rate
{
set;
get;
}
/// <summary>
/// 速算扣除数
/// </summary>
public decimal Deduct
{
set;
get;
}
/// <summary>
/// 应纳税额
/// </summary>
public decimal Tax
{
set;
get;
}
/// <summary>
/// 税后收入
/// </summary>
public decimal IncomeAfterTax
{
set;
get;
}
}
2、TaxManager.cs
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
/// <summary>
///TaxManager 个人所得税的计算处理
///版本:1.0
///官网:http://www.9aicai.com
///名称:爱财个人所得税计算器(C#版) 2012-2013
/// </summary>
public class TaxManager
{
public TaxManager()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
/// <summary>
/// 计算个人所得税
/// </summary>
/// <param name="income">工资收入</param>
/// <param name="golds">五险一金</param>
/// <param name="isForeign">是否是外籍人员</param>
/// <returns>个人所得税计算结果</returns>
public static TaxInfo Calc(decimal income, decimal golds, bool isForeign)
{
TaxInfo taxInfo = new TaxInfo();
taxInfo.Income = income;
taxInfo.Golds = golds;
taxInfo.IsForeign = isForeign;
//国内人员与外籍人员的起征点是不一样的,
taxInfo.StartPoint = taxInfo.IsForeign ? 4800 : 3500;
taxInfo.TaxableIncome = taxInfo.Income - taxInfo.Golds - taxInfo.StartPoint;
decimal rate, deduct;
//不需要纳税,应纳税额小于等于0
if (taxInfo.TaxableIncome <= 0)
{
taxInfo.Rate = 0;
taxInfo.Deduct = 0;
taxInfo.Tax = 0;
taxInfo.IncomeAfterTax = taxInfo.Income;
}//下面是需要纳税部分
else
{
//获取对应的税率与速算扣除数
getRateAndDeduct(taxInfo.TaxableIncome, out rate, out deduct);
taxInfo.Rate = rate;
taxInfo.Deduct = deduct;
taxInfo.Tax = taxInfo.TaxableIncome * taxInfo.Rate - taxInfo.Deduct;
taxInfo.IncomeAfterTax = taxInfo.Income - taxInfo.Golds - taxInfo.Tax;
}
return taxInfo;
}
/// <summary>
/// 获取对应的税率与速算扣除数,采用最新七级超额累进个人所得税税率表
/// </summary>
/// <param name="taxableIncome">应纳税所得额</param>
/// <param name="rate">适用税率</param>
/// <param name="deduct">速算扣除数</param>
private static void getRateAndDeduct(decimal taxableIncome, out decimal rate, out decimal deduct)
{
if (taxableIncome <= 1500)
{
rate = 3; deduct = 0;
}
else if (taxableIncome > 1500 && taxableIncome <= 4500)
{
rate = 10; deduct = 105;
}
else if (taxableIncome > 4500 && taxableIncome <= 9000)
{
rate = 20; deduct = 555;
}
else if (taxableIncome > 9000 && taxableIncome <= 35000)
{
rate = 25; deduct = 1005;
}
else if (taxableIncome > 35000 && taxableIncome <= 55000)
{
rate = 30; deduct = 2755;
}
else if (taxableIncome > 55000 && taxableIncome <= 80000)
{
rate = 35; deduct = 5505;
}
else
{
rate = 45; deduct = 13505;
}
}
}
相关文章推荐
- Android最新源码4.3下载-教程 2013-11
- Android最新源码4.3下载-教程 2013-11
- 2012最新ANDROID框架源码下载方法
- 最新个人所得税计算器源码(含新旧税法比较功能)
- 飞鸽传书官方网站 2012 最新源码公开
- vs2013调试源码错位问题最新解决方法
- 百度腾讯QQ等网站注册自动提交表单源码2012最新
- Android最新源码4.3下载-教程 2013-11
- Android最新源码4.3下载-教程 2013-11
- Android最新源码4.3下载-教程 2013-11
- Android最新源码4.3下载-教程 2013-11
- 2012-2013最新泰晤士报和QS世界大学排名前100名单对比
- 2013最新仿易迅商城源码,精品模版,shopex内核,价值500元,VIP资源
- C#版采集程序源码
- VS2012、2013使用Mysql数据库创建EF的AOD.NET实体模型
- android 4.0.3最新源码下载编译
- jsp的request及增进研究【5】--系列总结与最新源码公开
- 精选最新优秀源码下载网站
- ecshop之transport和jquery冲突之完美解决方案2012最新
- Ubuntu下载Android源码(最新)