- Payroll, PayrollSetting 모델 생성 - PayrollService 구현 (CRUD, 자동계산, 간이세액표, 일괄생성) - Web/API 컨트롤러 생성 (HTMX/JSON 이중 응답) - 급여 목록, 통계 카드, 급여 설정 뷰 생성 - 라우트 추가 (web.php, api.php) - 상태 흐름: draft → confirmed → paid
42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\HR;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\HR\Payroll;
|
|
use App\Services\HR\PayrollService;
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Response;
|
|
|
|
class PayrollController extends Controller
|
|
{
|
|
public function __construct(
|
|
private PayrollService $payrollService
|
|
) {}
|
|
|
|
/**
|
|
* 급여관리 페이지
|
|
*/
|
|
public function index(Request $request): View|Response
|
|
{
|
|
if ($request->header('HX-Request')) {
|
|
return response('', 200)->header('HX-Redirect', route('hr.payrolls.index'));
|
|
}
|
|
|
|
$stats = $this->payrollService->getMonthlyStats();
|
|
$departments = $this->payrollService->getDepartments();
|
|
$employees = $this->payrollService->getActiveEmployees();
|
|
$settings = $this->payrollService->getSettings();
|
|
$statusMap = Payroll::STATUS_MAP;
|
|
|
|
return view('hr.payrolls.index', [
|
|
'stats' => $stats,
|
|
'departments' => $departments,
|
|
'employees' => $employees,
|
|
'settings' => $settings,
|
|
'statusMap' => $statusMap,
|
|
]);
|
|
}
|
|
}
|