1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01: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 */ /* Ensure the project is related */
if (array_key_exists('project_id', $input) && isset($input['project_id'])) { 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){ if($project){
$input['client_id'] = $project->client_id; $input['client_id'] = $project->client_id;

View File

@ -64,7 +64,7 @@ class UpdateExpenseRequest extends Request
/* Ensure the project is related */ /* Ensure the project is related */
if (array_key_exists('project_id', $input) && isset($input['project_id'])) { 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){ if($project){
$input['client_id'] = $project->client_id; $input['client_id'] = $project->client_id;