@php $tz = config('app.display_timezone'); $statusColors = ['DRAFT' => 'slate', 'SENT' => 'sky', 'ACCEPTED' => 'emerald', 'REJECTED' => 'rose', 'EXPIRED' => 'amber']; $approvalColors = ['approved' => 'emerald', 'declined' => 'rose', 'pending' => 'amber']; $approvalLabels = ['approved' => __('Approved'), 'declined' => __('Declined'), 'pending' => __('Waiting for a director')]; @endphp
{{-- The quote request, and who builds quotes --}}

{{ __('Quote request') }}

@if ($request)

{{ __('With :who', ['who' => $request->assignee?->name ?? __('Administration')]) }} @if ($request->due_at) · {{ __('needed by :date', ['date' => $request->due_at->copy()->timezone($tz)->format('D j M')]) }} @endif

{{ \Illuminate\Support\Str::limit((string) $request->description, 240) }}

@else

{{ __('Administration builds and prices quotes. Ask for one with the brief, then follow it up with the client.') }}

@endif
@if ($canQuote && $opportunity->isOpen()) {{ __('Link a quote') }} {{ __('Create quote') }} @elseif ($canEdit && $opportunity->isOpen() && ! $request) {{ __('Request a quote') }} @endif
{{-- Every quote on this opportunity --}}

{{ __('Quotes') }}

{{ __('Revisions and alternatives are listed separately and never added together.') }}

@forelse ($quotes as $quote) @php $d = $discounts[$quote->id]; @endphp @empty @endforelse
{{ __('Quote') }} {{ __('Status') }} {{ __('Discount') }} {{ __('Valid until') }} {{ __('Total') }} {{ __('Actions') }}

{{ $quote->quote_number }} @if ($quote->id === $acceptedId) {{ __('Accepted one') }} @endif

{{ __('By :who, :date', ['who' => $quote->creator?->name ?? __('unknown'), 'date' => $quote->created_at?->copy()->timezone($tz)->format('j M Y')]) }}

@if ($quote->client_responded_at)

{{ __('Client answered :date as :name', ['date' => $quote->client_responded_at->copy()->timezone($tz)->format('j M Y'), 'name' => $quote->client_responded_name]) }}

@endif
{{ __(ucfirst(strtolower($quote->status))) }} @if ($d['amount'] > 0) {{ $quote->currency_code }} {{ number_format($d['amount'], 2) }} @if ($d['approved']) {{ __('Approved') }} @elseif ($d['request']?->status === 'cancelled') {{ __('Declined') }} @elseif ($d['request']) {{ __('Waiting for a director') }} @else {{ __('Needs approval') }} @endif @else {{ __('None') }} @endif {{ $quote->valid_until?->format('j M Y') ?? __('Not set') }} {{ $quote->currency_code }} {{ number_format((float) $quote->total, 2) }}
@if ($canEdit && $d['amount'] > 0 && ! $d['approved'] && ! $d['request']) @endif @if ($canViewQuotes) {{ __('View') }} @endif @if ($canQuote && in_array($quote->status, ['DRAFT', 'SENT'], true)) {{ __('Edit') }} @endif
@include('livewire.crm.partials.paginator', ['rows' => $quotes])
{{-- Director approvals (D5) --}}

{{ __('Director approvals') }}

{{ __('Discounts, credit terms and delivery-date exceptions need a director\'s recorded approval.') }}

@if ($canEdit && $opportunity->isOpen()) {{ __('Ask for an exception') }} @endif
@forelse ($approvals as $approval) @php $status = $approvalStatus[$approval->id]; @endphp @empty @endforelse
{{ __('Asked') }} {{ __('Request') }} {{ __('Decision') }} {{ __('Actions') }}
{{ $approval->created_at?->copy()->timezone($tz)->format('j M Y') }}

{{ $approval->creator?->name }}

{{ $approval->title }}

@if ($approval->description)

{{ $approval->description }}

@endif
{{ $approvalLabels[$status] }} @if ($status !== 'pending')

{{ $approval->completedBy?->name }}, {{ $approval->completed_at?->copy()->timezone($tz)->format('j M Y H:i') }}

@if ($approval->outcome)

{{ $approval->outcome }}

@endif @endif
@if ($isDirector && $approval->isOpen())
@endif
@include('livewire.crm.partials.paginator', ['rows' => $approvals])
{{-- Request a quote --}} {{ __('Request a quote') }}
{{ __('Cancel') }} {{ __('Send request') }} {{ __('Sending…') }}
{{-- Link an existing quote --}} {{ __('Link a quote') }}
@if ($linkable->isEmpty())

{{ __('This organisation has no quotes that are not already on an opportunity.') }}

@endif
{{ __('Cancel') }} {{ __('Link quote') }}
{{-- Ask for an exception --}} {{ __('Ask a director for an exception') }}

{{ __('A discount is approved on its quote: the quote asks the directors when it is sent.') }}

{{ __('Cancel') }} {{ __('Ask the directors') }}
{{-- A director's decision --}} {{ $decision === 'decline' ? __('Decline') : __('Approve') }} @if ($decidingTask)

{{ $decidingTask->title }}

@if ($decidingTask->description)

{{ $decidingTask->description }}

@endif @endif
{{ __('Cancel') }} {{ $decision === 'decline' ? __('Decline') : __('Approve') }}