{{ $company['name'] }}
{{ $company['address'] }}
{{ $company['city'] }}, {{ $company['postal_code'] }}
{{ $company['country'] }}
Phone: {{ $company['phone'] }}
Email: {{ $company['email'] }}
INVOICE
Invoice #: {{ $invoice->invoice_number }}
Date: {{ $invoice->created_at->format('M d, Y') }}
@if($invoice->paid_at)
Paid: {{ $invoice->paid_at->format('M d, Y') }}
@endif
{{ ucfirst($invoice->status) }}
Bill To:
{{ $user->first_name }} {{ $user->last_name }}
{{ $user->email }}
@if($user->phone)
{{ $user->phone }}
@endif @if($user->address)
{{ $user->address }}
@endif @if(isset($metadata['billing_info'])) @php $billing = is_string($metadata['billing_info']) ? json_decode($metadata['billing_info'], true) : $metadata['billing_info']; @endphp @if($billing)
{{ $billing['city'] ?? '' }}{{ isset($billing['province']) ? ', ' . $billing['province'] : '' }}
{{ $billing['postal_code'] ?? '' }}
{{ $billing['country'] ?? '' }}
@endif @endif
@if(isset($metadata['user']))
User Category: {{ $metadata['user']['user_category_name'] ?? $metadata['user']['user_category'] ?? 'N/A' }}
@endif @if(isset($metadata['payment_type']))
Payment Type: {{ ucwords(str_replace('_', ' ', $metadata['payment_type'])) }}
@endif
@if($payment_type === 'course_enrollment') @elseif(isset($metadata['type']) && $metadata['type'] === 'immigopro_package') @else @endif
Description Quantity Unit Price Amount
Course Enrollment: {{ $metadata['course']['title'] ?? $metadata['course_title'] ?? 'Course' }} @if(isset($metadata['course'])) @if(isset($metadata['course']['description']))
{{ Str::limit($metadata['course']['description'], 150) }}
@endif @if(isset($metadata['course']['duration']) || isset($metadata['course']['level']))
@if(isset($metadata['course']['duration'])) Duration: {{ $metadata['course']['duration'] }} @endif @if(isset($metadata['course']['level'])) | Level: {{ ucfirst($metadata['course']['level']) }} @endif @if(isset($metadata['course']['language'])) | Language: {{ $metadata['course']['language'] }} @endif
@endif @endif
1 {{ number_format($metadata['amount'] ?? $invoice->amount, 2) }} {{ number_format($metadata['amount'] ?? $invoice->amount, 2) }} {{ strtoupper($invoice->currency) }}
ImmigoPro Package: {{ $metadata['package_name'] ?? 'Package' }} @if(isset($metadata['payment_plan']))
Payment Plan: {{ $metadata['payment_plan'] === 'full' ? 'Full Payment' : ($metadata['payment_plan'] === '3month' ? '3-Month Plan' : ($metadata['payment_plan'] === '6month' ? '6-Month Plan' : ($metadata['payment_plan'] === '12month' ? '12-Month Plan' : ucfirst($metadata['payment_plan'])))) }}
@endif @if(isset($metadata['description']))
{{ $metadata['description'] }}
@endif
1 {{ number_format($metadata['amount'] ?? $invoice->amount, 2) }} {{ number_format($metadata['amount'] ?? $invoice->amount, 2) }} {{ strtoupper($invoice->currency) }}
{{ $metadata['product_name'] ?? $metadata['plan_name'] ?? 'Service' }} @if(isset($metadata['description']))
{{ $metadata['description'] }}
@endif
1 {{ number_format($invoice->amount, 2) }} {{ number_format($invoice->amount, 2) }} {{ strtoupper($invoice->currency) }}
@php $subtotal = isset($metadata['amount']) ? floatval($metadata['amount']) : floatval($invoice->amount); $taxAmount = isset($metadata['tax_amount']) ? floatval($metadata['tax_amount']) : 0; $total = floatval($invoice->amount); // Calculate tax rate if we have both subtotal and tax $taxRate = 0; if ($subtotal > 0 && $taxAmount > 0) { $taxRate = ($taxAmount / $subtotal) * 100; } @endphp
Subtotal:
{{ number_format($subtotal, 2) }} {{ strtoupper($invoice->currency) }}
@if($taxAmount > 0)
Tax @if($taxRate > 0)({{ number_format($taxRate, 2) }}%)@endif:
{{ number_format($taxAmount, 2) }} {{ strtoupper($invoice->currency) }}
@else
Tax:
0.00 {{ strtoupper($invoice->currency) }}
@endif
Total Amount:
{{ number_format($total, 2) }} {{ strtoupper($invoice->currency) }}
@if($invoice->status === 'paid' && $invoice->paid_at)
Amount Paid:
{{ number_format($total, 2) }} {{ strtoupper($invoice->currency) }}
Balance Due:
0.00 {{ strtoupper($invoice->currency) }}
@endif
@if(isset($metadata['user_details']) || isset($metadata['billing_info']))
Payment Information
@if(isset($metadata['user_details']))
Customer: {{ $metadata['user_details']['full_name'] ?? 'N/A' }}
@if(isset($metadata['user_details']['user_category']))
Category: {{ $metadata['user_details']['user_category'] }}
@endif @endif @if($invoice->status === 'paid')
✓ Payment Completed on {{ $invoice->paid_at->format('M d, Y \a\t h:i A') }}
@endif @if(isset($metadata['user_details']['email']))
Email: {{ $metadata['user_details']['email'] }}
@endif
@endif