Inventario & Control de Stock

Existencias físicas por tienda y cálculo automático de precio vitrina para no perder por brecha cambiaria

Cargar Factura IA
@if($feedbackMessage)
✓ {{ $feedbackMessage }}
@endif @if($totalAlertsCount > 0)

Alertas de Reposición Urgente

{{ $totalAlertsCount }} {{ $totalAlertsCount === 1 ? 'prenda en riesgo' : 'prendas en riesgo' }} @if(count($depletedItems) > 0) {{ count($depletedItems) }} agotadas @endif

Prendas con existencias críticas que requieren nuevo lote de mercancía para evitar quiebres de venta.

@if($showStockAlertsDetails)
@foreach($depletedItems as $item)
@if($item['variant']->image_url) {{ $item['variant']->name }} @else 🚫 @endif
Agotado (0 u)

{{ $item['variant']->product?->name ?? $item['variant']->name }} @if($item['variant']->product && $item['variant']->name && $item['variant']->name !== 'Variante Estándar') ({{ $item['variant']->name }}) @endif

SKU: {{ $item['variant']->sku }} Mínimo configurado: {{ (int)$item['min'] }} u
@endforeach @foreach($lowStockItems as $item)
@if($item['variant']->image_url) {{ $item['variant']->name }} @else ⚠️ @endif
¡Quedan solo {{ (int)$item['stock'] }} u!

{{ $item['variant']->product?->name ?? $item['variant']->name }} @if($item['variant']->product && $item['variant']->name && $item['variant']->name !== 'Variante Estándar') ({{ $item['variant']->name }}) @endif

SKU: {{ $item['variant']->sku }} Alerta mínima: {{ (int)$item['min'] }} u • Déficit: {{ (int)$item['deficit'] }} u
@endforeach
@endif
@endif
@if($totalAlertsCount > 0) @endif
@forelse($variants as $variant) @php $summaries = $variant->stockSummaries; if ($selectedLocationId > 0) { $summaries = $summaries->where('location_id', $selectedLocationId); } $totalQuantity = $summaries->sum(fn ($s) => (float) $s->quantity); $minAlert = (float) $variant->min_stock_alert; $priceBcvVes = (float)$variant->suggested_price_usdt * (float)($rates['VES_BCV'] ?? 1); $semaphore = 'green'; if ($totalQuantity <= 0) { $semaphore = 'red'; } elseif ($totalQuantity <= $minAlert) { $semaphore = 'yellow'; } $activeLots = $variant->lots->where('status', 'active'); @endphp @if($expandedVariantId === $variant->id) @endif @empty @endforelse
Prenda / Producto Estado Stock Existencia Precio Vitrina (USD) Precio en Bolívares (BCV) Lotes Acciones
{{ $variant->product?->name ?? $variant->name }} @if($variant->product && $variant->name && $variant->name !== 'Variante Estándar') ({{ $variant->name }}) @endif
SKU: {{ $variant->sku }}
@if($semaphore === 'green') En Stock @elseif($semaphore === 'yellow') Stock Bajo @else Agotado @endif {{ number_format($totalQuantity, 0) }} u físicas ${{ number_format((float)$variant->suggested_price_usdt, 2) }} Dólar BCV {{ number_format($priceBcvVes, 2) }} Bs Facturación legal {{ $activeLots->count() }} lotes

Lotes Activos (Consumo FIFO Automático):

@forelse($activeLots as $lot)
{{ $lot->lot_number }} ${{ number_format((float)$lot->unit_cost_usdt, 2) }} c/u
Disponible: {{ number_format((float)$lot->remaining_quantity, 0) }} u Ingreso: {{ $lot->created_at->format('d/m/y') }}
@empty

No hay lotes con saldo activo para esta variante.

@endforelse
No se encontraron productos registrados en el inventario.
{{ $variants->links() }}
@if($showQuickProductModal)

Registro Rápido de Prenda

Calcula automáticamente el precio vitrina para no perder por brecha cambiaria

@if($errorMessage)
{{ $errorMessage }}
@endif
$
%
Calculadora de Vitrina (Fórmula Kairos) BCV: {{ number_format((float)($rates['VES_BCV'] ?? 1), 2) }} | Paralelo: {{ number_format((float)($rates['VES_PARALELO'] ?? 1), 2) }}
Valor Base Real Deseado: ${{ number_format((float)$calculatedBaseUsd, 2) }} USD +${{ number_format((float)$calculatedBaseUsd - (float)($quickCostUsd ?: 0), 2) }} ganancia neta
Precio Vitrina a Fijar: ${{ $quickPreview['precio_vitrina_bcv'] }} USD {{ $quickPreview['precio_bolivares'] }} Bs en caja

💡 Protección: Si el cliente paga a tasa BCV oficial ({{ $quickPreview['precio_bolivares'] }} Bs), al comprar dólares a tasa paralelo obtendrás exactamente tus ${{ number_format((float)$calculatedBaseUsd, 2) }} USD netos.

@if($quickImage) ✓ Imagen seleccionada @endif
Cargando imagen...
@endif @if($showReceiveModal)

Entrada de Lote de Mercancía

@if($errorMessage)
{{ $errorMessage }}
@endif
@endif @if($showDeleteModal)

¿Eliminar del inventario?

Estás a punto de eliminar {{ $deletingVariantName }}. Si no tiene ventas registradas, se borrará definitivamente; si ya tiene historial de ventas, se retirará del mostrador y stock activo protegiendo la auditoría financiera.

@endif @if($showImageModal)

Fotografía de la Prenda

{{ $imageVariantName }}

@if($errorMessage)
{{ $errorMessage }}
@endif
@if($newProductImage) Vista previa @elseif($currentImageUrl) {{ $imageVariantName }} @else
Sin fotografía asignada
@endif
Cargando imagen...
@error('newProductImage') {{ $message }} @enderror

Formatos: JPG, PNG, WebP (máx. 3 MB). Se almacena optimizada en almacenamiento de alta velocidad.

@if($currentImageUrl && !$newProductImage) @endif
@if($newProductImage) @endif
@endif