@use('App\Enums\ExportFormat') @use('Brick\Math\BigDecimal') @use('PhpOffice\PhpSpreadsheet\Cell\DataType') @use('PhpOffice\PhpSpreadsheet\Style\NumberFormat') @use('Carbon\CarbonInterval') @use('App\Enums\TimeEntryAggregationType') @inject('interval', 'App\Service\IntervalService')
| {{ $group->description() }} | {{ $subGroup->description() }} | Duration | Duration (decimal) | Amount ({{ Str::upper($currency) }}) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $group1Entry['key'] ? 'Yes' : 'No' }} | @else{{ $group1Entry['description'] ?? $group1Entry['key'] ?? '-' }} | @endif @if ($subGroup === TimeEntryAggregationType::Billable){{ $group2Entry['key'] ? 'Yes' : 'No' }} | @else{{ $group2Entry['description'] ?? $group2Entry['key'] ?? '-' }} | @endif{{ $interval->format($duration) }} | {{ round($duration->totalHours, 2) }} | {{ round(BigDecimal::ofUnscaledValue($group2Entry['cost'], 2)->toFloat(), 2) }} | @else @if ($group === TimeEntryAggregationType::Billable){{ $group1Entry['key'] ? 'Yes' : 'No' }} | @else{{ $group1Entry['description'] ?? $group1Entry['key'] ?? '-' }} | @endif @if ($subGroup === TimeEntryAggregationType::Billable){{ $group2Entry['key'] ? 'Yes' : 'No' }} | @else{{ $group2Entry['description'] ?? $group2Entry['key'] ?? '-' }} | @endif{{ $duration->totalDays }} | {{ $duration->totalHours }} | {{ BigDecimal::ofUnscaledValue($group2Entry['cost'], 2)->__toString() }} | @endif
| Total | @if($exportFormat === ExportFormat::ODS || $exportFormat === ExportFormat::CSV){{ $interval->format($totalDurationInterval) }} | {{ round($totalDurationInterval->totalHours, 2) }} | {{ round(BigDecimal::ofUnscaledValue($totalCost, 2)->toFloat(), 2) }} | @else@if($counter > 1) =SUM(C2:C{{ $counter }}) @else =0 @endif | @if($counter > 1) =SUM(D2:D{{ $counter }}) @else =0 @endif | @if($counter > 1) =SUM(E2:E{{ $counter }}) @else =0 @endif | @endif