@php $appLocale = app()->getLocale(); $receiptLanguages = $receiptLanguages ?? ($receiptSettings->receipt_languages ?? ['en']); if (!function_exists('flipText')) { /** * DomPDF does not apply browser-style bidi; shape RTL text for correct PDF output. */ function flipText($text, $language = null) { if ($language && in_array($language, ['ar', 'fa', 'ur', 'he', 'ps', 'ku', 'sd', 'ckb'])) { $arabic = new ArPHP\I18N\Arabic(); return $arabic->utf8Glyphs($text); } return $text; } } @endphp {{ $orderBranch->name ?? restaurant()->name }} - {{ $order->show_formatted_order_number }}
@if ($receiptSettings->show_restaurant_logo) @endif
{{ $orderBranch->name ?? restaurant()->name }}
{{ $orderBranch->address ?? '' }}
{{ flipText(__('modules.customer.phone'), $appLocale) }} @if (count($receiptLanguages) > 1)
{{ flipText(__('modules.customer.phone', [], $receiptLanguages[1]), $receiptLanguages[1]) }} @endif: {{ $orderBranch->phone ?: restaurant()->phone_number }}
@if ($receiptSettings->show_tax) @if (empty($orderBranch->cr_number) && empty($orderBranch->vat_number)) @foreach ($taxDetails as $taxDetail)
{{ $taxDetail->tax_name }}: {{ $taxDetail->tax_id }}
@endforeach @endif @endif @if ($receiptSettings->show_cr_number && !empty($orderBranch->cr_number))
{{ flipText(__('modules.settings.branchCrNumber'), $appLocale) }} @if (count($receiptLanguages) > 1)
{{ flipText(__('modules.settings.branchCrNumber', [], $receiptLanguages[1]), $receiptLanguages[1]) }} @endif: {{ $orderBranch->cr_number }}
@endif @if ($receiptSettings->show_vat_number && !empty($orderBranch->vat_number))
{{ flipText(__('modules.settings.branchVatNumber'), $appLocale) }} @if (count($receiptLanguages) > 1)
{{ flipText(__('modules.settings.branchVatNumber', [], $receiptLanguages[1]), $receiptLanguages[1]) }} @endif: {{ $orderBranch->vat_number }}
@endif

{{ flipText(__('modules.settings.orderDetails'), $appLocale) }}

