diff --git a/app/Services/Sales/SalesDevelopmentApprovalService.php b/app/Services/Sales/SalesDevelopmentApprovalService.php index bad33a04..1d2effbd 100644 --- a/app/Services/Sales/SalesDevelopmentApprovalService.php +++ b/app/Services/Sales/SalesDevelopmentApprovalService.php @@ -65,7 +65,7 @@ public function getStats(): array public function getPendingApprovals(?string $search = null, int $perPage = 10): LengthAwarePaginator { $query = SalesTenantManagement::query() - ->with(['tenant', 'salesPartner.user', 'manager']) + ->with(['tenant', 'tenantProspect', 'salesPartner.user', 'manager']) ->where('sales_progress', 100) ->where('manager_progress', 100) ->where('hq_status', SalesTenantManagement::HQ_STATUS_PENDING); @@ -96,7 +96,7 @@ public function getInProgressItems(?string $search = null, int $perPage = 10): L ]; $query = SalesTenantManagement::query() - ->with(['tenant', 'salesPartner.user', 'manager']) + ->with(['tenant', 'tenantProspect', 'salesPartner.user', 'manager']) ->where('sales_progress', 100) ->where('manager_progress', 100) ->whereIn('hq_status', $progressStatuses); @@ -118,7 +118,7 @@ public function getInProgressItems(?string $search = null, int $perPage = 10): L public function getCompletedItems(?string $search = null, int $perPage = 10): LengthAwarePaginator { $query = SalesTenantManagement::query() - ->with(['tenant', 'salesPartner.user', 'manager']) + ->with(['tenant', 'tenantProspect', 'salesPartner.user', 'manager']) ->where('hq_status', SalesTenantManagement::HQ_STATUS_HANDOVER); // 검색 @@ -233,6 +233,7 @@ public function getDetail(int $id): SalesTenantManagement { return SalesTenantManagement::with([ 'tenant', + 'tenantProspect', 'salesPartner.user', 'manager', 'contractProducts.product', diff --git a/resources/views/sales/development/partials/completed-list.blade.php b/resources/views/sales/development/partials/completed-list.blade.php index 3108afaa..804a22da 100644 --- a/resources/views/sales/development/partials/completed-list.blade.php +++ b/resources/views/sales/development/partials/completed-list.blade.php @@ -12,14 +12,17 @@ @forelse($completedItems as $item) @php $tenant = $item->tenant; - $companyName = $tenant?->company_name ?? '알 수 없음'; + $prospect = $item->tenantProspect; + $companyName = $tenant?->company_name ?? $prospect?->company_name ?? '알 수 없음'; + $representativeName = $tenant?->representative_name ?? $prospect?->ceo_name ?? '-'; + $businessNumber = $tenant?->business_number ?? $prospect?->business_number ?? '-'; @endphp
{{ $companyName }}
- {{ $tenant?->representative_name ?? '-' }} | {{ $tenant?->business_number ?? '-' }} + {{ $representativeName }} | {{ $businessNumber }}
diff --git a/resources/views/sales/development/partials/detail-modal.blade.php b/resources/views/sales/development/partials/detail-modal.blade.php index f9c438e7..921ccea1 100644 --- a/resources/views/sales/development/partials/detail-modal.blade.php +++ b/resources/views/sales/development/partials/detail-modal.blade.php @@ -1,7 +1,15 @@ {{-- 상세 정보 모달 --}} @php $tenant = $management->tenant; - $companyName = $tenant?->company_name ?? '알 수 없음'; + $prospect = $management->tenantProspect; + + // 테넌트 또는 가망고객에서 정보 가져오기 + $companyName = $tenant?->company_name ?? $prospect?->company_name ?? '알 수 없음'; + $businessNumber = $tenant?->business_number ?? $prospect?->business_number ?? '-'; + $representativeName = $tenant?->representative_name ?? $prospect?->ceo_name ?? '-'; + $phone = $tenant?->phone ?? $prospect?->contact_phone ?? '-'; + $address = $tenant?->address ?? $prospect?->address ?? '-'; + $currentHqStep = $hqStatusOrder[$management->hq_status ?? 'pending'] ?? 0; @endphp @@ -10,7 +18,7 @@

{{ $companyName }}

-

{{ $tenant?->business_number ?? '-' }}

+

{{ $businessNumber }}

- {{-- 테넌트 정보 --}} + {{-- 고객 정보 --}}

고객 정보

업체명
-
{{ $tenant?->company_name ?? '-' }}
+
{{ $companyName }}
사업자번호
-
{{ $tenant?->business_number ?? '-' }}
+
{{ $businessNumber }}
대표자
-
{{ $tenant?->representative_name ?? '-' }}
+
{{ $representativeName }}
연락처
-
{{ $tenant?->phone ?? '-' }}
+
{{ $phone }}
주소
-
{{ $tenant?->address ?? '-' }}
+
{{ $address }}
diff --git a/resources/views/sales/development/partials/pending-list.blade.php b/resources/views/sales/development/partials/pending-list.blade.php index fc364862..df9785b8 100644 --- a/resources/views/sales/development/partials/pending-list.blade.php +++ b/resources/views/sales/development/partials/pending-list.blade.php @@ -12,14 +12,17 @@ @forelse($pendingItems as $item) @php $tenant = $item->tenant; - $companyName = $tenant?->company_name ?? '알 수 없음'; + $prospect = $item->tenantProspect; + $companyName = $tenant?->company_name ?? $prospect?->company_name ?? '알 수 없음'; + $representativeName = $tenant?->representative_name ?? $prospect?->ceo_name ?? '-'; + $businessNumber = $tenant?->business_number ?? $prospect?->business_number ?? '-'; @endphp
{{ $companyName }}
- {{ $tenant?->representative_name ?? '-' }} | {{ $tenant?->business_number ?? '-' }} + {{ $representativeName }} | {{ $businessNumber }}
{{ $item->updated_at->format('m/d') }}
diff --git a/resources/views/sales/development/partials/progress-list.blade.php b/resources/views/sales/development/partials/progress-list.blade.php index a0595cd9..445c5018 100644 --- a/resources/views/sales/development/partials/progress-list.blade.php +++ b/resources/views/sales/development/partials/progress-list.blade.php @@ -12,7 +12,10 @@ @forelse($progressItems as $item) @php $tenant = $item->tenant; - $companyName = $tenant?->company_name ?? '알 수 없음'; + $prospect = $item->tenantProspect; + $companyName = $tenant?->company_name ?? $prospect?->company_name ?? '알 수 없음'; + $representativeName = $tenant?->representative_name ?? $prospect?->ceo_name ?? '-'; + $businessNumber = $tenant?->business_number ?? $prospect?->business_number ?? '-'; $currentHqStep = $hqStatusOrder[$item->hq_status ?? 'pending'] ?? 0; @endphp
@@ -20,7 +23,7 @@
{{ $companyName }}
- {{ $tenant?->representative_name ?? '-' }} | {{ $tenant?->business_number ?? '-' }} + {{ $representativeName }} | {{ $businessNumber }}
{{ $item->updated_at->format('m/d') }}