Skip to content

Commit

Permalink
Fix incorrect grouping by billable in export report
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Oct 29, 2024
1 parent eaaa834 commit f145e82
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions resources/views/reports/time-entry-aggregate-index-excel.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,25 @@
$duration = CarbonInterval::seconds($group2Entry['seconds']);
@endphp
<tr>
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
@if($exportFormat === ExportFormat::ODS || $exportFormat === ExportFormat::CSV)
@if ($group === TimeEntryAggregationType::Billable)
{{ $group1Entry['key'] ? 'Yes' : 'No' }}
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group1Entry['key'] ? 'Yes' : 'No' }}
</td>
@else
{{ $group1Entry['description'] ?? $group1Entry['key'] ?? '-' }}
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group1Entry['description'] ?? $group1Entry['key'] ?? '-' }}
</td>
@endif
</td>
@if($exportFormat === ExportFormat::ODS || $exportFormat === ExportFormat::CSV)
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
@if ($subGroup === TimeEntryAggregationType::Billable)
@if ($subGroup === TimeEntryAggregationType::Billable)
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group2Entry['key'] ? 'Yes' : 'No' }}
@else
</td>
@else
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group2Entry['description'] ?? $group2Entry['key'] ?? '-' }}
@endif
</td>
</td>
@endif
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $interval->format($duration) }}
</td>
Expand All @@ -62,16 +66,24 @@
{{ round(BigDecimal::ofUnscaledValue($group2Entry['cost'], 2)->toFloat(), 2) }}
</td>
@else
@if ($subGroup === TimeEntryAggregationType::Billable)
@if ($group === 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' }}
</td>
@else
<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_STRING }}">
{{ $group2Entry['description'] ?? $group2Entry['key'] ?? '-' }}
</td>
@endif

<td style="border: 1px solid black;" data-type="{{ DataType::TYPE_NUMERIC }}"
data-format="[hh]:mm:ss">
{{ $duration->totalDays }}
Expand Down

0 comments on commit f145e82

Please sign in to comment.