@extends('layouts.admin') @section('title', 'Orders · Aromaniacs ERP') @section('overline', 'Sales') @section('heading', 'Orders') @section('content')
@if ($orders->isEmpty())

No orders yet.

Click "New Order" to log a sale and decrement stock.

@else @foreach ($orders as $order) @endforeach
Order # Date Customer Source Status Payment Total Actions
{{ $order->order_number }} {{ optional($order->placed_at)->format('d M Y') }}
{{ $order->customer_name }}
{{ $order->customer_phone ?? '—' }}
{{ $order->source?->label() }} @php $statusVal = $order->status?->value; @endphp @if ($statusVal === 'pending') Pending @elseif ($statusVal === 'cancelled') Cancelled @else {{ $order->status->label() }} @endif @if ($order->payment_status?->value === 'paid') Paid @elseif ($order->payment_status?->value === 'partial') Partial @else {{ $order->payment_status?->label() }} @endif {{ number_format((float) $order->total, 2) }}
{{ $orders->links() }}
@endif
@endsection