@php $setting = $setting ?? app(\App\Services\SettingService::class)->current(); $invoice = $invoice ?? []; $currency = $invoice['currency'] ?? \App\Enums\Currency::INR; $showGst = (float) ($invoice['tax'] ?? 0) > 0; $currencyLabel = $currency instanceof \App\Enums\Currency ? $currency->value : $currency; $showHsn = $currency instanceof \App\Enums\Currency ? $currency->isInr() : $currencyLabel === 'INR'; $isInr = $showHsn; $docTitle = $isInr ? 'TAX INVOICE' : 'INVOICE'; $totalLabel = $isInr ? 'Total' : 'Balance Due'; $letterheadAddress = $setting->formattedAddressForInvoice($isInr); @endphp
@include('documents.partials.letterhead')
Bill to
{{ $invoice['client_name'] }}
{{ $invoice['client_address'] ?? '' }}
@if (! empty($invoice['client_gst']))
GSTIN: {{ $invoice['client_gst'] }}
@endif
{{ $docTitle }}
@if (! empty($invoice['po_number'])) @endif
P.O. no. {{ $invoice['po_number'] }}@if (! empty($invoice['po_date'])) dated {{ \Illuminate\Support\Carbon::parse($invoice['po_date'])->format('d M Y') }}@endif
Invoice no.{{ $invoice['number'] }}
Date{{ \Illuminate\Support\Carbon::parse($invoice['date'])->format('d M Y') }}
Currency{{ $currencyLabel }}
@if ($showHsn) @endif @foreach ($invoice['items'] as $index => $item) @if ($showHsn) @endif @endforeach @if ($showGst) @if ($showHsn) @endif @endif
# DescriptionHSN/SACQty Rate Amount
{{ $index + 1 }} {{ $item['description'] }}{{ $item['hsn'] ?? '' }}{{ number_format((float) $item['qty'], 2) }} {{ money($item['rate'], 2, $currency) }} {{ money($item['amount'], 2, $currency) }}
{{ count($invoice['items']) + 1 }} GST @ {{ number_format((float) $invoice['tax_rate'], 2) }}%1.00 {{ money($invoice['tax'], 2, $currency) }} {{ money($invoice['tax'], 2, $currency) }}
@if (! empty($invoice['notes']))
Notes
{{ $invoice['notes'] }}
@endif
@if ($showGst) @endif
Subtotal {{ money($invoice['subtotal'], 2, $currency) }}
GST @ {{ number_format((float) $invoice['tax_rate'], 2) }}% {{ money($invoice['tax'], 2, $currency) }}
{{ $totalLabel }} {{ money($invoice['total'], 2, $currency) }}
@include('documents.partials.signoff', ['alignLeft' => true])