mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for archived invoice not emailing
This commit is contained in:
parent
4b3c7ec771
commit
cc883f0926
@ -39,9 +39,9 @@ class StoreUserRequest extends Request
|
||||
$rules['last_name'] = 'required|string|max:100';
|
||||
|
||||
if (config('ninja.db.multi_db_enabled')) {
|
||||
$rules['email'] = ['email', new ValidUserForCompany(), Rule::unique('users')];
|
||||
$rules['email'] = ['email', new ValidUserForCompany(), Rule::unique('users')->ignore($this->input('company_user.account.id'), 'account_id')];
|
||||
} else {
|
||||
$rules['email'] = ['email',Rule::unique('users')];
|
||||
$rules['email'] = ['email',Rule::unique('users')->ignore($this->input('company_user.account.id'), 'account_id')];
|
||||
}
|
||||
|
||||
|
||||
@ -56,6 +56,10 @@ class StoreUserRequest extends Request
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
nlog($this->input('company_user.account'));
|
||||
// nlog($this->input('company_user.account.id'));
|
||||
// nlog($this->input('company_user.account.id'));
|
||||
|
||||
if (isset($input['company_user'])) {
|
||||
if (! isset($input['company_user']['is_admin'])) {
|
||||
$input['company_user']['is_admin'] = false;
|
||||
|
@ -26,7 +26,7 @@ class ValidUserForCompany implements Rule
|
||||
*/
|
||||
public function passes($attribute, $value)
|
||||
{
|
||||
return MultiDB::checkUserAndCompanyCoExist($value, auth()->user()->company()->company_key);
|
||||
return MultiDB::checkUserAndCompanyCoExist($value, auth()->user()->company()->company_key, auth()->user()->company()->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,7 +78,7 @@ class TemplateEngine
|
||||
{
|
||||
if (strlen($this->entity) > 1 && strlen($this->entity_id) > 1) {
|
||||
$class = 'App\Models\\'.ucfirst($this->entity);
|
||||
$this->entity_obj = $class::whereId($this->decodePrimaryKey($this->entity_id))->company()->first();
|
||||
$this->entity_obj = $class::withTrashed()->where('id', $this->decodePrimaryKey($this->entity_id))->company()->first();
|
||||
} else {
|
||||
$this->mockEntity();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user