From 0ca668f7ff49547eeb8d858469b29f8a7d3f089d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 4 Aug 2022 16:41:56 +1000 Subject: [PATCH 1/4] Fixes for null contact --- app/Services/Payment/SendEmail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Payment/SendEmail.php b/app/Services/Payment/SendEmail.php index 39c3e063f7fc..be7326098c9c 100644 --- a/app/Services/Payment/SendEmail.php +++ b/app/Services/Payment/SendEmail.php @@ -36,7 +36,7 @@ class SendEmail $contact = $this->payment->client->contacts()->first(); - if ($contact->email) + if ($contact?->email) EmailPayment::dispatch($this->payment, $this->payment->company, $contact); } From e976a4d8fbc2b966137e398ff38f7c4eae78dfee Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 4 Aug 2022 17:12:07 +1000 Subject: [PATCH 2/4] Fixes for company logos in client portal --- app/Http/Controllers/Auth/ContactLoginController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Auth/ContactLoginController.php b/app/Http/Controllers/Auth/ContactLoginController.php index 4589bf548ac2..e64acd510d6e 100644 --- a/app/Http/Controllers/Auth/ContactLoginController.php +++ b/app/Http/Controllers/Auth/ContactLoginController.php @@ -37,7 +37,7 @@ class ContactLoginController extends Controller $this->middleware('guest:contact', ['except' => ['logout']]); } - public function showLoginForm(Request $request) + public function showLoginForm(Request $request, $company_key = false) { $company = false; $account = false; @@ -49,6 +49,9 @@ class ContactLoginController extends Controller elseif($request->has('company_key')){ MultiDB::findAndSetDbByCompanyKey($request->input('company_key')); $company = Company::where('company_key', $request->input('company_key'))->first(); + }elseif($company_key){ + MultiDB::findAndSetDbByCompanyKey($company_key); + $company = Company::where('company_key', $company_key)->first(); } if ($company) { From 0c05370686d6fd60950914d9904fe7161c7c3aa1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 5 Aug 2022 08:08:19 +1000 Subject: [PATCH 3/4] Move payment numbering into service --- app/Models/Vendor.php | 5 +++++ app/Services/Invoice/MarkPaid.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Models/Vendor.php b/app/Models/Vendor.php index d7af8b867c98..f267e9201cfa 100644 --- a/app/Models/Vendor.php +++ b/app/Models/Vendor.php @@ -172,6 +172,11 @@ class Vendor extends BaseModel return $this->company->company_key.'/'.$this->vendor_hash.'/'.$contact_key.'/purchase_orders/'; } + public function locale() + { + return $this->company->locale(); + } + public function country() { return $this->belongsTo(Country::class); diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index f7957b5439de..e0a49b57cd0b 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -55,7 +55,6 @@ class MarkPaid extends AbstractService $payment->amount = $this->invoice->balance; $payment->applied = $this->invoice->balance; - $payment->number = $this->getNextPaymentNumber($this->invoice->client, $payment); $payment->status_id = Payment::STATUS_COMPLETED; $payment->client_id = $this->invoice->client_id; $payment->transaction_reference = ctrans('texts.manual_entry'); @@ -74,6 +73,8 @@ class MarkPaid extends AbstractService $payment->saveQuietly(); + $payment->service()->applyNumber()->save(); + $this->setExchangeRate($payment); /* Create a payment relationship to the invoice entity */ From 8df82cf2e5368099b8000a8fcc36f637a04089d6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 5 Aug 2022 09:54:05 +1000 Subject: [PATCH 4/4] v5.5.7 --- VERSION.txt | 2 +- app/Jobs/Account/CreateAccount.php | 1 + config/ninja.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 29fe95d7a39b..322240ef0e97 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.6 \ No newline at end of file +5.5.7 \ No newline at end of file diff --git a/app/Jobs/Account/CreateAccount.php b/app/Jobs/Account/CreateAccount.php index 9ab7f99cd79f..70fe64a2606f 100644 --- a/app/Jobs/Account/CreateAccount.php +++ b/app/Jobs/Account/CreateAccount.php @@ -84,6 +84,7 @@ class CreateAccount if (Ninja::isHosted()) { $sp794f3f->hosted_client_count = config('ninja.quotas.free.clients'); $sp794f3f->hosted_company_count = config('ninja.quotas.free.max_companies'); + $sp794f3f->account_sms_verified = true; // $sp794f3f->trial_started = now(); // $sp794f3f->trial_plan = 'pro'; } diff --git a/config/ninja.php b/config/ninja.php index a10ffce554fe..8d50a532dd6a 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.5.6', - 'app_tag' => '5.5.6', + 'app_version' => '5.5.7', + 'app_tag' => '5.5.7', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),