2019年個人所得稅計算函數


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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM