DUE REPORT

@foreach ($months as $month) @endforeach @foreach ($months as $month) @endforeach @php $productName = implode(', ', array_column($billingProduct, 'name')); $yearlyTotalService = 0; $yearlyTotalRecovered = 0; @endphp @foreach ($months as $month) @php $monthlyService = $monthlyInfo[$month]['totalService'] ?? 0; $monthlyRecovered = $monthlyInfo[$month]['totalRecovered'] ?? 0; $yearlyTotalService += $monthlyService; $yearlyTotalRecovered += $monthlyRecovered; $grandYearlyTotalService += $monthlyService; $grandYearlyTotalRecovered += $monthlyRecovered; @endphp @endforeach @php $dueTillEndDate = $openingDue + $yearlyTotalService - $yearlyTotalRecovered; $grandTotalDueTill += $dueTillEndDate; @endphp @foreach ($months as $month) @endforeach
SL No Org Name Product Opening Due{{ $month }} Current Year Due till 30th of {{ date('F', strtotime($endDate ?? 'now')) }}
Bill Col. Bill Col.
{{ 1 }} {{ $billingClient->clientCompanyName }} {{ $productName }} {{ $openingDue > 0 ? $openingDue : '-' }}{{ $monthlyService > 0 ? $monthlyService : '-' }} {{ $monthlyRecovered > 0 ? $monthlyRecovered : '-' }}{{ $yearlyTotalService > 0 ? $yearlyTotalService : '-' }} {{ $yearlyTotalRecovered > 0 ? $yearlyTotalRecovered : '-' }} {{ $dueTillEndDate > 0 ? $dueTillEndDate : '-' }}
Grand Total {{ $totalDueAmount > 0 ? $totalDueAmount : '-' }}{{ $grandTotalServicePerMonth[$month] > 0 ? $grandTotalServicePerMonth[$month] : '-' }} {{ $grandTotalRecoveredPerMonth[$month] > 0 ? $grandTotalRecoveredPerMonth[$month] : '-' }} {{ $grandYearlyTotalService > 0 ? $grandYearlyTotalService : '-' }} {{ $grandYearlyTotalRecovered > 0 ? $grandYearlyTotalRecovered : '-' }} {{ $grandTotalDueTill > 0 ? $grandTotalDueTill : '-' }}