{{-- New-Unity ERP | app/Modules/Sales/Resources/Views/opportunities/show.blade.php | v1.0 | 20/07/2026 --}} {{-- v1.0 — Vista detalle de oportunidad con timeline de actividades. --}} @extends('layouts.vertical', ['pageTitle' => $opportunity->opportunity_number]) @section('page-title')

{{ $opportunity->opportunity_number }} {{ $opportunity->title }}

{{ __('opportunities.edit') }} {{ __('opportunities.back') }}
@endsection @section('content') @if(session('success'))
{{ session('success') }}
@endif
{{-- Left: Opportunity Info --}}
{{-- Stage Card --}}
{{ $opportunity->stage_label }}
{{ $opportunity->probability }}% {{ __('opportunities.probability_suffix') }}
${{ number_format($opportunity->estimated_value, 2) }}
{{ __('opportunities.estimated_value') }}
{{-- Progress bar --}}
{{-- Stage selector --}}
{{-- Details --}}
{{ __('opportunities.details') }}
{{ __('opportunities.customer') }} {{ $opportunity->customer->commercial_name ?? '—' }}
{{ __('opportunities.assigned_to') }} {{ $opportunity->assignedTo->name ?? '—' }}
{{ __('opportunities.product_interest') }} {{ $opportunity->product_interest ?? '—' }}
{{ __('opportunities.close_date') }} @if($opportunity->estimated_close_date) {{ $opportunity->estimated_close_date->format('d/m/Y') }} @else — @endif
{{ __('opportunities.last_activity') }} {{ $opportunity->last_activity_at ? $opportunity->last_activity_at->diffForHumans() : __('opportunities.none') }}
{{ __('opportunities.created_by') }} {{ $opportunity->createdBy->name ?? '—' }}
{{ __('opportunities.created') }} {{ $opportunity->created_at->format('d/m/Y') }}
{{-- Alerts --}} @if($rule) @if($daysSinceActivity !== null && $daysSinceActivity >= $rule->max_days_without_activity)
{{ $daysSinceActivity }} {{ __('opportunities.days_label') }} {{ __('opportunities.days_no_activity_1') }} {{ $rule->max_days_without_activity }} {{ __('opportunities.days_label') }}.
@endif @if($daysInStage >= $rule->max_days_in_stage)
{{ $daysInStage }} {{ __('opportunities.days_label') }} {{ __('opportunities.days_in_stage_1') }} {{ $rule->max_days_in_stage }} {{ __('opportunities.days_label') }}.
@endif @endif {{-- Description --}} @if($opportunity->description)
{{ __('opportunities.notes') }}
{{ $opportunity->description }}
@endif
{{-- Right: Activities --}}

{{ __('opportunities.activities_followup') }}

@if($opportunity->activities->isEmpty())

{{ __('opportunities.no_activities_yet') }}

{{ __('opportunities.schedule_hint') }}

@else
@foreach($opportunity->activities as $act)
@if(!$loop->last)
@endif
{{ $act->title }}
{{ $act->type_label }} {{ $act->scheduled_at->format('d/m/Y H:i') }} · {{ $act->assignedTo->name ?? '—' }}
@php $statusColor = match($act->status) { 'completed' => 'success', 'overdue' => 'danger', 'cancelled' => 'secondary', default => 'warning' }; @endphp {{ ucfirst($act->status) }} @if(in_array($act->status, ['pending', 'in_progress'])) @endif
@if($act->notes)
{{ $act->notes }}
@endif
@endforeach
@endif
{{-- Modal: Add Activity --}} @endsection @section('scripts') @endsection