个人所得税计算

VC实现的小工具:http://goc.ac.cn/liuag/html/software_calculatorx.html

个人所得税计算_第1张图片

计算公式很简单,程序一看就明白。PS:那时个税起征点是1600,现在都2000了,^-^

//根据税前工资和个税起征点计算所得税
double calculateTax(double presalary, double base)
{
   double tax;
   double TaxSalary = presalary - base;
   if(TaxSalary < 0) {
    tax = 0;
   }else if(TaxSalary <= 500) {
    tax = TaxSalary * 0.05;
   }else if(TaxSalary <= 2000 ) {
    tax = TaxSalary * 0.10 - 25;
   }else if(TaxSalary <= 5000) {
    tax = TaxSalary * 0.15 - 125;
   }else if(TaxSalary <= 20000) {
    tax = TaxSalary * 0.20 - 375;
   }else if(TaxSalary <= 40000) {
    tax = TaxSalary * 0.25 - 1375;
   }else if(TaxSalary <= 60000) {
    tax = TaxSalary * 0.30 - 3375;
   }else if(TaxSalary <= 80000) {
    tax = TaxSalary * 0.35 - 6375;
   }else if(TaxSalary <= 100000) {
    tax = TaxSalary * 0.40 - 10375;
   }else {
    tax = TaxSalary * 0.45 - 15875; 
   }
  
   return tax;
}
//根据税后工资和个税起征点计算税前工资
double calculateSalaryPretax(double postsalary, double base)
{
   double presalary;
   double TaxSalary = postsalary - base;
   double tax_rate, fast_number;
 
   if(TaxSalary <= 0) {
    return postsalary;
   }
   if(TaxSalary <= 475) {
    tax_rate = 0.05;
    fast_number = 0;
   }else if(TaxSalary <= 1875) {
    tax_rate = 0.10;
    fast_number = 25;
   }else if(TaxSalary <= 4375) {
    tax_rate = 0.15;
    fast_number = 125;
   }else if(TaxSalary <= 16375) {
    tax_rate = 0.20;
    fast_number = 375;
   }else if(TaxSalary <= 31375) {
    tax_rate = 0.25;
    fast_number = 1375;
   }else if(TaxSalary <= 45375) {
    tax_rate = 0.30;
    fast_number = 3375;
   }else if(TaxSalary <= 58375) {
    tax_rate = 0.35;
    fast_number = 6375;
   }else if(TaxSalary <= 70375) {
    tax_rate = 0.40;
    fast_number = 10375;
   }else {
    tax_rate = 0.45;
    fast_number = 15375;
   }
   presalary = (postsalary-(base * tax_rate) -fast_number) / (1 - tax_rate);
   return presalary;
}
(刘爱贵 / Aiguille.LIU)

你可能感兴趣的:(个人所得税计算)