{{-- ── ENCABEZADO ── --}}
{{ $empresa->nombre_comercial ?: $empresa->nombre }}
{{ $empresa->cedula_tipo }}-{{ $empresa->cedula_numero }}
@if($empresa->telefono)
Tel: {{ $empresa->telefono }}
@endif
{{ $empresa->email_facturacion }}

@if($factura->es_proforma) *** PROFORMA *** @else {{ match($factura->tipo_documento) { '01' => '*** FACTURA ELECTRÓNICA ***', '02' => '*** NOTA DE DÉBITO ***', '03' => '*** NOTA DE CRÉDITO ***', '04' => '*** TIQUETE ELECTRÓNICO ***', '99' => '*** REP ***', default => '*** COMPROBANTE ***' } }} @endif

{{-- ── DATOS DEL COMPROBANTE ── --}}
Consecutivo
{{ $factura->consecutivo }}
Fecha
{{ $factura->created_at->format('d/m/Y H:i') }}
@if($factura->condicion_venta === '02')
Condición
Crédito {{ $factura->plazo_credito_dias }}d
Vence
{{ $factura->fecha_vencimiento_cxc?->format('d/m/Y') }}
@endif
{{-- ── DATOS DEL CLIENTE ── --}} @if($factura->receptor_nombre)
Cliente
{{ $factura->receptor_nombre }}
@if($factura->receptor_cedula)
Cédula
{{ $factura->receptor_cedula_tipo }}-{{ $factura->receptor_cedula }}
@endif @endif
{{-- ── LÍNEAS ── --}} @foreach($lineas as $linea) @endforeach
Descripción Cant Total
{{ Str::limit($linea->descripcion, 22) }}
₡{{ number_format($linea->precio_unitario, 2) }} · {{ $linea->tarifa_iva }}% IVA @if($linea->descuento_monto > 0)
Desc: -₡{{ number_format($linea->descuento_monto, 2) }} @endif
{{ number_format($linea->cantidad, 2) }} ₡{{ number_format($linea->total_linea, 2) }}

{{-- ── TOTALES ── --}} @if($factura->base_gravada_13 > 0)
IVA 13%
₡{{ number_format($factura->iva_13, 2) }}
@endif @if($factura->base_gravada_4 > 0)
IVA 4% salud
₡{{ number_format($factura->iva_4, 2) }}
@endif @if($factura->base_gravada_2 > 0)
IVA 2% medic.
₡{{ number_format($factura->iva_2, 2) }}
@endif @if($factura->descuento_total > 0)
Descuentos
-₡{{ number_format($factura->descuento_total, 2) }}
@endif
TOTAL: ₡{{ number_format($factura->total_comprobante, 2) }}
{{-- ── MEDIOS DE PAGO ── --}} @php $medios = is_array($factura->medio_pago) ? $factura->medio_pago : json_decode($factura->medio_pago ?? '[]', true); $lpago = ['01'=>'Efectivo','02'=>'Tarjeta débito','03'=>'Tarjeta crédito', '04'=>'Transferencia','05'=>'SINPE Móvil','99'=>'Otro']; @endphp
Pago: {{ implode(' + ', array_map(fn($m) => $lpago[$m] ?? $m, $medios)) }}
{{-- ── DEVOLUCIÓN IVA ── --}} @if($factura->devolucion_iva_aplica && $factura->monto_devolucion_iva > 0)
💳 DEVOLUCIÓN IVA 4%: ₡{{ number_format($factura->monto_devolucion_iva, 2) }} Se acredita al tarjetahabiente (Art. 33, L.9635)
@elseif($factura->iva_4 > 0)
IVA 4% salud sin devolución (pago no electrónico)
@endif
{{-- ── CLAVE HACIENDA ── --}} @if(!$factura->es_proforma && $factura->clave_hacienda)
Clave Hacienda:
{{ $factura->clave_hacienda }}
Estado: {{ strtoupper($factura->estado_hacienda) }}
@endif
{{-- ── MENSAJE EMPRESA ── --}} @if($empresa->doc_mensaje_footer)
{{ $empresa->doc_mensaje_footer }}
@else
¡Gracias por su preferencia!
@endif
Comprobante electrónico · Hacienda CR v4.4