- PayslipMail Mailable 클래스 생성 (admin@codebridge-x.com 발송) - 급여명세서 이메일 템플릿 (전통 한국식 양식) - 이메일 발송 API 엔드포인트 추가 (POST /payrolls/{id}/send-payslip) - 목록 테이블에 이메일 발송 아이콘 버튼 추가 - 급여명세서 미리보기 모달 + 인쇄 기능
107 lines
5.0 KiB
PHP
107 lines
5.0 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<style>
|
|
body { font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; margin: 0; padding: 20px; background: #f5f5f5; }
|
|
.container { max-width: 720px; margin: 0 auto; background: #fff; padding: 40px 36px; }
|
|
h1 { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 2px; margin: 0 0 28px; border-bottom: 3px solid #333; padding-bottom: 16px; }
|
|
.info-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
|
|
.info-table td { padding: 6px 10px; font-size: 13px; border: 1px solid #999; }
|
|
.info-table .label { font-weight: 600; background: #f0f0f0; width: 70px; white-space: nowrap; }
|
|
.info-table .value { min-width: 100px; }
|
|
.payslip-table { width: 100%; border-collapse: collapse; margin-bottom: 0; }
|
|
.payslip-table th, .payslip-table td { border: 1px solid #999; padding: 7px 12px; font-size: 13px; }
|
|
.payslip-table th { background: #e8e8e8; font-weight: 700; text-align: center; letter-spacing: 4px; }
|
|
.payslip-table .item-name { text-align: center; }
|
|
.payslip-table .item-amount { text-align: right; font-variant-numeric: tabular-nums; }
|
|
.payslip-table .total-row td { font-weight: 700; background: #f8f8f8; }
|
|
.payslip-table .net-row td { font-weight: 800; font-size: 14px; background: #f0f7ff; }
|
|
.footer { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 12px; font-size: 12px; color: #666; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>{{ $payslipData['pay_year'] }}년{{ str_pad($payslipData['pay_month'], 2, '0', STR_PAD_LEFT) }}월분 급여명세서</h1>
|
|
|
|
{{-- 사원 정보 --}}
|
|
<table class="info-table">
|
|
<tr>
|
|
<td class="label">사원코드</td>
|
|
<td class="value">{{ $payslipData['employee_code'] ?? '-' }}</td>
|
|
<td class="label">사원명</td>
|
|
<td class="value">{{ $payslipData['employee_name'] ?? '-' }}</td>
|
|
<td class="label">입사일</td>
|
|
<td class="value">{{ $payslipData['hire_date'] ?? '-' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">부 서</td>
|
|
<td class="value">{{ $payslipData['department'] ?? '-' }}</td>
|
|
<td class="label">직 급</td>
|
|
<td class="value">{{ $payslipData['position'] ?? '-' }}</td>
|
|
<td class="label">호 봉</td>
|
|
<td class="value">{{ $payslipData['grade'] ?? '-' }}</td>
|
|
</tr>
|
|
</table>
|
|
|
|
{{-- 지급/공제 내역 --}}
|
|
@php
|
|
$payments = $payslipData['payments'] ?? [];
|
|
$deductionItems = $payslipData['deduction_items'] ?? [];
|
|
$maxRows = max(count($payments), count($deductionItems));
|
|
@endphp
|
|
<table class="payslip-table">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 25%;">지 급 내 역</th>
|
|
<th style="width: 25%;">지 급 액</th>
|
|
<th style="width: 25%;">공 제 내 역</th>
|
|
<th style="width: 25%;">공 제 액</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@for($i = 0; $i < $maxRows; $i++)
|
|
<tr>
|
|
<td class="item-name">{{ $payments[$i]['name'] ?? '' }}</td>
|
|
<td class="item-amount">{{ isset($payments[$i]['amount']) ? number_format($payments[$i]['amount']) : '' }}</td>
|
|
<td class="item-name">{{ $deductionItems[$i]['name'] ?? '' }}</td>
|
|
<td class="item-amount">{{ isset($deductionItems[$i]['amount']) ? number_format($deductionItems[$i]['amount']) : '' }}</td>
|
|
</tr>
|
|
@endfor
|
|
|
|
{{-- 빈 행 (최소 높이 확보) --}}
|
|
@for($i = $maxRows; $i < 8; $i++)
|
|
<tr>
|
|
<td class="item-name"> </td>
|
|
<td class="item-amount"></td>
|
|
<td class="item-name"></td>
|
|
<td class="item-amount"></td>
|
|
</tr>
|
|
@endfor
|
|
|
|
{{-- 공제액계 --}}
|
|
<tr class="total-row">
|
|
<td class="item-name"></td>
|
|
<td class="item-amount"></td>
|
|
<td class="item-name" style="font-weight: 700; letter-spacing: 4px;">공 제 액 계</td>
|
|
<td class="item-amount">{{ number_format($payslipData['total_deductions'] ?? 0) }}</td>
|
|
</tr>
|
|
|
|
{{-- 지급액계 / 차인지급액 --}}
|
|
<tr class="net-row">
|
|
<td class="item-name" style="letter-spacing: 4px;">지 급 액 계</td>
|
|
<td class="item-amount">{{ number_format($payslipData['gross_salary'] ?? 0) }}</td>
|
|
<td class="item-name" style="letter-spacing: 2px;">차인지급액</td>
|
|
<td class="item-amount">{{ number_format($payslipData['net_salary'] ?? 0) }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<div class="footer">
|
|
<span>귀하의 노고에 감사드립니다.</span>
|
|
<span>㈜코드브릿지엑스(CodebridgeX)</span>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|