2020新版个税计算--年终奖计算[Java版]

2020-01-15  本文已影响0人  qiHuang112

前言

上篇文章介绍了如何计算自己的每月工资,那年终奖又是如何计算的呢?年终奖的计算其实更加简单,因为它并不存在起征点专项扣除等概念。也不需要扣除五险一金,下面让我们来计算一下年终奖吧。

计算税后年终奖

计算税后年终奖我们首先需要计算年终奖纳了多少税:
税后年终奖 = 税前年终奖 - 年终奖纳税
年终奖纳税 = 税前年终奖 * 税率 - 速算扣除数
年终奖纳税的税率速算扣除数需要查以下表格:

级数 累计预扣预缴应纳税所得额 预扣率(%) 速算扣除数
1 不超过3000元的部分 3 0
2 超过3000元至12000元的部分 10 210
3 超过12000元至25000元的部分 20 1410
4 超过25000元至35000元的部分 25 2660
5 超过35000元至55000元的部分 30 4410
6 超过55000元至80000元的部分 35 7160
7 超过80000元的部分 45 15160

Java代码

/**
 * @param bonus 税前年终奖
 */
public static double getYearEndBonus(double bonus) {
    // 年终奖应缴税
    double tax;
    // 累计应缴税额(累计应缴税额 * 税率 - 速算扣除数)
    if (bonus <= 36000.0) {
        tax = bonus * 0.03;
    } else if (bonus <= 144000.0) {
        tax = bonus * 0.1 - 210;
    } else if (bonus <= 300000.0) {
        tax = bonus * 0.2 - 1410;
    } else if (bonus <= 420000.0) {
        tax = bonus * 0.25 - 2660;
    } else if (bonus <= 660000.0) {
        tax = bonus * 0.30 - 4410;
    } else if (bonus <= 960000.0) {
        tax = bonus * 0.35 - 7160;
    } else {
        tax = bonus * 0.45 - 15160;
    }
    // 税后年终奖(税后年终奖 = 税前年终奖 - 年终奖缴税)
    return bonus - tax;
}

可是由于数算扣除数并没有按12个月来扣缴,只是扣除了一次,就导致会出现老板发的年终奖更多,反而你到手的少了的问题。下面的税前税后年终奖曲线图展示了这一点。


税前年终奖2W~4W时,税后年终奖曲线图 税前年终奖10W~20W时,税后年终奖曲线图
税前年终奖0W~100W时,税后年终奖曲线图
有兴趣的童鞋可以用下面代码自己跑跑,画出上面的图,不过需要有python环境以及matplotlib环境才可以哦。
from matplotlib import pyplot as plt

# plt设置支持中文
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei']


def get_index_from_sections(bonus, sections: list):
    """
    :param bonus:税前年终奖
    :param sections:根据年终奖划分的不同税率区间
    :return:返回年终奖所在税率区间
    """
    index = 0
    while index < len(sections) and bonus > sections[index]:
        index = index + 1
    return index


def get_year_end_bonus(bonus):
    """
    :param bonus: 税前年终奖
    :return:税后年终奖
    """
    sections = [36000, 144000, 300000, 420000, 660000, 960000]
    rates = [0.03, 0.1, 0.2, 0.25, 0.3, 0.35, 0.45]
    deductions = [0, 210, 1410, 2660, 4410, 7160, 15160]
    index = get_index_from_sections(bonus, sections)
    # 年终奖纳税 = 税前年终奖 * 税率 - 速算扣除数
    tax = bonus * rates[index] - deductions[index]
    # 税后年终奖 = 税前年终奖 - 年终奖纳税
    return bonus - tax


def plot_bonus(r=range(0, 1000000), point: int = 0):
    """
    :param r: 税前年终奖区间
    :param point: 需要标出的点(税前年终奖的值)
    """
    x = r
    y = [get_year_end_bonus(i) for i in x]
    plt.plot(x, y)
    plt.xlabel('税前年终奖')
    plt.ylabel('税后年终奖')

    if point != 0:
        plt.scatter(x=point, y=get_year_end_bonus(point))
        p1 = r'(%d, %d)' % (point, get_year_end_bonus(point))
        plt.annotate(p1, xy=(point, get_year_end_bonus(point)))
    plt.show()


if __name__ == '__main__':
    plot_bonus()
    # plot_bonus(r=range(20000, 40000), point=36000)
    # plot_bonus(r=range(100000, 200000), point=144000)

合理避税

从上面展示的图中,我们可以看出,在不少税前年终奖区间,年终奖高反而拿到的钱却少了,下面通过计算,给出一些合理避税的方案区间,当你的老板给你发年终奖的时候,如果落入这个区间,那就让老板少发点年终奖,让你和老板的收益最大化。
下面是通过计算得出来的区间:

def get_bad_sections():
    sections = [36000, 144000, 300000, 420000, 660000, 960000]
    rates = [0.03, 0.1, 0.2, 0.25, 0.3, 0.35, 0.45]
    deductions = [0, 210, 1410, 2660, 4410, 7160, 15160]

    def get_right(i):
        return (sections[i] - rates[i] * sections[i] + deductions[i] - deductions[i + 1]) / (1 - rates[i + 1])

    return [(sections[i], int(get_right(i))) for i in range(len(sections))]
if __name__ == '__main__':
    print(get_bad_sections())

# 结果
[(36000, 38566), (144000, 160500), (300000, 318333), (420000, 447500), (660000, 706538), (960000, 1120000)]
上一篇 下一篇

猜你喜欢

热点阅读