@extends('admin.layout') @section('title', 'Orders') @section('content')

Orders

+ New order
In progress ({{ $counts['active'] }}) ★★★ Important ({{ $counts['important'] }}) Delivered ({{ $counts['delivered'] }}) All
@if(in_array($status, ['active', 'important'], true) && $counts['important'] > 0 && $status === 'active')
★★★ {{ $counts['important'] }} very important order{{ $counts['important'] === 1 ? '' : 's' }} must be delivered on the promised date. Show only these →
@endif @if($status === 'active' && ($soonCount || $lateCount))
@if($lateCount)⚠ {{ $lateCount }} order{{ $lateCount === 1 ? ' is' : 's are' }} past the promised date.@endif @if($soonCount)⏰ {{ $soonCount }} order{{ $soonCount === 1 ? '' : 's' }} due within 2 days.@endif
@endif
@if($q !== '')Clear@endif
@php $prevStage = null; @endphp @forelse($orders as $o) @php $days = $o->delivered_at ? null : (int) today()->diffInDays($o->due_date, false); $rowClass = $days === null ? '' : ($days < 0 ? 'late' : ($days <= 2 ? 'warn' : '')); @endphp @if(in_array($status, ['active', 'important'], true) && $o->stage_id !== $prevStage) @php $prevStage = $o->stage_id; @endphp @endif @empty @endforelse
#CustomerPhoneItemsAmountPromisedStage
Stage {{ $o->stage->sort_order }} · {{ $o->stage->name }} — {{ $stageCounts[$o->stage_id] ?? 0 }} order{{ ($stageCounts[$o->stage_id] ?? 0) === 1 ? '' : 's' }}
{{ $o->order_no }}@if($o->is_important)
★★★
@endif
{{ $o->customer_name }} @if(isset($tierByPhone[$o->phone])){{ $tierByPhone[$o->phone]['name'] }}@endif {{ $o->phone }} {{ $o->items }} @if($o->amount !== null) ৳{{ number_format($o->amount - ($o->discount ?? 0)) }} @if($o->discount)(−৳{{ number_format($o->discount) }})@endif @else — @endif {{ $o->due_date->format('d M') }} @if($o->delivered_at)Delivered {{ $o->delivered_at->format('d M') }} @elseif($days < 0)Late {{ abs($days) }}d @elseif($days === 0)Due today @elseif($days === 1)Due tomorrow @elseif($days === 2)Due in 2 days@endif
@csrf @method('PATCH')
Edit Track ↗
No orders here.
@if($orders->previousPageUrl())← Previous@endif @if($orders->hasMorePages())Next →@endif
@endsection