最近个人所得税提案比较热,然后说开玩笑说等提上来,税都不用交了。然后随口一问,月薪10W,要扣多少税?
网上查了下,不同薪资的不同税收政策。薪资扣完五险一金后,税率如下:
程序以每个挡位的薪资为键,税收为值,并设置最大税收,如下:
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.youkuaiyun.com/ck3207/article/details/79381179
运行结果:
tax_fare:23496.20,salary:71507.80
即月薪十万:应交税额为23496.20,实际到账工资为:71507.80。
注:跟自己平时扣税相比,相差不大,可粗略估计。