@if (user_can('Add Discount on POS'))
@lang('modules.order.addDiscount')
@endif
@lang('modules.order.totalItem')
{{ count($orderItemList) }}
@lang('modules.order.subTotal')
@php
$stampDiscountAmount = 0;
$hasFreeStampItems = false;
if (isset($orderID) && $orderID && isset($orderDetail) && $orderDetail) {
$stampDiscountAmount = (float)($orderDetail->stamp_discount_amount ?? 0);
$hasFreeStampItems = $orderDetail->items()->where('is_free_item_from_stamp', true)->exists();
} else {
foreach (($orderItemList ?? []) as $itemKey => $itemValue) {
$note = $itemNotes[$itemKey] ?? '';
$rawFreeFlag = is_array($itemValue)
? ($itemValue['is_free_item_from_stamp'] ?? false)
: ($itemValue->is_free_item_from_stamp ?? false);
$isFlaggedFree = in_array($rawFreeFlag, [true, 1, '1', 'true'], true);
if (
str_starts_with((string)$itemKey, 'free_stamp_')
|| $isFlaggedFree
|| str_contains((string)$note, __('loyalty::app.freeItemFromStamp'))
|| str_starts_with(strtolower(trim((string)$note)), 'free')
) {
$hasFreeStampItems = true;
break;
}
}
}
@endphp
@lang('app.stampDiscount')
@if($stampDiscountAmount > 0)
(-{{ currency_format($stampDiscountAmount, restaurant()->currency_id) }})
@elseif($hasFreeStampItems)
(@lang('app.freeItem'))
@endif
{{ currency_format($subTotal, restaurant()->currency_id) }}
@if(function_exists('module_enabled') && module_enabled('Loyalty'))
@include('loyalty::components.loyalty-discount-display', [
'loyaltyPointsRedeemed' => $loyaltyPointsRedeemed ?? 0,
'loyaltyDiscountAmount' => $loyaltyDiscountAmount ?? 0,
'currencyId' => restaurant()->currency_id,
'showEditIcon' => true,
'customer' => $customer ?? null
])
@lang('loyalty::app.loyaltyDiscount') (0 @lang('loyalty::app.points'))
@if(user_can('Update Order'))
@endif
-0
@endif
@lang('modules.order.discount')
@if ($discountType == 'percent')
({{ $discountValue }}%)
@endif
@if(user_can('Add Discount on POS') && user_can('Update Order'))
@endif
-{{ currency_format($discountAmount, restaurant()->currency_id) }}
@php
$applicableExtraCharges = collect($extraCharges ?? [])->filter(function ($charge) use ($orderType) {
$allowedTypes = $charge->order_types ?? [];
return empty($allowedTypes) || in_array($orderType, $allowedTypes);
});
@endphp
@if ($tipAmount > 0)
@lang('modules.order.tip')
{{ currency_format($tipAmount, restaurant()->currency_id) }}
@endif
@if ($orderType === 'delivery' && !is_null($deliveryFee))
@lang('modules.delivery.deliveryFee')
@lang('modules.delivery.freeDelivery')
@if ($deliveryFee > 0)
{{ currency_format($deliveryFee, restaurant()->currency_id) }}
@else
@lang('modules.delivery.freeDelivery')
@endif
@endif
@if ($taxMode == 'order')
@foreach ($taxes as $item)
{{ $item->tax_name }} ({{ $item->tax_percent }}%)
{{ currency_format(($item->tax_percent / 100) * $taxBase, restaurant()->currency_id) }}
@endforeach
@else
@php
$taxTotals = [];
foreach ($orderItemTaxDetails as $item) {
$qty = $item['qty'] ?? 1;
if (!empty($item['tax_breakup'])) {
foreach ($item['tax_breakup'] as $taxName => $taxInfo) {
if (!isset($taxTotals[$taxName])) {
$taxTotals[$taxName] = [
'percent' => $taxInfo['percent'],
'amount' => 0
];
}
$taxTotals[$taxName]['amount'] += $taxInfo['amount'] * $qty;
}
}
}
@endphp
@foreach ($taxTotals as $taxName => $taxInfo)
{{ $taxName }} ({{ $taxInfo['percent'] }}%)
{{ currency_format($taxInfo['amount'], restaurant()->currency_id) }}
@endforeach
@lang('modules.order.totalTax')
{{ currency_format($totalTaxAmount, restaurant()->currency_id) }}
@endif
@lang('modules.order.total')
{{ currency_format($total, restaurant()->currency_id) }}
@if ($orderDetail->status == 'kot' && user_can('Update Order'))
@lang('modules.order.newKot')
@if (user()->hasRole('Admin_'. user()->restaurant_id))
@endif
@endif
@if ($orderDetail->status == 'billed' && user_can('Update Order'))
@endif
@if ($orderType == 'delivery' && $orderDetail->delivery_address)
@if ($orderDetail->customer)
{{ $orderDetail->customer->name }}
@endif
@lang('modules.customer.address')
@if ($orderDetail->customer_lat && $orderDetail->customer_lng && branch()->lat && branch()->lng)
@lang('modules.order.viewOnMap')
@endif
{!! nl2br(e($orderDetail->delivery_address)) !!}
@endif