@if($order)

{{ __('modules.order.payment') }}

{{ __('modules.order.orderHash') }}{{ $order->order_number }} {{ currency_format($order->total, restaurant()->currency_id) }}
@endif
@if($order)
!$canAddTip, 'grid-cols-2 sm:grid-cols-5' => $canAddTip ])> @if($canAddTip) @endif
@if ($order)
@if($order->tip_amount > 0)
{{ __('modules.order.total') }} {{ currency_format($order->total - $order->tip_amount, restaurant()->currency_id) }}
{{ __('modules.order.tipAmount') }} + {{ currency_format($order->tip_amount, restaurant()->currency_id) }}
@endif
{{ __('modules.order.totalBill') }} {{ currency_format($order->total, restaurant()->currency_id) }}
{{ __('modules.order.amountPaid') }} {{ currency_format($paidAmount, restaurant()->currency_id) }}
@if($returnAmount > 0)
{{ __('modules.order.returnAmount') }} {{ currency_format($returnAmount, restaurant()->currency_id) }}
@else
{{ __('modules.order.dueAmount') }} {{ currency_format($balanceAmount, restaurant()->currency_id) }}
@endif
@endif
@foreach($predefinedAmounts as $amount) @endforeach
@foreach(range(1, 9) as $number) @endforeach

{{ __('modules.order.splitBill') }}

@for($i = 1; $i <= $numberOfSplits; $i++)
Split {{ $i }}
@if($numberOfSplits > 2) @endif
@endfor
@for($i = 1; $i <= $numberOfSplits; $i++)
Split {{ $i }}
@endfor
@foreach($customSplits as $splitNumber)
Split {{ $splitNumber }}
@if(count($customSplits) > 2) @endif
@endforeach
@foreach($customSplits as $splitNumber)
Split {{ $splitNumber }}
@endforeach
@foreach($splits as $splitId => $split)
@if(count($splits) > 1 && $splitId !== 1) @endif
@endforeach

{{ __('modules.order.availableItems') }}

{{ __('modules.order.clickToAdd') }}
@foreach($availableItems as $index => $item) @if($item['remaining'] > 0)
{{ $item['name'] }}
{{ $item['remaining'] }} x (  {{ __('modules.order.base') }}: {{ currency_format($item['base_price'], restaurant()->currency_id) }} @if($item['discount'] > 0) - {{ __('modules.order.discount') }}: {{ currency_format($item['discount'], restaurant()->currency_id) }} @endif @if($item['tax_amount'] > 0) + {{ __('modules.order.tax') }}: {{ currency_format($item['tax_amount'], restaurant()->currency_id) }} @endif @if($item['extra_charges'] > 0) + {{ __('modules.order.extraCharges') }}: {{ currency_format($item['extra_charges'], restaurant()->currency_id) }} @endif @if($item['tip'] > 0) + {{ __('modules.order.tipAmount') }}: {{ currency_format($item['tip'], restaurant()->currency_id) }} @endif )
{{ currency_format($item['price'] * $item['remaining'], restaurant()->currency_id) }}
{{ $item['remaining'] }}
@endif @endforeach

{{ __('modules.order.itemsInSplit', ['split' => $activeSplitId]) }}

{{ __('modules.order.total') }}: {{ currency_format(($splits[$activeSplitId]['total'] ?? 0), restaurant()->currency_id) }}
@if(empty($splits[$activeSplitId]['items']))
{{ __('modules.order.noItemsInSplit') }}
@else @foreach($splits[$activeSplitId]['items'] as $index => $item)
{{ $item['name'] }}
{{ currency_format($item['price'] * $item['quantity'], restaurant()->currency_id) }}
{{ $item['quantity'] }} x (  {{ __('modules.order.base') }}: {{ currency_format($item['base_price'], restaurant()->currency_id) }} @if($item['discount'] > 0) - {{ __('modules.order.discount') }}: {{ currency_format($item['discount'], restaurant()->currency_id) }} @endif @if($item['tax_amount'] > 0) + {{ __('modules.order.tax') }}: {{ currency_format($item['tax_amount'], restaurant()->currency_id) }} @endif @if($item['extra_charges'] > 0) + {{ __('modules.order.extraCharges') }}: {{ currency_format($item['extra_charges'], restaurant()->currency_id) }} @endif @if($item['tip'] > 0) + {{ __('modules.order.tipAmount') }}: {{ currency_format($item['tip'], restaurant()->currency_id) }} @endif )
@endforeach @endif
@if ($order)
{{ __('modules.order.totalBill') }} {{ currency_format($order->total, restaurant()->currency_id) }}
{{ __('modules.order.splitAmount') }} {{ currency_format(collect($splits)->sum('total'), restaurant()->currency_id) }}
@if(($balanceAmount > 0 || $returnAmount > 0) && $splitType === 'custom')
$balanceAmount > 0, 'text-green-600' => $returnAmount > 0 ])> {{ $balanceAmount > 0 ? __('modules.order.dueAmount') : __('modules.order.returnAmount') }} {{ currency_format($balanceAmount > 0 ? $balanceAmount : $returnAmount, restaurant()->currency_id) }}
@endif
@endif
@endif
@if($order)
{{ __('app.cancel') }} {{ __('modules.order.completePayment') }}
@endif
@lang('modules.order.addTip')
@if ($order)
@foreach([5, 10, 15, 20] as $value) @endforeach
{{ currency() }}
@lang('modules.order.currentTotal') {{ currency_format($order->total - $order->tip_amount, restaurant()->currency_id) }}
@lang('modules.order.tipAmount') + {{ currency_format($tipAmount ?? 0, restaurant()->currency_id) }}
@lang('modules.order.newTotal') {{ currency_format(($order->total - $order->tip_amount + ($tipAmount ?: 0)), restaurant()->currency_id) }}
@endif
@lang('app.cancel') @lang('app.save')