@if($account && $settings) @if($enablePoints && $currentTier)
{{ strtoupper(substr($currentTier->name, 0, 1)) }}
{{ __('loyalty::app.currentTier') }}
{{ $currentTier->name }}
@if($currentTier->description)
{{ $currentTier->description }}
@endif
@if($nextTier)
{{ __('loyalty::app.nextTier') }}: {{ $nextTier->name }}
@if($pointsToNextTier !== null)
{{ __('loyalty::app.pointsToNextTier') }}: {{ number_format($pointsToNextTier) }} {{ __('loyalty::app.points') }}
@endif
@else
{{ __('loyalty::app.highestTier') }}
@endif
@if($nextTier && $pointsToNextTier !== null)
{{ __('loyalty::app.tierProgress') }} {{ number_format($tierProgress, 1) }}%
@endif
@endif
@if($enablePoints)
{{ __('loyalty::app.pointsBalance') }}
{{ number_format($pointsBalance) }}
{{ __('loyalty::app.pointsValue') }}
@if($restaurant && $restaurant->currency_id) @if($pointsValue > 0) {{ currency_format($pointsValue, $restaurant->currency_id) }} @else {{ currency_format(0, $restaurant->currency_id) }} @endif @else @if($pointsValue > 0) {{ number_format($pointsValue, 2) }} @else {{ number_format(0, 2) }} @endif @endif
@endif @if($enableStamps)
{{ __('loyalty::app.totalStamps') }}
@php $totalStamps = 0; foreach($customerStamps as $stampData) { $totalStamps += $stampData['available_stamps'] ?? 0; } @endphp {{ number_format($totalStamps) }}
@endif
{{ __('loyalty::app.accountCreated') }}
{{ $account->created_at->format('M d, Y') }}
@if($enableStamps && count($customerStamps) > 0)

{{ __('loyalty::app.myStampCards') }}

{{ __('loyalty::app.stampCardsDescription') }}

@foreach($customerStamps as $stampData) @php $rule = $stampData['rule']; $stampsEarned = $stampData['stamps_earned'] ?? 0; $stampsRedeemed = $stampData['stamps_redeemed'] ?? 0; $availableStamps = $stampData['available_stamps']; $stampsRequired = $stampData['stamps_required']; $progress = $stampsRequired > 0 ? min(100, ($availableStamps / $stampsRequired) * 100) : 0; $canRedeem = $stampData['can_redeem']; @endphp

{{ $rule->menuItem->item_name ?? __('loyalty::app.unknownItem') }}

{{ __('loyalty::app.stampsRequired') }}: {{ $stampsRequired }}

{{ __('loyalty::app.stampsEarned') }}: {{ $stampsEarned }} {{ number_format($progress) }}%
{{ __('loyalty::app.availableStamps') }}: {{ $availableStamps }}/{{ $stampsRequired }} @if($stampsRedeemed > 0) ({{ __('loyalty::app.redeemed') }}: {{ $stampsRedeemed }}) @endif
@for($i = 1; $i <= $stampsRequired; $i++)
@if($i <= $availableStamps) @else @endif
@endfor
@if($canRedeem)
{{ __('loyalty::app.readyToRedeem') }}
@else
{{ __('loyalty::app.stampsNeeded') }}: {{ $stampsRequired - $availableStamps }}
@endif
@endforeach
@endif @if($enablePoints)

{{ __('loyalty::app.loyaltyLedger') }}

@if($ledgerEntries->count() > 0)
@foreach($ledgerEntries as $entry) @endforeach
{{ __('loyalty::app.transactionDate') }} {{ __('loyalty::app.transactionType') }} {{ __('loyalty::app.pointsChange') }} {{ __('loyalty::app.orderNumber') }} {{ __('loyalty::app.reason') }}
{{ $entry->created_at->format('M d, Y H:i') }} @if($entry->type == 'EARN') {{ __('loyalty::app.earn') }} @elseif($entry->type == 'REDEEM') {{ __('loyalty::app.redeem') }} @elseif($entry->type == 'ADJUST') {{ __('loyalty::app.adjust') }} @elseif($entry->type == 'EXPIRE') {{ __('loyalty::app.expire') }} @endif {{ $entry->points > 0 ? '+' : '' }}{{ number_format($entry->points) }} @if($entry->order) #{{ $entry->order->order_number ?? $entry->order->id }} @else -- @endif {{ $entry->reason ?? '--' }}
{{ $ledgerEntries->links() }}
@else

{{ __('loyalty::app.noLedgerEntries') }}

@endif
@endif @else
@if(!customer())

{{ __('Please log in to view your loyalty account.') }}

{{ __('Login') }} @elseif(!$account || !$settings)

{{ __('loyalty::app.loyaltyProgramNotEnabled') }}

{{ __('The loyalty program is not available for this restaurant.') }}

@else

{{ __('loyalty::app.loyaltyProgramNotEnabled') }}

@endif
@endif