@extends('layouts.app') @section('title', 'Detalles del Empleado') @section('content')

{{ $employee->first_name }} {{ $employee->middle_name }} {{ $employee->last_name }}

{{ ucfirst($employee->employment_status) }} @if($employee->department) • {{ $employee->department->name }} @endif @if($employee->position) • {{ $employee->position->name }} @endif

@if(session('success')) @endif
Información Personal
{{ $employee->employee_number }}
{{ $employee->first_name }} {{ $employee->middle_name }} {{ $employee->last_name }}
{{ $employee->birth_date ? $employee->birth_date->format('d/m/Y') : 'N/A' }}
@if($employee->gender === 'male') Masculino @elseif($employee->gender === 'female') Femenino @else N/A @endif
{{ $employee->national_id ?? ($employee->passport_number ?? 'N/A') }}
@if($employee->phone) {{ $employee->phone }} @else N/A @endif
@if($employee->email) {{ $employee->email }} @else N/A @endif
{{ $employee->address ?? 'N/A' }} @if($employee->city)
{{ $employee->city }} @endif @if($employee->state) , {{ $employee->state }} @endif @if($employee->country) , {{ $employee->country }} @endif @if($employee->postal_code)
Código Postal: {{ $employee->postal_code }} @endif
@if($employee->emergency_contact_name)
Contacto de Emergencia
{{ $employee->emergency_contact_name }}
@if($employee->emergency_contact_phone) {{ $employee->emergency_contact_phone }} @else N/A @endif
{{ $employee->emergency_contact_relationship ?? 'N/A' }}
@endif @if($employee->notes)
Notas

{{ $employee->notes }}

@endif
Información Laboral
@if($employee->department) {{ $employee->department->name }} @else N/A @endif
@if($employee->position) {{ $employee->position->name }} @else N/A @endif
{{ $employee->hire_date->format('d/m/Y') }}
@if($employee->termination_date)
{{ $employee->termination_date->format('d/m/Y') }}
@endif
{{ ucfirst(str_replace('_', ' ', $employee->employment_type)) }}
{{ number_format($employee->salary, 2) }} {{ $employee->salary_currency }} @if($employee->salary_usd && $employee->salary_currency !== 'USD')
({{ number_format($employee->salary_usd, 2) }} USD) @endif
{{ ucfirst($employee->pay_frequency) }}
@if($employee->subordinates && $employee->subordinates->count() > 0)
Subordinados ({{ $employee->subordinates->count() }})
@endif @if($employee->bank_name || $employee->bank_account)
Información Bancaria
@if($employee->bank_name)
{{ $employee->bank_name }}
@endif @if($employee->bank_account)
{{ $employee->bank_account }}
@endif @if($employee->bank_routing)
{{ $employee->bank_routing }}
@endif
@endif
Información Laboral Detallada
{{ $employee->employee_number }}
{{ ucfirst(str_replace('_', ' ', $employee->employment_status)) }}
@if($employee->department) {{ $employee->department->name }} ({{ $employee->department->code }}) @else N/A @endif
@if($employee->position) {{ $employee->position->name }} @else N/A @endif
@if($employee->manager) {{ $employee->manager->first_name }} {{ $employee->manager->last_name }} @else N/A @endif
{{ ucfirst(str_replace('_', ' ', $employee->employment_type)) }}
{{ $employee->hire_date->format('d/m/Y') }}
@if($employee->termination_date)
{{ $employee->termination_date->format('d/m/Y') }}
@endif
{{ number_format($employee->salary, 2) }} {{ $employee->salary_currency }} @if($employee->salary_usd && $employee->salary_currency !== 'USD')
Equivalente: {{ number_format($employee->salary_usd, 2) }} USD @endif
{{ ucfirst($employee->pay_frequency) }}
@if($employee->salary_exchange_rate)
{{ number_format($employee->salary_exchange_rate, 4) }}
@endif @if($employee->salary_rate_date)
{{ $employee->salary_rate_date->format('d/m/Y') }}
@endif
Documentos del Empleado
Subir Documento
@if($employee->documents && $employee->documents->count() > 0)
@foreach($employee->documents as $document) @endforeach
Tipo Título Archivo Fecha de Expiración Subido Por Fecha Acciones
{{ ucfirst($document->document_type) }} {{ $document->title }} {{ $document->file_name }}
{{ number_format($document->file_size / 1024, 2) }} KB
@if($document->expiry_date) @if($document->expiry_date->isPast()) Expirado @elseif($document->expiry_date->isBefore(now()->addDays(30))) {{ $document->expiry_date->format('d/m/Y') }} @else {{ $document->expiry_date->format('d/m/Y') }} @endif @else N/A @endif {{ $document->uploadedBy->name ?? 'N/A' }} {{ $document->created_at->format('d/m/Y') }}
@else

