@extends('admin.layouts.master') @section('content')
@if ($order->cancellation)

{{ trans('app.' . $order->cancellation->request_type . '_request') }}

{!! $order->cancellation->statusName() !!}

@lang('app.reason'): {!! $order->cancellation->reason !!}

@if ($order->cancellation->description)

@lang('app.detail'): {{ $order->cancellation->description ?? '' }}

@endif {{ trans('app.requested_items') }}:
@can('cancel', $order) @if ($order->cancellation->isNew()) {!! Form::open(['route' => ['admin.order.cancellation.handle', $order, 'approve'], 'method' => 'put', 'class' => 'form-inline indent5']) !!} {!! Form::close() !!} {!! Form::open(['route' => ['admin.order.cancellation.handle', $order, 'decline'], 'method' => 'put', 'class' => 'form-inline indent5']) !!} {!! Form::close() !!} @endif @if ($order->cancellation->inReview()) @if (Auth::user()->isFromPlatform()) {{ trans('app.approve') }} @else {!! trans('app.waiting_for_approval') !!} @endif @endif @endcan
@if ($order->cancellation->isPartial()) @foreach ($order->inventories as $item) @if (in_array($item->id, $order->cancellation->items)) @endif @endforeach @else @endif
{{ trans('app.image') }} {{ $item->pivot->item_description }} {{ get_formated_currency($item->pivot->unit_price, 2, $order->currency_id) }} × {{ $item->pivot->quantity }} {{ get_formated_currency($item->pivot->quantity * $item->pivot->unit_price, 2, $order->currency_id) }}
{{ trans('app.all_items') }}
@endif

{{ trans('app.order') . ': ' . $order->order_number }}

@if ($order->dispute) {{ trans('app.statuses.disputed') }} @endif @can('fulfill', $order) {{ trans('app.assign_deliveryboy') }} @endcan
{!! $order->orderStatus() !!}
{{ trans('app.payment') . ': ' . $order->paymentMethod->name }} {!! $order->paymentStatusName() !!}

{{ trans('app.order_details') }} @if ($order->auction_bid_id) {{ trans('auction::lang.winner') }} @endif

@if (count($order->inventories) > 0) @foreach ($order->inventories as $item) @endforeach @else @endif
{{ trans('app.image') }} {{ $item->pivot->item_description }} {{ get_formated_currency($item->pivot->unit_price, 2, $order->currency_id) }} × {{ $item->pivot->quantity }} {{ get_formated_currency($item->pivot->quantity * $item->pivot->unit_price, 2, $order->currency_id) }}
{{ trans('help.empty_cart') }}
@if ($order->buyer_note) {{ trans('app.buyer_note') }}:
{{ $order->buyer_note }}
@endif @if ($order->admin_note) {{ trans('app.admin_note') }}: @can('fulfill', $order) {{ trans('app.edit') }} @endcan
{!! $order->admin_note !!}
@else @can('fulfill', $order) {{ trans('app.add_admin_note') }} @endcan @endif
@if (is_incevio_package_loaded('packaging') && $order->shippingPackage) @endif @if ($order->handling) @endif
{{ trans('app.total') }} {{ get_formated_currency($order->total, 2, $order->currency_id) }}
{{ trans('app.discount') }} − {{ get_formated_currency($order->discount, 2, $order->currency_id) }}
{{ trans('app.shipping') }}
@if ($order->shippingRate) {{ optional($order->shippingRate)->name }} @php $carrier_name = $order->carrier ? $order->carrier->name : ($order->shippingRate ? optional($order->shippingRate->carrier)->name : null); @endphp @if ($carrier_name) {{ trans('app.by') . ' ' . $carrier_name }} @endif @else {{ trans('app.custom_shipping') }} @endif
{{ get_formated_currency($order->shipping, 2, $order->currency_id) }}
{{ trans('app.packaging') }}
{{ optional($order->shippingPackage)->name }}
{{ get_formated_currency($order->packaging, 2, $order->currency_id) }}
{{ trans('app.handling') }} {{ get_formated_currency($order->handling, 2, $order->currency_id) }}
{{ trans('app.taxes') }}
@if ($order->shippingZone) {{ optional($order->shippingZone)->name }} @elseif($order->shippingRate) {{ optional($order->shippingRate->shippingZone)->name }} @endif {{ get_formated_decimal($order->taxrate, true, 2) }}%
{{ get_formated_currency($order->taxes, 2, $order->currency_id) }}
{{ trans('app.grand_total') }} {{ get_formated_currency($order->grand_total, 2, $order->currency_id) }}
@php $refunded_amt = $order->refundedSum(); @endphp @if ($refunded_amt > 0) @endif @can('fulfill', $order)
@if (Auth::user()->canManageOrderPayments()) {!! Form::open(['route' => ['admin.order.order.togglePaymentStatus', $order], 'method' => 'put', 'class' => 'inline']) !!} {!! Form::close() !!} @if ($order->isPaid() && ((Auth::user()->isFromPlatForm() && !vendor_get_paid_directly()) || (Auth::user()->isFromMerchant() && vendor_get_paid_directly()))) @can('initiate', \App\Models\Refund::class) {{ trans('app.initiate_refund') }} @endcan @endif @endif
{{ trans('app.update_status') }} @if ($order->isFulfilled()) @unless ($order->isArchived()) @can('archive', $order) {!! Form::open(['route' => ['admin.order.order.archive', $order->id], 'method' => 'delete', 'class' => 'inline']) !!} {!! Form::close() !!} @endcan @endunless @else @unless ($order->isCanceled() || $order->cancellation) @if (!$order->cancellationFeeApplicable()) @if (Auth::user()->isFromPlatform()) {{ trans('app.cancel_order') }} @else {!! Form::open(['route' => ['admin.order.order.cancel', $order], 'method' => 'put', 'class' => 'inline']) !!} {!! Form::close() !!} @endif @else {{ trans('app.cancel_order') }} @endif @endunless @if ($order->deliver()) {{ trans('app.fulfill_order') }} @endif @endif
@endcan @include('admin.partials._activity_logs', ['logger' => $order])
@if (Auth::user()->isFromPlatform())

