From 3d36bcc0dbd6f56b51babff173785dc75c7f9214 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 1 Mar 2023 10:54:56 +1100 Subject: [PATCH 1/5] Ensure descriptions are translated --- app/PaymentDrivers/BaseDriver.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index f68391de2734..b746e17299ca 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -32,6 +32,7 @@ use App\Utils\Traits\MakesHash; use App\Exceptions\PaymentFailed; use App\Jobs\Mail\NinjaMailerJob; use App\Models\ClientGatewayToken; +use Illuminate\Support\Facades\App; use App\Jobs\Mail\NinjaMailerObject; use App\Utils\Traits\SystemLogTrait; use App\Events\Invoice\InvoiceWasPaid; @@ -726,6 +727,11 @@ class BaseDriver extends AbstractPaymentDriver */ public function getDescription(bool $abbreviated = true) { + App::forgetInstance('translator'); + $t = app('translator'); + $t->replace(Ninja::transformTranslations($this->client->getMergedSettings())); + App::setLocale($this->client->company->locale()); + if (! $this->payment_hash || !$this->client) { return 'No description'; } From e89ed1185ab469c80ab8dfa2b8015515ed134b5c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 1 Mar 2023 10:55:57 +1100 Subject: [PATCH 2/5] Remove trailing . from subscription title --- resources/views/portal/ninja2020/subscriptions/show.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/portal/ninja2020/subscriptions/show.blade.php b/resources/views/portal/ninja2020/subscriptions/show.blade.php index 997115475984..ae390898ac9e 100644 --- a/resources/views/portal/ninja2020/subscriptions/show.blade.php +++ b/resources/views/portal/ninja2020/subscriptions/show.blade.php @@ -6,7 +6,7 @@

- {{ $subscription->name }}. + {{ $subscription->name }}

From fde68813d8bc86138a245394b514b1939dc75d86 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 1 Mar 2023 10:57:35 +1100 Subject: [PATCH 3/5] Add translations for change plan --- lang/en/texts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/en/texts.php b/lang/en/texts.php index a3b1d7f30dd0..72e62179c4d8 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5007,7 +5007,7 @@ $LANG = array( 'bank_name' => 'Bank Name', 'bank_code' => 'Bank Code', 'bic' => 'BIC', - + 'change_plan_description' => 'Upgrade or downgrade your current plan.', ); From fa26c29d5bb47ef084ad46a54e2a3865fafb4ddb Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 1 Mar 2023 11:16:18 +1100 Subject: [PATCH 4/5] Return redirects --- app/Services/Subscription/SubscriptionService.php | 8 ++++---- lang/en/texts.php | 2 ++ .../views/portal/ninja2020/subscriptions/show.blade.php | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Services/Subscription/SubscriptionService.php b/app/Services/Subscription/SubscriptionService.php index 08d803d52ef5..87848cf0abdb 100644 --- a/app/Services/Subscription/SubscriptionService.php +++ b/app/Services/Subscription/SubscriptionService.php @@ -88,7 +88,6 @@ class SubscriptionService $recurring_invoice = $recurring_invoice_repo->save([], $recurring_invoice); $recurring_invoice->auto_bill = $this->subscription->auto_bill; - /* Start the recurring service */ $recurring_invoice->service() ->start() @@ -111,9 +110,10 @@ class SubscriptionService 'account_key' => $recurring_invoice->client->custom_value2, ]; - $response = $this->triggerWebhook($context); + $response = $this->triggerWebhook($context); + + return $this->handleRedirect('/client/recurring_invoices/'.$recurring_invoice->hashed_id); - $this->handleRedirect('/client/recurring_invoices/'.$recurring_invoice->hashed_id); } else { $invoice = Invoice::withTrashed()->find($payment_hash->fee_invoice_id); @@ -131,7 +131,7 @@ class SubscriptionService /* 06-04-2022 */ /* We may not be in a state where the user is present */ if (auth()->guard('contact')) { - $this->handleRedirect('/client/invoices/'.$this->encodePrimaryKey($payment_hash->fee_invoice_id)); + return $this->handleRedirect('/client/invoices/'.$this->encodePrimaryKey($payment_hash->fee_invoice_id)); } } } diff --git a/lang/en/texts.php b/lang/en/texts.php index 72e62179c4d8..18fa7cc2195a 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5008,6 +5008,8 @@ $LANG = array( 'bank_code' => 'Bank Code', 'bic' => 'BIC', 'change_plan_description' => 'Upgrade or downgrade your current plan.', + 'add_company_logo' => 'Add Logo', + 'add_stripe' => 'Add Stripe', ); diff --git a/resources/views/portal/ninja2020/subscriptions/show.blade.php b/resources/views/portal/ninja2020/subscriptions/show.blade.php index ae390898ac9e..a2e226cd928c 100644 --- a/resources/views/portal/ninja2020/subscriptions/show.blade.php +++ b/resources/views/portal/ninja2020/subscriptions/show.blade.php @@ -95,7 +95,7 @@ @if($invoice->subscription && $invoice->subscription->allow_plan_changes)

{{ ctrans('texts.change_plan') }}

-

Upgrade or downgrade your current plan.

+

{{ ctrans('texts.change_plan_description') }}

@foreach($invoice->subscription->service()->getPlans() as $subscription) From a9541f08b72062e2db3ee78f134d317bcdfe1aee Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 1 Mar 2023 12:56:25 +1100 Subject: [PATCH 5/5] Fixes for react build --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 1885318d63c4..ad9f18701a13 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.77 \ No newline at end of file +5.5.78 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index cf403ccda892..1b41cbad3624 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.77', - 'app_tag' => '5.5.77', + 'app_version' => '5.5.78', + 'app_tag' => '5.5.78', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),