@extends('dashboard.layouts.app') @section('content') @include('components.alert') @php $selectedPeriodLabel = \Carbon\Carbon::create()->month((int) $month)->year((int) $year)->format('F Y'); $expireDate = $promocode->expire_date ? \Carbon\Carbon::parse($promocode->expire_date) : null; $isExpired = $expireDate ? $expireDate->isPast() : false; $typeLabel = ucfirst($promocode->type); $discountLabel = $promocode->type === 'percentage' ? number_format($promocode->discount, 0) . '%' : number_format($promocode->discount, 0); @endphp
Back to List
Promocode
{{ $promocode->code }}
Created by {{ $promocode->createdBy->full_name ?? '—' }}
{{ $isExpired ? 'Expired' : 'Active' }} {{ $promocode->is_monthly_renewable ? 'Monthly Renewable' : 'Not Renewable' }}
Usage Filter

Filter promocode invoice usage by selected month and year.

{{ $selectedPeriodLabel }}
Limit
{{ $promocode->limit }}
Discount
{{ $discountLabel }}
Total Usage
{{ $promocode->usage_count_total ?? 0 }}
{{ $selectedPeriodLabel }} Usage
{{ $promocode->usage_count_filtered ?? 0 }}
Promocode Information

Main configuration and usage information for this promocode.

{{ $typeLabel }}
{{ $promocode->code }} {{ $promocode->limit }} {{ $typeLabel }} {{ $discountLabel }} {{ $promocode->is_monthly_renewable ? 'Yes' : 'No' }} @if ($expireDate) {{ $expireDate->format('d M Y') }} @else — @endif {{ $promocode->usage_count_total ?? 0 }} {{ $promocode->usage_count_filtered ?? 0 }} {{ $promocode->createdBy->full_name ?? '—' }}
Related Invoices

Invoices that used this promocode in {{ $selectedPeriodLabel }}.

{{ $promocode->studentInvoices->count() }} Invoice(s)
@forelse ($promocode->studentInvoices as $invoice) @php $completionStatusClass = $invoice->display_completion_status === 'complete' ? 'ui-pill--success' : 'ui-pill--warn'; @endphp {{ $loop->iteration }} {{ $invoice->invoice_number }} {{ $invoice->createdBy->email ?? '—' }}
{{ trim(($invoice->student->first_name ?? '') . ' ' . ($invoice->student->last_name ?? '')) ?: '—' }}
@if ($invoice->type == 'track') {{ $invoice->track->name_en ?? '—' }} @else {{ $invoice->product->name_en ?? '—' }} @endif
{{ $invoice->display_completion_status_label }} {{ \Carbon\Carbon::parse($invoice->created_at)->format('d M Y') }} @empty
No invoices found.

No invoices found for this promocode in {{ $selectedPeriodLabel }}.

@endforelse
@endsection