@extends('layouts.app') @section('content')

Payment Schedules @if(request('date_from') || request('date_to')) ({{ \Carbon\Carbon::parse(request('date_from', $monthStart))->format('M d, Y') }} - {{ \Carbon\Carbon::parse(request('date_to', $monthEnd))->format('M d, Y') }}) @else - {{ now()->format('F Y') }} @endif

Create Schedule
@if(session('success'))
{{ session('success') }}
@endif
Clear
Total Expected Amount

BDT {{ number_format($totalExpectedAmount, 2) }}

Total Payment Amount

BDT {{ number_format($totalPaymentAmount, 2) }}

Total Schedules

{{ $totalCount }}

@if($schedulesByDate->count() > 0)
Day-wise Summary
@foreach($schedulesByDate as $date => $schedules) @php $dayExpectedAmount = $schedules->sum('expected_payment_amount'); $dayPaymentAmount = $schedules->sum('transaction_payment_amount'); $dayCount = $schedules->count(); $dateObj = \Carbon\Carbon::parse($date); $isToday = $dateObj->isToday(); $isPast = $dateObj->isPast() && !$isToday; $isFuture = $dateObj->isFuture(); @endphp @endforeach
Date Day Expected Amount Payment Amount Total Schedules Status Actions
{{ $dateObj->format('Y-m-d') }} @if($isToday) Today @endif {{ $dateObj->format('l') }} BDT {{ number_format($dayExpectedAmount, 2) }} BDT {{ number_format($dayPaymentAmount, 2) }} {{ $dayCount }} @if($isToday) Today @elseif($isPast) Past @else Future @endif View
Grand Total: BDT {{ number_format($totalExpectedAmount, 2) }} BDT {{ number_format($totalPaymentAmount, 2) }} {{ $totalCount }}
@endif
@endsection