@php use App\Model\BusinessSetting; $company_phone =BusinessSetting::where('type', 'company_phone')->first()->value; $company_email =BusinessSetting::where('type', 'company_email')->first()->value; $company_name =BusinessSetting::where('type', 'company_name')->first()->value; $company_web_logo =BusinessSetting::where('type', 'company_web_logo')->first()->value; $company_mobile_logo =BusinessSetting::where('type', 'company_mobile_logo')->first()->value; @endphp
{{translate('Order_Invoice')}}

{{translate('invoice')}} #{{ $order->id }}


{{translate('Shop_Name')}} : {{ $order->seller_is == 'admin' ? $company_name : (isset($order->seller->shop) ? $order->seller->shop->name : translate('not_found')) }}

@if($order['seller_is']!='admin' && isset($order['seller']->gst) != null)

{{translate('GST')}} : {{ $order['seller']->gst }}

@endif

{{translate('date')}} : {{date('d-m-Y h:i:s a',strtotime($order['created_at']))}}

@if ($order->order_type == 'default_type')
@if ($order->shippingAddress) {{translate('shipping_to')}}

{{$order->customer !=null? $order->customer['f_name'].' '.$order->customer['l_name']:translate('name_not_found')}}

{{$order->customer !=null? $order->customer['email']:translate('email_not_found')}}

{{$order->customer !=null? $order->customer['phone']:translate('phone_not_found')}}

{{$order->shippingAddress ? $order->shippingAddress['address'] : ""}}

{{$order->shippingAddress ? $order->shippingAddress['city'] : ""}} {{$order->shippingAddress ? $order->shippingAddress['zip'] : ""}}

@else {{translate('customer_info')}}

{{$order->customer !=null? $order->customer['f_name'].' '.$order->customer['l_name']:translate('name_not_found')}}

@if (isset($order->customer) && $order->customer['id']!=0)

{{$order->customer !=null? $order->customer['email']:translate('email_not_found')}}

{{$order->customer !=null? $order->customer['phone']:translate('phone_not_found')}}

@endif
@endif

@if ($order->billingAddress) {{translate('billing_address')}}

{{$order->billingAddress ? $order->billingAddress['contact_person_name'] : ""}}

{{$order->billingAddress ? $order->billingAddress['phone'] : ""}}

{{$order->billingAddress ? $order->billingAddress['address'] : ""}}

{{$order->billingAddress ? $order->billingAddress['city'] : ""}} {{$order->billingAddress ? $order->billingAddress['zip'] : ""}}

@endif
@else
{{translate('POS_order')}}
@endif
@php $subtotal=0; $total=0; $sub_total=0; $total_tax=0; $total_shipping_cost=0; $total_discount_on_product=0; $extra_discount=0; @endphp @foreach($order->details as $key=>$details) @php $subtotal=($details['price'])*$details->qty @endphp @php $sub_total+=$details['price']*$details['qty']; $total_tax+=$details['tax']; $total_shipping_cost+=$details->shipping ? $details->shipping->cost :0; $total_discount_on_product+=$details['discount']; $total+=$subtotal; @endphp @endforeach
{{translate('no.')}} {{translate('item_description')}} {{translate('unit_price')}} {{translate('qty')}} {{translate('total')}}
{{$key+1}} {{$details['product']?$details['product']->name:''}} @if($details['variant'])
{{translate('variation')}} : {{$details['variant']}} @endif
{{\App\CPU\BackEndHelper::set_symbol(\App\CPU\BackEndHelper::usd_to_currency($details['price']))}} {{$details->qty}} {{\App\CPU\BackEndHelper::set_symbol(\App\CPU\BackEndHelper::usd_to_currency($subtotal))}}
@php($shipping=$order['shipping_cost'])

{{translate('payment_details')}}

{{ str_replace('_',' ',$order->payment_method) }}

{{$order->payment_status}} , {{date('y-m-d',strtotime($order['created_at']))}}

@if ($order->delivery_type !=null)

{{translate('delivery_info')}}

@if ($order->delivery_type == 'self_delivery')

{{translate('self_delivery')}}
{{translate('delivery_man_name')}} : {{$order->delivery_man['f_name'].' '.$order->delivery_man['l_name']}}
{{translate('delivery_man_phone')}} : {{$order->delivery_man['phone']}}

@else

{{$order->delivery_service_name}}
{{translate('tracking_id')}} : {{$order->third_party_delivery_tracking_id}}

@endif @endif
@if($order->order_type == 'default_type') @endif @if ($order->order_type != 'default_type') @endif
{{translate('sub_total')}} {{\App\CPU\BackEndHelper::set_symbol(\App\CPU\BackEndHelper::usd_to_currency($sub_total))}}
{{translate('tax')}} {{\App\CPU\BackEndHelper::set_symbol(\App\CPU\BackEndHelper::usd_to_currency($total_tax))}}
{{translate('shipping')}} {{\App\CPU\BackEndHelper::set_symbol(\App\CPU\BackEndHelper::usd_to_currency($shipping))}}
{{translate('coupon_discount')}} - {{\App\CPU\BackEndHelper::set_symbol(\App\CPU\BackEndHelper::usd_to_currency($order->discount_amount))}}
{{translate('discount_on_product')}} - {{\App\CPU\BackEndHelper::set_symbol(\App\CPU\BackEndHelper::usd_to_currency($total_discount_on_product))}}
{{translate('extra_discount')}} - {{\App\CPU\BackEndHelper::set_symbol(\App\CPU\BackEndHelper::usd_to_currency($extra_discount))}}
{{translate('total')}} {{\App\CPU\BackEndHelper::set_symbol(\App\CPU\BackEndHelper::usd_to_currency($order->order_amount))}}




{{translate('phone')}} : {{\App\Model\BusinessSetting::where('type','company_phone')->first()->value}}
{{translate('email')}} : {{$company_email}}
{{translate('website')}} : {{url('/')}}
{{translate('All_copy_right_reserved_©_'.date('Y').'_').$company_name}}