@extends('website.layouts.master') @section('content')

@lang('header.paymentdetails')

@if (isset($order))
{{ $order->created_at ? $order->created_at->translatedFormat('j F .g:i A') : '' }}
@php $lastTrackingStatus = $order->tracking->last()?->order_status; @endphp @if ($lastTrackingStatus == 'pending')

@lang('order.pending')

@elseif ($lastTrackingStatus == 'in_progress')

@lang('order.in_progress')

@elseif ($lastTrackingStatus == 'on_way')

@lang('order.on_way')

@elseif ($lastTrackingStatus == 'delivered')

@lang('order.delivered')

@elseif ($lastTrackingStatus == 'readyForPickup')

@lang('order.readyForPickup')

@elseif ($lastTrackingStatus == 'cancelled')

@lang('order.cancelled')

@endif

    @foreach ($order->orderDetails as $detail)
    {{ $detail->quantity }} x {{ app()->getLocale() === 'ar' ? $detail->dish?->name_ar : $detail->dish?->name_en }} @if ($detail->dishSize || $order->orderAddons->where('order_details_id', $detail->id)->isNotEmpty())

    @if ($detail->dishSize) @lang('header.size'): {{ app()->getLocale() === 'ar' ? $detail->dishSize->size_name_ar : $detail->dishSize->size_name_en }}
    @endif @if ($order->orderAddons->where('order_details_id', $detail->id)->isNotEmpty()) @lang('header.addons'): @php $addons = $order->orderAddons->where( 'order_details_id', $detail->id, ); @endphp @foreach ($addons as $addon) {{ app()->getLocale() === 'ar' ? $addon->Addon?->addons?->name_ar : $addon->Addon?->addons?->name_en }}, @endforeach @endif @if ($detail->note) @lang('header.note') : {{ $detail->note }} @endif

    @endif
    @endforeach
  • @lang('header.totalorder')

    {{ $order->total_price_after_tax }} {{ $order->Branch->country->currency_symbol }}

  • @lang('header.feesdelivery')

    @if ($order->delivery_fees) {{ $order->delivery_fees }} {{ $order->Branch->country->currency_symbol }} @else @lang('header.nodliveryfees') @endif

  • @lang('header.fees')

    @if ($order->delivery_fees) {{ $order->service_fees }} {{ $order->Branch->country->currency_symbol }} @else @lang('header.nofees') @endif

@if ($order->tax_application == 0)

@lang('header.includefees') {{ number_format(($order->tax_value / $order->total_price_befor_tax) * 100, 2) . '%' }} @lang('header.anotherway') {{ $order->tax_value }} {{ $order->Branch->country->currency_symbol }}

@else

@lang('header.notincludefees')

@endif
  • @lang('header.paymentmethod')

    @switch($order->orderTransactions->first()?->payment_method) @case('cash') @lang('header.cash') @break @case('credit_card') @lang('header.credit_card') @break @case('online') @lang('header.online') @break @default @lang('header.cash') @endswitch

  • @lang('header.deliveryTime')

    {{ getSetting('delivery_time') . __('header.min') }}

  • @if ($order->note)

    @lang('header.note')

    {{ $order->note }}

    @else @lang('header.nonote') @endif
@elseif(isset($reservation))
{{ $reservation->created_at ? $reservation->created_at->translatedFormat('j F .g:i A') : '' }}
@if ($reservation->status == 'confirm')
@lang('order.reservationConfirmed')
@elseif ($reservation->status == 'cancel')
@lang('order.cancelled')
@endif

@if ($reservation->reservation_type == 'without') @if ($reservation->transaction->payment_status == 'unpaid')

@lang('order.withoutDeposit')

@elseif($reservation->transaction->payment_status == 'part')

{{ $reservation->transaction->paid }} {{ $reservation->branch->country->currency_symbol }}

@if ($reservation->transaction->payment_method == 'online')

@lang('order.paidOnline')

@elseif($reservation->transaction->payment_method == 'cash')

@lang('order.paidCash')

@elseif($reservation->transaction->payment_method == 'credit_card')

@lang('order.paidCredit')

