Cotización #{{ $venta->numero ?? $venta->numero_cotizacion ?? $venta->id }}

Revise y complete los datos requeridos para aceptar su cotización.

@if($venta->plazo_entrega) @endif

Detalles de la Cotización

@if($venta->ventaProductos && $venta->ventaProductos->count() > 0) @php $porcentajeAgencia = intval($venta->porcentaje_agencia ?: 0); $descuento = intval($venta->descuento ?: 0); $neto = 0; @endphp {{-- Tabla de productos --}}
{{-- Cabecera --}} @foreach($venta->ventaProductos as $loop_index => $ventaProducto) @continue(!$ventaProducto->incluir_calculo) @php $cantidad = intval($ventaProducto->cantidad ?: 1); $precioProveedor = intval($ventaProducto->precio_proveedor ?: 0); $valorEstimado = intval($ventaProducto->valor_estimado ?: 0); $maquila = intval($ventaProducto->maquila ?: 0); $factoring = intval($ventaProducto->factoring ?: 0); $utilidad = intval($ventaProducto->utilidad ?: 0); $base = $precioProveedor + $valorEstimado + $maquila; $conUtilidad = $base * (1 + $utilidad / 100); $conAgencia = $conUtilidad * (1 + $porcentajeAgencia / 100); $valorUnitarioConAgencia = (int) round($conAgencia * (1 + $factoring / 100)); $valorTotal = $valorUnitarioConAgencia * $cantidad; if ($ventaProducto->incluir_calculo && !$ventaProducto->isAgotado()) { $neto += $valorTotal; } $codigo = $ventaProducto->producto->code ?? 'Sin código'; $images = $ventaProducto->producto->images ?? null; $images = is_string($images) ? json_decode($images, true) : $images; $firstImage = is_array($images) && !empty($images) ? $images[0] : null; if (!$firstImage && $ventaProducto->maqueta_imagen) { $firstImage = $ventaProducto->maqueta_imagen; } $imageSrc = $firstImage ? (filter_var($firstImage, FILTER_VALIDATE_URL) ? $firstImage : asset('storage/' . $firstImage)) : null; $productoUrl = ($codigo && $codigo !== 'Sin código') ? route('tienda.producto', $codigo) : null; $tieneAplicacion = $ventaProducto->tiene_aplicacion && $ventaProducto->tipo_aplicacion && $ventaProducto->tipo_aplicacion !== 'Sin Aplicación'; @endphp {{-- Imagen --}} {{-- Nombre + Código + Descripción --}} {{-- Cantidad --}} {{-- Aplicación --}} {{-- Precio unitario --}} {{-- Subtotal --}} @endforeach
Imagen Producto Cant. Unitario Subtotal
@if($imageSrc) {{ $ventaProducto->producto->name ?? 'Producto' }} @else
@endif
@if($productoUrl) {{ $ventaProducto->producto->name ?? 'Producto no encontrado' }} @else {{ $ventaProducto->producto->name ?? 'Producto no encontrado' }} @endif

{{ $codigo }}

@php $descRaw = $ventaProducto->descripcion ?? $ventaProducto->producto->description ?? ''; $desc = html_entity_decode(strip_tags($descRaw), ENT_QUOTES | ENT_HTML5, 'UTF-8'); $descTruncada = mb_strlen($desc) > 370 ? mb_substr($desc, 0, 370) . '…' : $desc; @endphp @if($descTruncada)

{{ $descTruncada }}

@endif
{{ $cantidad }} @if($ventaProducto->isAgotado()) @else ${{ number_format($valorUnitarioConAgencia, 0, ',', '.') }} @endif @if($ventaProducto->isAgotado()) Agotado @else ${{ number_format($valorTotal, 0, ',', '.') }} @endif
{{-- Totales --}} @php $descuentoMonto = (int) round($neto * ($descuento / 100)); $valorDespacho = intval($venta->valor_despacho ?: 0); $subtotal = $neto - $descuentoMonto + $valorDespacho; $iva = (int) round($subtotal * 0.19); $total = $subtotal + $iva; @endphp
{{-- Filas de detalle --}}
Neto ${{ number_format($neto, 0, ',', '.') }}
@if($descuento > 0)
Dcto. ({{ $descuento }}%) -${{ number_format($descuentoMonto, 0, ',', '.') }}
@endif @if($valorDespacho > 0)
Despacho ${{ number_format($valorDespacho, 0, ',', '.') }}
@endif
IVA (19%) ${{ number_format($iva, 0, ',', '.') }}
{{-- Fila Total destacada --}}
Total ${{ number_format($total, 0, ',', '.') }}
@else

No hay productos asociados a esta cotización.

@endif
@if($cotizacion_ya_aceptada)

Cotización Previamente Aceptada

Esta cotización ya ha sido procesada anteriormente.

Estado actual: {{ $venta->estado }}

Si requiere cambios, contáctese con nosotros.

@else
@if($es_rm) @else @endif
@if($empresa_autocompleta)

Empresa encontrada

Los datos de la empresa se han completado automáticamente.
@endif
@php $notaConfig = [ 'plugins' => 'lists link', 'toolbar' => 'bold italic bullist', 'height' => 200, 'statusbar' => false, 'content_style' => 'body { font-size: 14px; }', 'license_key' => 'gpl', ]; $notaClienteConfig = $notaConfig; @endphp
Aceptar y Enviar
@endif