Fix incorrect grouping by billable in export report

This commit is contained in:
Constantin Graf
2024-10-29 18:05:26 +01:00
parent eaaa83406d
commit f145e821a8

View File

@@ -37,21 +37,25 @@
$duration = CarbonInterval::seconds($group2Entry['seconds']); $duration = CarbonInterval::seconds($group2Entry['seconds']);
@endphp @endphp
<tr> <tr>
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
@if ($group === TimeEntryAggregationType::Billable)
{{ $group1Entry['key'] ? 'Yes' : 'No' }}
@else
{{ $group1Entry['description'] ?? $group1Entry['key'] ?? '-' }}
@endif
</td>
@if($exportFormat === ExportFormat::ODS || $exportFormat === ExportFormat::CSV) @if($exportFormat === ExportFormat::ODS || $exportFormat === ExportFormat::CSV)
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}"> @if ($group === TimeEntryAggregationType::Billable)
@if ($subGroup === TimeEntryAggregationType::Billable) <td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group1Entry['key'] ? 'Yes' : 'No' }}
</td>
@else
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group1Entry['description'] ?? $group1Entry['key'] ?? '-' }}
</td>
@endif
@if ($subGroup === TimeEntryAggregationType::Billable)
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group2Entry['key'] ? 'Yes' : 'No' }} {{ $group2Entry['key'] ? 'Yes' : 'No' }}
@else </td>
@else
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group2Entry['description'] ?? $group2Entry['key'] ?? '-' }} {{ $group2Entry['description'] ?? $group2Entry['key'] ?? '-' }}
@endif </td>
</td> @endif
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}"> <td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $interval->format($duration) }} {{ $interval->format($duration) }}
</td> </td>
@@ -62,16 +66,24 @@
{{ round(BigDecimal::ofUnscaledValue($group2Entry['cost'], 2)->toFloat(), 2) }} {{ round(BigDecimal::ofUnscaledValue($group2Entry['cost'], 2)->toFloat(), 2) }}
</td> </td>
@else @else
@if ($subGroup === TimeEntryAggregationType::Billable) @if ($group === TimeEntryAggregationType::Billable)
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}"> <td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group1Entry['key'] ? 'Yes' : 'No' }} {{ $group1Entry['key'] ? 'Yes' : 'No' }}
</td> </td>
@else
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group1Entry['description'] ?? $group1Entry['key'] ?? '-' }}
</td>
@endif
@if ($subGroup === TimeEntryAggregationType::Billable)
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group2Entry['key'] ? 'Yes' : 'No' }}
</td>
@else @else
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}"> <td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group2Entry['description'] ?? $group2Entry['key'] ?? '-' }} {{ $group2Entry['description'] ?? $group2Entry['key'] ?? '-' }}
</td> </td>
@endif @endif
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_NUMERIC }}" <td style="border: 1px solid black;" data-type="{{ DataType::TYPE_NUMERIC }}"
data-format="[hh]:mm:ss"> data-format="[hh]:mm:ss">
{{ $duration->totalDays }} {{ $duration->totalDays }}