@csrf
@if($order->table) ← Volver a la mesa @else @endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
{{-- ENCABEZADO EMPRESA --}}
@php $logo = $settings['company_logo'] ?? null; @endphp @if($logo) @endif
{{ $settings['company_name'] ?? 'MI RESTAURANTE' }}
@if(!empty($settings['company_ruc']))
RUC {{ $settings['company_ruc'] }}
@endif @if(!empty($settings['company_address']))
{{ $settings['company_address'] }}
@endif @if(!empty($settings['company_phone']))
Tel: {{ $settings['company_phone'] }}
@endif
{{ $order->document_type == 'Factura' ? 'Factura de Venta Electrónica' : ($order->document_type == 'Boleta' ? 'Boleta de Venta Electrónica' : 'Nota de Venta') }}
@if($order->serie && $order->correlativo) {{ $order->serie }}-{{ str_pad($order->correlativo, 4, '0', STR_PAD_LEFT) }} @else #{{ str_pad($order->id, 8, '0', STR_PAD_LEFT) }} @endif
{{-- DATOS --}} @if($order->table) @endif @if(!empty($order->waiter_name ?? null)) @endif @if(!empty($order->client_document)) @endif
Fecha{{ now()->format('d/m/Y') }}
Hora{{ now()->format('H:i:s') }}
Mesa{{ $order->table->name }}
Mozo{{ $order->waiter_name }}
Cliente{{ $order->client_name ?? 'Público General' }}
Documento{{ $order->client_document }}
{{-- DETALLE DE PRODUCTOS --}} @foreach($order->details as $detail) @endforeach
Cant Unid Descripción P.U. Dct Total
{{ $detail->quantity }} UND {{ strtoupper($detail->product->name ?? '') }} {{ number_format(round((float)$detail->price, 2), 2) }} 0.00 {{ number_format($detail->quantity * round((float)$detail->price, 2), 2) }}
{{-- TOTALES --}} @php $subtotal = $order->total / 1.18; $igv = $order->total - $subtotal; $descuento = $order->discount ?? 0; $propina = $order->tip ?? 0; $total = $order->total + $propina - $descuento; @endphp
@if($descuento > 0) @endif @if($propina > 0) @endif
Op. GravadasS/ {{ number_format($subtotal, 2) }}
IGV (18%)S/ {{ number_format($igv, 2) }}
Descuento-S/ {{ number_format($descuento, 2) }}
PropinaS/ {{ number_format($propina, 2) }}
TOTAL A PAGAR S/ {{ number_format($total, 2) }}
{{-- PAGO --}} @php $pmLabel = match($order->payment_method ?? 'cash') { 'cash' => 'Efectivo', 'card' => 'Tarjeta', 'yape' => 'Yape', 'plin' => 'Plin', 'transferencia' => 'Transferencia', default => ucfirst($order->payment_method ?? 'Efectivo') }; @endphp
CondiciónContado / {{ $pmLabel }}
Pago ({{ $pmLabel }})S/ {{ number_format((float)($order->received_amount ?? $total), 2) }}
SaldoS/ {{ number_format(($order->received_amount ?? $total) - $total, 2) }}
{{-- QR / ESTADO --}}
@if(in_array($order->document_type, ['Boleta', 'Factura']))
QR
Pendiente de envío a SUNAT
⏳ PENDIENTE DE ENVÍO
@endif