@extends('admin::layouts.master') @php use Webkul\Attribute\Models\AttributeOption; @endphp @section('page_title') {{ __('admin::app.sales.orders.view-title', ['order_id' => $order->increment_id]) }} - {{ isset($order->customer->first_name ) ? $order->customer->first_name .' '.$order->customer->last_name : 'Guest' }} @stop @section('content-wrapper')
{!! view_render_event('sales.order.tabs.before', ['order' => $order]) !!}

{{ __('Order Status') }}

@php $statusClass= ''; if(isset($order->estimate_start_date) && $order->status == 'processing' && (count($order->invoices) > 0) && $order->estimate_start_date <= date('Y-m-d H:i:s') && $order-> invoices[0]->state == 'paid'){ $statusClass = 'badge badge-sm badge-info'; } elseif($order->status == 'processing' && (count($order->invoices) > 0) && ($order->invoices[0]->state == 'pending')) { $statusClass='badge badge-sm badge-warning'; } elseif($order->status == 'processing' || $order->status == 'completed'){ $statusClass = 'badge badge-sm badge-success'; } elseif($order->status == 'canceled' || $order->status == 'fraud'){ $statusClass = 'badge badge-sm badge-danger'; } elseif($order->status == 'pending' || $order->status == 'pending_payment'){ $statusClass = 'badge badge-sm badge-warning'; } elseif($order->status == 'closed'){ $statusClass='badge badge-sm badge-info'; } @endphp @if(isset($order->estimate_start_date) && $order->status == 'processing' && (count($order->invoices) > 0) && $order->invoices[0]->state == 'paid' && $order->estimate_start_date <= date('Y-m-d H:i:s')) {{ __('Shipping') }} @elseif($order->status == 'processing' && (count($order->invoices) > 0) && ($order->invoices[0]->state == 'pending')) {{ __('Pending Payment') }} @else {{ $order->status_label }} @endif
point_of_sale {{ date('m-d-Y',strtotime($order->created_at)) }} orders @if(!empty($order->customer_id)) {{ $orderAgainstCustomer ?? '' }} @else {{ $orderAgainstCustomer ?? ''}} @endif

{{ __('Schedule') }}

calendar_month
local_shipping @if(!empty($order->estimate_end_date)) {{ date('D m-j', strtotime($order->estimate_start_date)) }} to {{ date('D m-d', strtotime($order->estimate_end_date)) }} @else {{ date('D m-d',strtotime($order->estimate_start_date)) }} @endif
{!! view_render_event('sales.order.created_at.after', ['order' => $order]) !!} {!! view_render_event('sales.order.channel_name.after', ['order' => $order]) !!}

{{ __('Contact') }}

@if(!empty($order->customer_id)) edit @else edit @endif
@if(!empty(trim($order->customer_full_name))) {{ $order->customer_full_name }} @else {{ $order->billing_address->first_name }} {{ $order->billing_address->last_name }} @endif
{{ $order->customer_email ?? $order->billing_address->email }}
@if ($order->billing_address || $order->shipping_address) @if ($order->billing_address)

{{ __('Billing') }}

edit
{{ $order->billing_address->name }}
{{ $order->billing_address->address1 }} {{ $order->billing_address->address2 }}
{{ $order->billing_address->city }}, {{ $order->billing_address->state }} {{ $order->billing_address->postcode }}
@if($order->billing_address->country != 'US') {{ $order->billing_address->country }} @endif
@endif @if ($order->shipping_address)

{{ __('Shipping') }}

edit
{{ $order->shipping_address->name }}
{{ $order->shipping_address->address1 }} {{ $order->shipping_address->address2 }}
{{ $order->shipping_address->city }}, {{ $order->shipping_address->state }} {{ $order->shipping_address->postcode }}
@if($order->shipping_address->country != 'US') {{ $order->shipping_address->country }} @endif
@endif @endif

{{ __('admin::app.sales.orders.payment-method') }}

credit_card_gear
@if($order->payment)
{{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }} @if ($isPartialPayment) , {{ core()->getConfigData('sales.paymentmethods.mpwalletsystem.title') }} {{ _('(Partial Payment)') }} @endif
{{ core()->formatBasePrice($order->base_grand_total) }}
@else
Pay By Phone
Pending
@endif

