From a2b8d573135feba904e19a2d2c5c8fa611d455c9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 24 Aug 2022 18:28:08 +1000 Subject: [PATCH] Ensure correct PDF is displayed to the contact --- VERSION.txt | 2 +- app/Http/Controllers/ClientPortal/CreditController.php | 1 + app/Http/Controllers/ClientPortal/InvoiceController.php | 1 + app/Http/Controllers/ClientPortal/QuoteController.php | 1 + .../Controllers/VendorPortal/PurchaseOrderController.php | 1 + app/Http/Livewire/QuotesTable.php | 8 ++++---- config/ninja.php | 4 ++-- .../portal/ninja2020/components/pdf-viewer.blade.php | 4 ++-- resources/views/portal/ninja2020/credits/show.blade.php | 2 +- .../portal/ninja2020/invoices/show-fullscreen.blade.php | 2 +- resources/views/portal/ninja2020/invoices/show.blade.php | 2 +- .../views/portal/ninja2020/purchase_orders/show.blade.php | 2 +- resources/views/portal/ninja2020/quotes/show.blade.php | 2 +- 13 files changed, 18 insertions(+), 14 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index b26261575073..62f9457511f8 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.15 \ No newline at end of file +6 \ No newline at end of file diff --git a/app/Http/Controllers/ClientPortal/CreditController.php b/app/Http/Controllers/ClientPortal/CreditController.php index 9b6ee3fefed8..c49606ae700e 100644 --- a/app/Http/Controllers/ClientPortal/CreditController.php +++ b/app/Http/Controllers/ClientPortal/CreditController.php @@ -35,6 +35,7 @@ class CreditController extends Controller $data = [ 'credit' => $credit, 'key' => $invitation ? $invitation->key : false, + 'invitation' => $invitation ]; if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) { diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index b5f42beb0783..2270a5f8350e 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -69,6 +69,7 @@ class InvoiceController extends Controller $data = [ 'invoice' => $invoice, + 'invitation' => $invitation, 'key' => $invitation ? $invitation->key : false, ]; diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index 8cf4d3d9a06f..ccaa48f98e57 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -61,6 +61,7 @@ class QuoteController extends Controller $data = [ 'quote' => $quote, 'key' => $invitation ? $invitation->key : false, + 'invitation' => $invitation ]; if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) { diff --git a/app/Http/Controllers/VendorPortal/PurchaseOrderController.php b/app/Http/Controllers/VendorPortal/PurchaseOrderController.php index a0361a6a09a9..ba2524bf0829 100644 --- a/app/Http/Controllers/VendorPortal/PurchaseOrderController.php +++ b/app/Http/Controllers/VendorPortal/PurchaseOrderController.php @@ -99,6 +99,7 @@ class PurchaseOrderController extends Controller 'settings' => $purchase_order->company->settings, 'sidebar' => $this->sidebarMenu(), 'company' => $purchase_order->company, + 'invitation' => $invitation ]; if ($request->query('mode') === 'fullscreen') { diff --git a/app/Http/Livewire/QuotesTable.php b/app/Http/Livewire/QuotesTable.php index a82f72898210..4600a0f7a9d9 100644 --- a/app/Http/Livewire/QuotesTable.php +++ b/app/Http/Livewire/QuotesTable.php @@ -28,17 +28,17 @@ class QuotesTable extends Component public $company; - public $sort_field = 'status_id'; // Default sortBy. Feel free to change or pull from client/company settings. + public $sort = 'status_id'; // Default sortBy. Feel free to change or pull from client/company settings. public $sort_asc = true; public function sortBy($field) { - $this->sort_field === $field + $this->sort === $field ? $this->sort_asc = ! $this->sort_asc : $this->sort_asc = true; - $this->sort_field = $field; + $this->sort = $field; } public function mount() @@ -51,7 +51,7 @@ class QuotesTable extends Component $query = Quote::query() ->with('client.gateway_tokens', 'company', 'client.contacts') - ->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc'); + ->orderBy($this->sort, $this->sort_asc ? 'asc' : 'desc'); if (count($this->status) > 0) { diff --git a/config/ninja.php b/config/ninja.php index 6bacd49a47f5..d0593cbac99b 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.15', - 'app_tag' => '5.5.15', + 'app_version' => '5.5.16', + 'app_tag' => '5.5.16', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/resources/views/portal/ninja2020/components/pdf-viewer.blade.php b/resources/views/portal/ninja2020/components/pdf-viewer.blade.php index ef1bcef4ec0d..9ef7d22ba57b 100644 --- a/resources/views/portal/ninja2020/components/pdf-viewer.blade.php +++ b/resources/views/portal/ninja2020/components/pdf-viewer.blade.php @@ -3,7 +3,7 @@ @endphp @push('head') - + @endpush @@ -86,7 +86,7 @@ @else - + @endif diff --git a/resources/views/portal/ninja2020/credits/show.blade.php b/resources/views/portal/ninja2020/credits/show.blade.php index 0504dce30de7..0d802adc7d79 100644 --- a/resources/views/portal/ninja2020/credits/show.blade.php +++ b/resources/views/portal/ninja2020/credits/show.blade.php @@ -33,7 +33,7 @@ @include('portal.ninja2020.components.entity-documents', ['entity' => $credit]) - @include('portal.ninja2020.components.pdf-viewer', ['entity' => $credit]) + @include('portal.ninja2020.components.pdf-viewer', ['entity' => $credit, 'invitation' => $invitation]) @endsection diff --git a/resources/views/portal/ninja2020/invoices/show-fullscreen.blade.php b/resources/views/portal/ninja2020/invoices/show-fullscreen.blade.php index f08c3dcff56b..d15cebda832d 100644 --- a/resources/views/portal/ninja2020/invoices/show-fullscreen.blade.php +++ b/resources/views/portal/ninja2020/invoices/show-fullscreen.blade.php @@ -1,2 +1,2 @@ - diff --git a/resources/views/portal/ninja2020/invoices/show.blade.php b/resources/views/portal/ninja2020/invoices/show.blade.php index 168c6f092aa2..6fb066a2ee99 100644 --- a/resources/views/portal/ninja2020/invoices/show.blade.php +++ b/resources/views/portal/ninja2020/invoices/show.blade.php @@ -96,7 +96,7 @@ @endif @include('portal.ninja2020.components.entity-documents', ['entity' => $invoice]) - @include('portal.ninja2020.components.pdf-viewer', ['entity' => $invoice]) + @include('portal.ninja2020.components.pdf-viewer', ['entity' => $invoice, 'invitation' => $invitation]) @include('portal.ninja2020.invoices.includes.terms', ['entities' => [$invoice], 'entity_type' => ctrans('texts.invoice')]) @include('portal.ninja2020.invoices.includes.signature') @endsection diff --git a/resources/views/portal/ninja2020/purchase_orders/show.blade.php b/resources/views/portal/ninja2020/purchase_orders/show.blade.php index 3f9ad02d9722..c95648b5d875 100644 --- a/resources/views/portal/ninja2020/purchase_orders/show.blade.php +++ b/resources/views/portal/ninja2020/purchase_orders/show.blade.php @@ -46,7 +46,7 @@ @endif @include('portal.ninja2020.components.entity-documents', ['entity' => $purchase_order]) - @include('portal.ninja2020.components.pdf-viewer', ['entity' => $purchase_order]) + @include('portal.ninja2020.components.pdf-viewer', ['entity' => $purchase_order, 'invitation' => $invitation]) @include('portal.ninja2020.invoices.includes.terms', ['entities' => [$purchase_order], 'entity_type' => ctrans('texts.purchase_order')]) @include('portal.ninja2020.invoices.includes.signature') @endsection diff --git a/resources/views/portal/ninja2020/quotes/show.blade.php b/resources/views/portal/ninja2020/quotes/show.blade.php index 9e54707f0a5b..fe80c8c6027a 100644 --- a/resources/views/portal/ninja2020/quotes/show.blade.php +++ b/resources/views/portal/ninja2020/quotes/show.blade.php @@ -105,7 +105,7 @@ @endif @include('portal.ninja2020.components.entity-documents', ['entity' => $quote]) - @include('portal.ninja2020.components.pdf-viewer', ['entity' => $quote]) + @include('portal.ninja2020.components.pdf-viewer', ['entity' => $quote, 'invitation' => $invitation]) @include('portal.ninja2020.invoices.includes.terms', ['entities' => [$quote], 'entity_type' => ctrans('texts.quote')]) @include('portal.ninja2020.invoices.includes.signature') @endsection