@extends("admin/layouts.master-soyuz") @section('title',"Edit Order : $inv_cus->order_prefix$order->order_id | ") @section("body") @php $orderlog = $order->fullordercancellog; $checkOrderCancel = $order->cancellog; $i=0; $deliverycheck = array(); $tstatus = 0; $cancel_valid = array(); @endphp @if(isset($order)) @if(count($order->invoices)>1) @foreach($order->invoices as $inv) @if($inv->variant) @if($inv->variant->products->cancel_avl != 0) @php array_push($cancel_valid,1); @endphp @else @php array_push($cancel_valid,0); @endphp @endif @endif @endforeach @else @php array_push($cancel_valid,0); @endphp @endif @foreach($order->invoices as $sorder) @if($sorder->status == 'delivered' || $sorder->status == 'cancel_request' || $sorder->status =='return_request' || $sorder->status == 'returned' || $sorder->status == 'ret_ref' || $sorder->status == 'refunded') @php array_push($deliverycheck, 0); @endphp @else @php array_push($deliverycheck, 1); @endphp @endif @endforeach @endif @if(in_array(0, $deliverycheck) && in_array(0,$cancel_valid)) @endif @if($order->manual_payment == '1')
This order is placed using {{ ucfirst($order->payment_method) }} method and purchase proof you can view here and after verify you can change the order status.
@endif
Edit Order #{{ $inv_cus->order_prefix.$order->order_id }}
@if(isset($orderlog)) @if(count($orderlog->inv_id) != count($order->invoices))

{{ date('d-m-Y | h:i A',strtotime($orderlog->updated_at)) }} • For Order #{{ $inv_cus->order_prefix.$order->order_id }} Few Items has been cancelled {{ $order->payment_method == 'COD' ? "." : "" }} @if($orderlog->method_choosen == 'orignal') and Amount {{ $orderlog->amount }} is refunded to its orignal source with TXN ID [{{ $orderlog->txn_id }}]. @elseif($orderlog->method_choosen == 'bank') @if($orderlog->is_refunded == 'completed') and Amount {{ $orderlog->amount }} is refunded to {{ $orderlog->user->name }}'s bank ac @if(isset($orderlog->bank->acno)) XXXX{{ substr($orderlog->bank->acno, -4) }} @endif with TXN/REF No {{ $orderlog->txn_id }} @if($orderlog->txn_fee !='')
(TXN FEE APPLIED) {{ $orderlog->txn_fee }} @endif.
@else Amount {{ $orderlog->amount }} is pending to {{ $orderlog->user->name }}'s bank ac @if(isset($orderlog->bank->acno)) XXXX{{ substr($orderlog->bank->acno, -4) }} @endif with TXN/REF. No: {{ $orderlog->txn_id }}. @endif @endif

@else

{{ date('d-m-Y | h:i A',strtotime($orderlog->updated_at)) }} • For Order #{{ $inv_cus->order_prefix.$order->order_id }} has been cancelled {{ $order->payment_method == 'COD' ? "." : "" }} @if($orderlog->method_choosen == 'orignal') and Amount {{ $orderlog->amount }} is refunded to its orignal source with TXN ID [{{ $orderlog->txn_id }}]. @elseif($orderlog->method_choosen == 'bank') @if($orderlog->is_refunded == 'completed') and Amount {{ $orderlog->amount }} is refunded to {{ $orderlog->user->name }}'s bank ac @if(isset($orderlog->bank->acno)) XXXX{{ substr($orderlog->bank->acno, -4) }} @endif with TXN/REF No {{ $orderlog->txn_id }} @if($orderlog->txn_fee !='')
(TXN FEE APPLIED) {{ $orderlog->txn_fee }} @endif.
@else Amount {{ $orderlog->amount }} is pending to {{ $orderlog->user->name }}'s bank ac @if(isset($orderlog->bank->acno)) XXXX{{ substr($orderlog->bank->acno, -4) }} @endif with TXN/REF. No: {{ $orderlog->txn_id }}. @endif @endif

@endif @endif @if($order->refundlogs()->count() > 0) @foreach($order->refundlogs->sortByDesc('id') as $rlogs) @php $orivar2 = App\AddSubVariant::withTrashed()->withTrashed()->withTrashed()->find($rlogs->getorder->variant_id); if($orivar2){ $varcount = count($orivar2->main_attr_value); } @endphp @if($orivar2)

