1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00

Fixes for project with both project and client id

This commit is contained in:
David Bomba 2022-08-25 08:10:26 +10:00
parent 7d01295168
commit 880f1a620f
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ class StoreExpenseRequest 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

@ -64,7 +64,7 @@ class UpdateExpenseRequest 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;