@php use Carbon\Carbon; $now = Carbon::now(); $day = $now->day; $month = $now->month; $year = $now->year; if ($day >= 26) { // Current month ka 26 se start hoga $startDate = Carbon::create($year, $month, 26); $endDate = $startDate->copy()->addMonth()->day(25); } else { // Pichle month ka 26 se start hoga $startDate = Carbon::create($year, $month - 1, 26); $endDate = Carbon::create($year, $month, 25); } $formattedRange = $startDate->format('d F') . ' to ' . $endDate->format('d F Y'); @endphp
MONTHLY COLLECTION REPORT FROM {{ $formattedRange }}
@php $totalUnits = 0; $totalDue = 0; $currentMonthDue = 0; $totalDueWithCurrent = 0; $totalReceived = 0; $bounceCheque = 0; $pendingUnits = 0; $totalReceivedPercentage = 0; @endphp @foreach ($model as $item) @if (isset($item->project)) @php $totalUnits += $item->total_units; $totalDue += $item->collection_monthly_installment_last_month_25_due; $currentMonthDue += $item->collection_monthly_installment_current_month_due; $totalDueWithCurrent += $item->collection_monthly_installment_last_month_25_due + $item->collection_monthly_installment_current_month_due; $totalReceived += $item->collection_monthly_installment_current_month_received; $totalReceivedPercentage += ($item->collection_monthly_installment_current_month_received / ($item->collection_monthly_installment_last_month_25_due + $item->collection_monthly_installment_current_month_due)) * 100; $bounceCheque += $item->bounce_cheque; $pendingUnits += $item->pending_units; @endphp @endif @endforeach
PROJECT TOTAL ACCOUNTS CURRENT DUE JULY INSTALLMENT DUE TOTAL MONTH OVERDUE TOTAL COLLECTED COLLECTION RATE Bounce Cheque PENDING TO COLLECT
{{ $item->project }} {{ $item->total_units }} {{ number_format($item->collection_monthly_installment_last_month_25_due, 2) }} {{ number_format($item->collection_monthly_installment_current_month_due, 2) }} {{ number_format($item->collection_monthly_installment_last_month_25_due + $item->collection_monthly_installment_current_month_due, 2) }} {{ number_format($item->collection_monthly_installment_current_month_received, 2) }} {{ number_format( ($item->collection_monthly_installment_current_month_received / ($item->collection_monthly_installment_last_month_25_due + $item->collection_monthly_installment_current_month_due)) * 100, 2, ) }}% {{ number_format($item->bounce_cheque, 2) }} {{ $item->pending_units }}
TOTAL {{ $totalUnits }} {{ number_format($totalDue, 2) }} {{ number_format($currentMonthDue, 2) }} {{ number_format($totalDueWithCurrent, 2) }} {{ number_format($totalReceived, 2) }} @php $avgRate = $model->count() > 0 ? $totalReceivedPercentage / $model->count() : 0; @endphp {{ number_format($avgRate, 2) }}% {{ number_format($bounceCheque, 2) }} {{ $pendingUnits }}