@extends('layouts.app') @section('title', 'Daily Cash Collections') @section('styles')@endsection @section('content')

Daily Cash Collections

{{ $from->format('d M Y') }}{{ $from->format('Y-m-d') !== $to->format('Y-m-d') ? ' | ' . $to->format('d M Y') : '' }}

to
@include('reports._export-buttons', ['exportType' => 'daily-cash'])
{{-- Analytics Summary Cards --}}

Invoiced

KES {{ number_format($summary['invoiced']) }}

Collections

KES {{ number_format($summary['collections']) }}

Cash

KES {{ number_format($summary['cash']) }}

Mobile Money

KES {{ number_format($summary['mpesa']) }}

Insurance

KES {{ number_format($summary['insurance']) }}

Expenses Paid

KES {{ number_format($summary['expenses_paid']) }}

Net Position

KES {{ number_format($summary['net_position']) }}

{{-- Shift Cards --}}
@foreach(['day' => ['label' => 'Day Shift (8:00 AM – 8:00 PM)', 'icon' => 'M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z', 'bg' => 'amber'], 'night' => ['label' => 'Night Shift (8:00 PM – 8:00 AM)', 'icon' => 'M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z', 'bg' => 'indigo']] as $shift => $meta) @php $s = $shifts[$shift]; @endphp

{{ $meta['label'] }}

CashKES {{ number_format($s['cash']) }}
M-Pesa / Mobile MoneyKES {{ number_format($s['mpesa']) }}
InsuranceKES {{ number_format($s['insurance']) }}
Card / Bank TransferKES {{ number_format($s['card']) }}
Shift TotalKES {{ number_format($s['total']) }}
@endforeach
{{-- Transaction Detail --}}

Transaction Detail

@forelse($paymentsList as $p) @php $sh = (Carbon\Carbon::parse($p->created_at)->setTimezone('Africa/Nairobi')->hour >= 8 && Carbon\Carbon::parse($p->created_at)->setTimezone('Africa/Nairobi')->hour < 20) ? 'Day' : 'Night'; @endphp @empty @endforelse
Date / TimeShiftPatientVisitMethodReferenceAmountReceived By
{{ $from->format('Y-m-d') !== $to->format('Y-m-d') ? $p->created_at->format('d M H:i') : $p->created_at->format('H:i') }} {{ $sh }} {{ $p->invoice?->patient?->full_name ?? '-' }} {{ $p->invoice?->visit?->visit_number ?? '-' }} {{ str_replace('_', ' ', $p->payment_method) }} {{ $p->reference_number ?? $p->mpesa_code ?? '-' }} KES {{ number_format($p->amount) }} {{ $p->receiver->name ?? '-' }}
No payments recorded for this date.
@endsection