@extends('../padre.padre') @section('contenido')
@php // Helper para conservar filtros actuales al navegar entre pestañas de estado $queryPestañas = function($nuevoEstado) use ($bodegaFiltro, $motivoFiltro, $buscar, $fechaDesde, $fechaHasta, $tipoFecha, $porPagina) { $params = [ 'estado' => $nuevoEstado, 'bodega' => $bodegaFiltro, 'motivo' => $motivoFiltro, 'buscar' => $buscar, 'por_pagina' => $porPagina, ]; if (!empty($fechaDesde)) $params['fecha_desde'] = $fechaDesde; if (!empty($fechaHasta)) $params['fecha_hasta'] = $fechaHasta; if ($tipoFecha !== 'auto') $params['tipo_fecha'] = $tipoFecha; return http_build_query($params); }; @endphp
📦 Bodega Virtual / Cuarentena
| Control de averías, vencimientos y bajas contables
Excel @include('menu.botonRegresar')
📦 Ítems: {{ number_format($metricas->total_items ?? 0) }} 🔢 Unidades: @if(($metricas->total_frcc ?? 0) > 0 && ($metricas->total_cajas ?? 0) > 0) {{ number_format($metricas->total_cajas ?? 0, 0) }} Cj + {{ number_format($metricas->total_frcc ?? 0, 0) }} Fr @elseif(($metricas->total_frcc ?? 0) > 0) {{ number_format($metricas->total_frcc ?? 0, 0) }} Fr @else {{ number_format($metricas->total_cajas ?? 0, 0) }} Cj @endif @if($estadoFiltro === 'baja_merma') 📉 Pérdida Merma: ${{ number_format($metricas->total_costo ?? 0, 0, ',', '.') }} @else 💰 Valor: ${{ number_format($metricas->total_costo ?? 0, 0, ',', '.') }} @endif @if($estadoFiltro === 'baja_merma') 📑 Cta: 531095 @elseif($estadoFiltro === 'retenido' || $estadoFiltro === 'todos') @if(($proximosVencer ?? 0) > 0) ⏳ Próx. Vencer: {{ number_format($proximosVencer ?? 0) }} @endif @endif
@if($estadoFiltro === 'baja_merma')
🗑️ Historial de Bajas / Mermas: Comprobantes oficiales BAJA-X registrados en la cuenta contable 531095 (Salida de Merma).
Gasto Cuenta 531095
@elseif($estadoFiltro === 'devuelto_proveedor')
🚚 Devoluciones a Proveedor: Productos retirados para trámite de reposición o nota crédito bajo comprobante DEV-PROV-X.
Pendiente NC
@elseif($estadoFiltro === 'reintegrado')
✅ Reintegrados a Venta: Productos reincorporados al inventario comercial del POS bajo comprobante REINT-X y sumados a Kardex.
En Kardex
@endif
Limpiar
@forelse($items as $item) @php $factorProd = ($item->factor && $item->factor > 1) ? floatval($item->factor) : 1; $costoTotalItem = (floatval($item->cantidad_caja) * floatval($item->costo_unitario)) + (floatval($item->cantidad_frcc) * (floatval($item->costo_unitario) / $factorProd)); @endphp @empty @endforelse
Ingreso Bodega Producto Cant. Caja Cant. Frcc Lote Vencimiento Costo Total Motivo Estado {{ $estadoFiltro === 'retenido' ? 'Acciones' : 'Resolución' }}
@if($item->estado === 'retenido') @else @endif {{ $item->numero_movimiento ?? ('CUAR-' . $item->id) }}
{{ substr($item->fecha_ingreso, 0, 10) }} {{ substr($item->fecha_ingreso, 11, 5) }}
{{ $item->nombreBodega ?? 'Bodega ' . $item->idbodega }} {{ $item->nombre_producto }}
Cód: {{ $item->codigoProd }} | Barras: {{ $item->barras ?: 'S/N' }} @if(!empty($item->observaciones))
📝 {{ $item->observaciones }}
@endif
{{ number_format($item->cantidad_caja, 2) }} {{ number_format($item->cantidad_frcc, 2) }} @if(!empty($item->lote)) {{ $item->lote }} @else - @endif @if(!empty($item->fechaVencimiento) && $item->fechaVencimiento !== '0000-00-00') @php $diasVenc = (strtotime($item->fechaVencimiento) - strtotime(date('Y-m-d'))) / 86400; @endphp {{ $item->fechaVencimiento }} ({{ intval($diasVenc) }}d) @else - @endif ${{ number_format($costoTotalItem, 0, ',', '.') }} @php $motivosMap = [ 'averia' => ['bg-danger', 'Averiado'], 'proximo_vencer' => ['bg-warning text-dark', 'Próx. Vencer'], 'cuarentena' => ['bg-info text-white', 'Cuarentena'], 'devolucion_proveedor' => ['bg-primary text-white', 'Dev. Prov.'] ]; $badge = $motivosMap[$item->motivo] ?? ['bg-secondary', $item->motivo]; @endphp {{ $badge[1] }} @if($item->estado === 'retenido') 🔒 Retenido @elseif($item->estado === 'reintegrado') ✅ Reintegrado @elseif($item->estado === 'baja_merma') 🗑️ Baja @elseif($item->estado === 'devuelto_proveedor') 🚚 Devuelto @endif @if($item->estado === 'retenido')
@elseif($item->estado === 'baja_merma')
{{ $item->numero_resolucion ?? 'BAJA' }}
👤 {{ $item->usuario_resolucion ?? 'admin' }} | 📅 {{ substr($item->fecha_resolucion, 0, 10) }}
@if(!empty($item->motivo_resolucion))
📝 {{ \Illuminate\Support\Str::limit($item->motivo_resolucion, 25) }}
@endif Cta. 531095
@elseif($item->estado === 'reintegrado')
{{ $item->numero_resolucion ?? 'REINT' }}
👤 {{ $item->usuario_resolucion ?? 'admin' }} | 📅 {{ substr($item->fecha_resolucion, 0, 10) }}
@if(!empty($item->motivo_resolucion))
📝 {{ \Illuminate\Support\Str::limit($item->motivo_resolucion, 25) }}
@endif Kardex
@elseif($item->estado === 'devuelto_proveedor')
{{ $item->numero_resolucion ?? 'DEV-PROV' }}
👤 {{ $item->usuario_resolucion ?? 'admin' }} | 📅 {{ substr($item->fecha_resolucion, 0, 10) }}
@if(!empty($item->motivo_resolucion))
📝 {{ \Illuminate\Support\Str::limit($item->motivo_resolucion, 25) }}
@endif Proveedor
@else @if(!empty($item->numero_resolucion)) {{ $item->numero_resolucion }}
@endif {{ $item->motivo_resolucion ?: 'Resuelto' }} @endif
📭
No se encontraron registros con los filtros seleccionados

Puedes cambiar de pestaña arriba, ajustar fechas o limpiar filtros.

@endsection