@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

{{\App\CPU\translate('invoice')}}

@if($order['seller_is']!='admin' && isset($order['seller']) && $order['seller']->gst != null)
{{\App\CPU\translate('GST')}} : {{ $order['seller']->gst }}
@endif
{{\App\CPU\translate('invoice')}} # {{ $order->id }}
{{\App\CPU\translate('date')}} : {{date('d-m-Y h:i:s a',strtotime($order['created_at']))}}
{{--
--}} {{----}}
@if ($order->shippingAddress) @else @endif @if ($order->billingAddress) @endif
{{\App\CPU\translate('shipping_to')}}:

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

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

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

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

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

{{\App\CPU\translate('customer_info')}}:

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

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

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

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

@endif
{{\App\CPU\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'] : ""}}

{{----}}
@php $subtotal=0; $total=0; $sub_total=0; $total_tax=0; $total_shipping_cost=0; $total_discount_on_product=0; $ext_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
{{\App\CPU\translate('no.')}} {{\App\CPU\translate('item_description')}} {{\App\CPU\translate('unit_price')}} {{\App\CPU\translate('qty')}} {{\App\CPU\translate('total')}}
{{$key+1}} {{$details['product']?$details['product']->name:''}}
{{\App\CPU\translate('variation')}} : {{$details['variant']}}
{{\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'])

{{\App\CPU\translate('payment_details')}}

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

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

{{\App\CPU\translate('delivery_info')}}

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

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

@else

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

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




{{\App\CPU\translate('phone')}} : {{\App\Model\BusinessSetting::where('type','company_phone')->first()->value}}
{{\App\CPU\translate('website')}} : {{url('/')}}
{{\App\CPU\translate('email')}} : {{$company_email}}