diff --git a/app/Services/EmploymentCertService.php b/app/Services/EmploymentCertService.php index a22e8e27..06e66b21 100644 --- a/app/Services/EmploymentCertService.php +++ b/app/Services/EmploymentCertService.php @@ -148,10 +148,9 @@ public function generatePdfResponse(array $content): \Illuminate\Http\Response $pdf->Ln(12); // 회사명 + 대표이사 + $ceoName = $content['ceo_name'] ?? ''; $pdf->SetFont($font, 'B', 14); - $pdf->Cell(0, 10, $content['company_name'] ?? '', 0, 1, 'C'); - $pdf->SetFont($font, '', 12); - $pdf->Cell(0, 10, '대표이사 (인)', 0, 1, 'C'); + $pdf->Cell(0, 10, ($content['company_name'] ?? '').' 대표이사 '.$ceoName.' (인)', 0, 1, 'C'); $pdfContent = $pdf->Output('', 'S'); $fileName = '재직증명서_'.($content['name'] ?? '').'.pdf'; diff --git a/resources/views/approvals/create.blade.php b/resources/views/approvals/create.blade.php index 11e23655..8be7c080 100644 --- a/resources/views/approvals/create.blade.php +++ b/resources/views/approvals/create.blade.php @@ -674,6 +674,8 @@ function applyBodyTemplate(formId) { hire_date: document.getElementById('cert-hire-date').value, company_name: document.getElementById('cert-company').value, business_num: document.getElementById('cert-business-num').value, + ceo_name: document.getElementById('cert-ceo-name').value, + company_address: document.getElementById('cert-company-address').value, purpose: purpose, issue_date: document.getElementById('cert-issue-date').value, }; @@ -955,6 +957,8 @@ function closeExpenseLoadModal() { document.getElementById('cert-department').value = d.department || ''; document.getElementById('cert-position').value = d.position || ''; document.getElementById('cert-hire-date').value = d.hire_date ? d.hire_date + ' ~' : ''; + document.getElementById('cert-ceo-name').value = d.ceo_name || ''; + document.getElementById('cert-company-address').value = d.company_address || ''; } else { showToast(data.message || '사원 정보를 불러올 수 없습니다.', 'error'); } @@ -993,11 +997,12 @@ function openCertPreview() { const hireDate = document.getElementById('cert-hire-date').value || '-'; const purpose = getCertPurpose() || '-'; const issueDate = document.getElementById('cert-issue-date').value || '-'; + const ceoName = document.getElementById('cert-ceo-name').value || '-'; const issueDateFormatted = issueDate !== '-' ? issueDate.replace(/-/g, function(m, i) { return i === 4 ? '년 ' : '월 '; }) + '일' : '-'; const el = document.getElementById('cert-preview-content'); - el.innerHTML = buildCertPreviewHtml({ name, resident, address, company, businessNum, department, position, hireDate, purpose, issueDateFormatted }); + el.innerHTML = buildCertPreviewHtml({ name, resident, address, company, businessNum, department, position, hireDate, purpose, issueDateFormatted, ceoName }); document.getElementById('cert-preview-modal').style.display = ''; document.body.style.overflow = 'hidden'; @@ -1541,7 +1546,7 @@ function buildCertPreviewHtml(d) {

${e(d.company)}

-

대표이사            (인)

+

대표이사    ${e(d.ceoName)}    (인)

`; } diff --git a/resources/views/approvals/edit.blade.php b/resources/views/approvals/edit.blade.php index 1390f382..34b3894c 100644 --- a/resources/views/approvals/edit.blade.php +++ b/resources/views/approvals/edit.blade.php @@ -514,6 +514,8 @@ function applyBodyTemplate(formId) { document.getElementById('cert-department').value = certContent.department || ''; document.getElementById('cert-position').value = certContent.position || ''; document.getElementById('cert-hire-date').value = certContent.hire_date || ''; + document.getElementById('cert-ceo-name').value = certContent.ceo_name || ''; + document.getElementById('cert-company-address').value = certContent.company_address || ''; document.getElementById('cert-issue-date').value = certContent.issue_date || '{{ now()->format("Y-m-d") }}'; // 용도 복원 @@ -596,6 +598,8 @@ function applyBodyTemplate(formId) { hire_date: document.getElementById('cert-hire-date').value, company_name: document.getElementById('cert-company').value, business_num: document.getElementById('cert-business-num').value, + ceo_name: document.getElementById('cert-ceo-name').value, + company_address: document.getElementById('cert-company-address').value, purpose: purpose, issue_date: document.getElementById('cert-issue-date').value, }; @@ -704,6 +708,8 @@ function applyBodyTemplate(formId) { document.getElementById('cert-department').value = d.department || ''; document.getElementById('cert-position').value = d.position || ''; document.getElementById('cert-hire-date').value = d.hire_date ? d.hire_date + ' ~' : ''; + document.getElementById('cert-ceo-name').value = d.ceo_name || ''; + document.getElementById('cert-company-address').value = d.company_address || ''; } else { showToast(data.message || '사원 정보를 불러올 수 없습니다.', 'error'); } @@ -742,11 +748,12 @@ function openCertPreview() { const hireDate = document.getElementById('cert-hire-date').value || '-'; const purpose = getCertPurpose() || '-'; const issueDate = document.getElementById('cert-issue-date').value || '-'; + const ceoName = document.getElementById('cert-ceo-name').value || '-'; const issueDateFormatted = issueDate !== '-' ? issueDate.replace(/-/g, function(m, i) { return i === 4 ? '년 ' : '월 '; }) + '일' : '-'; const el = document.getElementById('cert-preview-content'); - el.innerHTML = buildCertPreviewHtml({ name, resident, address, company, businessNum, department, position, hireDate, purpose, issueDateFormatted }); + el.innerHTML = buildCertPreviewHtml({ name, resident, address, company, businessNum, department, position, hireDate, purpose, issueDateFormatted, ceoName }); document.getElementById('cert-preview-modal').style.display = ''; document.body.style.overflow = 'hidden'; @@ -831,7 +838,7 @@ function buildCertPreviewHtml(d) {

${e(d.company)}

-

대표이사            (인)

+

대표이사    ${e(d.ceoName)}    (인)

`; } diff --git a/resources/views/approvals/partials/_certificate-form.blade.php b/resources/views/approvals/partials/_certificate-form.blade.php index fcabdddb..f9cc054e 100644 --- a/resources/views/approvals/partials/_certificate-form.blade.php +++ b/resources/views/approvals/partials/_certificate-form.blade.php @@ -9,6 +9,8 @@ @endphp