{{ $company?->name ?? config('app.name') }}
@if ($company?->legal_name)
{{ $company->legal_name }}
@endif @if ($company?->tax_id)
RUC: {{ $company->tax_id }}
@endif @if ($company?->address)
{{ $company->address }}{{ $company->city ? ' · '.$company->city : '' }}
@endif @if ($company?->phone)
Tel.: {{ $company->phone }}
@endif
COMPROBANTE DE VENTA
Número:{{ $sale->number }}
Sucursal:{{ $sale->branch?->name ?? 'Casa Central' }}
Fecha:{{ $sale->sold_at->format('d/m/Y H:i') }}
Caja:{{ $sale->cashSession?->cashRegister?->code ?? '—' }}
Cajero:{{ $sale->user?->name ?? '—' }}
Cliente: {{ $sale->customer?->name ?? 'Consumidor final' }}
@if ($sale->customer?->document_number)
{{ $sale->customer->document_type }}: {{ $sale->customer->document_number }}
@endif
@foreach ($sale->items as $item)
{{ $item->description }}
{{ number_format((float) $item->quantity, 3, ',', '.') }} × {{ number_format((float) $item->unit_price, 0, ',', '.') }} {{ number_format((float) $item->line_total, 0, ',', '.') }}
@if ($item->price_type === 'mayorista')
Precio mayorista aplicado
@endif
{{ (float) $item->tax_rate === 0.0 ? 'Exento de IVA' : 'IVA '.number_format((float) $item->tax_rate, 0).'%' }}
@if ((float) $item->discount > 0)
Descuento− {{ number_format((float) $item->discount, 0, ',', '.') }}
@endif
@endforeach
SubtotalGs. {{ number_format((float) $sale->subtotal, 0, ',', '.') }}
@if ((float) $sale->discount > 0)
Descuento− Gs. {{ number_format((float) $sale->discount, 0, ',', '.') }}
@endif
TOTALGs. {{ number_format((float) $sale->total, 0, ',', '.') }}
@php($taxGroups = $sale->items->groupBy(fn ($item) => (string) (float) $item->tax_rate)) @foreach ($taxGroups as $rate => $items)
{{ (float) $rate === 0.0 ? 'Productos exentos' : 'IVA incluido '.number_format((float) $rate, 0).'%' }} @if ((float) $rate === 0.0) Gs. {{ number_format((float) $items->sum('line_total'), 0, ',', '.') }} @else Gs. {{ number_format((float) $items->sum('tax_amount'), 0, ',', '.') }} @endif
@endforeach
Forma de pago{{ ucfirst($sale->payment_method) }}
@foreach ($sale->payments as $payment)
{{ ucfirst($payment->method) }}Gs. {{ number_format((float) $payment->amount, 0, ',', '.') }}
@endforeach @if ($sale->payment_method === 'efectivo')
RecibidoGs. {{ number_format((float) $sale->amount_received, 0, ',', '.') }}
VueltoGs. {{ number_format((float) $sale->change_amount, 0, ',', '.') }}
@endif @if ($sale->electronicDocument)
Factura electrónica: {{ ucfirst($sale->electronicDocument->status) }}
Entorno: {{ ucfirst($sale->electronicDocument->environment) }}
@endif