{{ __('Tip Management') }}

@php $query = \App\Models\Tip::query(); if (request('date_from')) { $query->whereDate('date', '>=', request('date_from')); } if (request('date_to')) { $query->whereDate('date', '<=', request('date_to')); } if (request('staff_id')) { $query->where('staff_id', request('staff_id')); } $totalTips = $query->sum('amount'); $totalCash = (clone $query)->where('type', 'cash')->sum('amount'); $totalCard = (clone $query)->where('type', 'card')->sum('amount'); @endphp
Total Tips
{{ currency($totalTips) }}
Cash Tips
{{ currency($totalCash) }}
Card Tips
{{ currency($totalCard) }}

Recent Tips

@php $tips = $query->with(['staff', 'order', 'branch'])->latest('date')->latest('created_at')->paginate(20); @endphp @if($tips->count() > 0)
@foreach($tips as $tip) @endforeach
Date Staff Order Type Amount Branch
{{ $tip->date->format('M d, Y') }} {{ $tip->staff->name ?? 'N/A' }} @if($tip->order) #{{ $tip->order->order_number }} @else Manual Entry @endif {{ ucfirst($tip->type) }} {{ currency($tip->amount) }} {{ $tip->branch->name ?? 'N/A' }}
{{ $tips->links() }}
@else

No tips found.

@endif