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