@extends('appshell::layouts.private') @section('title') Payout #{{ $payout->id }} @stop @section('content') @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- ── Payout header card ────────────────────────────── --}}
Payout #{{ $payout->id }}

Affiliate: {{ $payout->affiliate->code ?? '—' }} ({{ optional($payout->affiliate->user)->email ?? '—' }})

Total: ${{ number_format($payout->amount, 2) }}   {{ ucfirst($payout->status) }}

@if($payout->paid_at)

Paid: {{ $payout->paid_at->format('d M Y H:i') }}

@endif @if($payout->reference)

Reference: {{ $payout->reference }}

@endif @if($payout->notes)

Notes: {{ $payout->notes }}

@endif
@if($payout->affiliate->payout_instructions)
Payment Details (affiliate-supplied)
{{ $payout->affiliate->payout_instructions }}
@endif
{{-- ── Line items ───────────────────────────────────── --}}
Conversion Line Items
@forelse($payout->items as $item) @php $c = $item->conversion; @endphp @empty @endforelse
Conversion # Order Tier Sale Amount Commission Date
{{ $c->id ?? '—' }} {{ $c->order_id ?? '—' }} Tier {{ $c->tier ?? 1 }} ${{ number_format($c->amount ?? 0, 2) }} ${{ number_format($c->commission ?? 0, 2) }} {{ optional($c->created_at)->format('d M Y') ?? '—' }}
No items.
Total: ${{ number_format($payout->items->sum(fn($i) => $i->conversion->commission ?? 0), 2) }}
{{-- ── Mark as paid form (only when pending) ────────── --}} @unless($payout->isPaid())
Mark as Paid
@csrf
@endunless @stop