feat: [payroll] 근로소득세 간이세액표 기반 자동 계산 기능

- IncomeTaxBracket 모델 생성 (DB 조회 방식)
- PayrollService: calculateIncomeTax DB 기반으로 리팩토링
- 10,000천원 초과 구간 공식 계산 (calculateHighIncomeTax)
- 지방소득세 10원 단위 절삭 적용
- 공제대상가족수(1~11명) 반영 (본인 + 피부양자)
- calculate API에 user_id 파라미터 추가
- 사원 select에 data-dependents 속성 추가
- 모달에 공제대상가족수 표시
This commit is contained in:
김보곤
2026-02-27 13:58:59 +09:00
parent 61a0cc2480
commit 62e8040304
4 changed files with 204 additions and 54 deletions

View File

@@ -406,13 +406,19 @@ public function calculate(Request $request): JsonResponse
'bonus' => 'nullable|numeric|min:0',
'allowances' => 'nullable|array',
'deductions' => 'nullable|array',
'user_id' => 'nullable|integer',
]);
$result = $this->payrollService->calculateAmounts($validated);
$familyCount = 1;
if (! empty($validated['user_id'])) {
$familyCount = $this->payrollService->resolveFamilyCount($validated['user_id']);
}
$result = $this->payrollService->calculateAmounts($validated, null, $familyCount);
return response()->json([
'success' => true,
'data' => $result,
'data' => array_merge($result, ['family_count' => $familyCount]),
]);
}
}