@extends('layouts.app') @section('title', $inventory->name . ' — TI Manager') @section('content')
{{-- Encabezado --}}
{{-- Columna 1 --}}
{{-- Card: Equipo --}}
Equipo
Nombre {{ $inventory->name }}
@if($inventory->category)
Categoría {{ $inventory->category->name }}
@endif @if($inventory->brand)
Marca {{ $inventory->brand }}
@endif @if($inventory->model)
Modelo {{ $inventory->model }}
@endif
{{-- Card: Identificación --}}
Identificación
Serial {{ $inventory->serial_number ?? '—' }}
Etiqueta de activo {{ $inventory->asset_tag ?? '—' }}
Estado {{ $inventory->status_label }}
{{-- Card: Ubicación --}}
Ubicación
@if($inventory->branch && $inventory->branch->company)
Sede {{ $inventory->branch->name }} @if($inventory->branch->is_main) Principal @endif
@endif
@if($inventory->branch && $inventory->branch->hasGps())
Ver sede en Google Maps
@endif
{{-- Columna 2 --}}
{{-- Card: Asignación --}}
Asignación
Asignado a @if($inventory->assigned_to) {{ $inventory->assigned_to }} @else Sin asignar @endif
Dirección IP {{ $inventory->ip_address ?? '—' }}
MAC Address {{ $inventory->mac_address ?? '—' }}
@if($inventory->parent_id && $inventory->parent) @endif
{{-- Card: Fechas --}}
Fechas
Fecha de compra {{ $inventory->purchase_date ? $inventory->purchase_date->format('d/m/Y') : '—' }}
Fecha de instalación {{ $inventory->installation_date ? $inventory->installation_date->format('d/m/Y') : '—' }}
Inicio de Garantía {{ $inventory->warranty_start ? $inventory->warranty_start->format('d/m/Y') : '—' }}
Garantía hasta @if($inventory->warranty_until) {{ $inventory->warranty_until->format('d/m/Y') }} @if($inventory->warranty_until->isFuture()) Vigente @else Vencida @endif @else — @endif
{{-- Columna 3 --}}
{{-- Card: Especificaciones Técnicas --}} @if($inventory->features && count(array_filter($inventory->features)) > 0)
Especificaciones Técnicas
@php $featureLabels = [ 'pc_name' => 'Nombre del equipo', 'os' => 'Sistema Operativo', 'os_license' => 'Licencia del OS', 'processor' => 'Procesador', 'ram' => 'Memoria RAM', 'disk' => 'Almacenamiento (Disco)', 'gpu' => 'Tarjeta gráfica', 'office' => 'Office instalado', 'office_license' => 'Licencia de Office', 'antivirus' => 'Antivirus', 'antivirus_license' => 'Licencia de Antivirus', 'domain' => 'Dominio o grupo de trabajo', 'main_user' => 'Usuario principal', 'peripherals' => 'Periféricos', 'battery' => 'Estado de batería', 'charger' => 'Cargador asignado', 'accessories' => 'Accesorios', 'screen_size' => 'Tamaño de Pantalla', 'video_ports' => 'Puertos de Video', 'printer_type' => 'Tipo de Impresión', 'connection_type' => 'Tipo de Conexión', 'channels' => 'Cantidad de canales', 'firmware' => 'Firmware', 'admin_user' => 'Usuario administrador', 'admin_pass' => 'Contraseña', 'ddns_p2p' => 'DDNS o P2P', 'technology' => 'Tecnología', 'camera_type' => 'Tipo / Canales', 'resolution' => 'Resolución', 'cam_user' => 'Usuario (Cámara)', 'cam_pass' => 'Contraseña (Cámara)', 'managed' => 'Administrable', 'ports_count' => 'Cantidad de puertos', 'speed' => 'Velocidad', 'vlan' => 'VLAN configuradas', 'rack' => 'Rack', 'extension' => 'Extensión', 'fxs_ports' => 'Puerto FXS', 'voip_operator' => 'Operador VoIP', 'wan_ip' => 'IP WAN', 'lan_ip' => 'IP LAN', 'wifi' => 'Redes WiFi', 'mac_address' => 'Dirección MAC', ]; @endphp @foreach($inventory->features as $key => $value) @if(!empty($value))
{{ $featureLabels[$key] ?? ucfirst(str_replace('_', ' ', $key)) }} {{ is_array($value) ? implode(', ', $value) : $value }}
@endif @endforeach
@endif {{-- Card: Notas --}} @if($inventory->notes)
Notas

{{ $inventory->notes }}

@endif
{{-- Historial de Mantenimiento --}}

Historial de Mejoramiento/Mantenimiento

@if($inventory->maintenanceLogs && $inventory->maintenanceLogs->count() > 0)
{{-- Pseudo-elementos de la linea de tiempo deberian ir en CSS, pero agregamos estilo en linea si es necesario, o asumimos CSS de timeline --}}
@foreach($inventory->maintenanceLogs->sortByDesc('created_at') as $log)

{{ $log->title }}

{{ ucfirst($log->type) }} @if($log->has_warranty) @php $warrantyActive = $log->warranty_until && \Carbon\Carbon::parse($log->warranty_until)->endOfDay()->isFuture(); @endphp @if($warrantyActive) Garantía Vigente (hasta {{ \Carbon\Carbon::parse($log->warranty_until)->format('d/m/Y') }}) @else Garantía Vencida (venció el {{ \Carbon\Carbon::parse($log->warranty_until)->format('d/m/Y') }}) @endif @endif

{{ $log->description }}

@if($log->cost) Costo: ${{ number_format($log->cost, 2) }} @endif Registrado por: {{ $log->user->name ?? 'Usuario Desconocido' }} el {{ $log->created_at->format('d/m/Y h:i A') }}
@if($log->is_approved) @if($log->requires_approval) Aprobado por {{ $log->approvedBy->name ?? 'Cliente' }} el {{ \Carbon\Carbon::parse($log->approved_at)->format('d/m/Y h:i A') }} @else Registro Guardado Directamente @endif @else @if(auth()->user()->isClient())
@csrf
@else Pendiente de aprobación @endif @endif @if(auth()->user()->isAdmin())
@csrf @method('DELETE')
{{-- Modal para Editar Garantía --}} @endif
@if(!$loop->last)
@endif @endforeach
@else

No hay registros de mantenimiento para este equipo.

@endif
{{-- Modal de Alpine.js para Registrar Actividad --}}
@push('scripts') @endpush @endsection