@if(!empty($columnPeriods))
    @foreach($columnPeriods as $period)
        <td class="text-end{{ !empty($cellClass) ? ' ' . $cellClass : '' }}">{{ $money(is_array($amounts) ? ($amounts[$period['key']] ?? 0) : 0) }}</td>
    @endforeach
    <td class="text-end{{ !empty($cellClass) ? ' ' . $cellClass : '' }}">{{ $money($total ?? (is_array($amounts) ? array_sum($amounts) : $amounts)) }}</td>
@else
    <td class="text-end{{ !empty($cellClass) ? ' ' . $cellClass : '' }}">{{ $money(is_array($amounts) ? array_sum($amounts) : $amounts) }}</td>
@endif
