{{-- ── LEFT: Equipment list ─────────────────────────────── --}}
Inventario de Equipos
{{-- Filters --}}
{{-- List --}}
@foreach($equipment as $eq)
{{ $eq->name }}
{{ $eq->code }} · {{ $eq->category }}
{{ $statuses[$eq->status]['label'] ?? $eq->status }}
@if($eq->location)
📍 {{ $eq->location }}
@endif
@endforeach {{ $equipment->links() }}
{{-- ── RIGHT: Detail panel ──────────────────────────────── --}} @if($openEquipment)
{{-- Panel header --}}
{{ $openEquipment->name }}
{{ $openEquipment->code }} · {{ $openEquipment->location }}
{{ $statuses[$openEquipment->status]['label'] ?? $openEquipment->status }}
{{-- KPI row --}}
${{ number_format($openEquipment->monthly_utility_cost,0) }}
Costo Util. /mes
${{ number_format($openEquipment->monthly_depreciation,0) }}
Deprec. /mes
{{ $openEquipment->open_work_orders_count }}
OT Abiertas
{{ $openEquipment->overdue_plans_count }}
PM Vencidos
{{-- Tabs --}}
@foreach(['info'=>'Información','utilities'=>'Servicios','asset'=>'Activo Fijo','maintenance'=>'Mantenimiento'] as $t => $label) @endforeach
{{-- ── INFO TAB ── --}} @if($tab === 'info')
Categoría
{{ $openEquipment->category }}{{ $openEquipment->sub_category ? ' / '.$openEquipment->sub_category : '' }}
Fabricante
{{ $openEquipment->manufacturer ?? '—' }}
Modelo
{{ $openEquipment->model_name ?? '—' }}
N° Serie
{{ $openEquipment->serial_number ?? '—' }}
Año Fab.
{{ $openEquipment->year_manufactured ?? '—' }}
Instalación
{{ $openEquipment->installation_date?->format('d/m/Y') ?? '—' }}
Ubicación
{{ $openEquipment->location ?? '—' }}
@if($openEquipment->machine_id)
Máquina
{{ $openEquipment->machine->name ?? '—' }}
@endif @if($openEquipment->loom_id)
Telar
{{ $openEquipment->loom->name ?? '—' }}
@endif @if($openEquipment->notes)
Notas
{{ $openEquipment->notes }}
@endif
@endif {{-- ── UTILITIES TAB ── --}} @if($tab === 'utilities')
Consumos de Servicios
@if($showUtilityForm)
@error('utilityForm.utility_type') {{ $message }} @enderror
@error('utilityForm.measured_value') {{ $message }} @enderror
@error('utilityForm.unit_cost') {{ $message }} @enderror
@endif @if($openEquipment->utilities->isEmpty())

Sin consumos registrados.

@else @foreach($openEquipment->utilities as $u) @endforeach
ServicioConsumoCosto Unit.Costo /mes
{{ $utilityTypes[$u->utility_type]['icon'] ?? '' }} {{ $u->type_label }} {{ number_format($u->measured_value,3) }} {{ $u->unit }} ${{ number_format($u->unit_cost,4) }} ${{ number_format($u->monthly_cost,2) }}
Total mensual: ${{ number_format($openEquipment->monthly_utility_cost,2) }}
@endif @endif {{-- ── ASSET TAB ── --}} @if($tab === 'asset') @php $asset = $openEquipment->fixedAsset; @endphp
Activo Fijo
@if($showAssetForm)
@error('assetForm.acquisition_date') {{ $message }} @enderror
@error('assetForm.acquisition_cost') {{ $message }} @enderror
@error('assetForm.useful_life_years') {{ $message }} @enderror
@endif @if($asset)
Costo de adquisición
${{ number_format($asset->acquisition_cost,2) }}
{{ $asset->currency }}
Valor libro actual
${{ number_format($asset->calculated_book_value,2) }}
{{ $asset->depreciation_pct }}% depreciado
Deprec. anual
${{ number_format($asset->annual_depreciation,2) }}
Vida útil
{{ $asset->useful_life_years }} años
Adq. {{ $asset->acquisition_date?->format('d/m/Y') }}
{{-- Depreciation progress bar --}}
Progreso depreciación {{ $asset->depreciation_pct }}%
Proveedor
{{ $asset->supplier ?? '—' }}
Factura
{{ $asset->invoice_number ?? '—' }}
Método deprec.
Línea recta
@if($asset->notes)
Notas
{{ $asset->notes }}
@endif
@else

Sin activo fijo registrado.

@endif @endif {{-- ── MAINTENANCE TAB ── --}} @if($tab === 'maintenance')
Planes de Mantenimiento ({{ $openEquipment->maintenancePlans->count() }})
@if($openEquipment->maintenancePlans->isEmpty())

Sin planes configurados.

@else @foreach($openEquipment->maintenancePlans as $plan) @endforeach
NombreFrecuenciaPróximoEstado
{{ $plan->name }} Cada {{ $plan->frequency_value }} {{ $plan->frequency_type }} {{ $plan->next_due?->format('d/m/Y') ?? '—' }} @if($plan->is_overdue) Vencido @elseif($plan->days_until_due !== null && $plan->days_until_due <= 7) Próximo @else OK @endif
@endif
Órdenes de Trabajo recientes
@if($openEquipment->maintenanceOrders->isEmpty())

Sin órdenes de trabajo.

@else @foreach($openEquipment->maintenanceOrders->take(10) as $ot) @endforeach
OTTipoTítuloEstado
{{ $ot->code }} {{ $ot->type }} {{ $ot->title }} {{ $ot->status_label }}
@endif
@endif
@endif
{{-- ── Equipment form modal ─────────────────────────────── --}} @if($showForm) @endif