Skip to content

Instantly share code, notes, and snippets.

@sinri
Created December 25, 2019 07:12
Show Gist options
  • Save sinri/3b3aaee8fbd9bc62e15cc4fc870a5d32 to your computer and use it in GitHub Desktop.
Save sinri/3b3aaee8fbd9bc62e15cc4fc870a5d32 to your computer and use it in GitHub Desktop.
中华人民共和国2019年度年终奖税后到手金额计算函数
function realGetYearBonus($ori){
$x=$ori/12.0;
if($x<=3000){
$taxRate=3;
$quick=0;
}
elseif($x<=12000){
$taxRate=10;
$quick=210;
}
elseif($x<=25000){
$taxRate=20;
$quick=1410;
}
elseif($x<=35000){
$taxRate=25;
$quick=2660;
}
elseif($x<=55000){
$taxRate=30;
$quick=4410;
}
elseif($x<=80000){
$taxRate=35;
$quick=7160;
}
else{
$taxRate=45;
$quick=15160;
}
return $ori-($ori*($taxRate/100.0)-$quick);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment