- IncomeTaxBracket 모델 추가 (2024 간이세액표 DB 조회) - PayrollService 전면 개편: 4대보험 + 소득세 자동 계산 엔진 - 10,000천원 초과 고소득 구간 공식 계산 지원 - 과세표준 = 총지급액 - 식대(비과세), 10원 단위 절삭 - 일괄 생성(bulkGenerate), 전월 복사(copyFromPrevious) 기능 - 확정취소(unconfirm), 지급취소(unpay) 상태 관리 - 계산 미리보기(calculatePreview) 엔드포인트 추가 - 공제항목 수동 오버라이드(deduction_overrides) 지원 - Payroll 모델에 long_term_care, options 필드 추가
66 lines
3.1 KiB
PHP
66 lines
3.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V1\Payroll;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StorePayrollRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'user_id' => ['required', 'integer', 'exists:users,id'],
|
|
'pay_year' => ['required', 'integer', 'min:2000', 'max:2100'],
|
|
'pay_month' => ['required', 'integer', 'min:1', 'max:12'],
|
|
'base_salary' => ['required', 'numeric', 'min:0'],
|
|
'overtime_pay' => ['nullable', 'numeric', 'min:0'],
|
|
'bonus' => ['nullable', 'numeric', 'min:0'],
|
|
'allowances' => ['nullable', 'array'],
|
|
'allowances.*.name' => ['required_with:allowances', 'string', 'max:50'],
|
|
'allowances.*.amount' => ['required_with:allowances', 'numeric', 'min:0'],
|
|
'income_tax' => ['nullable', 'numeric', 'min:0'],
|
|
'resident_tax' => ['nullable', 'numeric', 'min:0'],
|
|
'health_insurance' => ['nullable', 'numeric', 'min:0'],
|
|
'pension' => ['nullable', 'numeric', 'min:0'],
|
|
'employment_insurance' => ['nullable', 'numeric', 'min:0'],
|
|
'deductions' => ['nullable', 'array'],
|
|
'deductions.*.name' => ['required_with:deductions', 'string', 'max:50'],
|
|
'deductions.*.amount' => ['required_with:deductions', 'numeric', 'min:0'],
|
|
'deduction_overrides' => ['nullable', 'array'],
|
|
'deduction_overrides.income_tax' => ['nullable', 'numeric', 'min:0'],
|
|
'deduction_overrides.resident_tax' => ['nullable', 'numeric', 'min:0'],
|
|
'deduction_overrides.health_insurance' => ['nullable', 'numeric', 'min:0'],
|
|
'deduction_overrides.long_term_care' => ['nullable', 'numeric', 'min:0'],
|
|
'deduction_overrides.pension' => ['nullable', 'numeric', 'min:0'],
|
|
'deduction_overrides.employment_insurance' => ['nullable', 'numeric', 'min:0'],
|
|
'family_count' => ['nullable', 'integer', 'min:1', 'max:11'],
|
|
'note' => ['nullable', 'string', 'max:1000'],
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'user_id' => __('validation.attributes.user_id'),
|
|
'pay_year' => __('validation.attributes.pay_year'),
|
|
'pay_month' => __('validation.attributes.pay_month'),
|
|
'base_salary' => __('validation.attributes.base_salary'),
|
|
'overtime_pay' => __('validation.attributes.overtime_pay'),
|
|
'bonus' => __('validation.attributes.bonus'),
|
|
'allowances' => __('validation.attributes.allowances'),
|
|
'income_tax' => __('validation.attributes.income_tax'),
|
|
'resident_tax' => __('validation.attributes.resident_tax'),
|
|
'health_insurance' => __('validation.attributes.health_insurance'),
|
|
'pension' => __('validation.attributes.pension'),
|
|
'employment_insurance' => __('validation.attributes.employment_insurance'),
|
|
'deductions' => __('validation.attributes.deductions'),
|
|
'note' => __('validation.attributes.note'),
|
|
];
|
|
}
|
|
}
|