diff --git a/app/Factory/CloneQuoteToInvoiceFactory.php b/app/Factory/CloneQuoteToInvoiceFactory.php index 13ad94391b14..086b6db742c5 100644 --- a/app/Factory/CloneQuoteToInvoiceFactory.php +++ b/app/Factory/CloneQuoteToInvoiceFactory.php @@ -43,6 +43,8 @@ class CloneQuoteToInvoiceFactory $invoice->number = null; $invoice->date = now()->format('Y-m-d'); $invoice->balance = 0; + $invoice->deleted_at = null; + return $invoice; } } diff --git a/app/Models/Presenters/ClientPresenter.php b/app/Models/Presenters/ClientPresenter.php index be0fea30a6c3..824393a7ba11 100644 --- a/app/Models/Presenters/ClientPresenter.php +++ b/app/Models/Presenters/ClientPresenter.php @@ -28,7 +28,7 @@ class ClientPresenter extends EntityPresenter } //$contact = $this->entity->primary_contact->first(); - $contact = $this->entity->contacts->first(); + $contact = $this->entity->contacts->whereNotNull('email')->first(); $contact_name = 'No Contact Set'; diff --git a/app/Services/Invoice/TriggeredActions.php b/app/Services/Invoice/TriggeredActions.php index 9dca9a50f733..2516a59999ed 100644 --- a/app/Services/Invoice/TriggeredActions.php +++ b/app/Services/Invoice/TriggeredActions.php @@ -12,7 +12,7 @@ namespace App\Services\Invoice; use App\Events\Invoice\InvoiceWasEmailed; -use App\Jobs\Invoice\EmailEntity; +use App\Jobs\Entity\EmailEntity; use App\Models\Invoice; use App\Services\AbstractService; use App\Utils\Ninja; diff --git a/config/database.php b/config/database.php index 6e016d9a9130..1333795cfc0f 100644 --- a/config/database.php +++ b/config/database.php @@ -207,6 +207,7 @@ return [ ['options' => [ 'replication' => 'sentinel', 'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'), + 'sentinel_timeout' => 1.0, 'parameters' => [ 'password' => env('REDIS_PASSWORD', null), 'database' => env('REDIS_DB', 0), @@ -225,6 +226,7 @@ return [ ['options' => [ 'replication' => 'sentinel', 'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'), + 'sentinel_timeout' => 1.0, 'parameters' => [ 'password' => env('REDIS_PASSWORD', null), 'database' => env('REDIS_CACHE_DB', 1), diff --git a/routes/api.php b/routes/api.php index ceeb78fadf6e..a0e63da14382 100644 --- a/routes/api.php +++ b/routes/api.php @@ -159,8 +159,8 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a Route::post('templates', 'TemplateController@show')->name('templates.show'); - Route::resource('tokens', 'TokenController')->middleware('password_protected'); // name = (tokens. index / create / show / update / destroy / edit - Route::post('tokens/bulk', 'TokenController@bulk')->name('tokens.bulk')->middleware('password_protected'); + Route::resource('tokens', 'TokenController'); // name = (tokens. index / create / show / update / destroy / edit + Route::post('tokens/bulk', 'TokenController@bulk')->name('tokens.bulk'); Route::get('settings/enable_two_factor', 'TwoFactorController@setupTwoFactor'); Route::post('settings/enable_two_factor', 'TwoFactorController@enableTwoFactor');