@if ($tenant)
{{ t('bill_to') }}
{{ $tenant->billing_name ?? ($tenant->company_name ?? 'Customer') }}
@if (!empty($tenant->billing_address)){!! nl2br(e($tenant->billing_address)) !!}
@endif
@if (!empty($tenant->billing_city)){{ $tenant->billing_city }}@if (!empty($tenant->billing_state)), {{ $tenant->billing_state }}@endif {{ $tenant->billing_zip_code ?? '' }}
@endif
@if (!empty($tenant->billing_phone)){{ $tenant->billing_phone }}
@endif
@if (!empty($tenant->billing_email)){{ $tenant->billing_email }}@endif
@endif
@if ($items && $items->count() > 0)
| {{ t('description') }} | {{ t('price') }} | {{ t('quantity') }} | {{ t('amount') }} |
@foreach ($items as $item)
{{ $item->title ?? t('default_item_title') }} @if (!empty($item->description)){!! nl2br(e($item->description)) !!} @endif |
{{ $invoice ? $invoice->formatAmount($item->amount ?? 0) : number_format($item->amount ?? 0, 2) }} |
{{ $item->quantity ?? 1 }} |
{{ $invoice ? $invoice->formatAmount(($item->amount ?? 0) * ($item->quantity ?? 1)) : number_format(($item->amount ?? 0) * ($item->quantity ?? 1), 2) }} |
@endforeach
@endif
@if ($invoice)
@php
$taxDetails = $invoice->getTaxDetails();
$subtotal = $invoice->subTotal();
$calculatedTaxAmount = 0;
foreach ($taxDetails as $tax) { $amt = $tax['amount'] ?? 0; if ($amt <= 0 && ($tax['rate'] ?? 0) > 0) { $amt = $subtotal * (($tax['rate'] ?? 0) / 100); } $calculatedTaxAmount += $amt; }
$fee = $invoice->fee ?? 0;
$calculatedTotal = $subtotal + $calculatedTaxAmount + $fee;
@endphp
| {{ t('subtotal') }} | {{ $invoice->formatAmount($subtotal) }} |
@if (count($taxDetails) > 0)@foreach ($taxDetails as $tax)| {{ $tax['name'] ?? t('tax_label') }} ({{ $tax['formatted_rate'] ?? '0%' }}) | {{ ($tax['amount'] ?? 0) <= 0 && ($tax['rate'] ?? 0) > 0 ? $invoice->formatAmount($subtotal * (($tax['rate'] ?? 0) / 100)) : $tax['formatted_amount'] ?? $invoice->formatAmount(0) }} |
@endforeach
@else| {{ t('tax') }} (0%) | {{ $invoice->formatAmount(0) }} |
@endif
@if ($fee > 0)| {{ t('fee') }} | {{ $invoice->formatAmount($fee) }} |
@endif
@if (count($creditTransactions) > 0)
| {{ t('credit_applied') }} | @php $credits = $creditTransactions->sum('amount'); if ($credits > $calculatedTotal) { $credits = $calculatedTotal; } @endphp{{ '- ' . $invoice->formatAmount($credits) }} |
| {{ $invoice->status == 'paid' ? t('amount_paid') : t('amount_due') }} | @php $finalamount = $calculatedTotal - $credits; @endphp{{ $invoice->formatAmount($finalamount) }} |
@endif
| {{ t('total') }} | {{ $invoice->formatAmount($calculatedTotal) }} |
@endif
@if ($invoice && $invoice->status === 'paid' && isset($transactions) && $transactions->count() > 0)
Transaction Details
@foreach ($transactions as $transaction)
Transaction ID: {{ $transaction->id }}
Payment Method: {{ ucfirst(str_replace('_', ' ', $transaction->type ?? '-')) }}
Reference: {{ $transaction->idempotency_key ?? '-' }}
Gateway Txn ID: {{ $transaction->metadata['transaction_id'] ?? $transaction->metadata['payment_reference'] ?? '-' }}
Payment Ref: {{ $transaction->metadata['exchange_reference_number'] ?? $transaction->metadata['order_no'] ?? '-' }}
Processed: {{ $transaction->created_at ? $transaction->created_at->format('M j, Y H:i') : '-' }}
@endforeach
@endif
@if ($invoice && $invoice->status === 'paid')
{{ t('payment_information') }}
{{ t('paid_on') }} {{ $invoice->paid_at ? $invoice->paid_at->format('F j, Y') : 'N/A' }}
{{ t('payment_received_message') }}
@endif