2019年,计算工资的个人所得税税额函数,js

2019年个人所得税的免征额从3500元提升到了5000元,这意味着月工资在5000元以下的人都不需要缴纳个人所得税了。

参见2019年税率表:2019最新工资个人所得税税率表

js脚本计算2019年个人所得税的计算方法,返回结果是个人所得税的税额

function calculateIndividualIncomeTax(wages) {
    var newWages = wages;
    var currentTaxRateMinValue = 85000;
    var taxArray = new Array();
    var taxLevelRateArray = new Array();
    taxLevelRateArray[0] = {
        rate: 0.45,
        minValue: 85001
    };
    taxLevelRateArray[1] = {
        rate: 0.35,
        minValue: 60001
    };
    taxLevelRateArray[2] = {
        rate: 0.30,
        minValue: 40001
    };
    taxLevelRateArray[3] = {
        rate: 0.25,
        minValue: 25001
    };
    taxLevelRateArray[4] = {
        rate: 0.20,
        minValue: 17001
    };
    taxLevelRateArray[5] = {
        rate: 0.10,
        minValue: 8001
    };
    taxLevelRateArray[6] = {
        rate: 0.03,
        minValue: 5001
    };
    taxLevelRateArray[7] = {
        rate: 0.0,
        minValue: 1
    };
    var taxSum = 0;
    for (var i = 0; i < taxLevelRateArray.length; i++) {

        //计算每个范围的税率
        currentTaxRateMinValue = taxLevelRateArray[i].minValue; //比如:税率 0.35; 适用的范围:大于 60001
        if (newWages >= currentTaxRateMinValue) {
            taxArray[i] = (newWages - currentTaxRateMinValue) * taxLevelRateArray[i].rate;
            newWages = currentTaxRateMinValue - 1;
            taxSum = taxSum + taxArray[i]; //累加税的总额度
        }
        console.log("大于", currentTaxRateMinValue, ",Rate:", taxLevelRateArray[i].rate, ",Tax:", taxArray[i], ",newWages:", newWages);
    }
    return taxSum;
}


调用:calculateIndividualIncomeTax(85002)
输出的日志:

VM617:25 大于 85001 ,Rate: 0.45 ,Tax: 0.45 ,newWages: 85000
VM617:25 大于 60001 ,Rate: 0.35 ,Tax: 8749.65 ,newWages: 60000
VM617:25 大于 40001 ,Rate: 0.3 ,Tax: 5999.7 ,newWages: 40000
VM617:25 大于 25001 ,Rate: 0.25 ,Tax: 3749.75 ,newWages: 25000
VM617:25 大于 17001 ,Rate: 0.2 ,Tax: 1599.8000000000002 ,newWages: 17000
VM617:25 大于 8001 ,Rate: 0.1 ,Tax: 899.9000000000001 ,newWages: 8000
VM617:25 大于 5001 ,Rate: 0.03 ,Tax: 89.97 ,newWages: 5000
VM617:25 大于 1 ,Rate: 0 ,Tax: 0 ,newWages: 0
21089.22

 

版权声明:本文为wangqiideal原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/cmt/p/14580194.html?from=https%3A%2F%2Fwww.cnblogs.com%2Fwangqiideal%2Farticles%2F10031308.html