Additional logic for task validation

This commit is contained in:
David Bomba 2023-06-22 11:54:11 +10:00
parent ae09df0cfd
commit 3081907cad
3 changed files with 22 additions and 0 deletions

View File

@ -95,6 +95,14 @@ class StoreTaskRequest extends Request
} }
} }
if (isset($input['project_id']) && isset($input['client_id'])) {
$search_project_with_client = Project::withTrashed()->where('id', $input['project_id'])->where('client_id', $input['client_id'])->company()->doesntExist();
if ($search_project_with_client) {
unset($input['project_id']);
}
}
$this->replace($input); $this->replace($input);
} }
} }

View File

@ -104,6 +104,15 @@ class UpdateTaskRequest extends Request
$input['color'] = ''; $input['color'] = '';
} }
if(isset($input['project_id']) && isset($input['client_id'])){
$search_project_with_client = Project::withTrashed()->where('id', $input['project_id'])->where('client_id', $input['client_id'])->company()->doesntExist();
if($search_project_with_client){
unset($input['project_id']);
}
}
$this->replace($input); $this->replace($input);
} }

View File

@ -356,6 +356,11 @@ class PaymentEmailEngine extends BaseEmailEngine
} }
if(strlen($invoice_list) < 4){
$invoice_list = Number::formatMoney($this->payment->amount, $this->client) ?: '&nbsp;';
}
return $invoice_list; return $invoice_list;
} }