sigd/resources/views/modules/reports/crf/row.blade.php

29 lines
1.1 KiB
PHP

@php
$data = $crfData->firstWhere('ws_code', $worksheet->ws_code);
$indentation = str_repeat(' ', $level * 6); // Adjust multiplier (4) for desired indentation width
@endphp
@if ($worksheet->children->isNotEmpty() && !$data)
<tr class="text-right">
<td colspan="5" class="text-left">
{!! $indentation !!}{{ $worksheet->ws_code }}. {{ $worksheet->ws_title }}
</td>
</tr>
@foreach ($worksheet->children as $child)
@include('reports.crf.row', ['worksheet' => $child, 'level' => $level + 1])
@endforeach
@else
@if ($data)
<tr class="text-right">
<td class="text-left">
{!! $indentation !!}{{ $worksheet->ws_code }}. {{ $worksheet->ws_title }}
</td>
<td>{{ $isExport ? $data->co2 : getFormattedValue($data->co2, 2) }}</td>
<td>{{ $isExport ? $data->ch4 : getFormattedValue($data->ch4, 2) }}</td>
<td>{{ $isExport ? $data->n2o : getFormattedValue($data->n2o, 2) }}</td>
<td>{{ $isExport ? $data->co2eq : getFormattedValue($data->co2eq, 2) }}</td>
</tr>
@endif
@endif