@if($companyData['logo']) @php $logoPath = str_replace(['storage/', 'public/'], '', $companyData['logo']); $fullPath = public_path('storage/' . $logoPath); @endphp @if(file_exists($fullPath)) @endif @endif
{{ $companyData['nombre'] }}
@if($companyData['ruc_nit']) RUC: {{ $companyData['ruc_nit'] }} @endif @if($companyData['direccion']) | {{ \Illuminate\Support\Str::limit($companyData['direccion'], 40) }} @endif @if($companyData['telefono']) | Tel: {{ $companyData['telefono'] }} @endif
FACTURA
No. {{ $invoice->invoice_number }}
Fecha: {{ $invoice->invoice_date->format('d/m/Y') }}
@if($invoice->due_date) Vence: {{ $invoice->due_date->format('d/m/Y') }}
@endif Moneda: {{ $invoice->currency }}
Cliente:
{{ $invoice->client->business_name ?? $invoice->client->legal_name }} @if($invoice->client->tax_id) | RUC: {{ $invoice->client->tax_id }} @endif
@if($invoice->salesman) Vendedor: {{ $invoice->salesman->first_name }} {{ $invoice->salesman->last_name }} @endif
@if($invoice->discount_amount > 0) @endif @foreach($invoice->details as $index => $detail) @if($invoice->discount_amount > 0) @endif @endforeach
# Producto Cant. PrecioDesc.Total
{{ $index + 1 }} {{ $detail->product->name ?? 'N/A' }} @if($detail->product->sku)
SKU: {{ $detail->product->sku }} @endif
{{ number_format($detail->quantity_ordered, 0) }} {{ number_format($detail->unit_price, 2) }} @if($detail->discount_percentage > 0) {{ number_format($detail->discount_percentage, 2) }}% @else - @endif {{ number_format($detail->total_price, 2) }}
Subtotal: {{ number_format($invoice->subtotal, 2) }} {{ $invoice->currency }}
@if($invoice->discount_amount > 0)
Descuento: -{{ number_format($invoice->discount_amount, 2) }}
@endif @if($invoice->tax_amount > 0)
IVA: {{ number_format($invoice->tax_amount, 2) }}
@endif
TOTAL: {{ number_format($invoice->total_amount, 2) }} {{ $invoice->currency }}
@if($invoice->notes)
Notas:
{{ \Illuminate\Support\Str::limit($invoice->notes, 150) }}
@endif