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

Weekly Projection Of {{ \Carbon\Carbon::parse($data['start_date'])->format('Y/m/d') }} and {{ \Carbon\Carbon::parse($data['end_date'])->format('Y/m/d') }}

@php $totalClients = 0; @endphp
Group / Individual Name Repayment Amount No Of Clients Day Of Collection @foreach ($data['weeklyProjections'] as $projection) @if ($projection?->loan?->loan_category_id == \App\Constants\LoanConstants::INDIVIDUAL_LOAN) @php $totalClients+=1; @endphp

{{ $projection?->loan?->individualClient?->client?->fullname }}

Individual

@else @php $totalClients+= $projection?->loan?->groupClients->count(); @endphp @if ($projection->loan?->groupClients?->isNotEmpty())
@foreach ($projection?->loan?->groupClients->take(4) as $groupClient) Avatar @endforeach @if ($projection?->loan?->groupClients->count() > 4)
+{{ $projection?->loan?->groupClients->count() - 4 }}
@endif

{{ $projection?->loan?->groupClients?->first()?->group?->name }}

Group

@endif @endif
{{ number_format($projection?->amount) }} @if ($projection?->loan?->loan_category_id == \App\Constants\LoanConstants::INDIVIDUAL_LOAN) 1 @else {{ $projection?->loan?->groupClients?->count() }} @endif {{ $projection?->date?->format('l') }}
@endforeach Total {{ number_format($data['weeklyProjections']?->sum('amount')) }} {{ number_format($totalClients) }}
@endsection