feat: [approvals] 사용인감계 양식 추가
- 증명서 카테고리에 사용인감계(seal_usage) 양식 등록 - 입력 폼: 사용일자, 인감종류, 용도, 제출처, 비고 - 회사 정보 자동 로드 (테넌트 정보 기반) - 미리보기/인쇄 기능 (원본 DOCX 유사 레이아웃) - create/edit/show 3개 페이지 모두 지원
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
use App\Models\Finance\BankAccount;
|
||||
use App\Models\Finance\CorporateCard;
|
||||
use App\Models\Tenants\Tenant;
|
||||
use App\Models\Tenants\TenantSetting;
|
||||
use App\Services\ApprovalService;
|
||||
use App\Services\HR\LeaveService;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -41,8 +43,9 @@ public function create(Request $request): View|Response
|
||||
$lines = $this->service->getApprovalLines();
|
||||
[$cards, $accounts] = $this->getCardAndAccountData();
|
||||
$employees = app(LeaveService::class)->getActiveEmployees();
|
||||
$tenantInfo = $this->getTenantInfo();
|
||||
|
||||
return view('approvals.create', compact('forms', 'lines', 'cards', 'accounts', 'employees'));
|
||||
return view('approvals.create', compact('forms', 'lines', 'cards', 'accounts', 'employees', 'tenantInfo'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,8 +67,9 @@ public function edit(Request $request, int $id): View|Response
|
||||
$lines = $this->service->getApprovalLines();
|
||||
[$cards, $accounts] = $this->getCardAndAccountData();
|
||||
$employees = app(LeaveService::class)->getActiveEmployees();
|
||||
$tenantInfo = $this->getTenantInfo();
|
||||
|
||||
return view('approvals.edit', compact('approval', 'forms', 'lines', 'cards', 'accounts', 'employees'));
|
||||
return view('approvals.edit', compact('approval', 'forms', 'lines', 'cards', 'accounts', 'employees', 'tenantInfo'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,6 +122,31 @@ public function completed(Request $request): View|Response
|
||||
return view('approvals.completed');
|
||||
}
|
||||
|
||||
private function getTenantInfo(): array
|
||||
{
|
||||
$tenantId = session('selected_tenant_id');
|
||||
$tenant = Tenant::find($tenantId);
|
||||
|
||||
if (! $tenant) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$displaySetting = TenantSetting::withoutGlobalScopes()
|
||||
->where('tenant_id', $tenantId)
|
||||
->where('setting_group', 'company')
|
||||
->where('setting_key', 'display_company_name')
|
||||
->first();
|
||||
$displayName = $displaySetting?->setting_value ?? '';
|
||||
|
||||
return [
|
||||
'company_name' => ! empty($displayName) ? $displayName : ($tenant->company_name ?? ''),
|
||||
'business_num' => $tenant->business_num ?? '',
|
||||
'ceo_name' => $tenant->ceo_name ?? '',
|
||||
'address' => $tenant->address ?? '',
|
||||
'phone' => $tenant->phone ?? '',
|
||||
];
|
||||
}
|
||||
|
||||
private function getCardAndAccountData(): array
|
||||
{
|
||||
$tenantId = session('selected_tenant_id');
|
||||
|
||||
Reference in New Issue
Block a user