Customer History

    @if (isset($order->customerHistory) && count($order->customerHistory) > 0) @foreach ($order->customerHistory as $key => $customerHistory)
  • {{ date('m/d h:i A', strtotime($customerHistory->date_created)) }} : {{ $customerHistory->subject }}

  • @endforeach @else
  • No Record Found
  • @endif

Order History

    @if (count( $order->comments()->orderBy('id', 'desc')->get())) @foreach ($order->comments()->orderBy('id', 'desc')->get() as $comment) @if($comment->created_by == 2)
  • {{ $comment->created_by_user_name ? $comment->created_by_user_name . ' -' : '' }} {{$comment->comment }}

  • @elseif($comment->created_by == 1)
  • {{ $comment->created_by_user_name ? $comment->created_by_user_name . ' -' : '' }} {{$comment->comment }}

  • @endif @endforeach @else
  • No Record Found
  • @endif
@if(auth()->guard('admin')->user()->role->name == 'Administrator' || auth()->guard('admin')->user()->role->name == 'Manager')@endif @php $items_count = $order->items->count(); @endphp @foreach ($order->items as $key => $item) @if(auth()->guard('admin')->user()->role->name == 'Administrator' || auth()->guard('admin')->user()->role->name == 'Manager' ) @endif @endforeach
  {{ __('admin::app.sales.orders.SKU') }} {{ __('admin::app.sales.orders.product-name') }}{{ __('Cost') }}{{ __('Price') }}
@if($item->product->attribute_family_id != 1) @if (isset($item->product) && !empty($item->product) && count($item->product->images) > 0)
@elseif(isset($item->product) && !empty($item->product) && isset($item->product->parent) && count($item->product->parent->images) > 0)
@else @endif @endif
@if($item->product->attribute_family_id != 1)

{{ $item->getTypeInstance()->getOrderedItem($item)->sku }}

@php $producthasStock = ''; if($item->product){ $producthasStock =$item->product->inventories() ->where('inventory_source_id', 1)->where('qty','>','0')->first(); } @endphp @if($order->status != 'completed' && isset($item->product) && $item->product->attribute_family_id == 4) @if($item->canInvoice()) Not Confirmed @elseif(!$item->canInvoice() && !empty($producthasStock)) Received @elseif(!$item->canInvoice() && empty($producthasStock))
Purchased
@csrf
@endif @endif @endif
{{ $item->name }} @if ($key + 1 != $items_count)
@endif
@if(!empty($item->data) && isset($item->data) && $item->data != 'null') @foreach (json_decode($item->data) as $key => $value)

{{ $key }} : {{ $value }}

@endforeach @endif
@if (isset($item->additional['attributes']))
@foreach ($item->additional['attributes'] as $attribute) {{ $attribute['attribute_name'] }} : {{ $attribute['option_label'] }}
@endforeach
@endif
@php $cost = 0; if(isset($item->product) && isset($item->product->attribute_values)){ $cost = $item->product->attribute_values->where('attribute_id','12')->pluck('float_value')->first(); } @endphp

{{ core()->formatBasePrice($cost) ?? number_format('0', 2) }}

@if(isset($item->product) && $item->product->attribute_family_id == 4)

({{ number_format('0', 2) }}%)

@endif

{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount) }}

@if(isset($item->product) && $item->product->attribute_family_id == 4) @php $price = $item->base_total + $item->base_tax_amount ?? 0; $cost = $item->product->attribute_values->where('attribute_id','12')->pluck('float_value')->first(); $val = $price > 0 ? ($price - $cost)/($price) * 100 : 0; @endphp ({{ number_format($val, 2) }}%) @endif

