@extends('dashboard.body.main') @section('specificpagestyles') @endsection @section('container') @if(!$activeShift)

Apertura de Caja

Para comenzar a vender, por favor ingresa el monto en efectivo inicial (sencillo) disponible en caja.

@csrf
$
@endif @php $cartQuantities = []; foreach ($productItem as $cItem) { $cartQuantities[$cItem->id] = ($cartQuantities[$cItem->id] ?? 0) + (int)$cItem->qty; } $frequentProduct = $products->first(); @endphp
{{-- Ticket Header compacto (2 líneas) --}}
TICKET N° {{ str_replace('INV-', '', $nextInvoiceNo) }} Venta al Público
Caja 01 • {{ now()->format('d/m/Y H:i') }}
{{-- Items del Ticket --}}
@forelse ($productItem as $item)
@if(!empty($item->options->image) && file_exists(public_path('upload/products/' . $item->options->image))) @elseif(!empty($item->options->image) && file_exists(storage_path('app/public/products/' . $item->options->image))) @else @endif {{ $item->name }}
{{-- Controles de cantidad --}}
{{ $item->qty }}
{{-- Precio --}} ${{ number_format($item->subtotal, 0, ',', '.') }} {{-- Botón Eliminar --}}
@empty
Agregar productos al ticket
Escanea, busca o selecciona un producto
@endforelse
{{-- Fila de acción rápida: Producto Común & Borrar todo (compacto) --}}
{{-- Resumen Totales Compacto --}}
Cant. Artículos: {{ Cart::count() }}
TOTAL COMPRA: ${{ number_format((float)Cart::total(), 0, ',', '.') }}
{{-- Botón COBRAR Destacado --}}
{{-- Buscador con escaneo de código de barras + Cámara IA --}}
{{-- Category Pills dinámicos sincronizados en tiempo real con la Base de Datos --}}
Catálogo @foreach($categories as $cat) {{ $cat->name }} @endforeach
{{-- Catálogo de Productos tipo E-commerce Grid --}}
@forelse ($products as $product) @php $inCartQty = $cartQuantities[$product->id] ?? 0; $hasCustomImage = false; $imgUrl = ''; if (!empty($product->product_image)) { if (file_exists(public_path('upload/products/thumbnail/' . $product->product_image))) { $hasCustomImage = true; $imgUrl = asset('upload/products/thumbnail/' . $product->product_image); } elseif (file_exists(storage_path('app/public/products/thumbnail/' . $product->product_image))) { $hasCustomImage = true; $imgUrl = asset('storage/products/thumbnail/' . $product->product_image); } elseif (file_exists(public_path('upload/products/' . $product->product_image))) { $hasCustomImage = true; $imgUrl = asset('upload/products/' . $product->product_image); } elseif (file_exists(storage_path('app/public/products/' . $product->product_image))) { $hasCustomImage = true; $imgUrl = asset('storage/products/' . $product->product_image); } } @endphp
{{-- Insignia 'Llevas: X' en posición absoluta fija --}} @if($inCartQty > 0) Llevas: {{ $inCartQty }} @endif
{{-- Imagen del producto (siempre se muestra, si no tiene foto se usa la genérica) --}}
{{ $product->product_name }}
{{-- Nombre y Stock disponible --}}
{{ $product->product_name }} Stk: {{ $product->product_store > 0 ? $product->product_store . ' uds' : 'Agotado' }}
{{-- Precio & Botón Agregar Fijo --}}
${{ number_format($product->selling_price, 0, ',', '.') }}
@csrf
@empty
@endforelse
{{-- Modal Detalle Producto --}} {{-- ===== Modal Producto Común ===== --}} {{-- Modal Ajustes de Cuenta --}}