mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #5000 from turbo124/v5-develop
Fixes for archived invoice not emailing
This commit is contained in:
commit
c887d81dd6
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@ -48,6 +48,11 @@ jobs:
|
||||
run: |
|
||||
sudo rm -rf bootstrap/cache/*
|
||||
sudo rm -rf node_modules
|
||||
- name: Prune Git History
|
||||
run: |
|
||||
sudo git gc
|
||||
sudo git gc --aggressive
|
||||
sudo git prune
|
||||
- name: Build project # This would actually build your project, using zip for an example artifact
|
||||
run: |
|
||||
zip -r ./invoiceninja.zip .* -x "../*"
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -214,7 +214,7 @@ class Import implements ShouldQueue
|
||||
// if($check_data['status'] == 'errors')
|
||||
// throw new ProcessingMigrationArchiveFailed(implode("\n", $check_data));
|
||||
|
||||
Mail::to($this->user)
|
||||
Mail::to($this->user->email, $this->user->name())
|
||||
->send(new MigrationCompleted($this->company, implode("<br>",$check_data)));
|
||||
|
||||
/*After a migration first some basic jobs to ensure the system is up to date*/
|
||||
|
@ -152,6 +152,11 @@ class Credit extends BaseModel
|
||||
return $this->hasMany(CreditInvitation::class);
|
||||
}
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo(Project::class)->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice which the credit has been created from.
|
||||
*/
|
||||
|
@ -149,6 +149,11 @@ class Quote extends BaseModel
|
||||
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
|
||||
}
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo(Project::class)->withTrashed();
|
||||
}
|
||||
|
||||
public function invitations()
|
||||
{
|
||||
return $this->hasMany(QuoteInvitation::class);
|
||||
|
@ -167,6 +167,11 @@ class RecurringInvoice extends BaseModel
|
||||
return $this->belongsTo(Client::class)->withTrashed();
|
||||
}
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo(Project::class)->withTrashed();
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class)->withTrashed();
|
||||
|
@ -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