{{ trans('app.shop') }}

@can('secretLogin', $order->shop->owner) {{ trans('app.secret_login_merchant') }} @endcan
{{ trans('app.logo') }}

@if (Gate::allows('view', $order->shop) && $order->shop->id) {{ $order->shop->name }} @else

{!! trans('help.shop_not_exist') !!}

{{ $order->shop->name }} @endif

@if ($order->shop->id) {{ trans('app.store_front') }} @endif
@endif

{{ trans('app.deliveryboy') }}

{{ trans('app.avatar') }} {{-- @if (config('system_settings.vendor_can_view_customer_info') && $order->delivery_boy_id) {{ $order->deliveryBoy->getName() }} @else --}} {{ $order->deliveryBoy ? $order->deliveryBoy->getName() : trans('app.no_assigned_yet') }} {{-- @endif --}}

@if ($order->deliveryBoy) {{ trans('app.email') . ': ' . $order->deliveryBoy->email }} @endif
@if (config('system_settings.vendor_can_view_customer_info'))

{{ trans('app.customer') }}

{{ trans('app.avatar') }} @if (config('system_settings.vendor_can_view_customer_info') && $order->customer_id) {{ $order->customer->getName() }} @else {{ $order->customer->getName() }} @endif @if ($order->email)
{{ trans('app.email') . ': ' . $order->email }} @endif

@if ($order->customer->email) {{ trans('app.email') . ': ' . $order->customer->email }} @endif @if ($order->conversation) {{ trans('app.view_conversations') }} @else {{-- {{ trans('app.send_message') }} --}} {{ trans('app.send_message') }} @endif {{ trans('app.invoice') }} @if ($order->dispute) {{ trans('app.view_dispute') }} @endif @if (is_incevio_package_loaded('pharmacy'))
{{ trans('pharmacy::lang.prescription') }}
@if (count($order->attachments)) @foreach ($order->attachments as $attachment) {{ $attachment->name }} @endforeach @endif @endif @if ($order->pickup())
{{ strtoupper(trans('app.pick_up_address')) }}
@php $warehouseIds = []; @endphp @foreach ($order->inventories as $key => $inventory) @if (!empty($inventory->warehouse)) @if (!in_array($inventory->warehouse_id, $warehouseIds)) @php $warehouseIds[] = $inventory->warehouse_id; @endphp {!! address_str_to_html($inventory->warehouse->address->toString()) !!} @endif @endif @endforeach @else
{{ strtoupper(trans('app.shipping_address')) }}
{!! address_str_to_html($order->shipping_address) !!}
{{ strtoupper(trans('app.billing_address')) }}
@if ($order->shipping_address == $order->billing_address) {!! Form::label('same_as_shipping_address', strtoupper(trans('app.same_as_shipping_address')), ['class' => 'indent5']) !!} @else {!! address_str_to_html($order->billing_address) !!} @endif @endif
@endif @if ($order->refunds->count())

{{ trans('app.refunds') }}

@foreach ($order->refunds as $refund) @endforeach
{{ $refund->created_at->diffForHumans() }} {{ get_formated_currency($refund->amount, 2, $order->currency_id) }} {!! $refund->statusName() !!} @if ($refund->isOpen()) @can('approve', $refund)   @endcan @endif
@endif

{{ trans('app.shipping') }}

{{ trans('app.tracking_id') }}: {{ $order->tracking_id }}
{{ trans('app.carrier') }}: {{ $order->carrier ? $order->carrier->name : ($order->shippingRate ? optional($order->shippingRate->carrier)->name : '') }}
{{ trans('app.total_weight') }}: {{ get_formated_weight($order->shipping_weight) }}
@if ($order->carrier && $order->tracking_id) @php $tracking_url = getTrackingUrl($order->tracking_id, $order->carrier_id); @endphp {{ trans('app.tracking_url') }}: {{ $tracking_url }} @endif
@endsection