diff --git a/VERSION.txt b/VERSION.txt index 75d1c3cf3216..f649ec23cd96 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.90 \ No newline at end of file +5.5.92 \ No newline at end of file diff --git a/app/Http/Controllers/ClientPortal/PaymentController.php b/app/Http/Controllers/ClientPortal/PaymentController.php index 61a08aea9c3e..680d629932e9 100644 --- a/app/Http/Controllers/ClientPortal/PaymentController.php +++ b/app/Http/Controllers/ClientPortal/PaymentController.php @@ -87,7 +87,7 @@ class PaymentController extends Controller return $this->render('payments.show', [ 'payment' => $payment, 'bank_details' => $payment_intent ? $data : false, - 'currency' => strtolower($payment->currency->code), + 'currency' => $payment->currency ? strtolower($payment->currency->code) : strtolower($payment->client->currency()->code), ]); } diff --git a/app/Http/Controllers/ClientPortal/PrePaymentController.php b/app/Http/Controllers/ClientPortal/PrePaymentController.php new file mode 100644 index 000000000000..9f62ab3ec962 --- /dev/null +++ b/app/Http/Controllers/ClientPortal/PrePaymentController.php @@ -0,0 +1,41 @@ +guard('contact')->user()->client->getSetting('client_initiated_payments_minimum'); + $data['title'] = ctrans('texts.amount'). " " .auth()->guard('contact')->user()->client->currency()->code." (".auth()->guard('contact')->user()->client->currency()->symbol . ")"; + return $this->render('pre_payments.index', $data); + } + +} \ No newline at end of file diff --git a/app/Http/ViewComposers/PortalComposer.php b/app/Http/ViewComposers/PortalComposer.php index 10261419bffd..d1e4134d511e 100644 --- a/app/Http/ViewComposers/PortalComposer.php +++ b/app/Http/ViewComposers/PortalComposer.php @@ -138,6 +138,12 @@ class PortalComposer $data[] = ['title' => ctrans('texts.subscriptions'), 'url' => 'client.subscriptions.index', 'icon' => 'calendar']; } + /* + if($this->settings->client_initiated_payments) { + $data[] = ['title' => ctrans('texts.pre_payment'), 'url' => 'client.pre_payments.index', 'icon' => 'dollar-sign']; + } + */ + return $data; } } diff --git a/app/Services/Quote/GetQuotePdf.php b/app/Services/Quote/GetQuotePdf.php index 09249ec9ff95..095b62650079 100644 --- a/app/Services/Quote/GetQuotePdf.php +++ b/app/Services/Quote/GetQuotePdf.php @@ -19,7 +19,7 @@ use Illuminate\Support\Facades\Storage; class GetQuotePdf extends AbstractService { - public function __construct(Quote $quote, ClientContact $contact = null) + public function __construct(public Quote $quote, public ?ClientContact $contact = null) { $this->quote = $quote; @@ -34,6 +34,9 @@ class GetQuotePdf extends AbstractService $invitation = $this->quote->invitations->where('client_contact_id', $this->contact->id)->first(); + if(!$invitation) + $invitation = $this->quote->invitations->first(); + $path = $this->quote->client->quote_filepath($invitation); $file_path = $path . $this->quote->numberFormatter() . '.pdf'; @@ -45,6 +48,6 @@ class GetQuotePdf extends AbstractService $file_path = (new CreateEntityPdf($invitation))->handle(); return $file_path; - //return Storage::disk($disk)->path($file_path); + } } diff --git a/config/ninja.php b/config/ninja.php index e56a4a0696df..0d7cff848858 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.90', - 'app_tag' => '5.5.90', + 'app_version' => '5.5.92', + 'app_tag' => '5.5.92', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/lang/en/texts.php b/lang/en/texts.php index 8d6ff548d554..0c91c98bcd70 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5020,7 +5020,7 @@ $LANG = array( 'white_label_body' => 'Thank you for purchasing a white label license.

Your license key is:

:license_key', 'payment_type_Klarna' => 'Klarna', 'payment_type_Interac E Transfer' => 'Interac E Transfer', - + 'pre_payment' => 'Pre Payment', ); diff --git a/public/images/svg/dark/dollar-sign.svg b/public/images/svg/dark/dollar-sign.svg new file mode 100644 index 000000000000..1a124d269619 --- /dev/null +++ b/public/images/svg/dark/dollar-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/images/svg/dollar-sign.svg b/public/images/svg/dollar-sign.svg new file mode 100644 index 000000000000..3a249fd44886 --- /dev/null +++ b/public/images/svg/dollar-sign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/routes/client.php b/routes/client.php index b77efaf61c7b..e7439906f6e5 100644 --- a/routes/client.php +++ b/routes/client.php @@ -1,19 +1,20 @@ name('client.catchall')->middleware(['domain_db', 'contact_account','locale']); //catch all @@ -66,6 +67,9 @@ Route::group(['middleware' => ['auth:contact', 'locale', 'domain_db','check_clie Route::get('payments', [App\Http\Controllers\ClientPortal\PaymentController::class, 'index'])->name('payments.index')->middleware('portal_enabled'); Route::get('payments/{payment}', [App\Http\Controllers\ClientPortal\PaymentController::class, 'show'])->name('payments.show'); + Route::get('pre_payments', [PrePaymentController::class, 'index'])->name('pre_payments.index')->middleware('portal_enabled'); + Route::get('pre_payments/process', [PrePaymentController::class, 'process'])->name('pre_payments.process')->middleware('portal_enabled'); + Route::get('profile/{client_contact}/edit', [App\Http\Controllers\ClientPortal\ProfileController::class, 'edit'])->name('profile.edit'); Route::put('profile/{client_contact}/edit', [App\Http\Controllers\ClientPortal\ProfileController::class, 'update'])->name('profile.update'); Route::put('profile/{client_contact}/edit_client', [App\Http\Controllers\ClientPortal\ProfileController::class, 'updateClient'])->name('profile.edit_client'); diff --git a/tests/Feature/Email/EmailServiceTest.php b/tests/Feature/Email/EmailServiceTest.php index 3f14e6e518df..17efec114d43 100644 --- a/tests/Feature/Email/EmailServiceTest.php +++ b/tests/Feature/Email/EmailServiceTest.php @@ -109,28 +109,6 @@ class EmailServiceTest extends TestCase $this->assertFalse($this->email_service->preFlightChecksFail()); } - public function testClientMailersAreUnCapped() - { - config(['ninja.environment' => 'hosted']); - - Cache::put($this->account->key, 1000000); - - collect([ - 'gmail', - 'office365', - 'client_postmark', - 'client_mailgun']) - ->each(function ($mailer) { - $this->email_object->settings->email_sending_method = $mailer; - - $this->assertFalse($this->email_service->preFlightChecksFail()); - }); - - $this->email_object->settings->email_sending_method = 'postmark'; - - $this->assertTrue($this->email_service->preFlightChecksFail()); - } - public function testFlaggedInvalidEmailsPrevented() { config(['ninja.environment' => 'hosted']);