@extends('layouts.admin-master') @section('title', 'Order lists') @section('css') @endsection @section('content')

@if(Auth::guard('admin')->user()->role_id == 'admin') Total B2B Order ({{ $all }}) @else Order History @endif

@if(Auth::guard('admin')->user()->role_id == 'admin')
Accept Order
Ready To Ship
On Delivery
Cancel
Complete
@endif
@if(Request::segment('3') == 'pending' || Request::get('order_id') || Request::get('customer') || Auth::guard('admin')->user()->role_id == 'admin' || in_array(Auth::guard('admin')->user()->id, [19,22]))

@if(Route::current()->getName() == 'order.search') Total Record: ({{count($orders)}}) @endif

@if(count($orders)>0) @foreach($orders as $index => $order) @php $total_price = ($order->total_price + $order->shipping_cost) - $order->coupon_discount; $partailPayment = ($order->orderPartialPayments) ? ($order->orderPartialPayments->sum('amount')) : 0; @endphp order_status == 'cancel') style="background:#ff000026" @endif > @endforeach @else @endif
# Order Id & Date Order Date Customer Qty Price Pay_method Payment Status Invoice Actions
{{(($orders->perPage() * $orders->currentPage() - $orders->perPage()) + ($index+1) )}} {{$order->order_id}} @if($order->payment_status == 'paid') @if($order->offer && $order->order_status != 'cancel' && $order->order_status != 'delivered' && $order->order_type != 'quiz') @php $delivery_date = Carbon\Carbon::parse($order->order_date)->addDays($order->offer->shipping_time ? $order->offer->shipping_time : 0)->format('Y-m-d'. ' 00:00:00'); @endphp
00

Days

00

HOURS

00

MINUTES

00

SECONDS

@endif @endif
{{\Carbon\Carbon::parse($order->order_date)->format(Config::get('siteSetting.date_format'))}}

{{\Carbon\Carbon::parse($order->order_date)->format('h:i:s A')}}

{{ $order->customer_name }}

{{ $order->billing_phone }}

@if($order->affiliateProduct)

Referred By
{{$order->affiliateProduct->affiliateAgent->name}}

@endif
{{$order->total_qty}} @if($partailPayment < $total_price && $order->payment_status != 'paid') Payable:{{$order->currency_sign}}{{$total_price }}
Received:{{$order->currency_sign}}{{($partailPayment) ? $partailPayment : 0 }}
Due:{{$order->currency_sign}}{{($partailPayment) ? $total_price - $partailPayment : $total_price }}
@else Paid:{{$order->currency_sign}}{{$total_price }} @endif
{{ str_replace( '-', ' ', $order->payment_method) }} @if($order->payment_method != 'nagad' && $order->payment_method != 'shurjopay') @if($order->payment_info) @if($order->tnx_id) Tnx_id: {{$order->tnx_id}}
@endif {{$order->payment_info}}
@endif @endif
@if(Auth::guard('admin')->user()->email == 'neyamulkn2@gmail.com' && ($order->payment_method == 'nagad' || $order->payment_method == 'shurjopay')) @if($order->tnx_id) Tnx_id: {{$order->tnx_id}}
@endif {{$order->payment_info}} Add Payment Issue @endif
@if(Auth::guard('admin')->user()->role_id == 'admin' || in_array(Auth::guard('admin')->user()->id, [22]))
payment_status != 'paid') onclick="orderPaymentPopup('{{ route("admin.orderPaymentDetails", $order->order_id)}}')" @endif title="Order payment info" data-toggle="tooltip" class="text-inverse p-r-10" >{{$order->payment_status}}
@if(count($order->orderNotify)>0) @foreach($order->orderNotify->where('type', '=', 'orderPayment') as $notify)

{{$index+1}}. By {{($notify->notify) ? $notify->staff->name : '' }} => {{$notify->notify}}
{{\Carbon\Carbon::parse($notify->created_at)->format(Config::get('siteSetting.date_format') .' | '.' h:i A')}}

@endforeach
@endif @else {{$order->payment_status}} @endif
@if($order->order_status == 'delivered') {{ str_replace('-', ' ', $order->order_status)}} @elseif($order->order_status == 'accepted') {{ str_replace('-', ' ', $order->order_status)}} @elseif($order->order_status == 'ready-to-ship') {{ str_replace('-', ' ', $order->order_status)}} @elseif($order->order_status == 'return') {{ str_replace('-', ' ', $order->order_status)}} @elseif($order->order_status == 'cancel') {{ str_replace('-', ' ', $order->order_status)}} @if(count($order->orderCancelReason)>0)
Reason @foreach($order->orderCancelReason as $reason) {{$reason->reason}} {{$reason->reason_details}} @endforeach @endif
@elseif($order->order_status == 'on-delivery') {{ str_replace('-', ' ', $order->order_status)}} @else Pending @endif @php $updateStatus = $order->orderNotify->where('type', '=', 'orderStatus'); @endphp @if(count($updateStatus)>0) @foreach($updateStatus as $notifyNo => $statusNotify) @if($statusNotify->notify)

{{$notifyNo+1}}. By {{($statusNotify->staff) ? $statusNotify->staff->name : 'Customer' }} => {{ucwords($statusNotify->notify)}}
{{\Carbon\Carbon::parse($statusNotify->created_at)->format(Config::get('siteSetting.date_format') .' | '.' h:i A')}}

@endif @endforeach
@endif
Invoice @if(Auth::guard('admin')->user()->role_id != 'admin') Details @else @endif

No orders found.

@endif
@if(Auth::guard('admin')->user()->role_id == 'admin' || in_array(Auth::guard('admin')->user()->id, [19,22]))
{{$orders->appends(request()->query())->links()}}
Showing {{ $orders->firstItem() }} to {{ $orders->lastItem() }} of total {{$orders->total()}} entries ({{$orders->lastPage()}} Pages)
@endif
@endsection @section('js') @endsection