首页 > 代码库 > 假如某人年薪100万,如何分配月发和年终奖会使其纳税金额最少
假如某人年薪100万,如何分配月发和年终奖会使其纳税金额最少
目的:假如某人年薪100万,如何分配月发和年终奖会使其纳税金额最少
规则:月发工资纳税计算方法
级数 | 工资含税级距 | 税率 | 速算扣除数 |
1 | 0-1500 | 3% | 0 |
2 | 1500-4500 | 10% | 105 |
3 | 4500-9000 | 20% | 555 |
4 | 9000-35000 | 25% | 1005 |
5 | 35000-55000 | 30% | 2755 |
6 | 55000-80000 | 35% | 5505 |
7 | 80000以上 | 45% | 13505 |
纳税公式为:(月工资金额-3500)*对应税率-速算扣除数
假如某员工月发金额为5500元,其纳税金额为:
年终奖纳税规则:
1、发放年终奖的当月工资高于3500元时,年终奖扣税方式为:年终奖*税率-速算扣除数,税率是按年终奖/12作为“应纳税所得额”对应的税率。
2、当月工资低于3500元时,年终奖个人所得税=(年终奖-(3500-月工资))*税率-速算扣除数,税率是按年终奖-(3500-月工资)除以12作为“应纳税所得额”对应的税率。
(规则2可不遵守,主要满足规则1即可,因为涉及纳税都是工资高的,工资低的可忽略)
假如某员工年终奖为6.6万,起纳税为:
先判断纳税等级,即66000/12=5500元(在纳税等级第二等级),故纳税金额为:
最想要的效果是假如此人年薪要求税后100万,该如何设置其月发和年终奖金额?(税后100万,就要将纳税金额考虑在工资范围内)
%% 工资税率最小计算
clc;
clear all;
close all;
totalIncome = 1000000;
[tatalTax ,taxOfMonth]= CalculateTotalTax(0,totalIncome);
for i = 100:100:floor(totalIncome/12)
[tatalTax_temp,taxlOfMonth_temp] = CalculateTotalTax(i,totalIncome);
if tatalTax_temp < tatalTax
tatalTax = tatalTax_temp;
taxOfMonth = taxlOfMonth_temp;
incomeOfMonth = i + taxOfMonth;
rewardOfYear = totalIncome - i * 12;
end
end
totalRewardOfYear = rewardOfYear + (tatalTax - taxOfMonth*12 );
function [tatalTax ,taxOfmonth]= CalculateTotalTax(income,totalIncome)
%计算纳税总额;
% totalIncome = 1000000;
if income > totalIncome/12
tatalTax = inf;
return;
elseif income < 0;
tatalTax = inf;
return;
end
rewardOfYear = totalIncome - income * 12;
[taxRate,QuickDeduction ] = myTax( income,true );
tatalTax = (income - 3500) * taxRate - QuickDeduction;
taxOfmonth = tatalTax ;
tatalTax = tatalTax * 12;
if income > 3500;
[taxRate,QuickDeduction ] = myTax(rewardOfYear/12,false );
tatalTax = tatalTax + rewardOfYear * taxRate -QuickDeduction;
else
rewardOfYear = rewardOfYear - (3500 - income);
if rewardOfYear < 0
rewardOfYear = 0;
end
[taxRate,QuickDeduction ] = myTax( rewardOfYear/12,false );
tatalTax = tatalTax + rewardOfYear * taxRate -QuickDeduction;
end
end
function [taxRate,QuickDeduction ] = myTax( salary,flag )
%实现税率和速算扣除数的查找
%月工资要减3500元年终奖除以12后;
if flag == true
if salary <= 3500
taxRate = 0;
QuickDeduction = 0;
return;
end
taxSalary = salary - 3500;%这个使计算工资的纳税部分;
else
taxSalary = salary;%这个计算年终奖的纳税;
end
switch true
case taxSalary <= 1500
taxRate = 0.03;
QuickDeduction = 0;
case taxSalary <= 4500;
taxRate = 0.1;
QuickDeduction = 105;
case taxSalary <= 9000;
taxRate = 0.2;
QuickDeduction = 555;
case taxSalary <= 35000;
taxRate = 0.25;
QuickDeduction = 1005;
case taxSalary <= 55000;
taxRate = 0.3;
QuickDeduction = 2755;
case taxSalary <= 80000;
taxRate = 0.35;
QuickDeduction = 5505;
otherwise
taxRate = 0.45;
QuickDeduction = 13505;
end
end
假如某人年薪100万,如何分配月发和年终奖会使其纳税金额最少