From 8faa687ae40cc7faace45f4d559446fe5649458d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 12 Jan 2022 22:52:56 +1100 Subject: [PATCH 1/8] Return error message when dealing with clients who have been deleted --- app/Http/Middleware/CheckClientExistence.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/CheckClientExistence.php b/app/Http/Middleware/CheckClientExistence.php index a03f90528dcc..05ecd8214780 100644 --- a/app/Http/Middleware/CheckClientExistence.php +++ b/app/Http/Middleware/CheckClientExistence.php @@ -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()) { From a56490c465656976496ee7336f5fc3cf70e8749c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 13 Jan 2022 10:54:34 +1100 Subject: [PATCH 2/8] Set type of payment terms --- app/Jobs/Util/Import.php | 5 +++++ 1 file changed, 5 insertions(+) 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; From 8f2f6f93eafaed51c5a617b0a728153abd582c86 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 13 Jan 2022 10:56:41 +1100 Subject: [PATCH 3/8] Set env vars for same site variable --- config/session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'), ]; From 37d6701780fddd28c2d439570baf6d4a8151307c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 13 Jan 2022 15:10:43 +1100 Subject: [PATCH 4/8] Adjust invitation controller to deal with deleted contacts --- app/Http/Controllers/ClientPortal/InvitationController.php | 4 ++++ app/Http/Middleware/CheckClientExistence.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 05ecd8214780..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') From 08ac7478dd6ceba7a6b899887a7c65fc82862d0d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 13 Jan 2022 17:44:26 +1100 Subject: [PATCH 5/8] Set mix_url to be configurable with env vars --- config/app.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 8c66dbf29ed76a4c1c7ecdd4359eef5586a5fdaf Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 14 Jan 2022 09:28:05 +1100 Subject: [PATCH 6/8] Fix error reporting for Stripe Sofort --- app/PaymentDrivers/Stripe/SOFORT.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, From d2e72e1a5efb89c3d2c04b741bd74dc2a610a50a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 14 Jan 2022 15:50:09 +1100 Subject: [PATCH 7/8] Fixes for eWay --- app/PaymentDrivers/Eway/Token.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } From 435f9caee619b4fc9a411622149a6e0f2c503b30 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 14 Jan 2022 16:05:43 +1100 Subject: [PATCH 8/8] v5.3.46 --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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/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', ''),