diff --git a/VERSION.txt b/VERSION.txt index 96fb010e76c9..a0155533fef6 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.3.45 \ No newline at end of file +5.3.46 \ No newline at end of file diff --git a/app/Http/Controllers/ClientPortal/InvitationController.php b/app/Http/Controllers/ClientPortal/InvitationController.php index bc0a2b5cc6a1..24ff67640387 100644 --- a/app/Http/Controllers/ClientPortal/InvitationController.php +++ b/app/Http/Controllers/ClientPortal/InvitationController.php @@ -87,6 +87,10 @@ class InvitationController extends Controller if(!$invitation) return abort(404,'The resource is no longer available.'); + /* 12/01/2022 Clean up an edge case where if the contact is trashed, restore if a invitation comes back. */ + if($invitation->contact->trashed()) + $invitation->contact->restore(); + /* Return early if we have the correct client_hash embedded */ $client_contact = $invitation->contact; diff --git a/app/Http/Middleware/CheckClientExistence.php b/app/Http/Middleware/CheckClientExistence.php index a03f90528dcc..f8238db1e6e2 100644 --- a/app/Http/Middleware/CheckClientExistence.php +++ b/app/Http/Middleware/CheckClientExistence.php @@ -34,7 +34,7 @@ class CheckClientExistence ->where('email', auth('contact')->user()->email) ->whereNotNull('email') ->where('email', '<>', '') - ->whereNull('deleted_at') + // ->whereNull('deleted_at') ->distinct('company_id') ->distinct('email') ->whereNotNull('company_id') @@ -46,10 +46,11 @@ class CheckClientExistence }) ->get(); + /* This catches deleted clients who don't have access to the app. We automatically log them out here*/ if (count($multiple_contacts) == 0) { Auth::logout(); - return redirect()->route('client.login'); + return redirect()->route('client.login')->with('message', 'Login disabled'); } if (count($multiple_contacts) == 1 && !Auth::guard('contact')->check()) { diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index 627619656c9a..52fff144557d 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -477,6 +477,11 @@ class Import implements ShouldQueue } $company_settings->{$key} = $value; + + if($key == 'payment_terms'){ + settype($company_settings->payment_terms, 'string'); + } + } $data['settings'] = $company_settings; diff --git a/app/PaymentDrivers/Eway/Token.php b/app/PaymentDrivers/Eway/Token.php index 7b20629ca44f..63b83b9c4840 100644 --- a/app/PaymentDrivers/Eway/Token.php +++ b/app/PaymentDrivers/Eway/Token.php @@ -60,14 +60,14 @@ class Token if(!$response_status['success']) return $this->processUnsuccessfulPayment($response); - $payment = $this->processSuccessfulPayment($response); + $payment = $this->processSuccessfulPayment($response, $cgt); return $payment; } - private function processSuccessfulPayment($response) + private function processSuccessfulPayment($response, $cgt) { $amount = array_sum(array_column($this->eway_driver->payment_hash->invoices(), 'amount')) + $this->eway_driver->payment_hash->fee_total; @@ -103,7 +103,7 @@ class Token 'error_code' => $error_code, ]; - return $this->driver_class->processUnsuccessfulTransaction($data); + return $this->eway_driver->processUnsuccessfulTransaction($data); } diff --git a/app/PaymentDrivers/Stripe/SOFORT.php b/app/PaymentDrivers/Stripe/SOFORT.php index bf5c1e717d9a..618e4c196db4 100644 --- a/app/PaymentDrivers/Stripe/SOFORT.php +++ b/app/PaymentDrivers/Stripe/SOFORT.php @@ -114,7 +114,7 @@ class SOFORT { $server_response = $this->stripe->payment_hash->data; - $this->stripe->sendFailureMail($server_response); + $this->stripe->sendFailureMail("There was an undefined error processing this payment."); $message = [ 'server_response' => $server_response, diff --git a/config/app.php b/config/app.php index 79240cf39cdc..8e4e58375b7a 100644 --- a/config/app.php +++ b/config/app.php @@ -53,7 +53,8 @@ return [ */ 'url' => env('APP_URL', 'http://localhost'), - 'mix_url' => env('APP_URL', 'http://localhost'), + + 'mix_url' => env('MIX_ASSET_URL', env('APP_URL', null)), /* |-------------------------------------------------------------------------- | Application Timezone diff --git a/config/ninja.php b/config/ninja.php index 155797ed4127..d8292a5e6435 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.3.45', - 'app_tag' => '5.3.45', + 'app_version' => '5.3.46', + 'app_tag' => '5.3.46', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/config/session.php b/config/session.php index 4e0f66cda64c..1fba5eb342f5 100644 --- a/config/session.php +++ b/config/session.php @@ -196,6 +196,6 @@ return [ | */ - 'same_site' => 'lax', + 'same_site' => env('SESSION_SAME_SITE', 'lax'), ];