@extends('tickets.layouts.admin_layout') @section('title', 'Orders - Loyaltiya Tickets') @section('content')

Orders

{{-- Summary cards --}}

Orders

{{ $summary['total_orders'] }}

Revenue

{{ number_format($summary['total_revenue'], 2) }}

Tickets Sold

{{ $summary['total_tickets'] }}

{{-- Date filter --}}
{{-- Orders table --}}
@if ($orders->isEmpty())

No orders found for this range.

@else
@foreach ($orders as $order) @endforeach
Order # Event Customer Qty Total Coupon Status Date
#{{ $order->id }} {{ $order->event->name }} {{ $order->customer->name }} {{ $order->quantity }} {{ $order->currency }} {{ number_format($order->total_amount, 2) }} @if ($order->coupon) {{ $order->coupon->code }} @else @endif {{ ucfirst($order->status) }} {{ $order->created_at->format('M d, Y h:i A') }}
{{-- Customer details --}}
Customer

Name: {{ $order->customer->name }}

Email: {{ $order->customer->email }}

@if ($order->customer->phone)

Phone: {{ $order->customer->phone }}

@endif

Type: {{ $order->customer->is_guest ? 'Guest checkout' : 'Registered account' }}

{{-- Order / payment details --}}
Order

Unit Price: {{ $order->currency }} {{ number_format($order->unit_price, 2) }}

Quantity: {{ $order->quantity }}

@if ($order->discount_amount > 0)

Discount: -{{ $order->currency }} {{ number_format($order->discount_amount, 2) }}

@endif

Total Paid: {{ $order->currency }} {{ number_format($order->total_amount, 2) }}

Paid At: {{ $order->paid_at ? $order->paid_at->format('M d, Y h:i A') : 'Not paid yet' }}

{{-- Coupon details --}}
Coupon
@if ($order->coupon)

Code: {{ $order->coupon->code }}

Type: {{ $order->coupon->type === 'percentage' ? $order->coupon->value . '% off' : $order->currency . ' ' . number_format($order->coupon->value, 2) . ' off' }}

Amount Saved: {{ $order->currency }} {{ number_format($order->discount_amount, 2) }}

@else

No coupon applied.

@endif
{{-- Tickets / check-in status --}} @if ($order->tickets->isNotEmpty())
Tickets
@foreach ($order->tickets as $ticket) @endforeach
Ticket # Status Checked In Last Check-in
{{ $ticket->ticket_number }} {{ ucfirst($ticket->status) }} {{ $ticket->checked_in_count }} / {{ $order->quantity }} {{ $ticket->checked_in_at ? $ticket->checked_in_at->format('M d, Y h:i A') : '—' }}
@endif
{{ $orders->links() }}
@endif
@endsection @push('styles') @endpush @push('scripts') @endpush