feat: [payroll] 공제항목 수동 수정 기능 추가 및 상여금→식대 변경

- 공제 6개 항목(국민연금/건강보험/장기요양/고용보험/소득세/지방소득세) 수동 수정 가능
- 수동 수정 시 노란색 배경으로 시각적 구분, 재계산 버튼으로 초기화
- 서버사이드 deduction_overrides 유효성 검증 및 적용 로직 추가
- 수정 모달에서 기존 공제값 복원 및 자동계산 비교로 수동 표시
- 상여금 → 식대 라벨 변경 (등록/상세/CSV)
This commit is contained in:
김보곤
2026-02-27 10:58:13 +09:00
parent 5314777c46
commit b5329eab3f
3 changed files with 209 additions and 22 deletions

View File

@@ -80,6 +80,13 @@ public function store(Request $request): JsonResponse
'deductions' => 'nullable|array',
'deductions.*.name' => 'required_with:deductions|string',
'deductions.*.amount' => 'required_with:deductions|numeric|min:0',
'deduction_overrides' => 'nullable|array',
'deduction_overrides.pension' => 'nullable|numeric|min:0',
'deduction_overrides.health_insurance' => 'nullable|numeric|min:0',
'deduction_overrides.long_term_care' => 'nullable|numeric|min:0',
'deduction_overrides.employment_insurance' => 'nullable|numeric|min:0',
'deduction_overrides.income_tax' => 'nullable|numeric|min:0',
'deduction_overrides.resident_tax' => 'nullable|numeric|min:0',
'note' => 'nullable|string|max:500',
]);
@@ -122,6 +129,13 @@ public function update(Request $request, int $id): JsonResponse
'deductions' => 'nullable|array',
'deductions.*.name' => 'required_with:deductions|string',
'deductions.*.amount' => 'required_with:deductions|numeric|min:0',
'deduction_overrides' => 'nullable|array',
'deduction_overrides.pension' => 'nullable|numeric|min:0',
'deduction_overrides.health_insurance' => 'nullable|numeric|min:0',
'deduction_overrides.long_term_care' => 'nullable|numeric|min:0',
'deduction_overrides.employment_insurance' => 'nullable|numeric|min:0',
'deduction_overrides.income_tax' => 'nullable|numeric|min:0',
'deduction_overrides.resident_tax' => 'nullable|numeric|min:0',
'note' => 'nullable|string|max:500',
]);
@@ -296,7 +310,7 @@ public function export(Request $request): StreamedResponse
$file = fopen('php://output', 'w');
fwrite($file, "\xEF\xBB\xBF"); // UTF-8 BOM
fputcsv($file, ['사원명', '부서', '기본급', '고정연장근로수당', '상여금', '총지급액', '국민연금', '건강보험', '장기요양보험', '고용보험', '근로소득세', '지방소득세', '총공제액', '실수령액', '상태']);
fputcsv($file, ['사원명', '부서', '기본급', '고정연장근로수당', '식대', '총지급액', '국민연금', '건강보험', '장기요양보험', '고용보험', '근로소득세', '지방소득세', '총공제액', '실수령액', '상태']);
foreach ($payrolls as $payroll) {
$profile = $payroll->user?->tenantProfiles?->first();