@extends('admin.layouts.app') @section('title', 'Orders') @section('crumbs')Orders@endsection @section('content') @php $labels = collect(\App\Models\Order::STATUSES)->map(fn ($s) => $s[0])->put('cancelled', 'Cancelled'); $query = request()->only(['q', 'from', 'to', 'landing']); @endphp
οΌ‹ Add order
@if ($status)@endif @if (request('landing'))@endif
@if (request()->hasAny(['q', 'from', 'to', 'landing'])) Reset @endif
{{-- courier: checkbox e order select kore ekshathe pathano --}} @php $couriers = \App\Services\Couriers\CourierManager::available(); @endphp
0 ta select @unless ($couriers)Courier Settings e key dao β†’@endunless
@csrf
@forelse ($orders as $o) @php $first = $o->items->first(); $h = $history[$o->phone] ?? null; $done = $h ? $h->delivered + $h->cancelled : 0; $ratio = $done ? (int) round($h->delivered / $done * 100) : null; $tone = $ratio === null ? '' : ($ratio >= 80 ? 'good' : ($ratio >= 50 ? 'mid' : 'bad')); @endphp {{-- courier: kon courier, ar courier er consignment id (+ courier er nijer status) --}} @empty @endforelse
DateProductCustomerAddressQty Success ratioSubtotalDiscountTotalPaymentStatusCourierConsignment ID
{{ $o->created_at->format('d M Y') }}
{{ $o->created_at->format('h:i A') }}
#{{ $o->order_number }}
@if ($first?->product?->image)@else{{ $first?->icon ?: 'πŸ“¦' }}@endif
{{ $first?->name ?? 'β€”' }}
@if ($first?->size || $first?->color)
{{ collect([$first->size, $first->color])->filter()->implode(' Β· ') }}
@endif @if ($o->items->count() > 1)
+{{ $o->items->count() - 1 }} more
@endif
{{ $o->customer_name }}
πŸ“ž {{ $o->phone }}
{{ $o->address }}
@if ($o->city)
πŸ“ {{ $o->zone }}, {{ $o->city }}
@endif {{ $o->area === 'inside' ? 'Inside Dhaka' : 'Outside Dhaka' }}
Γ—{{ (int) $o->items_sum_qty }} @if ($ratio === null) New customer @else
{{ $ratio }}%
{{ $h->delivered }}/{{ $done }} delivered
@endif
ΰ§³{{ number_format($o->subtotal) }} @if ((float) $o->discount > 0)βˆ’ΰ§³{{ number_format($o->discount) }}@elseβ€”@endif ΰ§³{{ number_format($o->total) }}
{{ $o->payment_method === 'cod' ? 'COD' : $o->payment_label }}
{{ ucfirst($o->payment_status) }}
{{ $o->status_label }} @if ($o->courier) 🚚 {{ \App\Services\Couriers\CourierManager::label($o->courier) }} @else β€” @endif @if ($o->consignment_id && $o->consignment_id !== 'manual') {{ $o->consignment_id }} @elseif ($o->consignment_id) {{ $o->tracking_code !== 'β€”' ? $o->tracking_code : 'Manual' }} @else β€” @endif @if ($o->tracking_code && ! in_array($o->tracking_code, [$o->consignment_id, 'β€”'], true) && $o->consignment_id !== 'manual')
Tracking: {{ $o->tracking_code }}
@endif @if ($o->courier_status && $o->courier_status !== 'manual')
{{ ucfirst(str_replace(['_', '-'], ' ', $o->courier_status)) }}
@endif
✏️ Edit
No orders found.
{{ $orders->links('admin.partials.pagination') }}
@endsection @push('scripts') @endpush