@foreach($section->rows as $row) @php $prev = (float) ($previousValues[$row->id] ?? ($existingValues[$row->id]['previous'] ?? 0)); $curr = (float) ($existingValues[$row->id]['current'] ?? 0); $isTotal = $row->isTotalRow(); if ($row->isPerformanceMode()) { $output = (float) ($existingValues[$row->id]['result'] ?? ($curr - $prev)); } else { $output = (float) ($existingValues[$row->id]['cumulative'] ?? ($prev + $curr)); } @endphp @endforeach
Variable Previous Current @php $firstRow = $section->rows->first(); @endphp {{ $firstRow?->outputLabel() ?? 'Cumulative' }}
{{ $row->label }} @if($readonly ?? false) @elseif($isTotal) @else @endif @if($readonly ?? false) @php $outputClass = $row->isPerformanceMode() ? ($output < 0 ? 'text-danger' : ($output > 0 ? 'text-success' : '')) : ''; @endphp @else @endif