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/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) { 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/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 */ 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); } 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', ''),