@extends('layouts.app') @section('title', 'Daily MPESA Report') @section('content')

Daily MPESA Report

@if($date != date('Y-m-d')) Today's Report @endif
Total Transactions
{{ $summary['total_count'] }}
Total Amount
Ksh {{ number_format($summary['total_amount'], 2) }}
Matched Transactions
{{ $summary['matched_count'] }}
Ksh {{ number_format($summary['matched_amount'], 2) }}
Unmatched Transactions
{{ $summary['unmatched_count'] }}
Ksh {{ number_format($summary['unmatched_amount'], 2) }}
Amount Statistics
Average Amount
Ksh {{ number_format($summary['avg_amount'], 2) }}
Maximum Amount
Ksh {{ number_format($summary['max_amount'], 2) }}
Minimum Amount
Ksh {{ number_format($summary['min_amount'], 2) }}
Match Rate
{{ $summary['total_count'] > 0 ? number_format(($summary['matched_count'] / $summary['total_count']) * 100, 1) : 0 }}%
Hourly Distribution
Transactions for {{ \Carbon\Carbon::parse($date)->format('F d, Y') }} {{ $transactions->count() }} transactions
@forelse($transactions as $transaction) @empty @endforelse
Time Transaction ID Phone Customer Amount Status Sale Actions
{{ $transaction->transaction_date->format('h:i A') }} {{ $transaction->transaction_id }} @if($transaction->mpesa_receipt_number)
Receipt: {{ $transaction->mpesa_receipt_number }} @endif
{{ $transaction->formatted_phone }} @if($transaction->full_name) {{ $transaction->full_name }} @else - @endif Ksh {{ number_format($transaction->amount, 2) }} @if($transaction->status == 'completed') Completed @elseif($transaction->status == 'pending') Pending @elseif($transaction->status == 'failed') Failed @endif @if($transaction->sale_id) Sale #{{ $transaction->sale_id }} @else Unmatched @endif
No transactions for this date

No MPESA transactions were recorded on {{ \Carbon\Carbon::parse($date)->format('F d, Y') }}

@if($topPhones->count() > 0)
Top Phone Numbers
@foreach($topPhones as $phone => $data) @endforeach
Phone Transactions Amount Matched Actions
{{ $phone }} @php $customer = \App\Models\Customer::where('phone', $phone)->first(); @endphp @if($customer)
{{ $customer->name }} @endif
{{ $data['count'] }} Ksh {{ number_format($data['amount'], 2) }} {{ $data['matched'] }}/{{ $data['count'] }} @if($customer) @endif
Amount Distribution
@endif
@push('scripts') @endpush @endsection