{{-- 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 @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) }} {!! purchase_order_status_badge($order->status) !!}
{{-- ==== 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