@extends('layouts.back-end.app') @section('title', translate('order_Details')) @push('css_or_js') @endpush @section('content') @php($shippingAddress = $order['shipping_address_data'] ?? null)

{{translate('order_Details')}}

{{ translate('Order_ID') }} #{{ $order['id'] }} @if($order['order_type'] == 'POS') ({{ 'POS' }}) @endif

{{date('d M, Y , h:i A',strtotime($order['created_at']))}}
@if ($linkedOrders->count() >0)
{{translate('linked_orders')}} ({{$linkedOrders->count()}}) :
@foreach($linkedOrders as $linked) {{$linked['id']}} @endforeach @endif @if($order['payment_method'] == 'cash_on_delivery' && $order['bring_change_amount'] > 0)
{{ translate('please_ensure_the_deliveryman_has') }} {{ $order['bring_change_amount'] }} {{ $order['bring_change_amount_currency'] ?? '' }} {{ translate('in_change_ready_for_the_customer') }}
@endif
@if ($order->verificationImages && count($order->verificationImages)>0 && $order->verification_status ==1)
@endif @if (getWebConfig('map_api_status') == 1 && isset($shippingAddress->latitude) && isset($shippingAddress->longitude))
@endif {{translate('print_Invoice')}}
{{translate('status')}}: @if($order['order_status']=='pending') {{translate(str_replace('_',' ',$order['order_status']))}} @elseif($order['order_status']=='failed') {{translate(str_replace('_',' ',$order['order_status'] == 'failed' ? 'Failed to Deliver' : ''))}} @elseif($order['order_status']=='processing' || $order['order_status']=='out_for_delivery') {{translate(str_replace('_',' ',$order['order_status'] == 'processing' ? 'Packaging' : $order['order_status']))}} @elseif($order['order_status']=='delivered' || $order['order_status']=='confirmed') {{translate(str_replace('_',' ',$order['order_status']))}} @else {{translate(str_replace('_',' ',$order['order_status']))}} @endif
{{translate('payment_Method')}} : {{translate($order['payment_method'])}}
@if($order->payment_method != 'cash_on_delivery' && $order->payment_method != 'pay_by_wallet' && !isset($order->offlinePayments))
{{translate('reference_Code')}} : {{str_replace('_',' ',$order['transaction_ref'])}} {{ $order->payment_method == 'offline_payment' ? '('.$order->payment_by.')':'' }}
@endif
{{translate('payment_Status')}}: @if($order['payment_status']=='paid') {{translate('paid')}} @else {{translate('unpaid')}} @endif
@if(getWebConfig('order_verification')) {{translate('order_verification_code')}} : {{$order['verification_code']}} @endif
@if ($order->order_note !=null)
{{ translate('order_Note') }}:
{{ $order->order_note }}
@endif
@php($item_price=0) @php($total_price=0) @php($subtotal=0) @php($total=0) @php($discount=0) @php($tax=0) @php($row=0) @foreach($order->details as $key=>$detail) @php($productDetails = $detail?->productAllStatus ?? json_decode($detail->product_details) ) @if($productDetails) @php($subtotal=$detail['price']*$detail['qty']+$detail['tax']-$detail['discount']) @php($item_price+=$detail['price']*$detail['qty']) @php($discount+=$detail['discount']) @php($tax+=$detail['tax']) @php($total+=$subtotal) @endif @php($sellerId=$detail->seller_id) @if(isset($productDetails->digital_product_type) && $productDetails->digital_product_type == 'ready_after_sell') @php($product_details = json_decode($detail->product_details)) @endif @endforeach
{{translate('SL')}} {{translate('item_details')}} {{translate('item_price')}} {{translate('tax')}} {{translate('item_discount')}} {{translate('total_price')}}
{{ ++$row }}
{{translate('image_Description')}}
{{substr($productDetails->name, 0, 30)}}{{strlen($productDetails->name)>10?'...':''}}
{{translate('qty')}} : {{$detail['qty']}}
{{translate('unit_price')}} : {{ setCurrencySymbol(amount: usdToDefaultCurrency(amount: $detail['price'] + ($detail->tax_model =='include' ? ($detail['tax'] / $detail['qty']) :0))) }} @if ($detail->tax_model =='include') ({{translate('tax_incl.')}}) @else ({{translate('tax').":".($productDetails->tax)}}{{$productDetails->tax_type ==="percent" ? '%' :''}}) @endif
@if ($detail->variant)
{{translate('variation')}} : {{$detail['variant']}}
@endif
@if(isset($productDetails->digital_product_type) && $productDetails->digital_product_type == 'ready_after_sell') @endif
{{ setCurrencySymbol(amount: usdToDefaultCurrency(amount: $detail['price']*$detail['qty']), currencyCode: getCurrencyCode()) }} {{ setCurrencySymbol(amount: usdToDefaultCurrency(amount: $detail['tax']), currencyCode: getCurrencyCode()) }} {{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $detail['discount']), currencyCode: getCurrencyCode())}}{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $subtotal), currencyCode: getCurrencyCode())}}

