计算每月扣税金额

最近个人所得税提案比较热,然后说开玩笑说等提上来,税都不用交了。然后随口一问,月薪10W,要扣多少税?

网上查了下,不同薪资的不同税收政策。薪资扣完五险一金后,税率如下:
tax_point
程序以每个挡位的薪资为键,税收为值,并设置最大税收,如下:

tax_dic = {1500:3,4500:10,9000:20,35000:25,55000:30,80000:35}
max_tax = 45

需扣除项(主要为:五险一金):

fare_dic = {"health_insurance":65,"social_security":256,"provident_fund":12,"tax_threshold":3500,"other":21}

除了“provident_fund”(公积金)的值为百分比,其他的值都为金额。
由于公积金每月金额会有上限,设置上限值为4654(以北京为例)处理如下:

provident_fund = lambda x:x*fare_dic["provident_fund"]*0.01 if x*fare_dic["provident_fund"]*0.01 < 4654 else 4654
# 假定每月薪资为10W
salary = 100000
# 五险一金费用
salary_reduce = provident_fund(salary) + fare_dic["social_security"] + fare_dic["health_insurance"] + fare_dic["other"]
# 需交税金额(薪资-五险一金相关费用-起征点)
salary_temp = salary - salary_reduce - fare_dic["tax_threshold"]

计算过程如下:

for key,value in sorted(tax_dic.items(), key = lambda x:x[0], reverse=False):
    if salary_temp < key:
        tax_fare += salary_temp*value*0.01
        print("tax_fare:%.2f,salary:%.2f" % (tax_fare, salary-tax_fare-salary_reduce))
        salary_temp = 0
        break
    else:
        tax_fare += key*value*0.01
    salary_temp -= key

# When your salary is really high, then you should deduct the tax to 45%.
if salary_temp > 0:
    tax_fare += salary_temp*max_tax*0.01
    print("tax_fare:%.2f,salary:%.2f" % (tax_fare, salary-tax_fare-salary_reduce))

若sorted 方法不熟悉,可参考前文 http://blog.csdn.net/ck3207/article/details/79381179
运行结果:

tax_fare:23496.20,salary:71507.80

即月薪十万:应交税额为23496.20,实际到账工资为:71507.80。
注:跟自己平时扣税相比,相差不大,可粗略估计。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值