>  기사  >  백엔드 개발  >  세금 급여 계산 후

세금 급여 계산 후

巴扎黑
巴扎黑원래의
2016-11-12 13:02:371466검색

<?php
header("Content-type: text/html; charset=utf-8");
/*
薪水
住房公积金比率
养老保险比率
医疗保险比率
*/
function after_sleep($salary,$housefund_ratio=0.1,$person_insurance_ratio=.08,$medical_insurance_ratio=.04)
{
    $base = 3500;
    $housefund = $salary * $housefund_ratio;  #.10 .08
    $person_insurance = $salary * $person_insurance_ratio;
    $medical_insurance = $salary * $medical_insurance_ratio;
    $insurance=($housefund + $person_insurance +$medical_insurance);
  
    if ($salary - $insurance   < $base ){
       return $salary - $insurance;
    }
    $taxable_income= ($salary - $insurance -$base  );
        
     if ($taxable_income  <=1500 ){
        $ratio = .03;
        $deduct = 0;
    }else if ($taxable_income > 1500 && $taxable_income <=4500)    {
        $ratio = .1;
        $deduct = 105;
 
            
    }else if ($taxable_income > 4500 && $taxable_income <=9000)    {
        $ratio = .2;
        $deduct = 555;
 
    } else if ($taxable_income > 9000 && $taxable_income <= 35000)  {
        
        $ratio = .25;
        $deduct = 1005;
    } else if ($taxable_income > 35000 && $taxable_income <= 55000)    {
        $ratio = .3;
        $deduct = 2755;
    } 
   
    $tax = $taxable_income * $ratio-$deduct;
    
    $money = $salary -$insurance-$tax;
    return $money;
} 
 
echo "税前\t税后\n";
for ($i=5000;$i<=50000;$i+=3000)
echo  $i,"\t",after_sleep($i,.08),"\n";


성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.