Fixes for task requests

This commit is contained in:
= 2022-08-22 07:53:15 +10:00
parent 6862fabbe0
commit 77d489211e
3 changed files with 4 additions and 4 deletions

View File

@ -70,8 +70,8 @@ class StoreTaskRequest extends Request
/* Ensure the project is related */
if (array_key_exists('project_id', $input) && isset($input['project_id'])) {
$project = Project::withTrashed()->find($input['project_id'])->company()->first();
$project = Project::withTrashed()->where('id', $input['project_id'])->company()->first();
;
if($project){
$input['client_id'] = $project->client_id;
}

View File

@ -69,7 +69,7 @@ class UpdateTaskRequest extends Request
/* Ensure the project is related */
if (array_key_exists('project_id', $input) && isset($input['project_id'])) {
$project = Project::withTrashed()->find($input['project_id'])->company()->first();
$project = Project::withTrashed()->where('id', $input['project_id'])->company()->first();
if($project){
$input['client_id'] = $project->client_id;

View File

@ -90,7 +90,7 @@ class Number
return (float) $s;
}
// remove all seperators from first part and keep the end
// remove all separators from first part and keep the end
$s = str_replace('.', '', substr($s, 0, -3)).substr($s, -3);
// return float