{{$ajoContribution->name}}

{{ucfirst($ajoContribution->type)}} Ajo Contribution

{{ucfirst($ajoContribution->status)}}

{{formatNumber($contributionTotalAmount)}}

{{ucfirst($ajoContribution->frequency)}} contributions starting from: {{$ajoContribution->start_date->format('d M Y')}}

@if ($ajoContribution->status == 'active')

{{$ajoContribution->hash_id}}

@endif
{{-- Add money --}} @if ( $isUserContributing && $ajoContribution->status == 'active')
{{-- Add money Modal --}}

Add money to Ajo Contribution

@if (!$ajoContribution->start_date->lte(now()))

Ajo Contribution has not started yet

@elseif ($hasUserDonated)

You have already made a contribution for this round

@else

Amount

{{formatNumber($ajoContribution->amount)}}

Add Money @endif
@endif {{-- Edit Ajo Contribution --}} @if ( $ajoContribution->status == 'active' && $isAdmin)

Edit Ajo Contribution

@if ($ajoContribution->type === 'personal') @else @endif
Update Ajo Contribution
@endif {{-- End Ajo Contribution --}} @if ( $ajoContribution->status == 'active' && $isAdmin)

End Ajo Contribution

Are you sure you want to end this Ajo Contribution?

End Ajo Contribution
@endif
{{-- contribution Rounds --}}

Contribution Rounds

@if ($ajoContribution->activeRound()->status == 'pending')

A member(s) have not paid for the current round, so the Ajo Contribution is on hold until payment is complete.

@endif
@forelse ($rounds as $round)

{{$round->beneficiary->name}} @if ($ajoContribution->current_round == $round->order) .current round @endif

{{formatNumber($round->balance)}}

{{-- for tailwind css --}} {{--
--}}

Round {{$round->order}}

{{$round->status}}

@empty

No rounds yet

@endforelse
{{-- turn on auto save --}} @if ($ajoContribution->status == 'active' && $ajoContribution->start_date->lte(now()) && $isUserContributing)

Auto-save

save automatically daily, weekly or monthly with autosave

@endif {{-- Ajo members --}}

Members

@foreach ($members as $user)

{{$user->name}} .{{$user?->pivot?->role}} @if ($user->id == auth()->id()) .You @endif

@if ($user?->pivot?->order_number)

Round {{$user->pivot->order_number}}

@endif

{{$user->email}}

{{$user->phone}}

@if ($user?->pivot?->is_contributing)
@foreach ($ajoContribution->rounds as $round)
@php $hasDonated = $round->donations()->where('user_id', $user->id)->exists(); $isCurrentUser = $user->id == auth()->id(); $isAdminUser = $user->id == $adminUser->id; $joinedLate = $round->order < $activeRound->order && $round->updated_at < $user->pivot->created_at; @endphp @if ($round->order > $activeRound->order) {{-- Future rounds - Yellow --}}
{{$round->order}}
@elseif ($joinedLate) {{-- For rounds that took place before the user joined - gray --}}
{{$round->order}}
@elseif ($hasDonated) {{-- Rounds with donation - Green --}}
{{$round->order}}
@elseif ($round->order <= $activeRound->order && !$hasDonated) @if ($isAdmin) {{-- admin is supposed to report to admin - red--}}
{{$round->order}}
@elseif ($isCurrentUser || $isAdminUser) {{-- Auth user should not be able report themselves or report an admin--}}
{{$round->order}}
@else {{-- Other non-admin users' unpaid rounds with report option --}}
{{-- Report member modal --}}

Report {{$user->name}}

Are you sure you want to report {{$user->name}} to the Admin for defaulting payment?

Report Cancel
@endif @endif
@endforeach
@endif
@endforeach