@extends('layouts.admin') @section('title', 'Digital Book') @section('page-title', 'Digital Book') @section('page-subtitle', $member->full_name . ' - ' . $member->member_id) @section('content')
@if($member->profile_photo) @else
{{ substr($member->first_name, 0, 1) }}{{ substr($member->last_name, 0, 1) }}
@endif

{{ $member->full_name }}

{{ $member->member_id }} | Member since {{ $member->membership_date?->format('M Y') ?? 'N/A' }}

Total Tithes (All Time)

GHS {{ number_format($totalTithes, 2) }}

{{ $tithes->flatten()->count() }} payments

Total Welfare (All Time)

GHS {{ number_format($totalWelfare, 2) }}

{{ $welfare->flatten()->count() }} payments

This Year Tithes

GHS {{ number_format($tithes->get(now()->year, collect())->sum('amount') ?? 0, 2) }}

This Year Welfare

GHS {{ number_format($welfare->get(now()->year, collect())->sum('amount') ?? 0, 2) }}

Tithe Book

@if($tithes->flatten()->isNotEmpty()) Export PDF @endif
@if($tithes->flatten()->isNotEmpty())
@foreach($tithes->flatten()->sortByDesc('payment_date') as $tithe) @endforeach
Date Month Receipt No. Amount (GHS) Payment Method Status
{{ $tithe->payment_date->format('M d, Y') }} {{ \Carbon\Carbon::parse($tithe->month . '-01')->format('F Y') }} {{ $tithe->receipt_number }} {{ number_format($tithe->amount, 2) }} {{ ucfirst(str_replace('_', ' ', $tithe->payment_method)) }} {{ ucfirst($tithe->payment_status) }}
Total: GHS {{ number_format($totalTithes, 2) }}
@else

No tithe records found

Record first tithe
@endif

Welfare Book

@if($welfare->flatten()->isNotEmpty()) Export PDF @endif
@if($welfare->flatten()->isNotEmpty())
@foreach($welfare->flatten()->sortByDesc('payment_date') as $contribution) @endforeach
Date Month Receipt No. Amount (GHS) Arrears (GHS) Status
{{ $contribution->payment_date->format('M d, Y') }} {{ \Carbon\Carbon::parse($contribution->month . '-01')->format('F Y') }} {{ $contribution->receipt_number }} {{ number_format($contribution->amount, 2) }} {{ number_format($contribution->arrears, 2) }} {{ ucfirst($contribution->payment_status) }}
Total: GHS {{ number_format($totalWelfare, 2) }} GHS {{ number_format($welfare->flatten()->sum('arrears'), 2) }}
@else

No welfare records found

Record first welfare contribution
@endif
@endsection