@php $isExport = $isExport ?? false; @endphp
@php $sumDirectAll = $sumIndirectAll = $sumOutsideAll = 0; @endphp @foreach ($gpcData as $sector => $subSectors) @php $sumDirectSector = $sumIndirectSector = $sumOutsideSector = 0; $keyDirectSector = $keyIndirectSector = $keyOutsideSector = null; $no = 1; @endphp @foreach ($subSectors as $subSector => $data) @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') @elseif (is_numeric($gpcValue)) @else @endif @else @endif @endfor @php $no++; @endphp @endforeach @if ($keyDirectSector === null && $sumDirectSector !== 0) @else @endif @if ($keyIndirectSector === null && $sumIndirectSector !== 0) @elseif ($keyIndirectSector === null && $sumIndirectSector === 0 && $sector != 'Stationary Energy') @else @endif @if ($keyOutsideSector === null && $sumOutsideSector !== 0) @else @endif @endforeach
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 {{ $crf->notation_key }}{{ $isExport ? $gpcValue : getFormattedValue($gpcValue, 2) }} {{ $gpcValue }} {{ isset($data['info']) ? $data['info'] : '' }}
Total {{ ucfirst($sector) }}{{ $isExport ? $sumDirectSector : getFormattedValue($sumDirectSector, 2) }} {{ $keyDirectSector }}{{ $isExport ? $sumIndirectSector : getFormattedValue($sumIndirectSector, 2) }} {{ $keyIndirectSector }}{{ $isExport ? $sumOutsideSector : getFormattedValue($sumOutsideSector, 2) }} {{ $keyOutsideSector }}
Total Emissions (excluding generation of grid-supplied energy) {{ $isExport ? $sumDirectAll : getFormattedValue($sumDirectAll, 2) }} {{ $isExport ? $sumIndirectAll : getFormattedValue($sumIndirectAll, 2) }} {{ $isExport ? $sumOutsideAll : getFormattedValue($sumOutsideAll, 2) }}