@php $ce = is_array($ce ?? null) ? $ce : []; $variant = $variant ?? 'pre'; $isPdwp = $variant === 'pd'; $fyLabel = static function (string $fy): string { $fy = trim($fy); return $fy !== '' ? $fy : '—'; }; @endphp @if ($isPdwp) @foreach ($ce['fiscal_years_capital'] ?? [] as $fyBlock) @foreach ($fyBlock['lines'] ?? [] as $line) @endforeach @endforeach @foreach ($ce['fiscal_years_revenue'] ?? [] as $fyBlock) @foreach ($fyBlock['lines'] ?? [] as $line) @endforeach @endforeach
13. Capital Cost (Summary of the Project Cost): (Rs. In Million)
A. Capital Cost component
{{ $fyBlock['roman'] ?? '' }} Fiscal Year {{ $fyLabel($fyBlock['fiscal_year'] ?? '') }} {{ $fyBlock['fy_total_million'] ?? '' }}
{{ $line['hierarchy_line'] ?? '' }} {{ $line['amount_million'] ?? '' }}
Sub-Total Capital
B. Revenue Component
{{ $fyBlock['roman'] ?? '' }} Fiscal Year {{ $fyLabel($fyBlock['fiscal_year'] ?? '') }} {{ $fyBlock['fy_total_million'] ?? '' }}
{{ $line['hierarchy_line'] ?? '' }} {{ $line['amount_million'] ?? '' }}
Sub-Total Revenue
Total (Capital + Revenue)
@else {{-- Pre-PDWP & DDWP: rows only (parent table supplies §14 header) --}} A.  Capital Cost component @foreach ($ce['fiscal_years_capital'] ?? [] as $fyBlock) {{ $fyBlock['roman'] ?? '' }}  Fiscal Year {{ $fyLabel($fyBlock['fiscal_year'] ?? '') }} {{ $fyBlock['fy_total_million'] ?? '' }} @foreach ($fyBlock['lines'] ?? [] as $line) {{ $line['hierarchy_line'] ?? '' }} {{ $line['amount_million'] ?? '' }} @endforeach @endforeach Sub-Total Capital B.  Revenue Component @foreach ($ce['fiscal_years_revenue'] ?? [] as $fyBlock) {{ $fyBlock['roman'] ?? '' }}  Fiscal Year {{ $fyLabel($fyBlock['fiscal_year'] ?? '') }} {{ $fyBlock['fy_total_million'] ?? '' }} @foreach ($fyBlock['lines'] ?? [] as $line) {{ $line['hierarchy_line'] ?? '' }} {{ $line['amount_million'] ?? '' }} @endforeach @endforeach Sub-Total Revenue Total (Capital + Revenue) @endif