{{-- Page header --}}
{{ __('Back to Map') }}

{{ __('Cronograma') }}: {{ $project->name }}

{{ __('Report PDF') }} {{ $project->start_date?->format('d/m/Y') ?? __('N/A') }} — {{ $project->end_date_estimated?->format('d/m/Y') ?? __('N/A') }}
{{-- Legend --}}
{{ __('Planificado') }} {{ __('Real') }} {{ __('Retrasado') }}
{{-- Editor de fechas por fase (siempre visible) --}}

Fechas planificadas y reales por fase

@foreach($phases as $phase)
{{ $phase->name }}
@endforeach
@if(empty($ganttData))
Define fechas planificadas arriba para ver el diagrama.
@else {{-- Gantt table --}}
{{-- Phase name column --}} {{-- Month header row --}} {{-- Dates column --}} {{-- Status column --}} @foreach($ganttData as $phase) {{-- Phase name --}} {{-- Gantt bar cell --}} {{-- Dates column --}} {{-- Status badge --}} @endforeach
{{ __('Fase') }} @php $projectStart = $project->start_date ?? now()->startOfMonth(); $projectEnd = $project->end_date_estimated ?? now()->addMonths(6); $totalDays = max(1, $projectStart->diffInDays($projectEnd)); // Build month segments $months = []; $cursor = $projectStart->copy()->startOfMonth(); while ($cursor->lte($projectEnd)) { $mStart = $cursor->copy()->max($projectStart); $mEnd = $cursor->copy()->endOfMonth()->min($projectEnd); $days = max(1, $mStart->diffInDays($mEnd) + 1); $widthPct = round(($days / $totalDays) * 100, 2); $months[] = [ 'label' => $cursor->translatedFormat('M Y'), 'width_pct' => $widthPct, ]; $cursor->addMonthNoOverflow(); } @endphp
@foreach($months as $month)
{{ $month['label'] }}
@endforeach
{{ __('Fechas') }} {{ __('Estado') }}
{{ $phase['name'] }}
@if($phase['features_count'] > 0)
{{ $phase['features_count'] }} {{ __('elementos') }}
@endif
{{-- Month grid lines --}} @php $offset = 0; @endphp @foreach($months as $i => $month) @if($i > 0)
@endif @php $offset += $month['width_pct']; @endphp @endforeach {{-- Planned bar --}}
{{-- Actual bar (if exists) --}} @if($phase['a_start_pct'] !== null && $phase['a_width_pct'] !== null)
@endif {{-- Progress label --}}
{{ $phase['progress'] }}%
{{ $phase['planned_start'] }} – {{ $phase['planned_end'] }}
@if($phase['actual_start'])
{{ $phase['actual_start'] }} – {{ $phase['actual_end'] ?? __('En curso') }}
@endif
@if($phase['is_delayed']) {{ __('En retraso') }} @elseif($phase['progress'] >= 100) {{ __('Completado') }} @elseif($phase['progress'] > 0) {{ $phase['progress'] }}% @else {{ __('Pendiente') }} @endif
{{-- Summary footer --}}
{{ count($ganttData) }} {{ __('fases') }} • {{ __('Actualizado') }}: {{ now()->format('d/m/Y H:i') }}
@endif