STUDENT ORDER INVOICE

Student Order # @if(!empty($order->invoice_number)) {{ $order->invoice_number }} @elseif(!empty($order->order_number)) {{ $order->order_number }} @else {{ $order->id }} @endif

Company Logo

Student: @if($order->student) {{ $order->student->student_name ?? '' }} @if(!empty($order->student->student_id)) {{ $order->student->student_id }} @endif @if(!empty($order->student->email))
Email: {{ $order->student->email }} @endif @if(!empty($order->student->phone))
Phone: {{ $order->student->phone }} @endif @else Student @endif

School: {{ $order->student && $order->student->school ? $order->student->school->name : 'N/A' }}

Invoice Date: {{ \Carbon\Carbon::parse($order->created_at)->format('d M Y') }}

@php $i = 1; $subtotal = 0; $items = $order->orderItems ?? collect(); // Group items by type (compulsory and addon) $compulsoryItems = $items ->filter(fn ($it) => in_array($it->item_type, ['compulsary', 'compulsory'], true)) ->sortBy('reference_id'); $addonItems = $items->where('item_type', 'addon')->sortBy('reference_id'); @endphp @if($compulsoryItems->count() > 0) @foreach($compulsoryItems as $item) @php $qty = $item->quantity ?? 1; $unitPrice = $item->unit_price ?? 0; $lineTotal = $item->line_total ?? ($qty * $unitPrice); $subtotal += $lineTotal; @endphp @endforeach @endif @if($addonItems->count() > 0) @foreach($addonItems as $item) @php $qty = $item->quantity ?? 1; $unitPrice = $item->unit_price ?? 0; $lineTotal = $item->line_total ?? ($qty * $unitPrice); $subtotal += $lineTotal; @endphp @endforeach @endif @if($items->count() == 0) @endif
# Product Qty Unit Price Total
Compulsory Items
{{ $i++ }} {{ $item->name ?? 'N/A' }} Compulsory {{ $qty }} ₹{{ number_format($unitPrice, 2) }} ₹{{ number_format($lineTotal, 2) }}
Add-on Items
{{ $i++ }} {{ $item->name ?? 'N/A' }} Add-on {{ $qty }} ₹{{ number_format($unitPrice, 2) }} ₹{{ number_format($lineTotal, 2) }}
No products found.
Subtotal ₹{{ number_format((float) ($order->subtotal ?? $subtotal), 2) }}
Grand Total ₹{{ number_format((float) ($order->total ?? ($order->subtotal ?? $subtotal)), 2) }}
Notes:
Thank you for your order. Please contact support if you have any questions regarding your student order.
Payment is due @if(isset($order->due_date)) by {{ \Carbon\Carbon::parse($order->due_date)->format('d M Y') }}. @else within 7 days. @endif