mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
Add pdf detailed report and placeholder for aggregate endpoint
This commit is contained in:
committed by
Constantin Graf
parent
5593d141ea
commit
b0bcc4f330
@@ -13,17 +13,17 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class TimeEntriesDetailedCsvExport extends CsvExport
|
||||
{
|
||||
public const array HEADER = [
|
||||
'id',
|
||||
'user_id',
|
||||
'project_id',
|
||||
'task_id',
|
||||
'start_time',
|
||||
'end_time',
|
||||
'duration',
|
||||
'description',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
'Description',
|
||||
'Task',
|
||||
'Project',
|
||||
'Client',
|
||||
'User',
|
||||
'Start',
|
||||
'End',
|
||||
'Duration',
|
||||
'Duration (decimal)',
|
||||
'Billable',
|
||||
'Tags',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -31,16 +31,20 @@ class TimeEntriesDetailedCsvExport extends CsvExport
|
||||
*/
|
||||
public function mapRow(Model $model): array
|
||||
{
|
||||
$duration = $model->getDuration();
|
||||
|
||||
return [
|
||||
'id' => $model->id,
|
||||
'user_id' => $model->user_id,
|
||||
'project_id' => $model->project_id,
|
||||
'task_id' => $model->task_id,
|
||||
'start_time' => $model->start,
|
||||
'end_time' => $model->end,
|
||||
'description' => $model->description,
|
||||
'created_at' => $model->created_at,
|
||||
'updated_at' => $model->updated_at,
|
||||
'Description' => $model->description,
|
||||
'Task' => $model->task?->name,
|
||||
'Project' => $model->project?->name,
|
||||
'Client' => $model->client?->name,
|
||||
'User' => $model->user->name,
|
||||
'Start' => $model->start->format('Y-m-d H:i:s'),
|
||||
'End' => $model->end?->format('Y-m-d H:i:s'),
|
||||
'Duration' => $duration !== null ? (int) floor($duration->totalHours).':'.$duration->format('%I:%S') : null,
|
||||
'Duration (decimal)' => $duration?->totalHours,
|
||||
'Billable' => $model->billable ? 'Yes' : 'No',
|
||||
'Tags' => $model->tagsRelation->pluck('name')->implode(', '),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user