个人所得税计算

153 阅读1分钟

《关于请教了会计小姐姐一下午才弄懂该怎么计算个税这件事》

147ECA29.gif

// 计算结果
/** 
* X月的个税=(X月以及X月之前的应缴纳所得额总和 - 五险一金*X - 起征点*X - 专项扣除*X) * 适用税率 - X月之前个税总和
* 
* 1月:(10000(工资) - 221.78(五险一金) - 1500(专项扣除) - 5000(起征点) = 3278.22 ) * (3278.22 < 36000 = 3%(适用税率)) - 0(速算扣除数)
* 12月:(120000(累计工资) - 2661.36(累计五险一金) - 18000(累计专项扣除) - 60000(累计起征点) = 39338.64 ) * (36000 < 39338.64 < 144000 = 30%(适用税率)) - 2520(速算扣除数)
* 
* salary			工资			10000
* socialSecurityValue 		社保			
* accumulationFundValue	        公积金	           +社保 221.78
* specialProjectValue		专项附加扣除             1500
* thresholdTotal		起征点			5000
*/
result() {
    const that = this
    that.list = []
    let salary = that.salary
    let socialSecurity = that.socialSecurityValue
    let accumulationFund = that.accumulationFundValue
    let specialProject = that.specialProjectValue

    // 累计薪资
    let salaryTotal = 0;
    // 起征点
    let thresholdTotal = 0;
    // 累计社保
    let socialSecurityTotal = 0;
    // 累计公积金
    let accumulationFundTotal = 0;
    // 累计专项附加扣除
    let specialProjectTotal = 0;
    let payments = [];
    // 速算扣除
    for (let i = 0; i < 12; i++) {
	salaryTotal += Number(salary)
	socialSecurityTotal += Number(socialSecurity)
	accumulationFundTotal += Number(accumulationFund)
	specialProjectTotal += Number(specialProject)
	thresholdTotal += 5000

	const should = (salaryTotal - thresholdTotal - socialSecurityTotal - accumulationFundTotal - specialProjectTotal)

	// 税率
	const taxRate = that.calculate(should)
	// 速算扣除
	const mbtMens = that.mbtMen(taxRate)
	// 累计缴纳
	let tatol = should * that.calculate(should) - mbtMens
	payments.push(tatol)
	//当月缴纳
	const now = payments[i] - (payments[i - 1] || 0)
	// 应纳税所得额
	const taxableIncome = salaryTotal - thresholdTotal - socialSecurityTotal - accumulationFundTotal - specialProjectTotal
	// 税后工资
	const wage = Number(salary) - Number(socialSecurity) - Number(accumulationFund) - now

	console.log(
		i + 1 + '月:',
		// '累计工资:', salaryTotal,
		// '累计社保:', socialSecurityTotal,
		// '累计公积金:', accumulationFundTotal,
		// '累计专项附加扣除:', specialProjectTotal,
		// '起征点:', thresholdTotal,
		// '税率:', that.calculate(should),
		'应纳税所得额:', taxableIncome,
		'累计缴纳:', tatol,
		'当月应缴:', now,
		'本月税后收入', wage
                );
            }
    },
// 税率计算
calculate(value) {
	let result = 0;
	if (value <= 36000) {
		result = 0.03;
	} else if (value > 36000 && value <= 144000) {
		result = 0.1;
	} else if (value > 144000 && value <= 300000) {
		result = 0.2;
	} else if (value > 300000 && value <= 420000) {
		result = 0.25;
	} else if (value > 420000 && value <= 660000) {
		result = 0.3;
        } else if (value > 660000 && value <= 960000) {
		result = 0.35;
	} else if (value > 960000) {
		result = 0.45;
	}
	return result;
    },
// 速算扣除数
mbtMen(value) {
	let result = 0;
	if (value == 0.03) {
		result = 0;
	} else if (value == 0.1) {
		result = 2520;
	} else if (value == 0.2) {
		result = 16920;
	} else if (value == 0.25) {
		result = 31920;
	} else if (value == 0.3) {
		result = 52920;
	} else if (value == 0.35) {
		result = 85920;
	} else if (value == 0.45) {
		result = 181920;
	}
	return result;
}