diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index 9b7e3ef1697f..8eddfce00646 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -54,11 +54,11 @@ class InvoiceController extends Controller 'invoice' => $invoice, ]; - if ($request->query('mode') === 'portal') { - return $this->render('invoices.show', $data); + if ($request->query('mode') === 'fullscreen') { + return response()->file($invoice->pdf_file_path(null, 'path')); } - return $this->render('invoices.show.fullscreen', $data); + return $this->render('invoices.show', $data); } /** diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index 85e7ab4a07f6..e0c3a1ba99af 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -35,7 +35,7 @@ class QuoteController extends Controller * * @param ShowQuoteRequest $request * @param Quote $quote - * @return Factory|View + * @return Factory|View|\Symfony\Component\HttpFoundation\BinaryFileResponse */ public function show(ShowQuoteRequest $request, Quote $quote) { @@ -43,11 +43,11 @@ class QuoteController extends Controller 'quote' => $quote, ]; - if ($request->query('mode') === 'portal') { - return $this->render('quotes.show', $data); + if ($request->query('mode') === 'fullscreen') { + return response()->file($quote->pdf_file_path(null, 'path')); } - return $this->render('quotes.show.fullscreen', $data); + return $this->render('quotes.show', $data); } public function bulk(ProcessQuotesInBulkRequest $request) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 55b12addcdba..8b5d33e6e6b8 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -367,13 +367,13 @@ class Invoice extends BaseModel return $invoice_calc->build(); } - public function pdf_file_path($invitation = null) + public function pdf_file_path($invitation = null, string $type = 'url') { if (! $invitation) { $invitation = $this->invitations->first(); } - $storage_path = Storage::url($this->client->invoice_filepath().$this->number.'.pdf'); + $storage_path = Storage::$type($this->client->invoice_filepath().$this->number.'.pdf'); if (! Storage::exists($this->client->invoice_filepath().$this->number.'.pdf')) { event(new InvoiceWasUpdated($this, $this->company, Ninja::eventVars())); diff --git a/app/Models/Quote.php b/app/Models/Quote.php index 8ce236a5574f..b02b0f99f7da 100644 --- a/app/Models/Quote.php +++ b/app/Models/Quote.php @@ -187,13 +187,13 @@ class Quote extends BaseModel return new QuoteService($this); } - public function pdf_file_path($invitation = null) + public function pdf_file_path($invitation = null, string $type = 'url') { if (! $invitation) { $invitation = $this->invitations->where('client_contact_id', $this->client->primary_contact()->first()->id)->first(); } - $storage_path = Storage::url($this->client->quote_filepath().$this->number.'.pdf'); + $storage_path = Storage::$type($this->client->quote_filepath().$this->number.'.pdf'); if (Storage::exists($this->client->quote_filepath().$this->number.'.pdf')) { return $storage_path; diff --git a/resources/views/portal/ninja2020/invoices/show.blade.php b/resources/views/portal/ninja2020/invoices/show.blade.php index 24d83f95e5b3..604e2c350d6e 100644 --- a/resources/views/portal/ninja2020/invoices/show.blade.php +++ b/resources/views/portal/ninja2020/invoices/show.blade.php @@ -101,14 +101,14 @@ - {{ ctrans('texts.page') }}: + {{ ctrans('texts.page') }}: {{ strtolower(ctrans('texts.of')) }}
-
+ +
- +
@endsection diff --git a/resources/views/portal/ninja2020/quotes/show.blade.php b/resources/views/portal/ninja2020/quotes/show.blade.php index cc7232016a96..e53b9363a9d0 100644 --- a/resources/views/portal/ninja2020/quotes/show.blade.php +++ b/resources/views/portal/ninja2020/quotes/show.blade.php @@ -20,73 +20,48 @@ @endif -
+ -
+
+ + @endsection @section('footer')