@endif
@endif @elseif ($reservation->reservation_type == 'with')
@lang('order.table') ({{ $reservation->tables->table_number }}) @if ($reservation->reservation_type == 'with') (@lang('order.withOrder')) @endif
@lang('order.arrival'): {{ $reservation->time_from ? $reservation->time_from->format('h:i') : 'N/A' }} @lang($reservation->time_from->format('A') === 'AM' ? 'header.am' : 'header.pm')
{{ $reservation->date->translatedFormat('j F , Y') }}
{{ $reservation->adult + $reservation->men + $reservation->women }}@lang('order.person') @if ($reservation->kids != 0) ,{{ $reservation->kids }}@lang('order.kid') @endif
@if ($reservation->tables->type == 1) @lang('order.inside') @else @lang('order.outside') @endif
@lang('order.leaving'): {{ $reservation->time_to ? $reservation->time_to->format('h:i') : 'N/A' }} @lang($reservation->time_to->format('A') === 'AM' ? 'header.am' : 'header.pm')
@lang('order.items')
@foreach ($reservation->order->orderDetails as $detail) @php $addons = $reservation->order->orderAddons->filter( fn($addon) => $addon->order_details_id == $detail->id && $addon->Addon?->addons?->name_ar, ); @endphp
{{ $detail->quantity }} x {{ app()->getLocale() === 'ar' ? $detail->dish?->name_ar : $detail->dish?->name_en }} @if ($detail->dishSize) ({{ app()->getLocale() === 'ar' ? $detail->dishSize->size_name_ar : $detail->dishSize->size_name_en }}) @endif

@if ($reservation->order->tax_applications == 0) {{ $detail->price_befor_tax + $addons->sum('price_before_tax') }} @else {{ $detail->price_after_tax + $addons->sum('price_after_tax') }} @endif {{ $reservation->order->Branch->country->currency_symbol }}

@if ($addons->isNotEmpty())
{{ $addons->map(fn($addon) => app()->getLocale() === 'ar' ? $addon->Addon->addons->name_ar : $addon->Addon->addons->name_en)->implode(', ') }}
@endif @endforeach
  • @lang('header.totalorder')

    @php $subTotalPrice = $reservation->order->total_price_befor_tax; if ($reservation->order->tax_application == 1) { $subTotalPrice += $reservation->order->tax_value; } @endphp {{ $subTotalPrice }} {{ $reservation->order->Branch->country->currency_symbol }}

  • @if ($reservation->order->coupon_value != 0)

    @lang('header.coupon')

    -{{ $reservation->order->coupon_value }} {{ $reservation->order->Branch->country->currency_symbol }}

    @endif
  • @if ($reservation->order->transaction->first()->payment_status === 'part')
  • @lang('order.withDeposit')

    -{{ $reservation->order->transaction->first()->paid }} {{ $reservation->order->Branch->country->currency_symbol }}

  • @lang('order.remainingPrice')

    @if ($reservation->order->tax_application == 0) {{ $reservation->order->total_price_befor_tax - $reservation->order->transaction->first()->paid }} @else {{ $reservation->order->total_price_befor_tax + $reservation->order->tax_value - $reservation->order->transaction->first()->paid }} @endif {{ $reservation->order->Branch->country->currency_symbol }}

  • @endif
  • @lang('header.fees')

    @if ($reservation->order->service_fees) {{ $reservation->order->service_fees }} {{ $reservation->order->Branch->country->currency_symbol }} @else @lang('header.nofees') @endif

@if ($reservation->order->tax_application == 0)

@lang('header.includefees') {{ number_format(($reservation->order->tax_value / $reservation->order->total_price_befor_tax) * 100, 2) . '%' }} @lang('header.anotherway') {{ $reservation->order->tax_value }} {{ $reservation->order->Branch->country->currency_symbol }}

@else

@lang('header.notincludefees')

@endif
  • @lang('header.paymentmethod')

    @switch($reservation->order->orderTransactions->first()?->payment_method) @case('cash') @lang('header.cash') @break @case('credit_card') @lang('header.credit_card') @break @case('online') @lang('header.online') @break @default @lang('header.cash') @endswitch

@lang('header.total')
{{ $reservation->order->total_price_after_tax }} {{ $reservation->order->Branch->country->currency_symbol }}
@endif
@endif
@endsection