html和js制作个人所得税表格,【JS】计算个人所得税(新版)

首页

专栏

javascript

文章详情

0

计算个人所得税(新版)

114500.htmlniaogege发布于 今天 02:04

题目:

员工2015年入职,2019年每月应发工资均为30000元,每月减除费用5000元,“三险一金”等专项扣除为4500元,享受子女教育、赡养老人两项专项附加扣除共计2000元,没有减免收入及减免税额等情况,以前三个月为例,应当按照以下方法计算各月应预扣预缴税额:

1月份:(30000–5000-4500-2000)×3%=555元

2月份:(30000×2-5000×2-4500×2-2000×2)×10%-2520-555=625元

3月份:(30000×3-5000×3-4500×3-2000×3)×10%-2520-555-625=1850元

结论:上述计算结果表明,由于2月份累计预扣预缴应纳税所得额为37000元,已适用10%的税率,因此2月份和3月份应预扣预缴有所增高

新个人所得税税率表

c27a002dfb44a82d5ec55f30a82d4e96.png

代码化

输入: 应发工资/每月减除费用/五险一金扣除/专项附加扣除

输出:根据个人所得税预扣率表计算每个月的税额,也阔以计算年度税额

主要代码

个人计算税收

* {

margin: 0;

padding: 0

}

// 本期应预扣预缴税额=(累计预扣预缴应纳税所得额×预扣率-速算扣除数)-累计减免税额

// 累计预扣预缴应纳税所得额=累计免税收入-累计减除费用-累计专项扣除-累计专项附加扣除-累计依法确定的其他扣除

new Vue({

el: '#app',

template: `

每月应发工资(税前){{taxFreeIncome}}

每月减除费用 {{countDeduction}}

每月五险一金{{insurance}}

每月专项抵扣 {{specialAddOn}}

累积 {{monthNum}} 月

  • 第{{i + 1}}月 应缴费 {{item}}

年终 {{yearEndMonth}} 系数

年度总应付工资(税前) {{yearTotal}} 元

年度总税额 {{totalTax}} 元

年度到手工资 {{yearTotal - totalTax}}

平均月度到手工资 {{(yearTotal - totalTax) / 12 }}

计算

`,

data() {

return {

taxFreeIncome: 30000, // 应收工资

countDeduction: 5000,// 起征税

insurance: 4500, // 五险一金

specialAddOn: 2000, // 专项抵扣

monthNum: 12, // 累积几个月

monthTax: [], // 累积几个月显示

totalTax: 0, // 年度总共税收

yearTotal: 0, // 年度总收益税前

yearEndMonth: 0, // 年终系数

yearEndAward: 0, // 年终奖

}

},

methods: {

count() {

const arr = []

let prepaidIncome = 0; // 每月缴税

let totalTax = 0

for (let i = 1; i <= this.monthNum; i ++) {

const taxableIncome = (this.taxFreeIncome - this.countDeduction - this.insurance - this.specialAddOn) * i;

if (taxableIncome < 36000) {

prepaidIncome = Number((taxableIncome * 0.03) - totalTax);

} else if ( 36000 < taxableIncome <= 144000) {

prepaidIncome = Number(( taxableIncome * 0.1) - 2520 - totalTax);

} else if (144000 < taxableIncome <= 300000) {

prepaidIncome = ( taxableIncome * 0.2) - 16920 - totalTax;

} else if (300000 < taxableIncome <= 420000) {

prepaidIncome = ( taxableIncome * 0.25) - 31920 - totalTax;

} else if (420000 < taxableIncome <= 660000) {

prepaidIncome = ( taxableIncome * 0.3) - 52920 - totalTax;

} else if (660000 < taxableIncome <= 960000) {

prepaidIncome = ( taxableIncome * 0.35) - 85920 - totalTax;

} else if (taxableIncome > 960000) {

prepaidIncome = ( taxableIncome * 0.45) - 181920 - totalTax;

}

arr.push(prepaidIncome);

totalTax = arr.reduce((cur, total) => (cur + total), 0)

}

this.monthTax = arr

this.totalTax = totalTax;

this.yearTotal = this.taxFreeIncome * (12 + Number(this.yearEndMonth));

totalTax = 0

}

}

})

javascript前端vue.js

阅读 41更新于 今天 02:14

赞收藏

分享

本作品系原创,采用《署名-非商业性使用-禁止演绎 4.0 国际》许可协议

114500.html

niaogege

224声望

5粉丝

关注作者

0 条评论

得票时间

114500.html

提交评论

114500.html

niaogege

224声望

5粉丝

关注作者

宣传栏

目录

题目:

员工2015年入职,2019年每月应发工资均为30000元,每月减除费用5000元,“三险一金”等专项扣除为4500元,享受子女教育、赡养老人两项专项附加扣除共计2000元,没有减免收入及减免税额等情况,以前三个月为例,应当按照以下方法计算各月应预扣预缴税额:

1月份:(30000–5000-4500-2000)×3%=555元

2月份:(30000×2-5000×2-4500×2-2000×2)×10%-2520-555=625元

3月份:(30000×3-5000×3-4500×3-2000×3)×10%-2520-555-625=1850元

结论:上述计算结果表明,由于2月份累计预扣预缴应纳税所得额为37000元,已适用10%的税率,因此2月份和3月份应预扣预缴有所增高

