@extends('layouts.app') @section('content') @include('proedge.admin.discounts._styles') @php $hasFilters = request()->hasAny(['keyword', 'offer_id', 'from', 'to']); @endphp
@include('proedge.admin.discounts._flash')
@include('proedge.admin.discounts._panel_head', [ 'title' => 'Redemptions', 'addTarget' => null, 'hasFilters' => $hasFilters, ])
{{-- Filters --}}
Reset

@include('proedge.admin.discounts._summary')
@include('proedge.admin.discounts._th', ['field' => 'redeemed_at', 'label' => 'When']) @include('proedge.admin.discounts._th', ['field' => 'code', 'label' => 'Code']) @include('proedge.admin.discounts._th', ['field' => 'user_id', 'label' => 'User']) @include('proedge.admin.discounts._th', ['field' => 'amount_discounted', 'label' => 'Discount']) @forelse($redemptions as $r) @empty @endforelse
Offer PartnerApplied to
{{ $r->redeemed_at ? $r->redeemed_at->format('d M Y H:i') : '—' }} @if($r->code) {{ $r->code }} @else {{-- An offer given straight to a customer, or a coupon applied in the Stripe Dashboard. --}} given directly @endif {{ data_get($r->rule_snapshot, 'name', optional($r->offer)->name) ?: '—' }} {{ data_get($r->rule_snapshot, 'partner') ?: '—' }} {{ optional($r->user)->name ?: 'Unknown' }} #{{ $r->user_id }} {{ str_replace('_', ' ', $r->redeemable_type) }} #{{ $r->redeemable_id }} @if(! $r->gateway_invoice_id && (float) $r->amount_discounted === 0.0) {{-- Applied to a customer but not billed yet; the first invoice carrying it fills the amount in. --}} awaiting first invoice @else {{ strtoupper($r->currency) }} {{ number_format((float) $r->amount_discounted, 2) }} @endif
@if($hasFilters) No redemptions match those filters. @else Nothing redeemed yet. Redemptions are recorded once checkout can accept codes. @endif
{{-- Bootstrap 3 numbered pagination, matching Leads. The app's default template is Tailwind, which this panel does not load, so it fell back to bare Previous / Next links. --}} {{ $redemptions->links('pagination::default') }}
@endsection