@extends('layouts.app') @section('title', 'Refund #' . $refund->id) @section('content')
{{-- Breadcrumb --}}

Refund Request #{{ $refund->id }}

{{-- Refund Status Banner --}}
Status @if($refund->status === 0) Pending @elseif($refund->status === 2) Declined @elseif($refund->status === 1 && $refund->is_completed) Completed @elseif($refund->status === 1) Processing @else Unknown @endif
Product {{ $refund->orderItem?->product_title ?? 'Unknown' }}
Amount ₦{{ number_format($refund->orderItem?->product_total_price ?? 0, 2) }}
Requested {{ $refund->created_at ? $refund->created_at->diffForHumans() : 'N/A' }}
@if($availableActions['can_decide'] ?? false) @endif @if($availableActions['can_complete'] ?? false) @endif
{{-- Stats Row --}}
@php $detailStats = [ ['label' => 'Item Amount', 'value' => '₦' . number_format($stats['item_amount'] ?? 0, 2), 'icon' => 'fa-shopping-cart', 'color' => 'primary'], ['label' => 'Shipping', 'value' => '₦' . number_format($stats['shipping_amount'] ?? 0, 2), 'icon' => 'fa-truck', 'color' => 'info'], ['label' => 'Total Refund', 'value' => '₦' . number_format($stats['wallet_refund_amount'] ?? 0, 2), 'icon' => 'fa-money-bill-wave', 'color' => 'success'], ['label' => 'Messages', 'value' => $stats['message_count'] ?? 0, 'icon' => 'fa-comments', 'color' => 'warning'], ['label' => 'Days Open', 'value' => $stats['days_open'] ?? 0, 'icon' => 'fa-calendar-day', 'color' => 'secondary'], ['label' => 'Payment Method', 'value' => $summary['payment_method'] ?? 'N/A', 'icon' => 'fa-credit-card', 'color' => 'info'], ]; @endphp @foreach($detailStats as $stat)

{{ $stat['label'] }}

{{ $stat['value'] }}
@endforeach
{{-- Summary Card --}}
Refund Summary
Order Number
#{{ $summary['order_number'] ?? 'N/A' }}
Product
{{ $summary['product_title'] ?? 'N/A' }}
Quantity
{{ $summary['quantity'] ?? 0 }}
Item Amount
₦{{ number_format($summary['item_amount'] ?? 0, 2) }}
Shipping
₦{{ number_format($summary['shipping_amount'] ?? 0, 2) }}
Currency
{{ $summary['currency'] ?? 'NGN' }}
Parties
Buyer
{{ $summary['buyer_name'] ?? 'Unknown' }}
{{ $refund->buyer?->email ?? '' }}
Seller
{{ $summary['seller_name'] ?? 'Unknown' }}
{{ $refund->seller?->email ?? '' }}
@if($refund->refund_reference)
Reference
{{ $refund->refund_reference }}
@endif @if($refund->completed_at)
Completed At
{{ $refund->completed_at->format('M d, Y H:i') }}
@endif @if($completedBy)
Completed By
{{ $completedBy->username ?? 'Unknown' }}
@endif
{{-- Tabs --}}
{{-- Messages Tab --}}
@include('admin.refunds.partials.tab-messages', ['refund' => $refund])
{{-- Decision Tab --}}
@include('admin.refunds.partials.tab-decision', [ 'refund' => $refund, 'availableActions' => $availableActions, ])
{{-- Complete Tab --}} @if($availableActions['can_complete'] ?? false)
@include('admin.refunds.partials.tab-complete', [ 'refund' => $refund, 'availableActions' => $availableActions, ])
@endif {{-- Timeline Tab --}}
@include('admin.refunds.partials.tab-timeline', ['timeline' => $timeline])
{{-- Related Refunds Tab --}} @if($relatedRefunds->count() > 0) @endif {{-- Wallet Tab --}} @if($walletEntries->count() > 0)
@include('admin.refunds.partials.tab-wallet', ['walletEntries' => $walletEntries])
@endif
@endsection @push('styles') @endpush @push('scripts') @endpush