@extends('layouts.app') @section('title',__('orders.title')) @section('content') @php $tabs=[['label'=>__('orders.all'),'url'=>route('sales.orders.index',array_filter(['search'=>request('search')])),'count'=>$stats['total'],'active'=>!in_array(request('status'),$statuses,true)]]; foreach($statuses as $status) $tabs[]=['label'=>__('ui.status.'.$status),'url'=>route('sales.orders.index',array_filter(['search'=>request('search'),'status'=>$status])),'count'=>$stats[$status]??0,'active'=>request('status')===$status]; $money=fn($o)=>$o->currency.' '.number_format((float)$o->grand_total,2); @endphp @if($canCreate){{ __('orders.create') }}@endif @if(in_array(request('status'),$statuses,true))@endif @if($orders->isEmpty()) @if($canCreate && !request()->hasAny(['search','status'])){{ __('orders.create') }}@endif @else {{ __('orders.order') }}{{ __('orders.customer') }}{{ __('orders.salesperson') }}{{ __('orders.status') }}{{ __('orders.total') }}{{ __('orders.created') }} @foreach($orders as $order) {{ $order->order_number }}@if($order->invoice_number){{ __('orders.invoice_no',['number'=>$order->invoice_number]) }}@endif {{ $order->customer_name }} {{ $order->salesperson_name }} {{ $money($order) }} {{ \Illuminate\Support\Carbon::parse($order->created_at)->format('d M Y H:i') }} @endforeach @endif @if($canCreate)
{{ __('orders.create') }}
@endif @endsection