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

@if(Auth::guard('admin')->user()->role_id == 'admin') Total voucher ({{ $total_voucher }}) @else Voucher History @endif

Pending Voucher
Accept Voucher
Today Delivery
Processing
Ready To Ship
On Delivery

@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; $delivery_next_date = (count($order->voucherTimelines)>0) ? Carbon\Carbon::parse($order->voucherTimelines[0]->invoice_date)->addDays(30)->format('Y-m-d'. ' 00:00:00') : Carbon\Carbon::parse($order->order_date)->addDays(10)->format('Y-m-d'. ' 00:00:00'); @endphp format('Y-m-d'. ' 00:00:00') >= $delivery_next_date && ($order->order_status != 'cancel' && $order->order_status != 'closed')) class="blink" @endif id="{{$order->order_id}}" @if($order->order_status == 'cancel' || $order->order_status == 'closed') style="background:#ff000026" @endif > @endforeach @else @endif
# Order Product Customer Next Delivery Time Qty Price Rate Pay_method Payment status Invoice Action
{{(($orders->perPage() * $orders->currentPage() - $orders->perPage()) + ($index+1) )}} {{$order->order_id}}
{{\Carbon\Carbon::parse($order->order_date)->format(Config::get('siteSetting.date_format'))}}

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

@if(count($order->order_details)>0) {{ $order->order_details[0]->product->title }} @endif {{ $order->customer_name }}

{{ $order->billing_phone }}

@if($order->affiliateProduct)

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

@endif
@if($order->order_status != 'cancel' && $order->order_status != 'closed') {{Carbon\Carbon::parse($delivery_next_date)->format('d M, Y')}}
00

Days

00

HOURS

00

MINUTES

00

SECONDS

@else

Voucher {{$order->order_status}}

@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
{!! ($order->voucher_rate) ? $order->currency_sign. ($order->voucher_rate * $order->total_qty) : ' Not set ' !!} {{ 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]))
order_id)}}')" title="Update order payment info" 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 == 'closed') {{ str_replace('-', ' ', $order->order_status)}} @elseif($order->order_status == 'accepted') Processing @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
({{$order->voucher_timelines_count}}) Times

No vouchers found.

{{$orders->appends(request()->query())->links()}}
Showing {{ $orders->firstItem() }} to {{ $orders->lastItem() }} of total {{$orders->total()}} entries ({{$orders->lastPage()}} Pages)
@endsection @section('js') @endsection