@if ($config->mostrar_logo_ticket && $config->logo)
 }})
@endif
{{ $config->nombre_comercial ?: $config->nombre_empresa }}
@if ($config->nif)
RUC: {{ $config->nif }}
@endif
@if ($config->direccion)
{{ $config->direccion }}
@endif
{{ trim(($config->codigo_postal ?? '').' '.($config->poblacion ?? '')) }}
@if ($config->telefono)
Tel: {{ $config->telefono }}
@endif
@if ($config->cabecera_ticket)
{{ $config->cabecera_ticket }}
@endif
@php
$tipoDocNombre = match($venta->tipo) {
'factura' => 'FACTURA ELECTRÓNICA',
'boleta' => 'BOLETA DE VENTA ELECTRÓNICA',
'nota_credito' => 'NOTA DE CRÉDITO ELECTRÓNICA',
'nota_debito' => 'NOTA DE DÉBITO ELECTRÓNICA',
'guia_remision' => 'GUÍA DE REMISIÓN REMITENTE',
'cotizacion' => 'COTIZACIÓN / PROFORMA',
default => 'NOTA DE VENTA (TICKET INTERNO)',
};
@endphp
| {{ $tipoDocNombre }} |
| Número: | {{ $venta->referencia }} |
| Fecha de emisión: | {{ $venta->fecha->format('d/m/Y H:i') }} |
| Cajero / Vendedor: | {{ $venta->user->name ?? '-' }} |
@if ($venta->cliente)
| Señor(es): | {{ $venta->cliente->nombre_completo }} |
@if ($venta->cliente->nif)
| {{ strlen($venta->cliente->nif) === 11 ? 'RUC:' : 'DNI:' }} | {{ $venta->cliente->nif }} |
@endif
@if ($venta->cliente->direccion)
| Dirección: | {{ $venta->cliente->direccion }} |
@endif
@else
| Cliente: | CLIENTES VARIOS |
@endif
| Articulo |
Cant. |
Precio |
Importe |
@foreach ($venta->detalles as $d)
| {{ $d->descripcion }} |
|
{{ rtrim(rtrim(number_format($d->cantidad, 2, '.', ''), '0'), '.') }} |
{{ formato_numero($d->precio_unitario, 2) }} |
{{ formato_numero($d->total, 2) }} |
@if ($d->descuento_porcentaje > 0)
| Dto. {{ formato_numero($d->descuento_porcentaje, 0) }}% |
@endif
@endforeach
@if (($venta->op_gravadas ?? 0) > 0)
| Op. Gravadas | {{ formato_moneda($venta->op_gravadas) }} |
@endif
@if (($venta->op_exoneradas ?? 0) > 0)
| Op. Exoneradas (Ley Libro) | {{ formato_moneda($venta->op_exoneradas) }} |
@endif
@if ($venta->descuento_importe > 0)
| Descuento ({{ formato_numero($venta->descuento_porcentaje, 0) }}%) | -{{ formato_moneda($venta->descuento_importe) }} |
@endif
| IGV (18%) | {{ formato_moneda($venta->iva_importe) }} |
| TOTAL | {{ formato_moneda($venta->total) }} |
{{-- Monto en Letras SUNAT --}}
{{ numero_a_letras($venta->total) }}
| Forma de pago | {{ $venta->forma_pago === 'yape_plin' ? 'Yape / Plin' : ucfirst($venta->forma_pago) }} |
@if ($venta->forma_pago === 'efectivo' && $venta->importe_entregado > 0)
| Entregado | {{ formato_moneda($venta->importe_entregado) }} |
| Cambio / Vuelto | {{ formato_moneda($venta->cambio) }} |
@endif
@if ($venta->forma_pago === 'mixto')
| Efectivo | {{ formato_moneda($venta->importe_efectivo) }} |
| Tarjeta | {{ formato_moneda($venta->importe_tarjeta) }} |
@endif
@if ($venta->puntos_generados > 0)
| Puntos obtenidos | +{{ $venta->puntos_generados }} |
@endif
{{-- Código QR de Representación Impresa (SUNAT) --}}
@php
$tipoSunat = match($venta->tipo) {
'factura' => '01',
'boleta' => '03',
'nota_credito' => '07',
'nota_debito' => '08',
'guia_remision' => '09',
default => '00',
};
$docCliente = $venta->cliente?->nif ?? '00000000';
$qrData = implode('|', [
$config->nif ?? '',
$tipoSunat,
$venta->serie,
str_pad($venta->numero, 8, '0', STR_PAD_LEFT),
number_format($venta->iva_importe, 2, '.', ''),
number_format($venta->total, 2, '.', ''),
$venta->fecha->format('Y-m-d'),
strlen($docCliente) === 11 ? '6' : '1',
$docCliente
]);
$qrUrl = 'https://api.qrserver.com/v1/create-qr-code/?size=110x110&data=' . urlencode($qrData);
@endphp
Representación impresa de Comprobante de Pago Electrónico
@if ($config->pie_ticket){{ $config->pie_ticket }}
@endif
{{ now()->format('d/m/Y H:i') }}
@php
$urlPubTicket = $venta->url_publica;
$nomCli = $venta->cliente ? ($venta->cliente->nombre_completo ?? $venta->cliente->nombre) : 'Cliente';
$empNom = $config->nombre_comercial ?? $config->nombre_empresa ?? 'Librería';
$msgWsTicket = "Hola {$nomCli}, le compartimos su comprobante electrónico {$venta->referencia} por " . formato_moneda($venta->total) . " de {$empNom}.\n\nPuede visualizarlo aquí: {$urlPubTicket}";
$telWs = preg_replace('/[^0-9]/', '', $venta->cliente?->telefono ?? '');
if (strlen($telWs) === 9) $telWs = '51' . $telWs;
$linkWsApp = $telWs ? "whatsapp://send?phone={$telWs}&text=" . rawurlencode($msgWsTicket) : "whatsapp://send?text=" . rawurlencode($msgWsTicket);
@endphp
📱 WhatsApp