[Python] 年终奖税后计算器

去年年终奖比前年涨了一些,但实际到手反而少了,当时只知道是因为税率提了一档导致的,但没有深究为什么

最近研究了一下,发现这就是著名的年终奖一元陷阱

年终奖的税率计算是,先把年终奖平分到12个月,根据个人所得税税率表找到对应的税率

于是年终奖扣税 = 年终奖×对应税率 - 速算扣除数

如果年终奖多了1块钱,进入下一档税率,根据跨度,会多扣5到15个点,但对应的速扣数没有增加12倍,就导致了年终奖多发一元,实际到手少很多的年终奖一元陷阱

 

 

 

举例说明,假如13薪和年终奖一起发,两个加一起算总年终奖。

比如13薪是10000,年终奖44000,总年终奖是54000,得出54000/12 = 1500, 查表得出用10%那档税率, 实际到手 = 54000 - (54000 × 10% - 105) = 48705

假如年终奖涨了1000,总年终奖变成55000,55000/12 = 4583, 查表得出用20% 那档税率, 实际到手 = 55000 - (55000 × 20% - 555) =44555

税率档从10%升到20%,所以虽然总年终奖多了1000,但扣的税多了5150,导致实际到手反而少了4150

 

代码如下

def taxRate(bonus,thirteen_month_salary):

    total = bonus + thirteen_month_salary
    base = total/12

    if base < 0:
        bonus_tax = 0
    if base <= 1500:
        bonus_tax = total * 0.03
    elif base > 1500 and base <= 4500:
        bonus_tax = total * 0.1 - 105
    elif base > 4500 and base <= 9000:
        bonus_tax = total * 0.2 - 555
    elif base > 9000 and base <= 35000:
        bonus_tax = total * 0.25 - 1005
    elif base > 35000 and base <= 55000:
        bonus_tax = total * 0.3 - 2755
    elif base > 55000 and base <= 80000:
        bonus_tax = total * 0.35 - 5505
    elif base > 80000:
        bonus_tax = total * 0.45 - 13505

    print('Bonus tax payable is : %d' % bonus_tax)

    return bonus_tax

def BonusAfterTax(bonus, thirteen_month_salary):
    # 纳税额
    tax = taxRate(bonus,thirteen_month_salary)

    # 税后bonus
    bonus_after_tax = bonus + thirteen_month_salary - tax

    print('Bonus after tax is : %d' % bonus_after_tax)
    print('bonus_after_tax percentage is : %.2f %%' % float(bonus_after_tax * 100 / (bonus + thirteen_month_salary)))

    return bonus_after_tax



if __name__ == '__main__':
    bonus_before_tax = int(input('Please input your Bonus before tax:'))
    thirteen_month_salary = int(input('Please input your 13rd Salary before tax:'))
    BonusAfterTax(bonus_before_tax, thirteen_month_salary)

 

如果速扣数也能对应增加12倍,年终奖一元陷阱就解决了

同样总年终奖从54000涨到55000,如果速扣数相应增加12倍,得出税后年终奖从49860涨到50660

这样税前年终奖涨1000,实际到手涨800,而不是少4150,这才符合期望

 

期待税法能早点把这个失误改过来

 

 代码如下

def bonusTaxRate(bonus,thirteen_month_salary):

    total = bonus + thirteen_month_salary
    base = total/12

    if base < 0:
        bonus_tax = 0
    if base <= 1500:
        bonus_tax = total * 0.03
    elif base > 1500 and base <= 4500:
        bonus_tax = total * 0.1 - 105
    elif base > 4500 and base <= 9000:
        bonus_tax = total * 0.2 - 555
    elif base > 9000 and base <= 35000:
        bonus_tax = total * 0.25 - 1005
    elif base > 35000 and base <= 55000:
        bonus_tax = total * 0.3 - 2755
    elif base > 55000 and base <= 80000:
        bonus_tax = total * 0.35 - 5505
    elif base > 80000:
        bonus_tax = total * 0.45 - 13505

    print('Bonus tax payable is : %d' % bonus_tax)

    return bonus_tax


