#INVOICE
Phone : {{\App\Models\BusinessSetting::where(['key'=>'phone'])->first()->value}}
Email : {{\App\Models\BusinessSetting::where(['key'=>'email_address'])->first()->value}}
Address : {{\App\Models\BusinessSetting::where(['key'=>'address'])->first()->value}}
@if($order->customer)
Order ID : {{$order['id']}}
Customer Name : {{$order->customer['f_name'].' '.$order->customer['l_name']}}
Phone : {{$order->customer['phone']}}
Delivery Address : {{$order->delivery_address?$order->delivery_address['address']:''}}
@endif
Customer Name : {{$order->customer['f_name'].' '.$order->customer['l_name']}}
Phone : {{$order->customer['phone']}}
Delivery Address : {{$order->delivery_address?$order->delivery_address['address']:''}}
@endif
Order details {{$order->details->count()}}
Order Note : {{$order['order_note']}}
Payment Method : {{str_replace('_',' ',$order['payment_method'])}}
@if($order['__action_reference']==null) Reference Code : @else Reference Code : {{$order['__action_reference']}} @endif
Order Type : {{str_replace('_',' ',$order['order_type'])}}
@php($sub_total=0)
@php($total_tax=0)
@php($total_dis_on_pro=0)
@php($add_ons_cost=0)
@foreach($order->details as $detail)
@if($detail->product)
@php($add_on_qtys=json_decode($detail['add_on_qtys'],true))
@php($sub_total+=$amount)
@php($total_tax+=$detail['tax_amount']*$detail['quantity'])
@endif @endforeach
{{$detail->product['name']}}
@if(isset(json_decode($detail['variation'],true)[0])) Variation : @foreach(json_decode($detail['variation'],true)[0] as $key1 =>$variation)
@if(isset(json_decode($detail['variation'],true)[0])) Variation : @foreach(json_decode($detail['variation'],true)[0] as $key1 =>$variation)
{{$key1}} :
{{$variation}}
@endforeach
@endif
@foreach(json_decode($detail['add_on_ids'],true) as $key2 =>$id)
@php($addon=\App\Models\AddOn::withOutGlobalScope(App\Scopes\RestaurantScope::class)->find($id))
@if($key2==0)Addons : @endif
@if($add_on_qtys==null)
@php($add_on_qty=1)
@else
@php($add_on_qty=$add_on_qtys[$key2])
@endif
{{$addon['name']}} :
{{$add_on_qty}} x {{\App\CentralLogics\Helpers::format_currency($addon['price'])}}
@php($add_ons_cost+=$addon['price']*$add_on_qty)
@endforeach
@if($detail['discount_on_product']!=0)
@endif
{{\App\CentralLogics\Helpers::format_currency(\App\CentralLogics\Helpers::variation_price(json_decode($detail['product_details'],true),$detail['variation']))}}
@endif
{{\App\CentralLogics\Helpers::format_currency($detail['price']-$detail['discount_on_product'])}}
{{$detail['quantity']}}
@php($amount=($detail['price']-$detail['discount_on_product'])*$detail['quantity'])
{{\App\CentralLogics\Helpers::format_currency($amount)}}
@endif @endforeach
- Items Price:
- {{\App\CentralLogics\Helpers::format_currency($sub_total)}}
- Tax / VAT:
- {{\App\CentralLogics\Helpers::format_currency($total_tax)}}
- Addon Cost:
-
{{\App\CentralLogics\Helpers::format_currency($add_ons_cost)}}
- Subtotal:
- {{\App\CentralLogics\Helpers::format_currency($sub_total+$total_tax+$add_ons_cost)}}
- Coupon Discount:
- - {{\App\CentralLogics\Helpers::format_currency($order['coupon_discount_amount'])}}
- Delivery Fee:
-
@if($order['order_type']=='take_away')
@php($del_c=0)
@else
@php($del_c=$order['delivery_charge'])
@endif
{{\App\CentralLogics\Helpers::format_currency($del_c)}}
- Total:
- {{\App\CentralLogics\Helpers::format_currency($sub_total+$del_c+$total_tax+$add_ons_cost-$order['coupon_discount_amount'])}}