新个人所得税税率表

c27a002dfb44a82d5ec55f30a82d4e96.png

代码化

输入: 应发工资/每月减除费用/五险一金扣除/专项附加扣除

输出:根据个人所得税预扣率表计算每个月的税额,也阔以计算年度税额

主要代码

个人计算税收

* {

margin: 0;

padding: 0

}

// 本期应预扣预缴税额=(累计预扣预缴应纳税所得额×预扣率-速算扣除数)-累计减免税额

// 累计预扣预缴应纳税所得额=累计免税收入-累计减除费用-累计专项扣除-累计专项附加扣除-累计依法确定的其他扣除

new Vue({

el: '#app',

template: `

每月应发工资(税前){{taxFreeIncome}}

每月减除费用 {{countDeduction}}

每月五险一金{{insurance}}

每月专项抵扣 {{specialAddOn}}

累积 {{monthNum}} 月

  • 第{{i + 1}}月 应缴费 {{item}}

年终 {{yearEndMonth}} 系数

年度总应付工资(税前) {{yearTotal}} 元

年度总税额 {{totalTax}} 元

年度到手工资 {{yearTotal - totalTax}}

平均月度到手工资 {{(yearTotal - totalTax) / 12 }}

计算

`,

data() {

return {

taxFreeIncome: 30000, // 应收工资

countDeduction: 5000,// 起征税

insurance: 4500, // 五险一金

specialAddOn: 2000, // 专项抵扣

monthNum: 12, // 累积几个月

monthTax: [], // 累积几个月显示

totalTax: 0, // 年度总共税收

yearTotal: 0, // 年度总收益税前

yearEndMonth: 0, // 年终系数

yearEndAward: 0, // 年终奖

}

},

methods: {

count() {

const arr = []

let prepaidIncome = 0; // 每月缴税

let totalTax = 0

for (let i = 1; i <= this.monthNum; i ++) {

const taxableIncome = (this.taxFreeIncome - this.countDeduction - this.insurance - this.specialAddOn) * i;

if (taxableIncome < 36000) {

prepaidIncome = Number((taxableIncome * 0.03) - totalTax);

} else if ( 36000 < taxableIncome <= 144000) {

prepaidIncome = Number(( taxableIncome * 0.1) - 2520 - totalTax);

} else if (144000 < taxableIncome <= 300000) {

prepaidIncome = ( taxableIncome * 0.2) - 16920 - totalTax;

} else if (300000 < taxableIncome <= 420000) {

prepaidIncome = ( taxableIncome * 0.25) - 31920 - totalTax;

} else if (420000 < taxableIncome <= 660000) {

prepaidIncome = ( taxableIncome * 0.3) - 52920 - totalTax;

} else if (660000 < taxableIncome <= 960000) {

prepaidIncome = ( taxableIncome * 0.35) - 85920 - totalTax;

} else if (taxableIncome > 960000) {

prepaidIncome = ( taxableIncome * 0.45) - 181920 - totalTax;

}

arr.push(prepaidIncome);

totalTax = arr.reduce((cur, total) => (cur + total), 0)

}

this.monthTax = arr

this.totalTax = totalTax;

this.yearTotal = this.taxFreeIncome * (12 + Number(this.yearEndMonth));

totalTax = 0

}

}

})

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个用JavaScript编写的个人所得税计算器的例子: ```javascript <!DOCTYPE html> <html> <head> <title>个人所得税计算器</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> body { font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; background-color: #f5f5f5; } h1 { text-align: center; margin-top: 50px; } form { max-width: 500px; margin: 0 auto; background-color: #fff; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0,0,0,0.2); } label { display: block; margin-bottom: 10px; } input[type="number"] { width: 100%; padding: 10px; border-radius: 5px; border: none; box-shadow: 0 0 5px rgba(0,0,0,0.2); margin-bottom: 20px; box-sizing: border-box; } input[type="submit"], input[type="reset"] { background-color: #4CAF50; color: #fff; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; margin-right: 10px; } input[type="reset"] { background-color: #f44336; } input[type="submit"]:hover, input[type="reset"]:hover { background-color: #3e8e41; } .result { margin-top: 20px; padding: 10px; background-color: #f0f0f0; border-radius: 5px; box-shadow: 0 0 5px rgba(0,0,0,0.2); } </style> </head> <body> <h1>个人所得税计算器</h1> <form onsubmit="return false;"> <label for="income">月收入(元):</label> <input type="number" id="income" required> <label for="threshold">起征额(元):</label> <input type="number" id="threshold" required> <input type="submit" value="计算" onclick="calculate()"> <input type="reset" value="重填"> </form> <div class="result" id="result"></div> <script type="text/javascript"> function calculate() { var income = document.getElementById("income").value; var threshold = document.getElementById("threshold").value; var tax = (income - threshold) * 0.1; if (tax < 0) { tax = 0; } document.getElementById("result").innerHTML = "所得税为:" + tax.toFixed(2) + "元"; } </script> </body> </html> ``` 这个计算器使用了HTML和JavaScript编写,可以在网页上直接使用。用户输入月收入和起征额后,点击“计算”按钮即可计算出所得税。如果需要重新输入,可以点击“重填”按钮清空输入框。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值