作者 何书鹏
1 个管道 的构建 通过 耗费 8 秒

汇缴基数

... ... @@ -36,8 +36,6 @@ class AfterToBefore extends Api
"param": { //已填的选项
"salary_hand_average": "8000",
"add_money": "1500",
"social_base": "",
"housing_fund_base": "",
"housing_fund_rate": ""
},
"salary_average": 9753.2, //税前平均每月工资
... ... @@ -250,7 +248,9 @@ class AfterToBefore extends Api
"name": "After-tax monthly salary"
}
]
}
},
"social_base": 9753.2, //社保汇缴基数
"housing_fund_base": 9753.2 //公积金汇缴基数
}
})
*/
... ... @@ -259,8 +259,6 @@ class AfterToBefore extends Api
$param = $this->request->param(); //返回给前端
$salary_hand_average = $this->request->param('salary_hand_average',0);
$add_money = $this->request->param('add_money',0);
$social_base = $this->request->param('social_base');
$housing_fund_base = $this->request->param('housing_fund_base');
$housing_fund_rate = $this->request->param('housing_fund_rate');
empty($salary_hand_average) && $this->error('请输入税后平均每月工资');
if(empty($add_money)){
... ... @@ -268,22 +266,6 @@ class AfterToBefore extends Api
}
$social_top = 28017; //社保封顶金额
$social_bottom = 4927; //社保保底金额
// // 社保基数
// if(!empty($social_base)){
// $social_base > $social_top && $this->error('社保汇缴基数不能大于'.$social_top);
// $social_base < $social_bottom && $this->error('社保汇缴基数不能小于'.$social_bottom);
// }else{
// $social_base = $salary > $social_top ? $social_top : ($salary < $social_bottom ? $social_bottom : $salary);
// }
// $housing_fund_top = 28017; //公积金封顶金额
// $housing_fund_bottom = 2480; //公积金保底金额
// // 公积金基数
// if(!empty($housing_fund_base)){
// $housing_fund_base > $housing_fund_top && $this->error('公积金汇缴基数不能大于'.$housing_fund_top);
// $housing_fund_base < $housing_fund_bottom && $this->error('公积金汇缴基数不能小于'.$housing_fund_bottom);
// }else{
// $housing_fund_base = $salary > $housing_fund_top ? $housing_fund_top : ($salary < $housing_fund_bottom ? $housing_fund_bottom : $salary);
// }
// 公积金缴存比例5%-7%
$social_rate_user = Db::name('social_insurance_rate')->where('id',1)->find();
$social_rate_company = Db::name('social_insurance_rate')->where('id',2)->find();
... ... @@ -364,7 +346,7 @@ class AfterToBefore extends Api
],
];
// 五险一金汇缴明细-个人合计
$social_user_money = array_sum(array_map(function($val){return $val['money'];}, $social_user));
$social_user_money = round(array_sum(array_map(function($val){return $val['money'];}, $social_user)),2);
// 五险一金汇缴明细-单位
$social_company = [
'housing_fund' => [
... ... @@ -508,7 +490,11 @@ class AfterToBefore extends Api
]
],$user_go['en']),
];
$this->success('请求成功',compact('param','salary_average','social_user','social_user_money','social_company','social_company_money','person_fee_average','company_cost','user_go','company_go'));
// 社保汇缴基数
$social_base = $salary_average > 28017 ? 28017 : ($salary_average < 4927 ? 4927 : $salary_average);
// 公积金汇缴基数
$housing_fund_base = $social_base;
$this->success('请求成功',compact('param','salary_average','social_user','social_user_money','social_company','social_company_money','person_fee_average','company_cost','user_go','company_go','social_base','housing_fund_base'));
}
}
... ...
... ... @@ -856,8 +856,6 @@
"param": { //已填的选项
"salary_hand_average": "8000",
"add_money": "1500",
"social_base": "",
"housing_fund_base": "",
"housing_fund_rate": ""
},
"salary_average": 9753.2, //税前平均每月工资
... ... @@ -1070,7 +1068,9 @@
"name": "After-tax monthly salary"
}
]
}
},
"social_base": 9753.2, //社保汇缴基数
"housing_fund_base": 9753.2 //公积金汇缴基数
}
}</pre>
</div>
... ... @@ -4745,7 +4745,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2020-09-29 14:46:54 </div>
Generated on 2020-10-09 09:32:24 </div>
<div class="col-md-6" align="right">
<a href="./" target="_blank">工资计算器</a>
</div>
... ...