@extends('admin.layouts.master-soyuz') @section('title',__('Edit Order :orderid | ',['orderid' => $inv_cus->order_prefix.$order->order_id])) @section('body') @component('admin.component.breadcumb',['secondaryactive' => 'active']) @slot('heading') {{ __('Order') }} @endslot @slot('menu1') {{ __("Edit Order") }} @endslot @slot('button')
{{ __("Back")}}
@endslot @endcomponent
@if ($errors->any()) @endif
{{ __('Edit Order') }} {{ $order->order_id }}
@if($order->manual_payment == '1')
{{__("This order is placed using")}} {{ ucfirst($order->payment_method) }} {{__("method and purchase proof you can view")}} order_id }}">{{ __("here") }} {{__("and")}} {{__("after verify you can change the order status")}}.
@endif @if(count($order->cancellog))
@foreach($order->cancellog as $orderlog)

{{ date('d-m-Y | h:i A',strtotime($orderlog->updated_at)) }} • {{__("For Order")}} #{{ $inv_cus->order_prefix.$order->order_id }} • {{ __("Item") }} {{ $orderlog->singleOrder->variant->products->name ?? $orderlog->singleOrder->simple_product->product_name }} @if($orderlog->singleOrder->variant) ({{ variantname($orderlog->singleOrder->variant) }}) @endif {{__("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->transaction_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->transaction_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->transaction_id }}. @endif @endif

@endforeach
@endif @if($order->refundlogs()->count() > 0) @foreach($order->refundlogs->sortByDesc('id') as $rlogs) @php $orivar2 = App\AddSubVariant::withTrashed()->find($rlogs->getorder->variant_id); @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

{{__("Order Placed On :")}} {{ date('d/m/Y - h:i a', strtotime($order->created_at)) }}

{{__("Order ID :")}} {{ $inv_cus->order_prefix.$order->order_id }}

{{__("Total qty. :") }} {{ $order->qty_total }}

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

{{__("Payment method :") }} {{ ucfirst($order->payment_method) }}

{{__("Transcation ID :") }} {{ $order->transaction_id }}

{{__("Payment Received")}}

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

{{ ucfirst($order->payment_receive) }}

@else @endif
{{ __("Delivery Address") }}
@if($order->shippingaddress)

{{ $order->shippingaddress->name }}

{{ $order->shippingaddress->email }}

@if($order->shippingaddress->phone != '')

{{ $order->shippingaddress->phone }}

@endif @if(isset($order->shippingaddress->getCountry))

{{$order->shippingaddress->getcity->name ?? ''}}, {{ $order->shippingaddress->getstate->name ?? '' }}, {{ $order->shippingaddress->getCountry->nicename ?? '' }}, {{ $order->shippingaddress->pin_code }}

@endif @endif
{{ __("Billing Address") }}

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

{{ $order->billing_address['email'] }}

@if($order->billing_address['mobile'] != '')

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

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

{{ $ci ?? ''}}, {{ $s ?? '' }}, {{ $c->nicename ?? '' }}, @if(isset($order->billing_address['pincode'])) {{ $order->billing_address['pincode'] }} @endif

@endif
@foreach($order->invoices as $invoice) @if($invoice->local_pick != '' && !in_array($invoice->status,['return_request','refunded','ret_ref','Refund Pending']))
@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 @if($invoice->local_pick !='' && !in_array($invoice->status,['delivered','return_request','refunded','ret_ref','Refund Pending']))

{{__('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
@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

@if($invoice->status == 'Refund Pending' || $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)")}}

{{__("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->sortByDesc('id') 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(!in_array($o->status,['shipped','canceled','delivered','Refund Pending','ret_ref','refunded','return_request'])) @endif @endforeach @endsection @section('custom-script') @endsection