@extends('admin.layouts.index-template', [ 'pageTitle' => $pageTitle ?? 'Stock Reservado por Sucursales', 'items' => $products, 'icon' => 'lock', 'module' => 'Stock Reservado', 'createRoute' => null, 'indexRoute' => route('stock.reserved'), 'searchPlaceholder' => 'Buscar por título, SKU o descripción...', 'emptyIcon' => 'lock', 'emptyTitle' => 'No hay productos', 'emptyMessage' => 'No se encontraron productos con los criterios de búsqueda', 'stats' => [ 'all' => [ 'label' => 'Total', 'count' => isset($products) && method_exists($products, 'total') ? $products->total() : \App\Models\Stock::where('BORRADO', 'N')->count(), 'color' => 'primary', 'icon' => 'lock' ], 'active' => [ 'label' => 'Activos', 'count' => \App\Models\Stock::where('WEB_VTA', 'S')->where('BORRADO', 'N')->count(), 'color' => 'success', 'icon' => 'checkbox-circle' ], 'inactive' => [ 'label' => 'Inactivos', 'count' => \App\Models\Stock::where(function($q) { $q->where('WEB_VTA', '!=', 'S') ->orWhereNull('WEB_VTA'); })->where('BORRADO', 'N')->count(), 'color' => 'secondary', 'icon' => 'pause-circle' ], 'reserved' => [ 'label' => 'Con Reservas', 'count' => \App\Models\Stock::where('WW_RESE', '>', 0)->where('BORRADO', 'N')->count(), 'color' => 'warning', 'icon' => 'lock' ] ] ]) @push('css') @endpush @section('filters')
@endsection @section('table-headers') Imagen Producto Total @include('admin.stock.partials.sucursales-headers') Estado @endsection @section('table-body') @foreach($products as $product) @php $productImage = $product->stock_images->first(); @endphp @if(!empty($productImage->image)) {{ $product->DE_ARTI }} @else
@endif
{{ Str::limit($product->DE_ARTI, 35) }}
{{ $product->CO_ARTI }} @if($product->categoria)
{{ $product->categoria->DE_CATEGOR }} @endif
@php $totalReserved = $product->WW_RESE ?? 0; @endphp {{ number_format($totalReserved, 2) }} @include('admin.stock.partials.sucursales-cells') @if($product->WEB_VTA == 'S') Activo @else Inactivo @endif @endforeach @endsection @push('js') @endpush