@extends("admin.layouts.app") @section("title", __("admin.orders.title")) @section("content")
@foreach(["" => "All", "pending" => "Pending", "active" => "Active", "fraud" => "Fraud", "cancelled" => "Cancelled"] as $val => $label) @php $isActive = (request("status","") == $val); @endphp $val ?: null]) }}" style="display:inline-block;padding:8px 16px;font-size:13px;text-decoration:none;color:{{ $isActive ? "#1a4d80" : "#666" }};font-weight:{{ $isActive ? "700" : "400" }};border-bottom:{{ $isActive ? "3px solid #1a4d80" : "3px solid transparent" }};margin-bottom:-1px;"> {{ $label }} @endforeach
@include('admin.partials.list-filters', ['filters' => $filters, 'action' => route('admin.orders.index'), 'keep' => ['status' => request('status')]])
@csrf
@if(auth('admin')->user()?->hasPermission('manage_orders'))
{{ __('admin.invoices.bulk_actions') }}:
@endif @forelse($orders as $order) @php $badgeClass = match(strtolower($order->status ?? "")) { "active" => "badge-active", "pending" => "badge-pending", "fraud" => "badge-fraud", "cancelled" => "badge-cancelled", default => "badge-cancelled", }; @endphp @empty @endforelse
{!! $filters->sortLink('order_num', __('common.table.order_num')) !!} {{ __('common.table.client') }} {!! $filters->sortLink('date', __('common.table.date')) !!} {!! $filters->sortLink('amount', __('common.table.amount')) !!} {{ __('common.table.payment_method') }} {{ __('admin.orders.payment') }} {{ __('common.table.status') }} {{ __('common.table.actions') }}
#{{ $order->order_num }} @if($order->client) client_id) }}" style="color:#337ab7;text-decoration:none;">{{ $order->client?->full_name ?? "Deleted Client" }} @else N/A @endif {{ $order->date?->format(date_fmt()) ?? "-" }} {{ money_fmt($order->amount) }} {{ $order->payment_method ? payment_method_label((string) $order->payment_method) : "-" }} @include('admin.orders.partials.payment-status', ['invoice' => $order->invoice, 'balance' => $order->invoice ? ($balances[$order->invoice->id] ?? null) : null]) {{ ucfirst($order->status ?? "") }} {{ __('common.actions.view') }}
{{ __('admin.orders.no_orders') }}
{{ $orders->withQueryString()->links() }}
@endsection