/**
* beginMoney 征收起点
* handMoeny 税后工资
*/
function deCalcPersonalTax(beginMoney,handMoney){
var critical = [0,500,2000,5000,20000,40000,60000,80000,100000];
var taxRates = [0.05,0.10,0.15,0.20,0.25,0.30,0.35,0.40,0.45];
var quickCalcNumbers = [0,25,125,375,1375,3375,6375,10375,15375];
var moneyRange = new Array();
for(var i = 0,j = critical.length;i < j;i++){
moneyRange.push(beginMoney + critical[i] - quickCalcNumbers[i]);
}
var index = 0;
for(var i = 0,j = moneyRange.length;i < j;i++){
if(moneyRange[i] > handMoney){
index = i - 1;
break;
}
}
var taxRate;
var quickCalcNumber;
if(index < 0){
taxRate = 0;
quickCalcNumber = 0;
}else{
taxRate = taxRates[index];
quickCalcNumber = quickCalcNumbers[index];
}
var totalMoney = (handMoney - beginMoney * taxRate - quickCalcNumber) / (1 - taxRate);
var tax = totalMoney - handMoney;
return {
"totalMoney" : totalMoney,
"tax" : tax
}
}