feat: [esign] 근로계약서 작성 시 사원 연봉 자동 반영
- 사원검색 API에 연봉 금액 포함 - 사원 선택 시 연봉 총금액/월급여 템플릿 변수 자동 채움
This commit is contained in:
@@ -112,6 +112,8 @@ public function searchEmployees(Request $request): JsonResponse
|
||||
$birthDay = substr($rn, 4, 2);
|
||||
}
|
||||
|
||||
$salaryInfo = $emp->getSalaryInfo();
|
||||
|
||||
return [
|
||||
'id' => $emp->id,
|
||||
'name' => $emp->user?->name,
|
||||
@@ -125,6 +127,7 @@ public function searchEmployees(Request $request): JsonResponse
|
||||
'birth_year' => $birthYear,
|
||||
'birth_month' => $birthMonth,
|
||||
'birth_day' => $birthDay,
|
||||
'annual_salary' => $salaryInfo['annual_salary'] ?? null,
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
@@ -953,6 +953,9 @@ className={`w-full text-left px-3 py-2.5 rounded-lg mb-1 transition-colors ${i =
|
||||
// 입사일에서 년/월/일 분리
|
||||
let hireYear = '', hireMonth = '', hireDay = '';
|
||||
let endYear = '', endMonth = '', endDay = '';
|
||||
// 연봉 금액 포맷
|
||||
const annualSalary = emp.annual_salary ? Number(emp.annual_salary).toLocaleString() : '';
|
||||
const monthlySalary = emp.annual_salary ? Math.round(emp.annual_salary / 12).toLocaleString() : '';
|
||||
if (emp.hire_date) {
|
||||
const hd = emp.hire_date.replace(/-/g, '');
|
||||
if (hd.length >= 8) {
|
||||
@@ -1009,6 +1012,14 @@ className={`w-full text-left px-3 py-2.5 rounded-lg mb-1 transition-colors ${i =
|
||||
'계약.*연도': hireYear,
|
||||
'계약.*월$': hireMonth,
|
||||
'계약.*일$': hireDay,
|
||||
// 연봉 금액 (사원관리 연봉정보에서 자동 반영)
|
||||
'연봉.*총.*금액': annualSalary,
|
||||
'연봉.*금액': annualSalary,
|
||||
'연봉액': annualSalary,
|
||||
'연간.*급여': annualSalary,
|
||||
'연봉$': annualSalary,
|
||||
'월.*급여': monthlySalary,
|
||||
'월급': monthlySalary,
|
||||
};
|
||||
|
||||
setMetadata(prev => {
|
||||
|
||||
Reference in New Issue
Block a user