@extends('layouts.app') @section('title', 'Monthly Payment Schedules') @section('content')

Monthly 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

Back Create Schedule
@if(session('success')) @endif @if(session('error')) @endif
Clear
Total Amount

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

Total Committed Amount

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

Remaining Amount

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

Total Schedules

{{ $totalCount }}

@if($schedulesByDate->count() > 0)
Day-wise Summary
@foreach($schedulesByDate as $date => $schedules) @php $dayAmount = $schedules->sum('amount'); $dayPaidAmount = $schedules->sum('paid_amount'); $dayRemainingAmount = $dayAmount - $dayPaidAmount; $dayCount = $schedules->count(); $dateObj = \Carbon\Carbon::parse($date); $isToday = $dateObj->isToday(); $isPast = $dateObj->isPast() && !$isToday; $isFuture = $dateObj->isFuture(); @endphp @endforeach
Date Day Total Amount Committed Amount Remaining Amount Total Schedules Status Actions
{{ $dateObj->format('Y-m-d') }} @if($isToday) Today @endif {{ $dateObj->format('l') }} BDT {{ number_format($dayAmount, 2) }} BDT {{ number_format($dayPaidAmount, 2) }} BDT {{ number_format($dayRemainingAmount, 2) }} {{ $dayCount }} @if($isToday) Today @elseif($isPast) Past @else Future @endif View
Grand Total: BDT {{ number_format($totalAmount, 2) }} BDT {{ number_format($totalPaidAmount, 2) }} BDT {{ number_format($totalRemainingAmount, 2) }} {{ $totalCount }}
@else
No payment schedules found for the selected period.
@endif @if($monthlySchedules->count() > 0)
Detailed Schedule List
@foreach($monthlySchedules as $schedule) @endforeach
# Provider Invoice Due Date Amount Committed Amount Remaining Payment Status Notes Actions
{{ $loop->iteration }} {{ $schedule->provider->company_name ?? $schedule->provider->name ?? 'N/A' }} @if($schedule->invoice_id) {{ $schedule->invoice->bill_no ?? 'Invoice #' . $schedule->invoice_id }} @else @endif {{ $schedule->due_date->format('d M Y') }} @if($schedule->isOverdue()) Overdue @endif BDT {{ number_format($schedule->amount, 2) }} BDT {{ number_format($schedule->paid_amount, 2) }} BDT {{ number_format($schedule->remaining_amount, 2) }} @if($schedule->payment_status == 'paid') Paid @elseif($schedule->payment_status == 'partial') Partial @else Pending @endif @if($schedule->notes) {{ Str::limit($schedule->notes, 30) }} @else @endif
@endif
@endsection