Recent Activity (Last 2 Weeks)

View All →
Rs. {{ number_format($twoWeekStats['total_sales'], 0) }}
Total Sales
Rs. {{ number_format($twoWeekStats['total_collected'], 0) }}
Cash Collected
{{ number_format($twoWeekStats['total_refilled'], 0) }}
Products Refilled
@if ($recentSales->isNotEmpty() || $recentRefills->isNotEmpty())
@php // Combine and sort all activities $activities = collect(); foreach ($recentSales as $sale) { $activities->push([ 'type' => 'sale', 'date' => $sale->sale_date, 'data' => $sale, ]); } foreach ($recentRefills as $refill) { $activities->push([ 'type' => 'refill', 'date' => $refill->request_date, 'data' => $refill, ]); } foreach ($recentPayments as $payment) { $activities->push([ 'type' => 'payment', 'date' => $payment->payment_date, 'data' => $payment, ]); } $activities = $activities->sortByDesc('date')->take(8); @endphp @foreach ($activities as $activity)
@if ($activity['type'] === 'sale')
Sale: {{ $activity['data']->sale_code }}
{{ $activity['data']->shop->name }}
{{ $activity['data']->quantity_sold }} units × Rs.{{ number_format($activity['data']->unit_price, 2) }}
Rs. {{ number_format($activity['data']->total_amount, 2) }}
@elseif($activity['type'] === 'refill')
Refill: {{ $activity['data']->refill_code }}
{{ $activity['data']->shop->name }}
{{ $activity['data']->product->name }}
+{{ $activity['data']->quantity_approved }} units
@else
Payment: {{ $activity['data']->payment_code }}
{{ $activity['data']->shop->name }}
{{ ucfirst($activity['data']->payment_method) }}
Rs. {{ number_format($activity['data']->amount, 2) }}
@endif
{{ $activity['date']->format('M d') }}
{{ $activity['date']->format('h:i A') }}
@endforeach
@else
📊
No recent activity in the last 2 weeks
@endif