|
|
@@ -71,7 +71,10 @@ class PersonSalaryService extends Service
|
|
|
$unit[] = [
|
|
|
'main_id' => $id,
|
|
|
'employee_id' => $value['employee_id'],
|
|
|
- 'salary' => $value['salary'],
|
|
|
+ 'base_salary' => $value['base_salary'],
|
|
|
+ 'performance_salary' => $value['performance_salary'],
|
|
|
+ 'bonus' => $value['bonus'],
|
|
|
+ 'other' => $value['other'],
|
|
|
'social_insurance' => $value['social_insurance'],
|
|
|
'public_housing_fund' => $value['public_housing_fund'],
|
|
|
'crt_time' => $time,
|
|
|
@@ -85,7 +88,7 @@ class PersonSalaryService extends Service
|
|
|
private function getDetail($id){
|
|
|
$data = MonthlyPsOrderDetails::where('del_time',0)
|
|
|
->where('main_id', $id)
|
|
|
- ->select('employee_id', 'salary', 'social_insurance', 'public_housing_fund')
|
|
|
+ ->select('employee_id', 'base_salary', 'social_insurance', 'public_housing_fund', 'performance_salary', 'bonus', 'other')
|
|
|
->get()->toArray();
|
|
|
|
|
|
$id = array_column($data,'employee_id');
|
|
|
@@ -208,12 +211,18 @@ class PersonSalaryService extends Service
|
|
|
if(empty($data['details'])) return [false, '人员月度工时单明细不能为空'];
|
|
|
foreach ($data['details'] as $key => $value){
|
|
|
if(empty($value['employee_id'])) return [false, '人员不能为空'];
|
|
|
- $res = $this->checkNumber($value['salary'],2,'non-negative');
|
|
|
- if(! $res['valid']) return [false,'工资:' . $res['error']];
|
|
|
+ $res = $this->checkNumber($value['base_salary'],2,'non-negative');
|
|
|
+ if(! $res['valid']) return [false,'基本工资:' . $res['error']];
|
|
|
+ $res = $this->checkNumber($value['performance_salary'],2,'non-negative');
|
|
|
+ if(! $res['valid']) return [false,'绩效工资:' . $res['error']];
|
|
|
$res = $this->checkNumber($value['social_insurance'],2,'non-negative');
|
|
|
if(! $res['valid']) return [false,'社保:' . $res['error']];
|
|
|
$res = $this->checkNumber($value['public_housing_fund'],2,'non-negative');
|
|
|
if(! $res['valid']) return [false,'公积金:' . $res['error']];
|
|
|
+ $res = $this->checkNumber($value['bonus'],2,'non-negative');
|
|
|
+ if(! $res['valid']) return [false,'奖金工资:' . $res['error']];
|
|
|
+ $res = $this->checkNumber($value['other'],2,'non-negative');
|
|
|
+ if(! $res['valid']) return [false,'其他:' . $res['error']];
|
|
|
$data['details'][$key]['top_depart_id'] = $data['top_depart_id'];
|
|
|
}
|
|
|
list($status, $msg) = $this->checkArrayRepeat($data['details'],'employee_id','人员');
|
|
|
@@ -305,9 +314,12 @@ class PersonSalaryService extends Service
|
|
|
$res[$item->main_id][] = [
|
|
|
'employee_number' => $tmpEmp ? $tmpEmp->number : '',
|
|
|
'employee_title' => $tmpEmp ? $tmpEmp->title : '',
|
|
|
- 'salary' => $item->salary,
|
|
|
+ 'base_salary' => $item->base_salary,
|
|
|
'social_insurance' => $item->social_insurance,
|
|
|
'public_housing_fund' => $item->public_housing_fund,
|
|
|
+ 'performance_salary' => $item->performance_salary,
|
|
|
+ 'bonus' => $item->bonus,
|
|
|
+ 'other' => $item->other,
|
|
|
];
|
|
|
}
|
|
|
return $res; // 返回 [main_id => [detail_row, detail_row]]
|