Invoice task status badges

This commit is contained in:
David Bomba 2023-11-15 20:47:56 +11:00
parent c5c75f3574
commit d689124871
2 changed files with 13 additions and 1 deletions

View File

@ -162,6 +162,18 @@ class Task extends BaseModel
return $this->belongsTo(TaskStatus::class)->withTrashed();
}
public function stringStatus()
{
if($this->invoice_id)
return '<h5><span class="badge badge-success">'.ctrans('texts.invoiced').'</span></h5>';
if($this->status)
return '<h5><span class="badge badge-primary">' . $this->status?->name ?? '';
return '';
}
public function invoice()
{
return $this->belongsTo(Invoice::class)->withTrashed();

View File

@ -47,7 +47,7 @@
{{ $task->project?->name }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
{{ $task->status?->name }}
{!! $task->stringStatus() !!}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
{{ \Carbon\CarbonInterval::seconds($task->calcDuration())->cascade()->forHumans() }}