四月莺飞草长,心情荡漾,清明小长假还有赶在路上的51黄金周,简直不能更愉快~然而,工资日到来的时候,有朋友傻眼了,前几月都挺正常的,为啥突然之间工资单少了快1000元???神马情况???(✿◡‿◡)。HR和会计小姐姐们好无奈,导入新个税系统算的,核实了好多遍都是这样,真不是她们算错了。。。。
进入正题,各位大大,你需要了解2019年新个税啦~~~
并不认真的新个税简介
详细请看
文章目录:2019新个税累计预扣法
Excel计算请参考这个
2019年新个税税率表及新个税政策下如何扣个税)
总之,2019年开始个税是按照年度计算的累计预扣缴税.
1、根据累计预扣预缴应纳税所得额算等级,也就是税率。
2、这个累计预扣预缴应纳税所得额=年度累计总收入-年度减除费用(5000每月)-年度累计专项扣除(也就是五险一金)-年度累计专项附加扣除(也就是租房补贴等)
所以工资掉下来的朋友,暴露了你们的高收入,你们已经升到累计预扣预缴应纳税所得额算二级啦,这个月开始个税预扣率由3%变成10%啦,基本上突变会发生在每次升级时候,貌似突变后的工资都会低于个人年均工资,也就是说相对而言前几个月工资比较多。
python计算个税并对比五险一金额度对总收入的影响
以月收入15000,五险一金500元为例,效果图如下。其中红线是年均税后月收入,绿线是应缴税累加值,蓝色柱形是每月应发工资。单位:元。
同时对比提高五险一金额度到1000元前后的收入情况,可以看到年度缴税总额减少了600元,即:月平均工资下降450元,五险一金账户月提高500元,少缴税部分进入了五险一金账户。
- 纯属练手,仅供参考,如实际工资有出入,敬请谅解。
- PS:没考虑各位大大们的高额年终奖,这个扣税我还不会算
- PS:从2019年1月开始累积预扣算税,不管1月发的是2018年12月的工资还是2019年1月的工资
- PS:或许应该考虑分段求算税收,后期改进再干
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def net_pay_calc(salary_list=[10000,10000,20000],social_insurance_fund=2010.65,
social_insurance_addition_fund=1500):
"""
函数:计算几个月的税后工资
输入:
salary_list = [10000,10000,20000] #你的税前工资序列
social_insurance_fund = 2010.65 #你的五险一金钱数或序列
social_insurance_addition_fund = 1500 #你的专项附加扣除
输出:
打印这几个月的税后工资
"""
basic_fee = 5000 #减除费用:基本生活保障基数
if isinstance(salary_list,list):
pass
else:
salary_list = [salary_list]
month = len(salary_list)
if isinstance(basic_fee,float) or isinstance(basic_fee,int):
basic_fee = [basic_fee] * month
if isinstance(social_insurance_fund,float) or isinstance(social_insurance_fund,int):
social_insurance_fund = [social_insurance_fund] * month
if isinstance(social_insurance_addition_fund,float) or isinstance(social_insurance_addition_fund,int):
social_insurance_addition_fund = [social_insurance_addition_fund] * month
i = 1
tax_pay_list = [] #累计预扣预缴应纳税所得额
net_pays = []
while True:
print('*'*50)
salary_sum = sum(salary_list[:i]) #累计收入
basic_fee_sum = sum(basic_fee[:i]) #累计减除费用
social_insurance_fund_sum = sum(social_insurance_fund[:i]) #累计专项扣除
social_insurance_addition_fund_sum = sum(social_insurance_addition_fund[:i]) #累计专项附加扣除
#累计预扣预缴应纳税所得额 = 累计收入-累计减除费用-累计专项扣除-累计专项附加扣除
taxable_income = salary_sum - (basic_fee_sum + social_insurance_fund_sum + social_insurance_addition_fund_sum)
taxable_income = taxable_income if taxable_income>0 else 0
#预扣率
rate = np.where(taxable_income <= 36000,0.03,
np.where(taxable_income <= 144000,0.1,
np.where(taxable_income <= 300000,0.2,
np.where(taxable_income <= 420000,0.25,
np.where(taxable_income <= 660000,0.3,
np.where(taxable_income <= 960000,0.35,0.4))))))
#速算扣除数
quick_deduction = np.where(taxable_income <= 36000,0,
np.where(taxable_income <= 144000,2520,
np.where(taxable_income <= 300000,16920,
np.where(taxable_income <= 420000,31920,
np.where(taxable_income <= 660000,52920,
np.where(taxable_income <= 960000,85920,181920))))))
print("%d月份税前收入:%.2f 元"%(i,salary_list[i-1]))
print("本月预扣率%.2f,速算扣除数%d"%(rate,quick_deduction))
#本期应预扣预缴税额=(累计预扣预缴应纳税所得额*预扣率-速算扣除数-累计已预扣预缴税额
tax_paid = tax_pay_list[i-2] if i>1 else 0 #累计已预扣预缴税额
tax_due = taxable_income * rate - quick_deduction #i月累计预扣应缴纳税额
tax_pay_list.append(tax_due)
tax_of_month = tax_due - tax_paid #本期应预扣预缴税额
net_pay = salary_list[i-1] - social_insurance_fund[i-1] - tax_of_month
net_pays.append(net_pay)
print("本月累计预扣预缴应纳税所得额:%.2f,本月预扣率%.2f,速算扣除数%d"%(taxable_income,rate,quick_deduction))
print("本月累计应纳税额:%.2f,累计已缴税额:%.2f,本月应缴税额%.2f"%(tax_due,tax_paid,tax_of_month))
print("本月的应发工资是:%.2f 元"%(net_pay))
if i == month:
break
else:
i += 1
return net_pays,tax_pay_list
#===============================================================
if __name__ == "__main__":
salary_list = eval(input("请输入你的税前工资序列:"))
social_insurance_fund = eval(input("再请输入你的五险一金数或序列:"))
social_insurance_addition_fund = eval(input("最后请输入你的专项附加扣除额度:"))
cmp = eval(input("是否通过修改五险一金数来对比实际收入差别(是:1,否:0):"))
net_pays,tax_pay_list = net_pay_calc(salary_list,social_insurance_fund,social_insurance_addition_fund)
if cmp:
social_insurance_fund2 = eval(input("再请输入你的五险一金数:"))
net_pays2,tax_pay_list2 = net_pay_calc(salary_list,social_insurance_fund2,social_insurance_addition_fund)
print('工资是:%.2f(RMB)'%salary_list[0])
print('如果五险一金费用是%.2f,年度总缴税%.2f,月平均工资是%.2f'%(np.mean(social_insurance_fund),tax_pay_list[-1],np.mean(net_pays)))
print('如果五险一金费用是%.2f,年度总缴税%.2f,月平均工资是%.2f'%(social_insurance_fund2,tax_pay_list2[-1],np.mean(net_pays2)))
fig, (ax0, ax1) = plt.subplots(2, 1, sharex=True)
ax0.bar(np.arange(len(salary_list))+1,net_pays, align='center',color='SkyBlue', ecolor='black')
# ax0.set_xlabel('Month')
ax0.set_ylabel('Net Pay(RMB)')
ax0.set_ylim(min(net_pays)*0.95,max(net_pays)*1.05)
ax0.set_title('Average social_insurance_fund:%.2f'%(np.mean(social_insurance_fund)))
# ax0.set_title('social_insurance_fund:%d'%social_insurance_fund)
ax0.axhline(y=np.mean(net_pays),linestyle='--',color='r')
ax02 = ax0.twinx() # instantiate a second axes that shares the same x-axis
color = 'tab:green'
ax02.set_ylabel('Tax Paid', color=color) # we already handled the x-label with ax1
ax02.plot(np.arange(len(salary_list))+1, tax_pay_list,'*-', color=color,ms=10)
ax02.tick_params(axis='y', labelcolor=color)
ax1.bar(np.arange(len(salary_list))+1,net_pays2, align='center',color='SkyBlue', ecolor='black')
ax1.set_xlabel('Month')
ax1.set_ylabel('Net Pay(RMB)')
ax1.set_ylim(min(net_pays2)*0.95,max(net_pays2)*1.05)
ax1.set_title('Average social_insurance_fund:%.2f'%social_insurance_fund2)
ax1.axhline(y=np.mean(net_pays2),linestyle='--',color='r')
ax12 = ax1.twinx() # instantiate a second axes that shares the same x-axis
color = 'tab:green'
ax12.set_ylabel('Tax Paid', color=color) # we already handled the x-label with ax1
ax12.plot(np.arange(len(salary_list))+1, tax_pay_list2,'*-', color=color,ms=10)
ax12.tick_params(axis='y', labelcolor=color)
else:
print('工资序列是:%s(RMB),\n五险一金费用序列是%s,\n年度总缴税%.2f'%(salary_list,social_insurance_fund,tax_pay_list[-1]))
fig, ax0 = plt.subplots()
ax0.bar(np.arange(len(salary_list))+1,net_pays, align='center',color='SkyBlue', ecolor='black')
ax0.set_xlabel('Month')
ax0.set_ylabel('Net Pay(RMB)')
ax0.set_ylim(min(net_pays)*0.95,max(net_pays)*1.05)
ax0.set_title('Average social_insurance_fund:%.2f'%(np.mean(social_insurance_fund)))
ax0.axhline(y=np.mean(net_pays),linestyle='--',color='r')
ax02 = ax0.twinx() # instantiate a second axes that shares the same x-axis
color = 'tab:green'
ax02.set_ylabel('Tax Paid', color=color) # we already handled the x-label with ax1
ax02.plot(np.arange(len(salary_list))+1, tax_pay_list,'*-', color=color,ms=10)
ax02.tick_params(axis='y', labelcolor=color)