{{ date('d-m-Y | h:i A',strtotime($rlogs->updated_at)) }} • Item {{ $orivar2->products->name }} ({{ variantname($orivar2) }}) has been @if($rlogs->getorder->status == 'return_request') requested for return @else @if($rlogs->getorder->status == 'ret_ref') Returned and refunded @else {{ ucfirst($rlogs->getorder->status) }} @endif @endif @if($rlogs->method_choosen == 'orignal') and Amount {{ $rlogs->amount }} is {{ $rlogs->status }} to its orignal source with TXN ID: {{ $rlogs->txn_id }}. @elseif($rlogs->method_choosen == 'bank') @if($rlogs->status == 'refunded') and Amount {{ $rlogs->amount }} is {{ $rlogs->status }} to {{ $rlogs->user->name }}'s bank ac @if(isset($rlogs->bank->acno)) XXXX{{ substr($rlogs->bank->acno, -4) }} @endif with TXN ID: {{ $rlogs->txn_id }} @if($rlogs->txn_fee !='')
(TXN FEE APPLIED) {{ $rlogs->txn_fee }} @endif
. @else and Amount {{ $rlogs->amount }} is pending to {{ $rlogs->user->name }}'s bank ac @if(isset($rlogs->bank->acno)) XXXX{{ substr($rlogs->bank->acno, -4) }} @endif with TXN ID/REF NO: {{ $rlogs->txn_id }} @if($rlogs->txn_fee !='')
(TXN FEE APPLIED) {{ $rlogs->txn_fee }} @endif. @endif @endif

@endif @endforeach @endif @if($order->cancellog->count()>0)
@foreach($order->cancellog->sortByDesc('id') as $cancellog) @php $orivar2 = App\AddSubVariant::withTrashed()->withTrashed()->findorfail($cancellog->singleOrder->variant_id); $varcount = count($orivar2->main_attr_value); @endphp

{{ date('d-m-Y | h:i A',strtotime($cancellog->updated_at)) }} • Item {{ $orivar2->products->name }}({{ variantname($orivar2) }}) has been canceled @if($cancellog->method_choosen == 'orignal') and Amount {{ $cancellog->amount }} is refunded to its orignal source with TXN ID: {{ $cancellog->transaction_id }}. @elseif($cancellog->method_choosen == 'bank') @if($cancellog->is_refunded == 'completed') and Amount {{ $cancellog->amount }} is refunded to {{ $cancellog->user->name }}'s bank ac with TXN ID {{ $cancellog->transaction_id }} @if($cancellog->txn_fee !='')
(TXN FEE APPLIED) {{ $cancellog->txn_fee }} @endif
. @else and Amount {{ $cancellog->amount }} is pending to {{ $cancellog->user->name }}'s bank ac with TXN ID/REF NO {{ $cancellog->transaction_id }} @if($cancellog->txn_fee !='')
(TXN FEE APPLIED) {{ $cancellog->txn_fee }} @endif. @endif @endif

@endforeach
@endif
Customer Information Shipping Address Billing Address
@php $user = $order->user; $address = $order->shippingaddress; if($user->country_id !=''){ $c = App\Allcountry::where('id',$user->country_id)->first()->nicename; $s = App\Allstate::where('id',$user->state_id)->first()->name; $ci = App\Allcity::where('id',$user->city_id)->first() ? App\Allcity::where('id',$user->city_id)->first()->name : ''; } @endphp

{{$user->name}}

{{ $user->email }}

@if(isset($user->mobile))

{{$user->mobile}}

@endif @if(isset($c))

{{$ci}}, {{ $s }}, {{ $c }}

@endif

{{ $address->name }}, {{ $address->phone }}

{{ strip_tags($address->address) }},

@php $user = App\User::find($order->user_id); $c = App\Allcountry::where('id',$address->country_id)->first()->nicename; $s = App\Allstate::where('id',$address->state_id)->first()->name; $ci = App\Allcity::where('id',$address->city_id)->first() ? App\Allcity::where('id',$address->city_id)->first()->name : ''; @endphp

