@extends('layouts.admin_dynamic') @section('content')

{{ ($myOrders ?? false) ? 'My Orders' : 'All Sales Orders' }}   {{ __('Agent Shop') }}   {{ __('Normal Shop') }}

@if($myOrders ?? false) @endif
@if($myOrders ?? false) All Orders @else My Orders @endif
@forelse ($orders as $order) @empty @endforelse
Order # Type Sold By Customer Phone Items Amount (KES) Status Date Actions
{{ $order->order_number }} @if($order->type === 'agent') Agent @else Shop @endif {{ $order->user->name ?? 'Unknown' }} {{ $order->customer->name ?? 'Walk-in' }} {{ $order->customer->phone ?? '-' }} {{ $order->total_product }} {{ number_format($order->total_amount, 2) }} @if($order->status === 'completed') Completed @elseif($order->status === 'cancelled') Cancelled @else {{ ucfirst($order->status) }} @endif {{ $order->order_date->format('d M Y') }} @php $actions = [ [ 'data-replace' => null, 'url' => url('Backoffice/requests/view/' . $order->id), 'ajax-url' => null, 'name' => 'View', 'icon' => 'eye', 'class' => 'btn btn-success', ], [ 'data-replace' => null, 'url' => route('download.receipt', $order->id), 'ajax-url' => null, 'name' => 'Receipt', 'icon' => 'download', 'class' => 'btn btn-default', ], ]; @endphp @include('partials.actions', ['actions' => $actions])

No orders found.

@endsection