| SL No | Org Name | Product | Opening Due | @foreach ($months as $month){{ $month }} | @endforeachCurrent Year | Due till 30th of {{ date('F', strtotime($endDate ?? 'now')) }} | ||
|---|---|---|---|---|---|---|---|---|
| Bill | Col. | @endforeachBill | Col. | |||||
| {{ $key + 1 }} | {{ $billingClient->clientCompanyName }} | {{ $productName }} | {{ $billingClient->openingDue > 0 ? $billingClient->openingDue : '-' }} | @foreach ($months as $month) @php $monthlyService = $billingClient->monthlyData[$month]['totalService'] ?? 0; $monthlyRecovered = $billingClient->monthlyData[$month]['totalRecovered'] ?? 0; $yearlyTotalService += $monthlyService; $yearlyTotalRecovered += $monthlyRecovered; $grandYearlyTotalService += $monthlyService; // Accumulate grand total here $grandYearlyTotalRecovered += $monthlyRecovered; // Accumulate grand total here @endphp{{ $monthlyService > 0 ? $monthlyService : '-' }} | {{ $monthlyRecovered > 0 ? $monthlyRecovered : '-' }} | @endforeach @php $dueTillEndDate = $billingClient->openingDue + $yearlyTotalService - $yearlyTotalRecovered; $grandTotalDueTill += $dueTillEndDate; // Accumulate total for "Due till 30th" @endphp{{ $yearlyTotalService > 0 ? $yearlyTotalService : '-' }} | {{ $yearlyTotalRecovered > 0 ? $yearlyTotalRecovered : '-' }} | {{ $dueTillEndDate > 0 ? $dueTillEndDate : '-' }} |
| Grand Total | {{ $totalDueAmount > 0 ? $totalDueAmount : '-' }} | @foreach ($months as $month){{ $grandTotalServicePerMonth[$month] > 0 ? $grandTotalServicePerMonth[$month] : '-' }} | {{ $grandTotalRecoveredPerMonth[$month] > 0 ? $grandTotalRecoveredPerMonth[$month] : '-' }} | @endforeach{{ $grandYearlyTotalService > 0 ? $grandYearlyTotalService : '-' }} | {{ $grandYearlyTotalRecovered > 0 ? $grandYearlyTotalRecovered : '-' }} | {{ $grandTotalDueTill > 0 ? $grandTotalDueTill : '-' }} | ||