No hay documentos registrados para este empleado.

@endif
Solicitudes de Ausencia
@if($employee->leaveRequests && $employee->leaveRequests->count() > 0)
@foreach($employee->leaveRequests as $leave) @endforeach
Tipo Fecha Inicio Fecha Fin Días Estado Fecha Solicitud Acciones
{{ $leave->leaveType->name ?? 'N/A' }} {{ $leave->start_date->format('d/m/Y') }} {{ $leave->end_date->format('d/m/Y') }} {{ $leave->start_date->diffInDays($leave->end_date) + 1 }} @switch($leave->status) @case('pending') Pendiente @break @case('approved') Aprobada @break @case('rejected') Rechazada @break @default {{ ucfirst($leave->status) }} @endswitch {{ $leave->created_at->format('d/m/Y') }} -
@else

No hay solicitudes de ausencia registradas.

@endif
Evaluaciones de Desempeño
@if($employee->performanceEvaluations && $employee->performanceEvaluations->count() > 0)
@foreach($employee->performanceEvaluations as $evaluation) @endforeach
Período Fecha Evaluación Calificación Estado Evaluador Acciones
{{ $evaluation->evaluation_period ?? 'N/A' }} {{ $evaluation->evaluation_date ? $evaluation->evaluation_date->format('d/m/Y') : 'N/A' }} @if($evaluation->overall_rating) {{ number_format($evaluation->overall_rating, 1) }}/5.0 @else N/A @endif {{ ucfirst($evaluation->status) }} {{ $evaluation->evaluator->name ?? 'N/A' }}
@else

No hay evaluaciones de desempeño registradas.

@endif
Capacitaciones
@if($employee->trainingParticipants && $employee->trainingParticipants->count() > 0)
@foreach($employee->trainingParticipants as $participant) @endforeach
Capacitación Fecha Inicio Fecha Fin Estado Calificación Acciones
{{ $participant->training->title ?? 'N/A' }} {{ $participant->training->start_date ? $participant->training->start_date->format('d/m/Y') : 'N/A' }} {{ $participant->training->end_date ? $participant->training->end_date->format('d/m/Y') : 'N/A' }} {{ ucfirst(str_replace('_', ' ', $participant->status)) }} @if($participant->score) {{ $participant->score }}/100 @else N/A @endif
@else

No hay capacitaciones registradas.

@endif
Historial de Cambios
@if($employee->history && $employee->history->count() > 0)
@foreach($employee->history->sortByDesc('effective_date') as $history)
{{ ucfirst(str_replace('_', ' ', $history->change_type)) }}
{{ $history->effective_date->format('d/m/Y') }}
@if($history->reason)

Motivo: {{ $history->reason }}

@endif @if($history->old_values || $history->new_values)
@if($history->old_values)
Valores Anteriores:
{{ json_encode($history->old_values, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@endif @if($history->new_values)
Valores Nuevos:
{{ json_encode($history->new_values, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@endif
@endif Cambiado por: {{ $history->changedBy->name ?? 'Sistema' }} el {{ $history->created_at->format('d/m/Y H:i') }}
@endforeach
@else

No hay historial de cambios registrado.

@endif
@endsection @push('styles') @endpush