@for ($i = 0; $i <= count($orders) - 1; $i++)
@if ($orders[$i]->eo_cust_status == 'New')
@if ($orders[$i]->eo_order_status == 'Pending')
@includeIf('components.edi-modal-action', [
'order' => $orders[$i],
'action' => 'approve',
])
@includeIf('components.edi-modal-action', [
'order' => $orders[$i],
'action' => 'reject',
])
@includeIf('components.edi-modal-info', [
'order' => [$orders[$i]],
'type' => 'view',
])
@php
$status = '';
if ($orders[$i]->eo_cust_status == 'Cancelled') {
$status = 'rgba(255,0,0,0.1)';
} elseif ($orders[$i]->eo_cust_status == 'Updated') {
$status = 'rgba(0,128,128,0.1)';
}
@endphp
| {{ $orders[$i]->id }}
|
{{ $orders[$i]->eo_created_date }}
|
{{ $orders[$i]->eo_cust_code }}
|
|
{{ $orders[$i]->eo_product_id == null ? 'false' : 'true' }} |
|
{{ $orders[$i]->eo_collection_address_code == null ? 'false' : 'true' }}
|
|
{{ $orders[$i]->eo_delivery_address_code == null ? 'false' : 'true' }}
|
{{ $orders[$i]->eo_cust_status }} |
|
@endif
@else
{{-- else updated & cancelled send two orders, skip one ahead --}}
@if ($orders[$i]->eo_order_status == 'Pending')
@includeIf('components.edi-modal-action', [
'order' => $orders[$i],
'action' => 'approve',
])
@includeIf('components.edi-modal-action', [
'order' => $orders[$i],
'action' => 'reject',
])
@includeIf('components.edi-modal-info', [
'order' => [$orders[$i], $orders[$i + 1]],
'type' => 'view',
])
@php
$status = '';
if ($orders[$i]->eo_cust_status == 'Cancelled') {
$status = 'rgba(255,0,0,0.1)';
} elseif ($orders[$i]->eo_cust_status == 'Updated') {
$status = 'rgba(0,128,128,0.1)';
}
@endphp
| {{ $orders[$i]->id }}
|
{{ $orders[$i]->eo_created_date }}
|
{{ $orders[$i]->eo_cust_code }}
|
|
{{ $orders[$i]->eo_product_id == null ? 'false' : 'true' }} |
|
{{ $orders[$i]->eo_collection_address_code == null ? 'false' : 'true' }}
|
|
{{ $orders[$i]->eo_delivery_address_code == null ? 'false' : 'true' }}
|
{{ $orders[$i]->eo_cust_status }} |
|
@endif
@php
$i += 1;
@endphp
@endif
@endfor