Fix bug in time-entry.update-multiple; Add computed property for client_id

This commit is contained in:
Constantin Graf
2024-10-08 19:15:16 +02:00
committed by Constantin Graf
parent b3b84db004
commit d5a4df738f
4 changed files with 123 additions and 1 deletions

View File

@@ -373,6 +373,10 @@ class TimeEntryController extends Controller
$oldTask = $timeEntry->task;
$timeEntry->fill($changes);
// If project is changed, but task is not, we remove the old task from the time entry
if ($oldProject !== null && $project !== null && $oldProject->isNot($project) && $task === null) {
$timeEntry->task()->disassociate();
}
if ($overwriteClient) {
$timeEntry->client()->associate($client);
}