@extends('layouts.app') @section('title', 'Refund '.$refund->reference) @section('content')

{{ $refund->reference }}

{{ $refund->customer?->display_name }} · requested {{ $refund->created_at?->format('d M Y H:i') }}

@if ($refund->status === 'requested')
@csrf
@endif @if ($refund->status === 'approved')
@csrf
@endif @if (in_array($refund->status, ['requested', 'approved'], true))
@csrf
@endif
@include('components.kpi', ['label' => 'Amount', 'value' => money($refund->amount), 'variant' => 'info']) @include('components.kpi', ['label' => 'Status', 'value' => title_case_words($refund->status), 'variant' => $refund->status === 'processed' ? 'good' : ($refund->status === 'rejected' ? 'bad' : 'warn')]) @include('components.kpi', ['label' => 'Refund via', 'value' => title_case_words($refund->method)]) @include('components.kpi', ['label' => 'Approved by', 'value' => $refund->approver?->name ?: '—'])

Request

Customer
{{ $refund->customer?->display_name }}
Amount
{{ money($refund->amount) }}
Refund via
{{ title_case_words($refund->method) }}
Reason
{{ title_case_words($refund->reason) }}
Requested
{{ $refund->created_at?->format('d M Y H:i') }}
Approved by
{{ $refund->approver?->name ?: 'Not yet approved' }}
Processed
{{ $refund->processed_at?->format('d M Y H:i') ?: 'Not processed' }}

Original payment

@if ($refund->payment)
Reference
{{ $refund->payment->reference }}
Amount
{{ money($refund->payment->amount) }}
Method
{{ title_case_words($refund->payment->method) }}
Paid
{{ $refund->payment->paid_at?->format('d M Y H:i') }}
@foreach ($refund->payment->invoices as $invoice)
Invoice
{{ $invoice->invoice_number }}
@endforeach
@else

The original payment is no longer on record.

@endif

What happens next

Requested
Created just now. No money has moved.
Approved
A second person has signed it off. Still no money moved — it can be rejected here.
Processed
Writes a negative payment against the customer, mirrors it onto the invoice the original payment settled, and refreshes the customer balance. This is the irreversible step.
Rejected
Closed with a reason appended. Nothing moved.
@endsection