@extends('layouts.app') @section('title', 'Inventario de Lotes') @section('page-title', 'Inventario — Lotes en Stock') @section('breadcrumb') @endsection @section('content') {{-- Alertas de vencimiento --}}
{{ $vencidos }} lote(s) vencido(s) con stock disponible. Ver
{{ $alertas30 }} lote(s) por vencer en los próximos 30 días. @if($alertas30 > 0) Ver @endif
@if($alertas7 > 0)
{{ $alertas7 }} lote(s) vencen en 7 días o menos.
@endif

Lotes en Inventario

PDF Exportar CSV
@forelse($lotes as $lote) @php $diasRestantes = $lote->fecha_vencimiento ? now()->diffInDays($lote->fecha_vencimiento, false) : null; $rowClass = match(true) { $lote->estado === 'vencido' => 'table-danger', $diasRestantes !== null && $diasRestantes <= 7 => 'table-danger', $diasRestantes !== null && $diasRestantes <= 30 => 'table-warning', default => '', }; @endphp @empty @endforelse
N° Lote Producto Categoría Almacén Cant. Actual U.M. Proveedor F. Ingreso F. Vencimiento Estado Acciones
{{ $lote->numero_lote }} {{ $lote->producto->nombre }}
{{ $lote->producto->codigo }}
{{ optional($lote->producto->categoria)->nombre ?? '—' }} {{ $lote->almacen->nombre }} {{ number_format($lote->cantidad_actual, 3) }} {{ optional($lote->producto->unidadMedida)->abreviatura }} {{ optional($lote->proveedor)->razon_social ?? '—' }} {{ $lote->fecha_ingreso ? \Carbon\Carbon::parse($lote->fecha_ingreso)->format('d/m/Y') : '—' }} @if($lote->fecha_vencimiento) {{ \Carbon\Carbon::parse($lote->fecha_vencimiento)->format('d/m/Y') }} @if($diasRestantes !== null) @if($diasRestantes <= 0) Vencido @elseif($diasRestantes <= 7) {{ $diasRestantes }}d @elseif($diasRestantes <= 30) {{ $diasRestantes }}d @endif @endif @else @endif @switch($lote->estado) @case('vigente') Vigente @break @case('por_vencer') Por vencer @break @case('vencido') Vencido @break @default {{ $lote->estado }} @endswitch @hasanyrole('super-admin|jefe-logistica|jefe-calidad') @if($lote->estado === 'bloqueado')
@csrf
@elseif(in_array($lote->estado, ['vigente','por_vencer'])) @endif @endhasanyrole
No se encontraron lotes con stock.
{{ $lotes->links() }}
{{-- Modal bloqueo --}} @push('scripts') @endpush @endsection