def bonusAfterTax(bonus, thirteen_month_salary):
    # 纳税额
    tax = bonusTaxRate(bonus,thirteen_month_salary)

    # 税后bonus
    bonus_after_tax = bonus + thirteen_month_salary - tax

    print('Bonus after tax is : %d' % bonus_after_tax)
    print('bonus_after_tax percentage is : %.2f %%' % float(bonus_after_tax * 100 / (bonus + thirteen_month_salary)))
    print('                 ')

    return bonus_after_tax



def newBonusTaxRate(bonus, thirteen_month_salary):

    total = bonus + thirteen_month_salary
    base = total / 12
  #速扣数相应增大12倍
    if base < 0:
        bonus_tax = 0
    if base <= 1500:
        bonus_tax = total * 0.03
    elif base > 1500 and base <= 4500:
        bonus_tax = total * 0.1 - 105 * 12
    elif base > 4500 and base <= 9000:
        bonus_tax = total * 0.2 - 555 * 12
    elif base > 9000 and base <= 35000:
        bonus_tax = total * 0.25 - 1005 * 12
    elif base > 35000 and base <= 55000:
        bonus_tax = total * 0.3 - 2755 * 12
    elif base > 55000 and base <= 80000:
        bonus_tax = total * 0.35 - 5505 * 12
    elif base > 80000:
        bonus_tax = total * 0.45 - 13505 * 12

    print('New bonus tax payable is : %d' % bonus_tax)

    return bonus_tax


def newBonusAfterTax(bonus, thirteen_month_salary):
    total = bonus + thirteen_month_salary

    # 纳税额
    new_bonus_tax = newBonusTaxRate(bonus,thirteen_month_salary)

    # 税后bonus
    bonus_after_tax = total - new_bonus_tax

    print('New Bonus after tax is : %d' % bonus_after_tax)
    print('New bonus_after_tax percentage is : %.2f %%' % float(bonus_after_tax * 100 / total))
    print('                ')

    return bonus_after_tax

if __name__ == '__main__':
    bonus_before_tax = int(input('Please input your Bonus before tax:'))
    thirteen_month_salary = int(input('Please input your 13rd Salary before tax:'))
    bonusAfterTax(bonus_before_tax, thirteen_month_salary)
    newBonusAfterTax(bonus_before_tax, thirteen_month_salary)

 

转载于:https://www.cnblogs.com/FiaFia/p/8581234.html

2019年实施专项扣除、累计个税及税后工资计算器 2019年新个税下累计预扣法如何计算 根据2018年12月21日最新出炉的“国家税务总局公告2018年第61号 ”国家税务总局关于发布《个人所得税扣缴申报管理办法(试行)》的公告第六条 ,扣缴义务人向居民个人支付工资、薪金所得当按照累计预扣法计算预扣税款,并按月办理扣缴申报。 累计预扣的定义 累计预扣法,是指扣缴义务人在一个纳税年度内预扣预缴税款,以纳税人在本单位截至当前月份工资、薪金所得累计收入减除累计免税收入、累计减除费用、累计专项扣除、累计专项附加扣除和累计依法确定的其他扣除后的余额为累计预扣预缴纳税所得额,计算累计预扣预缴税额,再减除累计减免税额和累计已预扣预缴税额,其余额为本期预扣预缴税额。余额为负值,暂不退税。纳税年度终了后余额仍为负值,由纳税人通过办理综合所得年度汇算清缴,税款多退少补 预扣预缴个税下计算公式 本期预扣预缴税额=(累计预扣预缴纳税所得额×预扣率-速算扣除数)-累计减免税额-累计已预扣预缴税额 累计预扣预缴纳税所得额=累计收入-累计免税收入-累计减除费用-累计专项扣除-累计专项附加扣除-累计依法确定的其他扣除 (其中:累计减除费用,按照5000元/月乘以纳税人当年截至本月在本单位的任职受雇月份数计算。)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值