@extends('layouts.back-end.app') @section('title', translate('order_Details')) @section('content')

{{ translate('order_Details') }}

{{ translate('order_ID') }} #{{$order['id']}}

{{date('d M Y H:i:s',strtotime($order['created_at'])) }}
{{ translate('status') }}: @if($order['order_status']=='pending') {{ translate(str_replace('_',' ',$order['order_status'])) }} @elseif($order['order_status']=='failed') {{ translate(str_replace('_',' ',$order['order_status'])) }} @elseif($order['order_status']=='processing' || $order['order_status']=='out_for_delivery') {{ translate(str_replace('_',' ',$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(str_replace('_',' ',$order['payment_method'])) }}
@if(isset($order['transaction_ref']) && $order->payment_method != 'cash_on_delivery' && $order->payment_method != 'pay_by_wallet' && !isset($order->offline_payments))
{{ translate('reference_Code') }} : {{ translate(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') && $order->order_type == "default_type") {{ translate('order_verification_code') }} : {{$order['verification_code']}} @endif
@php($item_price=0) @php($subtotal=0) @php($total=0) @php($discount=0) @php($tax=0) @php($product_price=0) @php($total_product_price=0) @foreach($order->details as $key=>$detail) @if($productDetails) @php($item_price+=$detail['price']*$detail['qty']) @php($subtotal=($detail['price']*$detail['qty'])+$detail['tax']-$detail['discount']) @php($product_price = $detail['price']*$detail['qty']) @php($total_product_price+=$product_price) @if($productDetails->product_type == 'digital') @endif @php($discount+=$detail['discount']) @php($tax+=$detail['tax']) @php($total+=$subtotal) @endif @php($sellerId=$detail->seller_id) @endforeach
{{ translate('SL') }} {{ translate('item_details') }} {{ translate('item_price') }} {{ translate('tax') }} {{ translate('item_discount') }} {{ translate('total_price') }}
{{++$key}}
{{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('extra_discount') }}
- {{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['extraDiscount']), currencyCode: getCurrencyCode()) }}
{{ translate('sub_total') }}
{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['subTotal']), currencyCode: getCurrencyCode()) }}
{{ translate('coupon_discount') }}
- {{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['couponDiscount']), currencyCode: getCurrencyCode()) }}
{{ translate('vat') }}/{{ translate('tax') }}
{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['taxTotal']), currencyCode: getCurrencyCode()) }}
{{ translate('total') }}
{{setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['totalAmount']), currencyCode: getCurrencyCode()) }}
@if ($order->order_type == 'pos' || $order->order_type == 'POS')
{{translate('paid_amount')}}
{{ setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['paidAmount']), currencyCode: getCurrencyCode()) }}
{{translate('change_amount')}}
{{ setCurrencySymbol(amount: usdToDefaultCurrency(amount: $orderTotalPriceSummary['changeAmount']), currencyCode: getCurrencyCode()) }}
@endif
@if($order->customer)

{{ translate('customer_information') }}

{{translate('image')}}
{{$order->customer['f_name'].' '.$order->customer['l_name']}} {{$order->customer['phone']}} {{$order->customer['email']}}
@else
{{ translate('no_customer_found') }}
@endif
@endsection