@if(!isOrderPrefixEnabled()) {{ flipText(__('modules.order.orderNumber'), $appLocale) }}: #{{ $order->order_number }} @else {{ $order->formatted_order_number }} @endif
@php $tokenNumber = $order->kot->whereNotNull('token_number')->first()?->token_number; @endphp @if ($tokenNumber)
{{ flipText(__('modules.order.tokenNumber'), $appLocale) }}: {{ $tokenNumber }}
@endif
{{ flipText(__('app.dateTime'), $appLocale) }}: {{ $order->date_time->timezone(timezone())->translatedFormat(dateFormat() . ' ' . timeFormat()) }}
@if ($receiptSettings->show_table_number && $order->table && $order->table->table_code)
{{ flipText(__('modules.settings.tableNumber'), $appLocale) }}: {{ $order->table->table_code }}
@endif @if ($receiptSettings->show_total_guest && $order->number_of_pax)
{{ flipText(__('modules.order.noOfPax'), $appLocale) }}: {{ $order->number_of_pax }}
@endif @if ($receiptSettings->show_waiter && $order->waiter && $order->waiter->name)
{{ flipText(__('modules.order.waiter'), $appLocale) }}: {{ $order->waiter->name }}
@endif @if ($receiptSettings->show_customer_name && $order->customer && $order->customer->name)
{{ flipText(__('modules.customer.customer'), $appLocale) }}: {{ $order->customer->name }}
@endif @if ($receiptSettings->show_customer_address && $order->customer && $order->customer->delivery_address)
{{ flipText(__('modules.customer.customerAddress'), $appLocale) }}: {{ $order->customer->delivery_address }}
@endif @if ($receiptSettings->show_customer_phone && $order->customer && $order->customer->phone)
{{ flipText(__('modules.customer.phone'), $appLocale) }}: {{ $order->customer->phone }}
@endif
@foreach ($order->items as $item) @endforeach
{{ flipText(__('modules.order.qty'), $appLocale) }} {{ flipText(__('modules.menu.itemName'), $appLocale) }} {{ flipText(__('modules.order.price'), $appLocale) }} ({{ restaurant()->currency->currency_code }}) {{ flipText(__('modules.order.amount'), $appLocale) }} ({{ restaurant()->currency->currency_code }})
{{ $item->quantity }} {{ flipText($item->menuItem->item_name, $appLocale) }} @if (count($receiptLanguages) > 1 && $item->menuItem->translations->count() > 1)
{{ flipText($item->menuItem->getTranslatedValue('item_name', $receiptLanguages[1]), $receiptLanguages[1]) }} @endif @if (isset($item->menuItemVariation))
({{ $item->menuItemVariation->variation }}) @endif @foreach ($item->modifierOptions as $modifier)
• {{ $modifier->name }} @if($modifier->price > 0) (+{{ currency_format($modifier->price, restaurant()->currency_id, false, true) }}) @endif
@endforeach @if($item->note)
{{ flipText(__('modules.order.note'), $appLocale) }}: {{ $item->note }}
@endif
{{ currency_format($item->price, restaurant()->currency_id, false, false) }} {{ currency_format($item->amount, restaurant()->currency_id, false, false) }}
{{ flipText(__('modules.order.subTotal'), $appLocale) }}: {{ currency_format($order->sub_total, restaurant()->currency_id, false, true) }}
@if (!is_null($order->discount_amount))
{{ flipText(__('modules.order.discount'), $appLocale) }} @if ($order->discount_type == 'percent') ({{ rtrim(rtrim($order->discount_value, '0'), '.') }}%) @endif: -{{ currency_format($order->discount_amount, restaurant()->currency_id, false, true) }}
@endif @foreach ($order->charges as $item)
{{ $item->charge->charge_name }} @if ($item->charge->charge_type == 'percent') ({{ $item->charge->charge_value }}%) @endif: {{ currency_format(($item->charge->getAmount($order->sub_total - ($order->discount_amount ?? 0))), restaurant()->currency_id, true, true) }}
@endforeach @if ($order->tip_amount > 0)
{{ flipText(__('modules.order.tip'), $appLocale) }}: {{ currency_format($order->tip_amount, restaurant()->currency_id, false, true) }}
@endif @if ($order->order_type === 'delivery' && !is_null($order->delivery_fee))
{{ flipText(__('modules.delivery.deliveryFee'), $appLocale) }}: @if($order->delivery_fee > 0) {{ currency_format($order->delivery_fee, restaurant()->currency_id, false, true) }} @else {{ flipText(__('modules.delivery.freeDelivery'), $appLocale) }} @endif
@endif @if ($taxMode == 'order') @foreach ($order->taxes as $item)
{{ $item->tax->tax_name }} ({{ $item->tax->tax_percent }}%): {{ currency_format(($item->tax->tax_percent / 100) * $taxBase, restaurant()->currency_id, false, true) }}
@endforeach @else @if($order->total_tax_amount > 0) @php $taxTotals = []; $totalTax = 0; foreach ($order->items as $item) { $qty = $item->quantity ?? 1; $taxBreakdown = is_array($item->tax_breakup) ? $item->tax_breakup : (json_decode($item->tax_breakup, true) ?? []); foreach ($taxBreakdown as $taxName => $taxInfo) { if (!isset($taxTotals[$taxName])) { $taxTotals[$taxName] = [ 'percent' => $taxInfo['percent'] ?? 0, 'amount' => ($taxInfo['amount'] ?? 0) * $qty ]; } else { $taxTotals[$taxName]['amount'] += ($taxInfo['amount'] ?? 0) * $qty; } } $totalTax += $item->tax_amount ?? 0; } @endphp @foreach ($taxTotals as $taxName => $taxInfo)
{{ $taxName }} ({{ $taxInfo['percent'] }}%) {{ currency_format($taxInfo['amount'], restaurant()->currency_id, false, true) }}
@endforeach
{{ flipText(__('modules.order.totalTax'), $appLocale) }}: {{ currency_format($totalTax, restaurant()->currency_id, false, true) }}
@endif @endif @if ($payment)
{{ flipText(__('modules.order.balanceReturn'), $appLocale) }}: {{ currency_format($payment->balance, restaurant()->currency_id, false, true) }}
@endif
{{ flipText(__('modules.order.total'), $appLocale) }}: {{ currency_format($order->total, restaurant()->currency_id, false, true) }}
@if ($receiptSettings->show_payment_status)
{{ flipText(__('modules.order.paymentStatus'), $appLocale) }} @if($order->status === 'paid') {{ flipText(__('modules.order.paid'), $appLocale) }} @else {{ flipText(__('modules.order.unpaid'), $appLocale) }} @endif
@endif
@if ($receiptSettings->show_payment_details && $order->payments->count())

{{ flipText(__('modules.order.paymentDetails'), $appLocale) }}

@foreach ($order->payments as $payment) @endforeach
{{ flipText(__('modules.order.amount'), $appLocale) }} {{ flipText(__('modules.order.paymentMethod'), $appLocale) }} {{ flipText(__('app.dateTime'), $appLocale) }}
{{ currency_format($payment->amount, restaurant()->currency_id, false, true) }} {{ ucwords(str_replace('_', ' ', $payment->payment_method)) }} @if($payment->payment_method != 'due') {{ $payment->created_at->timezone(timezone())->translatedFormat(dateFormat() . ' ' . timeFormat()) }} @endif
@endif