@lang('order.orders')
@if (session('message'))
{{ session('message') }}
@endif
@php
// Check if any order has the status 'cancelled'
$hasCancelledOrders = $orders->contains('last_status', 'cancelled');
@endphp
| @lang('order.ID') | @lang('order.invoice_num') | @lang('order.date') | @lang('order.type') | @lang('order.branch') | @lang('order.client') | @lang('order.total_price') | @lang('order.status') | @lang('order.status_paid') | @lang('order.payment_method') | @if ($hasCancelledOrders)@lang('order.reason_for_cancellation') | @lang('order.type2') | @lang('order.user_id') | @endif@lang('order.actions') | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $order->id }} | {{ $order->invoice_number }} | {{ $order->date }} | @lang('order.' . strtolower($order->type)) | {{ $order->branch ? (app()->getLocale() === 'ar' ? $order->branch->name_ar : $order->branch->name_en) : __('order.none') }} | {{ $order->client->name ?? __('order.client_deleted') }} | {{ $order->total_price_after_tax }} {{ $order->branch->country->currency_symbol }} | @lang('order.' . strtolower($order->last_status)) | @if ($order->transaction) @lang('order.' . strtolower($order['transaction']['payment_status'])) @else ----- @endif | @if ($order->transaction) @lang('order.' . strtolower($order['transaction']['payment_method'])) @else ----- @endif | @if ($hasCancelledOrders) @if ($order->last_status === 'cancelled' && $order->cancellation_reason){{ $order->cancellation_reason->reason }} | {{ $order->cancellation_reason->type }} | {{ $order->cancellation_reason->user->name ?? 'N/A' }} | @else----- | ----- | ----- | @endif @endif@if (auth('admin')->user()->hasPermissionTo('detail report_delivery_orders', 'admin')) @lang('order.show') @endif |