diff --git a/app/Http/ViewComposers/PortalComposer.php b/app/Http/ViewComposers/PortalComposer.php index 10261419bffd..5c0468fe2a65 100644 --- a/app/Http/ViewComposers/PortalComposer.php +++ b/app/Http/ViewComposers/PortalComposer.php @@ -138,6 +138,10 @@ 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..0f48142f0e4a 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/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');