您的位置:首页 > 编程语言 > Python开发

2019最新个税计算_python

2019-01-02 21:17 302 查看

2019年的个税制度改得比较复杂,每个月交的都不一样,前面交得少,后面交得多,但和2018年全年交的总数是一样的,可以多拿一点点利息哈。最大的改变就是,加上专项优惠,2019年还是可以减点税的。


def tax(salary_pre, social_insurance, accumulation_fund, deduction):
"""根据税前月薪,社保比例,公积金比例,专项扣除
算出2019每月应交税额"""
temp = salary_pre * (1 - social_insurance - accumulation_fund) - 5000 - deduction
month1 = []
count = 0
# 计算新税
for i in range(1, 13):
k = int(temp * i)
if k <= 0:
rate_tax = 0
part_tax = 0
elif 0 < k <= 36000:
rate_tax = 0.03
part_tax = 0
elif 36000 < k <= 144000:
rate_tax = 0.1
part_tax = 2520
elif 144000 < k <= 300000:
rate_tax = 0.2
part_tax = 16920
elif 300000 < k <= 420000:
rate_tax = 0.25
part_tax = 31920
elif 420000 < k <= 660000:
rate_tax = 0.3
part_tax = 52920
elif 660000 < k <= 960000:
rate_tax = 0.35
part_tax = 85920
elif k > 960000:
rate_tax = 0.45
part_tax = 181920

month1.append(temp * i * rate_tax - part_tax - count)
count += month1[i-1]

year = round(sum(month1), 2)
month = [round(i, 2) for i in month1]
# 计算旧税
n = temp + deduction
if n <= 3000:
tax_pre = n * 0.03
elif 3000 < n <= 12000:
tax_pre = n * 0.1 - 210
elif 12000 < n <= 25000:
tax_pre = n * 0.1 - 210
elif 25000 < n <= 35000:
tax_pre = n * 0.1 - 210
elif 35000 < n <= 55000:
tax_pre = n * 0.1 - 210
elif 55000 < n <= 80000:
tax_pre = n * 0.1 - 210
elif n > 80000:
tax_pre = n * 0.1 - 210

tax_pre = round(tax_pre, 2)
year_pre = round(tax_pre * 12, 2)

print("2019各月交税:")
print(month)
print('2019全年交税:' + str(year))
print('税改前每月交税:' + str(tax_pre))
print('税改前全年交税:' + str(year_pre))

#填入税前月薪,社保比例,公积金比例,专项扣除
tax(30000, 0.1, 0.05, 1500)
20000
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: