{{-- resources/views/backend/users/details/purchase_table.blade.php --}}
Purchase Details
{{-- ==== FILTER FORM (AJAX) ==== --}}
@csrf
entries
@if ($orders->isEmpty()) @else @php $isPaginated = $orders instanceof \Illuminate\Pagination\LengthAwarePaginator; $startIndex = $isPaginated ? ($orders->currentPage() - 1) * $orders->perPage() : 0; @endphp @foreach ($orders as $loopIndex => $order) @php $serial = $startIndex + $loopIndex + 1; @endphp @php $OrderbadgeColor = [ 'pending' => 'warning', 'received' => 'success', 'confirmed' => 'info', ]; $Orderstatus = $order->status->getValue(); $OrderbadgeColor = $OrderstatusColors[$Orderstatus] ?? 'secondary'; @endphp @endforeach @endif
# Order Code Num. of Products Amount Order Status
No Orders found
{{ $serial }} @if (Auth::user()->hasPermission('purchase.orders.view')) {{ $order->code }} @else {{ $order->code }} @endif
{{ $order->user->name ?? 'N/A' }}
{{ $order->products_count ?? 0 }} {{ number_format($order->sub_total, 2) }} {{ ucfirst($order->status->label()) }}
{{-- ==== PAGINATION & SUMMARY (Only show when paginated) ==== --}}

@if ($orders instanceof \Illuminate\Pagination\LengthAwarePaginator) Showing {{ $orders->firstItem() }} to {{ $orders->lastItem() }} of {{ $orders->total() }} entries @else Showing {{ $orders->count() }} @if($orders->count() === 1) entry @else entries @endif @endif

@if ($orders instanceof \Illuminate\Pagination\LengthAwarePaginator) {!! $orders->appends(request()->query())->links() !!} @endif