@extends('layouts.admin.app') @section('title', '') @push('css_or_js') @endpush @section('content')

{{ \App\Models\BusinessSetting::where(['key' => 'restaurant_name'])->first()->value }}

{{ \App\Models\BusinessSetting::where(['key' => 'company_address'])->first()->value }}
Phone : {{ \App\Models\BusinessSetting::where(['key' => 'company_phone'])->first()->value }}

{{ translate('Order ID : ') }}{{ $order['id'] }}
{{ date('d/M/Y h:m a', strtotime($order['created_at'])) }}
@if (isset($order->customer))
{{ translate('Customer Name : ') }}{{ $order->customer['f_name'] . ' ' . $order->customer['l_name'] }}
{{ translate('Phone : ') }}{{ $order->customer['phone'] }}
@php($address = \App\Models\CustomerAddress::find($order['delivery_address_id']))
{{ translate('Address : ') }}{{ isset($address) ? $address['address'] : '' }}
@endif

@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
{{ translate('QTY') }} {{ translate('DESC') }} {{ translate('Price') }}
{{ $detail['quantity'] }} {{ Str::limit($detail->product['name'], 200) }}
@if (count(json_decode($detail['variation'], true)) > 0) {{ translate('variation') }} : @foreach (json_decode($detail['variation'], true) as $variation) @if (isset($variation['name']) && isset($variation['values'])) {{ $variation['name'] }} - @foreach ($variation['values'] as $value) {{ $value['label'] }} : {{ \App\CentralLogics\Helpers::set_symbol($value['optionPrice']) }} @endforeach @else @if (isset(json_decode($detail['variation'], true)[0])) @foreach (json_decode($detail['variation'], true)[0] as $key1 => $variation)
{{ $key1 }} : {{ $variation }}
@endforeach @endif @break @endif @endforeach @else
{{ translate('Price') }} : {{ \App\CentralLogics\Helpers::set_symbol($detail->price) }}
@endif {{-- @if (count(json_decode($detail['variation'], true)) > 0) --}} {{-- {{translate('Variation : ')}} --}} {{-- @foreach (json_decode($detail['variation'], true)[0] as $key1 => $variation) --}} {{--
--}} {{-- {{$key1}} : --}} {{-- {{ $key1 == 'price' ? Helpers::set_symbol($variation) : $variation }} --}} {{--
--}} {{-- @endforeach --}} {{-- @endif --}} @foreach (json_decode($detail['add_on_ids'], true) as $key2 => $id) @php($addon = \App\Model\AddOn::find($id)) @if ($key2 == 0) {{ translate('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::set_symbol($addon['price']) }}
@php($add_ons_cost += $addon['price'] * $add_on_qty) @endforeach {{ translate('Discount : ') }}{{ \App\CentralLogics\Helpers::set_symbol($detail['discount_on_product']) }}
@php($amount = ($detail['price'] - $detail['discount_on_product']) * $detail['quantity']) {{ \App\CentralLogics\Helpers::set_symbol($amount) }}
{{ translate('Items Price:') }}
{{ \App\CentralLogics\Helpers::set_symbol($sub_total) }}
{{ translate('Tax / VAT:') }}
{{ \App\CentralLogics\Helpers::set_symbol($total_tax) }}
{{ translate('Addon Cost:') }}
{{ \App\CentralLogics\Helpers::set_symbol($add_ons_cost) }}
{{ translate('Subtotal:') }}
{{ \App\CentralLogics\Helpers::set_symbol($sub_total + $total_tax + $add_ons_cost) }}
{{ translate('Extra Discount') }}:
- {{ \App\CentralLogics\Helpers::set_symbol($order['extra_discount']) }}
{{ translate('Coupon Discount:') }}
- {{ \App\CentralLogics\Helpers::set_symbol($order['coupon_discount_amount']) }}
{{ translate('Delivery Fee:') }}
@if ($order['order_type'] == 'take_away') @php($del_c = 0) @else @php($del_c = $order['delivery_charge']) @endif {{ \App\CentralLogics\Helpers::set_symbol($del_c) }}
{{ translate('Total:') }}
{{ \App\CentralLogics\Helpers::set_symbol($sub_total + $del_c + $total_tax + $add_ons_cost - $order['coupon_discount_amount'] - $order['extra_discount']) }}

{{ translate('"""THANK YOU"""') }}

{{ \App\Models\BusinessSetting::where(['key' => 'footer_text'])->first()->value }}
@endsection @push('script') @endpush