@use('Brick\Math\BigDecimal')
@use('Brick\Money\Money')
@use('PhpOffice\PhpSpreadsheet\Cell\DataType')
@use('Carbon\CarbonInterval')
@inject('interval', 'App\Service\IntervalService')
@inject('colorService', 'App\Service\ColorService')
Report
Report
{{ $start->format('d.m.Y') }} - {{ $end->format('d.m.Y') }}
Duration: {{ $interval->format(CarbonInterval::seconds($aggregatedData['seconds'])) }}
Total cost: {{ Money::of(BigDecimal::ofUnscaledValue($aggregatedData['cost'], 2)->__toString(), $currency)->formatTo('en_US') }}
@foreach($aggregatedData['grouped_data'] as $group1Entry)
{{ $group1Entry['description'] ?? $group1Entry['key'] ?? 'No '.Str::lower($group->description()) }}
|
{{ $subGroup->description() }}
|
Duration
|
Duration (decimal)
|
Cost
|
@php
$counter = 1;
$totalDuration = 0;
$totalCost = 0;
@endphp
@foreach($group1Entry['grouped_data'] as $group2Entry)
@php
$duration = CarbonInterval::seconds($group2Entry['seconds']);
@endphp
|
{{ $group2Entry['description'] ?? $group2Entry['key'] ?? '-' }}
|
{{ $interval->format($duration) }}
|
{{ round($duration->totalHours, 2) }}
|
{{ Money::of(BigDecimal::ofUnscaledValue($group2Entry['cost'], 2)->__toString(), $currency)->formatTo('en_US') }}
|
@php
$totalDuration += $group2Entry['seconds'];
$totalCost += $group2Entry['cost'];
@endphp
@endforeach
@endforeach