{{ $ci }}, {{ $s }}, {{ $ci }}

{{ $address->pin_code }}

{{ $order->billing_address['firstname'] }}, {{ $order->billing_address['mobile'] }}

{{ strip_tags($order->billing_address['address']) }},

@php $c = App\Allcountry::where('id',$order->billing_address['country_id'])->first()->nicename; $s = App\Allstate::where('id',$order->billing_address['state'])->first()->name; $ci = isset(App\Allcity::where('id',$order->billing_address['city'])->first()) ? App\Allcity::where('id',$order->billing_address['city'])->first()->name : ''; @endphp

{{ $ci }}, {{ $s }}, {{ $ci }}

@if(isset($order->billing_address['pincode'])) {{ $order->billing_address['pincode'] }} @endif

Order Summary

Total Qty: {{ $order->qty_total }}

Order Total: {{ round($order->order_total,2) }}

@if($order->payment_method !='COD' && $order->payment_method != 'BankTransfer')

Payment Recieved: {{ ucfirst($order->payment_receive) }}

@else @endif

Payment Method: {{ ucfirst($order->payment_method) }}

Transcation ID: {{ $order->transaction_id }}

Order Date: {{ date('d/m/Y @ h:i a', strtotime($order->created_at)) }}

@foreach($order->invoices as $invoice) @if($invoice->local_pick != '' && $invoice->status != 'return_request' && $invoice->status != 'refunded' && $invoice->status !='ret_ref')
@if(isset($invoice->variant)) @php $orivar = $invoice->variant; @endphp For Item {{ $invoice->variant->products->name }} ({{ variantname($orivar) }}) @endif @if($invoice->simple_products) {{ $invoice->simple_products->product_name }} @endif Customer has choosen Local Pickup. @if($invoice->status != 'delivered') Estd Delivery date: {{ $invoice->loc_deliv_date == '' ? "Yet to update" : date('d-m-Y',strtotime($invoice->loc_deliv_date)) }} @else Item Delivered On: {{ $invoice->loc_deliv_date == '' ? "Yet to update" : date('d-m-Y',strtotime($invoice->loc_deliv_date)) }} @endif
@endif @endforeach
@foreach($order->invoices as $invoice) @if($invoice->local_pick !='' && $invoice->status != 'delivered' && $invoice->status != 'return_request' && $invoice->status != 'refunded' && $invoice->status !='ret_ref')

Update Local Pickup Delivery dates:

@if($invoice->variant) @php $orivar = $invoice->variant; @endphp

{{ $invoice->variant->products->name }} ({{ variantname($orivar) }})

@endif @if($invoice->simple_product) {{ $invoice->simple_product->product_name }} @endif
@csrf

@endif @endforeach
Order Details
@foreach($order->invoices as $invoice) @endforeach
Invoice No Item Name Qty Status Pricing & Tax Total Action
{{ $inv_cus->prefix }}{{ $invoice->inv_no }}{{ $inv_cus->postfix }}
@if(isset($invoice->variant)) @if($invoice->variant->variantimages) @else @endif @endif @if(isset($invoice->simple_product)) @endif
@if(isset($invoice->variant)) {{substr($invoice->variant->products->name, 0, 25)}}{{strlen($invoice->variant->products->name)>25 ? '...' : ""}} ({{ variantname($invoice->variant) }}) @endif @if($invoice->simple_product) {{ $invoice->simple_product->product_name }} @endif
@if($invoice->variant) Sold By: {{$invoice->variant->products->store->name}} @endif @if($invoice->simple_product) Sold By: {{$invoice->simple_product->store->name}} @endif
Price: {{ round(($invoice->price),2) }}
Tax: {{ round($invoice->tax_amount,2) }}
{{ $invoice->qty }}
@if($invoice->status == 'delivered') {{ ucfirst($invoice->status) }} @elseif($invoice->status == 'processed') {{ ucfirst($invoice->status) }} @elseif($invoice->status == 'shipped') {{ ucfirst($invoice->status) }} @elseif($invoice->status == 'return_request') Return Requested @elseif($invoice->status == 'returned') Returned @elseif($invoice->status == 'cancel_request') Cancelation Request @elseif($invoice->status == 'canceled') Canceled @elseif($invoice->status == 'refunded') Refunded @elseif($invoice->status == 'ret_ref') Return & Refunded @else {{ ucfirst($invoice->status) }} @endif

