@extends('layouts.vendor')
@section('page-title', request('status') ? ucfirst(request('status')) . ' Refunds' : 'Refunds')
@push('styles')
@endpush
@section('content')
@php
$statusLabels = [
'pending' => ['title' => 'Pending Refund List', 'count' => $stats['pending'], 'label' => 'Pending Refunds'],
'approved' => ['title' => 'Approved Refund List', 'count' => $stats['approved'], 'label' => 'Approved Refunds'],
'processed' => ['title' => 'Processed Refund List', 'count' => $stats['processed'], 'label' => 'Processed Refunds'],
'rejected' => ['title' => 'Rejected Refund List', 'count' => $stats['rejected'], 'label' => 'Rejected Refunds'],
];
$currentStatus = request('status') ?: 'all';
$pageTitle = request('status') && isset($statusLabels[request('status')]) ? $statusLabels[request('status')]['title'] : 'Refund Request List';
$totalCount = request('status') && isset($statusLabels[request('status')]) ? $statusLabels[request('status')]['count'] : $stats['total'];
$statusText = request('status') && isset($statusLabels[request('status')]) ? explode(' ', $statusLabels[request('status')]['label'])[0] : '';
@endphp
{{-- Page Header --}}
{{-- Stats Row --}}
Pending
{{ $stats['pending'] }}
Approved
{{ $stats['approved'] }}
Processed
{{ $stats['processed'] }}
Rejected
{{ $stats['rejected'] }}
Total Refunded
{{ price($stats['total_amount']) }}
{{-- Refunds Table --}}
@if(request('status'))
{{ $statusLabels[request('status')]['label'] }}
@endif
| # |
Order Code |
Product |
Customer |
Amount |
Status |
Date |
@forelse($refunds as $refund)
|
{{ $loop->iteration + ($refunds->currentPage() - 1) * $refunds->perPage() }}
|
{{ $refund->order->order_number ?? 'N/A' }}
|
@if($refund->orderItem)
{{ Str::limit($refund->orderItem->product_name, 30) }}
@else
N/A
@endif
|
{{ $refund->customer->name ?? 'N/A' }}
{{ $refund->customer->email ?? '' }}
|
{{ price($refund->amount) }}
|
{{ ucfirst($refund->status) }}
|
{{ $refund->created_at->format('M d, Y') }}
|
@empty
|
|
@endforelse
@if($refunds->hasPages())
{{ $refunds->links() }}
@endif
@endsection