@if ($order->haveStockableItems() && $order->base_shipping_amount > 0) @endif @if ($order->base_discount_amount > 0) @endif @if ($order->base_tax_amount > 0) @endif @if ($isPartialPayment) @endif @if ($order->base_grand_total_invoiced > 0) @endif @if ($order->base_grand_total_refunded > 0) @endif @php $invoice_amount = 0; if (count($order->invoices) > 0 && $order->invoices[0]->state == 'paid') { $invoice_amount = $order->base_grand_total_invoiced; } $duePayment = (float)($order->grand_total) - (float)($invoice_amount); @endphp @if ($isPartialPayment) @if ($order->base_total_due > 0) @elseif ($duePayment > 0) @endif @elseif (number_format($duePayment, 2) > 0) @endif
{{ __('admin::app.sales.orders.subtotal') }} - {{ core()->formatBasePrice($order->base_sub_total) }}
{{ __('admin::app.sales.orders.shipping-handling') }} - {{ core()->formatBasePrice($order->base_shipping_amount) }}
{{ __('admin::app.sales.orders.discount') }} @if ($order->coupon_code) ({{ $order->coupon_code }}) @endif - ({{ core()->formatBasePrice($order->base_discount_amount) }})
{{ __('admin::app.sales.orders.tax') }} {{ number_format($order->tax_percentage, 2) }} % - {{ core()->formatBasePrice($order->base_tax_amount) }}
{{ __('admin::app.sales.orders.grand-total') }} - {{ core()->formatBasePrice($order->base_grand_total) }}
{{ __('Paid By wallet') }} - {{ core()->formatBasePrice($order->base_grand_total - $remain) }}
{{ __('Remaining Grand Total') }} - {{ core()->formatBasePrice($remain) }}
{{ __('admin::app.sales.orders.total-paid') }} - {{ core()->formatBasePrice($order->base_grand_total_invoiced) }}
{{ __('admin::app.sales.orders.total-refunded') }} - {{ core()->formatBasePrice($order->base_grand_total_refunded) }}
{{ __('admin::app.sales.orders.total-due') }} -{{ core()->formatBasePrice($remain) }}{{ core()->formatBasePrice($duePayment) }}
{{ __('admin::app.sales.orders.total-due') }} - {{ core()->formatBasePrice($duePayment) }}
@foreach ($order->invoices as $invoice) @endforeach @if (!$order->invoices->count()) @endif
{{ __('admin::app.sales.invoices.id') }} {{ __('admin::app.sales.invoices.date') }} {{ __('admin::app.sales.invoices.order-id') }} {{ __('admin::app.sales.invoices.customer-name') }} {{ __('admin::app.sales.invoices.status') }} {{ __('admin::app.sales.invoices.amount') }} {{ __('admin::app.sales.invoices.action') }}
#{{ $invoice->id }} {{ $invoice->created_at }} #{{ $invoice->order->increment_id }} {{ $invoice->address->name ?? '' }} {{ $invoice->status_label }} {{ core()->formatBasePrice($invoice->base_grand_total) }}
{{ __('admin::app.common.no-result-found') }}
@foreach ($order->shipments as $shipment) @endforeach @if (!$order->shipments->count()) @endif
{{ __('admin::app.sales.shipments.id') }} {{ __('admin::app.sales.shipments.date') }} {{ __('admin::app.sales.shipments.carrier-title') }} {{ __('admin::app.sales.shipments.tracking-number') }} {{ __('admin::app.sales.shipments.total-qty') }} {{ __('admin::app.sales.shipments.action') }}
#{{ $shipment->id }} {{ $shipment->created_at }} {{ $shipment->carrier_title }} {{ $shipment->track_number }} {{ $shipment->total_qty }}
{{ __('admin::app.common.no-result-found') }}
@foreach ($order->refunds as $refund) @endforeach @if (!$order->refunds->count()) @endif
{{ __('admin::app.sales.refunds.id') }} {{ __('admin::app.sales.refunds.date') }} {{ __('admin::app.sales.refunds.order-id') }} {{ __('admin::app.sales.refunds.customer-name') }} {{ __('admin::app.sales.refunds.status') }} {{ __('admin::app.sales.refunds.refunded') }} {{ __('admin::app.sales.refunds.action') }}
#{{ $refund->id }} {{ $refund->created_at }} #{{ $refund->order->increment_id }} {{ $refund->order->customer_full_name }} {{ __('admin::app.sales.refunds.refunded') }} {{ core()->formatBasePrice($refund->base_grand_total) }}
{{ __('admin::app.common.no-result-found') }}
{!! view_render_event('sales.order.tabs.after', ['order' => $order]) !!}
@stop @push('scripts') @include('admin::layouts.tinymce') @endpush