@php $isExport = $isExport ?? false; @endphp
| Sectors and Subsectors | Direct Emissions (tCO2e) | Indirect emissions from the use of grid-supplied electricity, heat, steam and/or cooling | Emissions occurring outside the city boundary as a result of in-city activities | Please explain any excluded sources, identify any emissions covered under an ETS and provide any other comments | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Emissions in tCO2e |
Notation Key (if needed) |
Emissions in tCO2e |
Notation Key (if needed) |
Emissions in tCO2e |
Notation Key (if needed) |
||||||||||
| {{ ucfirst($sector) }} @if ($subSector) > {{ $subSector }} @endif | @for ($i = 1; $i <= 3; $i++) @php $crf = $data[$i] ?? null; @endphp @if ($crf) @php $gpcValue = ''; $totalValue = 0; $gpcCodes = $crf->gpc_code; if (is_array($gpcCodes)) { foreach ($gpcCodes as $gpcCode) { $gpcValue = $gpc[$gpcCodes[0]] ?? 'ERR'; $value = $gpc[$gpcCode] ?? 0; $totalValue += is_numeric($value) ? $value : 0; } } else { $gpcValue = $gpc[$crf->gpc_code] ?? 'ERR'; } $gpcValue = $totalValue !== 0 ? $totalValue : $gpcValue; if (is_numeric($gpcValue)) { if ($i == 1) { $sumDirectSector += $gpcValue; if ($sector !== 'Generation of grid-supplied energy') { $sumDirectAll += $gpcValue; } } elseif ($i == 2) { $sumIndirectSector += $gpcValue; if ($sector !== 'Generation of grid-supplied energy') { $sumIndirectAll += $gpcValue; } } elseif ($i == 3) { $sumOutsideSector += $gpcValue; if ($sector !== 'Generation of grid-supplied energy') { $sumOutsideAll += $gpcValue; } } } $currentSum = $i == 1 ? $sumDirectSector : ($i == 2 ? $sumIndirectSector : $sumOutsideSector); if ($currentSum === 0) { if (!is_numeric($gpcValue)) { $keyValue = $gpcValue == 'ERR' ? $crf->notation_key : $gpcValue; if ($no == 1) { if ($i == 1) { $keyDirectSector = $keyValue; } elseif ($i == 2) { $keyIndirectSector = $keyValue; } elseif ($i == 3) { $keyOutsideSector = $keyValue; } } if ( ($i == 1 && $keyValue != $keyDirectSector && $keyDirectSector != null) || ($i == 2 && $keyValue != $keyIndirectSector && $keyIndirectSector != null) || ($i == 3 && $keyValue != $keyOutsideSector && $keyOutsideSector != null) ) { if ($i == 1) { $keyDirectSector = null; } elseif ($i == 2) { $keyIndirectSector = null; } elseif ($i == 3) { $keyOutsideSector = null; } } } } else { if ($i == 1) { $keyDirectSector = null; } elseif ($i == 2) { $keyIndirectSector = null; } elseif ($i == 3) { $keyOutsideSector = null; } } @endphp @if ($gpcValue == 'ERR'){{ $crf->notation_key }} | @elseif (is_numeric($gpcValue)){{ $isExport ? $gpcValue : getFormattedValue($gpcValue, 2) }} | @else | {{ $gpcValue }} | @endif @else@endif @endfor | {{ isset($data['info']) ? $data['info'] : '' }} | @php $no++; @endphp|||||||||
| Total {{ ucfirst($sector) }} | @if ($keyDirectSector === null && $sumDirectSector !== 0){{ $isExport ? $sumDirectSector : getFormattedValue($sumDirectSector, 2) }} | @else | {{ $keyDirectSector }} | @endif @if ($keyIndirectSector === null && $sumIndirectSector !== 0){{ $isExport ? $sumIndirectSector : getFormattedValue($sumIndirectSector, 2) }} | @elseif ($keyIndirectSector === null && $sumIndirectSector === 0 && $sector != 'Stationary Energy') | @else | {{ $keyIndirectSector }} | @endif @if ($keyOutsideSector === null && $sumOutsideSector !== 0){{ $isExport ? $sumOutsideSector : getFormattedValue($sumOutsideSector, 2) }} | @else | {{ $keyOutsideSector }} | @endif|||||
| Total Emissions (excluding generation of grid-supplied energy) | {{ $isExport ? $sumDirectAll : getFormattedValue($sumDirectAll, 2) }} | {{ $isExport ? $sumIndirectAll : getFormattedValue($sumIndirectAll, 2) }} | {{ $isExport ? $sumOutsideAll : getFormattedValue($sumOutsideAll, 2) }} | ||||||||||||