@extends('admin.layout.app') @section('content')

Student Order Details

Back to Orders
@if (session('success'))
{{ session('success') }}
@endif
Order Information
Order ID {{ $order->id }}
Student ID {{ $order->student ? $order->student->student_id : 'N/A' }}
Student Name {{ $order->student ? $order->student->student_name : 'N/A' }}
School {{ $order->student && $order->student->school ? $order->student->school->name : 'N/A' }}
Order Date {{ $order->created_at ? $order->created_at->format('Y-m-d H:i') : '' }}
Status {{ ucfirst($order->order_status ?? 'pending') }}
Total Items {{ $order->orderItems->count() }}
@csrf
Invoice
Order Items
@if($order->orderItems->count())
@php $total = 0; @endphp @foreach($order->orderItems as $k => $item) @php $lineTotal = (float) ($item->line_total ?? ((float) $item->unit_price * (int) $item->quantity)); $total += $lineTotal; $typeLabel = $item->item_type === 'addon' ? 'Add On' : 'Compulsory'; @endphp @endforeach
# Item Type Qty Unit Price Subtotal
{{ $k + 1 }} {{ $item->name }} {{ $typeLabel }} {{ $item->quantity }} ₹{{ number_format((float) $item->unit_price, 2) }} ₹{{ number_format($lineTotal, 2) }}
Total ₹{{ number_format($total, 2) }}
@else
No items found for this order.
@endif
@endsection