@extends('layouts.master') @section('title') Revenue @endsection @section('css') {{-- --}} @endsection @section('content')

Revenue

@php $selectedMonths = request()->input('months', 4); // Default to 4 if not provided $hour = \Carbon\Carbon::now()->format('H'); if ($hour >= 5 && $hour < 12) { $greeting = 'Good Morning'; } elseif ($hour >= 12 && $hour < 17) { $greeting = 'Good Afternoon'; } else { $greeting = 'Good Evening'; } @endphp

{{ $greeting }}, {{ auth()->user()->firstname }}!

Here's what's happening with your hotspot.

@if($months < 2)
Daily Trend ({{ $months }} month)

Not enough data to display the trend charts. Please select at least 2 months.

@else
{{ $months }} Months Trend
Daily Trend ({{ $months }} months)
@endif
Average Daily Revenue
{{ $averageDailyRevenueFormatted }}
Average Hourly Revenue
{{ $averageHourlyRevenueFormatted }}
Top and least ({{ $months }} {{ $months == 1 ? 'Month' : 'Months' }})
@if(isset($mostRevenueDay))

Most: {{ \Carbon\Carbon::create()->startOfWeek()->addDays($mostRevenueDay->day_of_week - 1)->format('l') }} (Ksh {{ number_format($mostRevenueDay->total_amount, 2) }})

@else

Most: Data not available

@endif @if(isset($leastRevenueDay))

Least: {{ \Carbon\Carbon::create()->startOfWeek()->addDays($leastRevenueDay->day_of_week - 1)->format('l') }} (Ksh {{ number_format($leastRevenueDay->total_amount, 2) }})

@else

Least: Data not available

@endif
@foreach(['Voucher', 'Payment Method', 'Amount', 'Reference', 'Timestamp'] as $cell) @endforeach
{{ $cell }}
@endsection @section('script') @endsection