@php $cancellog = App\CanceledOrders::where('order_id','=',$invoice->order->id)->where('inv_id','=',$invoice->id)->first(); @endphp @if(!empty($cancellog) || $invoice->status == 'canceled' || $invoice->status == 'refunded' || $invoice->status == 'returned' || $invoice->status == 'refunded' || $invoice->status == 'ret_ref' || $invoice->status == 'return_request') @else @endif
Total Price: {{ round(($invoice->price*$invoice->qty),2) }}

Total Tax: {{ round(($invoice->tax_amount),2) }}

Shipping Charges: {{ round($invoice->shipping,2) }}

(Price & TAX Multiplied with Quantity)

{{ round($invoice->qty*($invoice->price+$invoice->tax_amount)+$invoice->shipping,2) }}
(Incl. of TAX & Shipping)
@php $log = App\CanceledOrders::where('inv_id', '=', $invoice->id)->where('user_id',$invoice->order->user_id)->first(); @endphp @if($invoice->variant && $invoice->status != 'canceled' && $invoice->status != 'returned' && $invoice->status != 'return_request' && $invoice->status !='Refund Pending' && $invoice->status != 'delivered' && $invoice->status !='ret_ref' && $invoice->status !='refunded' && $invoice->variant->products->cancel_avl != 0) Cancel @elseif($invoice->variant && $invoice->variant->products->cancel_avl ==0) No Cancellation Available @else No action for you. @endif
Subtotal {{ round($order->order_total+$order->discount,2) }}
Coupon Discount - {{ round($order->discount,2) }} ({{ $order->coupon }})
Gift Packaging Charge + {{ round($order->gift_charge,2) }}
Handling Charge + {{ round($order->handlingcharge,2) }}
Grand Total {{ round($order->order_total+$order->handlingcharge,2) }}

Order Activity Logs

@if(count($order->orderlogs)<1) No activity logs for this order
@endif #{{ $inv_cus->order_prefix }}{{ $order->order_id }}
@foreach($order->orderlogs as $logs) @if(isset($logs->variant)) @php $findinvoice = App\InvoiceDownload::find($logs->inv_id)->first(); $orivar = App\AddSubVariant::withTrashed()->withTrashed()->find($logs->variant_id); if($order->payment_method !='COD'){ if(isset($cancellog)){ $findinvoice2 = App\InvoiceDownload::where('id','=',$cancellog->inv_id)->first(); $orivar2 = App\AddSubVariant::withTrashed()->withTrashed()->findorfail($findinvoice2->variant_id); } } @endphp {{ date('d-m-Y | h:i:a',strtotime($logs->updated_at)) }} • For Order {{ $orivar->products->name }} ({{variantname($orivar)}}) : @if($logs->user->role_id == 'a') {{ $logs->user->name }} (Admin) changed status to {{ $logs->log }} @elseif($logs->user->role_id == 'v') {{ $logs->user->name }} (Vendor) changed status to {{ $logs->log }} @else {{ $logs->user->name }} (Customer) changed status to {{ $logs->log }} @endif @endif @if(isset($logs->simple_product)) {{ date('d-m-Y | h:i:a',strtotime($logs->updated_at)) }} • For Order Item {{ $logs->simple_product->product_name }} @if($logs->user->role_id == 'a') {{ $logs->user->name }} (Admin) changed status to {{ $logs->log }} @elseif($logs->user->role_id == 'v') {{ $logs->user->name }} (Vendor) changed status to {{ $logs->log }} @else {{ $logs->user->name }} (Customer) changed status to {{ $logs->log }} @endif @endif

@endforeach
@foreach($order->invoices as $o) @if($o->variant && $o->status != 'canceled' && $o->status != 'returned' && $o->status != 'return_request' && $o->status != 'delivered' && $o->status !='ret_ref' && $o->status !='refunded' && $o->variant->products->cancel_avl != 0) @endif @endforeach @if(!$order->fullordercancellog()->count()) @endif @endsection @section('custom-script') @endsection