2018年最新稿酬个税计算方法 C#实现

2018年最新稿酬个税计算方法 C#实现,需要注意金额的小数位数,稿酬所得个税计算器 默认税率20%,费用扣除金额可能会有2位以上的小数,以及个税金额要做四舍五入处理。

public class WritingTax

{

public WritingTax()

{

//

// TODO: 在此处添加构造函数逻辑

//

}

//实际税率为百分之十四

///

/// 稿酬所得个税计算器 默认税率20%

///

///

///

public static WritingInfo Calc(decimal income)

{

return Calc(income, 0.2m);

}

public static WritingInfo Calc(decimal income, decimal rate)

{

WritingInfo writingInfo = new WritingInfo

{

Income = income,

Rate = rate

};

decimal deduct = 800;

if (writingInfo.Income > 4000)

deduct = writingInfo.Income * 0.2m;

//费用扣除金额可能会有2位以上的小数

writingInfo.Deduct = Math.Round(deduct, 2, MidpointRounding.AwayFromZero);

writingInfo.TaxableIncome = writingInfo.Income - writingInfo.Deduct;

//个税金额做四舍五入

decimal tax = writingInfo.TaxableIncome * writingInfo.Rate;

writingInfo.Tax = Math.Round(tax, 2, MidpointRounding.AwayFromZero);

writingInfo.IncomeAT = writingInfo.Income - writingInfo.Tax;

return writingInfo;

}

}