@extends('backend.layout.main') @section('content')

Instalment List

@foreach($plans as $plan) @php $paid_count = $plan->installments->where('status', 'completed')->count(); $total_count = $plan->installments->count(); $next_installment = $plan->installments->where('status', 'pending')->sortBy('payment_date')->first(); $next_date = $next_installment ? date(config('date_format'), strtotime($next_installment->payment_date)) : 'N/A'; @endphp @endforeach
Plan Name Reference Customer Total Amount Paid Remaining Next Due Date Action
{{$plan->name}} {{$plan->reference->reference_no ?? 'N/A'}} {{$plan->reference->customer->name ?? 'N/A'}} {{number_format($plan->total_amount, config('decimal'))}} {{$paid_count}} / {{$total_count}} {{$total_count - $paid_count}} {{$next_date}}
@push('scripts') @endpush @endsection