diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index 83c541452f98..d53d668ee2ef 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -96,7 +96,7 @@ class QuoteController extends Controller $client_contact = auth()->user(); $data['quotes'] = Quote::whereIn('id', $ids) - ->whereClientId($client_contact->client->id) + ->where('client_id', $client_contact->client_id) ->withTrashed() ->get(); @@ -195,10 +195,10 @@ class QuoteController extends Controller } } - if (count($ids) == 1) { + if ($quotes->count() == 1) { //forward client to the invoice if it exists - if ($quote->invoice()->exists()) { - return redirect()->route('client.invoice.show', $quote->invoice->hashed_id); + if ($quotes->first()->invoice()->exists()) { + return redirect()->route('client.invoice.show', $quotes->first()->invoice->hashed_id); } return redirect()->route('client.quote.show', $quotes->first()->hashed_id); diff --git a/phpstan.neon b/phpstan.neon index 2b60d7d20252..4514c5ecc89e 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -17,5 +17,5 @@ parameters: ignoreErrors: - '#Call to an undefined method [a-zA-Z0-9\\_]+::company\(\)#' - '#Call to an undefined method [a-zA-Z0-9\\_]+::entityFilter\(\)#' - - '#Call to an undefined method [a-zA-Z0-9\\_]+::withTrashed()\(\)#' + - '#Call to an undefined method [a-zA-Z0-9\\_]+::withTrashed\(\)#' - '#Undefined method#' \ No newline at end of file diff --git a/resources/views/portal/ninja2020/quotes/approve.blade.php b/resources/views/portal/ninja2020/quotes/approve.blade.php index 4eab04f48667..67fab2fe8f26 100644 --- a/resources/views/portal/ninja2020/quotes/approve.blade.php +++ b/resources/views/portal/ninja2020/quotes/approve.blade.php @@ -4,6 +4,7 @@ @push('head') + @endpush @@ -41,7 +42,7 @@

- {{ ctrans('texts.invoice') }} + {{ ctrans('texts.quote') }} ({{ $quote->number }}) @@ -82,11 +83,12 @@

+@endsection +@section('footer') + @include('portal.ninja2020.quotes.includes.user-input') @include('portal.ninja2020.invoices.includes.terms', ['entities' => $quotes, 'entity_type' => ctrans('texts.quote')]) @include('portal.ninja2020.invoices.includes.signature') - - @endsection @push('footer')