@php($orderTotalPriceSummary = \App\Utils\OrderManager::getOrderTotalPriceSummary(order: $order))
{{translate('item_price')}}
{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['itemPrice']), currencyCode: getCurrencyCode())}}
{{translate('item_discount')}}
-{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['itemDiscount']), currencyCode: getCurrencyCode())}}
{{translate('sub_total')}}
{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['subTotal']), currencyCode: getCurrencyCode())}}
{{translate('coupon_discount')}}
{{(!in_array($order['coupon_code'], [0, NULL]) ? '('.translate('expense_bearer_').($order['coupon_discount_bearer']=='inhouse' ? 'admin' : ($order['coupon_discount_bearer'] =='seller'? 'vendor' : $order['coupon_discount_bearer'])).')': '' )}}
-{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['couponDiscount']), currencyCode: getCurrencyCode())}}
{{translate('vat')}}/{{translate('tax')}}
{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['taxTotal']), currencyCode: getCurrencyCode())}}
{{translate('shipping_fee')}}
{{($order['is_shipping_free'] ? '('.translate('expense_bearer_').($order['free_delivery_bearer'] == 'seller' ? 'vendor' : $order['free_delivery_bearer']).')': '' )}}
{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['shippingTotal']), currencyCode: getCurrencyCode())}}
{{translate('total')}}
{{ setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['totalAmount']), currencyCode: getCurrencyCode())}}
@if($order->payment_method == 'offline_payment' && isset($order->offlinePayments))

{{translate('Payment_Information')}}

@foreach ($order->offlinePayments->payment_info as $key=>$item) @if (isset($item) && $key != 'method_id') @endif @endforeach
{{translate('payment_Method')}} : {{ translate($order['payment_method']) }}
{{translate($key)}} : {{ $item }}
@if(isset($order->payment_note) && $order->payment_method == 'offline_payment')

{{translate('payment_Note')}}:

{{ $order->payment_note }}

@endif
@endif

{{translate('order_&_Shipping_Info')}}

{{translate('payment_status')}}
{{ $order->payment_status=='paid' ? translate('paid'):translate('unpaid')}}
@if($physicalProduct)
  • @if ($order->shipping_type == 'order_wise') @endif
  • @if (isset($order->deliveryMan))
    {{translate('Image')}}
    {{ $order->deliveryMan?->f_name.' '.$order->deliveryMan?->l_name}}
    {{$order->deliveryMan?->phone}}
    @else
    {{translate('Image')}}
    {{translate('no_delivery_man_assigned')}}
    @endif
  • @if (isset($order->deliveryMan))
  • @endif
  • {{translate('image')}}
    {{$order->delivery_service_name ?? translate('not_assign_yet')}}
    {{translate('track_ID').' '.':'.' '.$order->third_party_delivery_tracking_id}}
@endif
@if(!$order->is_guest && $order->customer)

{{translate('customer_information')}}

{{translate('Image')}}
{{$order->customer['f_name'].' '.$order->customer['l_name']}} {{ $orderCount }} {{translate('orders')}} {{$order->customer['phone']}} {{$order->customer['email']}}
@endif @if($physicalProduct)
@if($shippingAddress)

{{translate('shipping_address')}}

@if($order['order_status'] != 'delivered') @endif
{{translate('name')}} : {{$shippingAddress->contact_person_name}} {{ $order->is_guest ? '('. translate('guest_customer') .')':''}}
{{translate('contact')}} : {{$shippingAddress->phone}}
@if ($order->is_guest && $shippingAddress->email)
{{translate('email')}} : {{$shippingAddress->email}}
@endif
{{translate('country')}} : {{$shippingAddress->country}}
{{translate('city')}} : {{$shippingAddress->city}}
{{translate('zip_code')}} : {{$shippingAddress->zip}}
{{$shippingAddress->address ?? translate('empty')}}
@else
{{translate('no_shipping_address_found')}}
@endif
@endif
@php($billing=$order['billing_address_data']) @if($billing)

{{translate('billing_address')}}

@if($order['order_status'] != 'delivered') @endif
{{translate('name')}} : {{$billing->contact_person_name}} {{ $order->is_guest ? '('. translate('guest_customer') .')':''}}
{{translate('contact')}} : {{$billing->phone}}
@if ($order->is_guest && $billing->email)
{{translate('email')}} : {{$billing->email}}
@endif
{{translate('country')}} : {{$billing->country}}
{{translate('city')}} : {{$billing->city}}
{{translate('zip_code')}} : {{$billing->zip}}
{{$billing->address}}
@else
{{translate('no_billing_address_found')}}
@endif

{{ translate('shop_Information') }}

@if($order->seller_is == 'admin')
{{ $companyName }}
{{ $totalDelivered }} {{translate('orders_Served')}}
@else @if(!empty($order->seller->shop))
{{ $order->seller->shop->name }}
{{ $totalDelivered }} {{translate('orders_Served')}} {{ $order->seller->shop->contact }}
{{ $order->seller->shop->address }}
@else
{{translate('image_description')}}

{{ translate('no_shop_found').'!'}}

@endif @endif
@if ($order->verificationImages && count($order->verificationImages)>0) @endif @if($billing) @endif customer['l_name']??""}}}"> @endsection @push('script_2') @if(getWebConfig('map_api_status') ==1 ) @endif @endpush