@extends('layouts.app') @section('title', 'Detalles del Inventario Físico') @section('content')

{{ $inventory->name }}

Código: {{ $inventory->inventory_number }}

@if($inventory->status === 'planned') Editar
@csrf
@elseif($inventory->status === 'in_progress')
@csrf
@endif Volver
@if(session('success')) @endif @if(session('error')) @endif
Información General
@if($inventory->completed_by) @endif
Código: {{ $inventory->inventory_number }}
Almacén: {{ $inventory->warehouse->name ?? 'N/A' }}
Tipo: @php $typeLabels = [ 'full' => 'Inventario Completo', 'partial' => 'Inventario Parcial', 'cycle_count' => 'Conteo Cíclico', 'spot_check' => 'Verificación Aleatoria' ]; @endphp {{ $typeLabels[$inventory->type] ?? $inventory->type }}
Estado: @php $statusColors = [ 'planned' => 'warning', 'in_progress' => 'info', 'completed' => 'success', 'cancelled' => 'danger' ]; $statusLabels = [ 'planned' => 'Planificado', 'in_progress' => 'En Progreso', 'completed' => 'Completado', 'cancelled' => 'Cancelado' ]; @endphp {{ $statusLabels[$inventory->status] ?? $inventory->status }}
Fecha Inicio: {{ $inventory->start_date->format('d/m/Y') }}
Fecha Fin: {{ $inventory->end_date ? $inventory->end_date->format('d/m/Y') : '-' }}
Creado por: {{ $inventory->createdBy->name ?? 'N/A' }}
Completado por: {{ $inventory->completedBy->name ?? 'N/A' }}
Fecha Completado: {{ $inventory->completed_at ? $inventory->completed_at->format('d/m/Y H:i') : '-' }}
Estadísticas
Total Items: {{ $inventory->items->count() }}
Items Contados: {{ $inventory->items->where('status', '!=', 'pending')->count() }} @if($inventory->items->count() > 0) ({{ number_format(($inventory->items->where('status', '!=', 'pending')->count() / $inventory->items->count()) * 100, 1) }}%) @endif
Items Pendientes: {{ $inventory->items->where('status', 'pending')->count() }}
Varianza Total: @if($inventory->total_variance_usd != 0) ${{ number_format($inventory->total_variance_usd, 2) }} @else $0.00 @endif
@if($inventory->status === 'in_progress' && $inventory->items->count() > 0)
@php $progress = ($inventory->items->where('status', '!=', 'pending')->count() / $inventory->items->count()) * 100; @endphp
{{ number_format($progress, 1) }}%
@endif
@if($inventory->description)
Descripción

{{ $inventory->description }}

@endif @if($inventory->notes)
Notas

{{ $inventory->notes }}

@endif
Items del Inventario ({{ $inventory->items->count() }})
@if($inventory->items->count() > 0)
@foreach($inventory->items as $item) @endforeach
Producto Ubicación Cantidad Sistema Cantidad Contada Diferencia Varianza ($) Estado Contado por Fecha
{{ $item->product->name ?? 'N/A' }} @if($item->product)
{{ $item->product->code }} @endif
{{ $item->location->name ?? 'N/A' }} {{ number_format($item->system_quantity, 3) }} @if($item->counted_quantity !== null) {{ number_format($item->counted_quantity, 3) }} @else - @endif @if($item->variance_quantity != 0) {{ number_format($item->variance_quantity, 3) }} @else 0.000 @endif @if($item->variance_amount_usd != 0) ${{ number_format($item->variance_amount_usd, 2) }} @else $0.00 @endif @php $itemStatusColors = [ 'pending' => 'warning', 'counted' => 'info', 'verified' => 'primary', 'adjusted' => 'success' ]; $itemStatusLabels = [ 'pending' => 'Pendiente', 'counted' => 'Contado', 'verified' => 'Verificado', 'adjusted' => 'Ajustado' ]; @endphp {{ $itemStatusLabels[$item->status] ?? $item->status }} {{ $item->countedBy->name ?? '-' }} {{ $item->counted_at ? $item->counted_at->format('d/m/Y H:i') : '-' }}
@else

No hay items en este inventario

@endif
@endsection