diff --git a/app/Models/Task.php b/app/Models/Task.php index df8fd59603b5..8e5eff798767 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -162,6 +162,18 @@ class Task extends BaseModel return $this->belongsTo(TaskStatus::class)->withTrashed(); } + public function stringStatus() + { + if($this->invoice_id) + return '
'.ctrans('texts.invoiced').'
'; + + if($this->status) + return '
' . $this->status?->name ?? ''; + + return ''; + + } + public function invoice() { return $this->belongsTo(Invoice::class)->withTrashed(); diff --git a/resources/views/portal/ninja2020/components/livewire/tasks-table.blade.php b/resources/views/portal/ninja2020/components/livewire/tasks-table.blade.php index 30e3b7b0e5d9..0336ae4575ad 100644 --- a/resources/views/portal/ninja2020/components/livewire/tasks-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/tasks-table.blade.php @@ -47,7 +47,7 @@ {{ $task->project?->name }} - {{ $task->status?->name }} + {!! $task->stringStatus() !!} {{ \Carbon\CarbonInterval::seconds($task->calcDuration())->cascade()->forHumans() }}