@php $primary = $setting?->primary_color ?: '#124a61'; $accent = $setting?->accent_color ?: '#2e86ab'; $companyName = $setting?->company_name ?: $quote->team?->name; $symbol = $currencySymbol ?: ''; $code = $quote->currency_code ?: ''; $money = function ($value) use ($symbol, $code) { $formatted = number_format((float) $value, 2); return ($symbol !== '' ? $symbol . ' ' : ($code !== '' ? $code . ' ' : '')) . $formatted; }; $logoUrl = $setting?->logoSrc(); $statusColors = [ 'DRAFT' => ['bg' => '#f1f5f9', 'text' => '#475569'], 'SENT' => ['bg' => '#e0f2fe', 'text' => '#0369a1'], 'ACCEPTED' => ['bg' => '#d1fae5', 'text' => '#047857'], 'REJECTED' => ['bg' => '#ffe4e6', 'text' => '#be123c'], 'EXPIRED' => ['bg' => '#fef3c7', 'text' => '#b45309'], ]; $statusColor = $statusColors[$quote->status] ?? $statusColors['DRAFT']; @endphp
{{-- Branded header --}}
@if ($logoUrl) {{ $companyName }} @endif

{{ $companyName }}

@if ($setting?->email)

{{ $setting->email }}

@endif @if ($setting?->phone)

{{ $setting->phone }}

@endif

{{ __('Quote') }}

{{ $quote->quote_number }}

{{ $expired && $quote->status === 'SENT' ? __('EXPIRED') : $quote->status }}
@if ($banner)
{{ $banner }}
@endif {{-- Meta --}}

{{ __('Prepared For') }}

{{ $quote->customer?->name ?: '—' }}

@if ($quote->customer?->address)

{{ $quote->customer->address }}

@endif @if ($quote->customer?->email)

{{ $quote->customer->email }}

@endif @if ($quote->customer?->phone)

{{ $quote->customer->phone }}

@endif
{{ __('Issued') }}
{{ $quote->created_at?->format('M j, Y') }}
@if ($quote->valid_until)
{{ __('Valid Until') }}
{{ $quote->valid_until->format('M j, Y') }}
@endif
{{ __('Currency') }}
{{ $code ?: '—' }}
{{-- Line items --}}
@forelse ($quote->lineItems as $line) @empty @endforelse
{{ __('Description') }} {{ __('Qty') }} {{ __('Unit Price') }} {{ __('Total') }}

{{ $line->name }}

@if ($line->description)

{!! nl2br(e($line->description)) !!}

@endif
{{ number_format((float) $line->qty, 2) }} {{ $money($line->unit_price) }} {{ $money($line->line_total) }}
{{ __('No items.') }}
{{-- Totals --}}
{{ __('Subtotal') }}
{{ $money($quote->subtotal) }}
@if ((float) $quote->discount > 0)
{{ __('Discount') }}
- {{ $money($quote->discount) }}
@endif
{{ __('VAT') }}
{{ $money($quote->vat) }}
@if ((float) $quote->surcharge > 0)
{{ \App\Models\PaymentMethod::feeLabel() }}
{{ $money($quote->surcharge) }}
@endif
{{ __('Total') }}
{{ $money($quote->total) }}
{{-- ============================ THE ANSWER ============================ --}}
@if ($quote->client_responded_at) @if ($quote->status === 'ACCEPTED')

{{ __('You accepted this quote') }}

{{ __('Accepted by :name on :date. We will be in touch about the next steps.', [ 'name' => $quote->client_responded_name, 'date' => $quote->client_responded_at->format('M j, Y'), ]) }}

@else

{{ __('You declined this quote') }}

{{ __('On :date. If that was a mistake, please get in touch.', ['date' => $quote->client_responded_at->format('M j, Y')]) }}

@if ($quote->decline_reason)
{{ $quote->decline_reason }}
@endif
@endif @elseif ($expired)

{{ __('This quote has expired') }}

{{ __('Prices move. Get in touch and we will gladly requote for you.') }}

@elseif ($canRespond) @if ($deciding === null)

{{ __('Happy with this?') }}

{{ __('Let us know either way. Accepting does not commit you to payment today.') }}

@elseif ($deciding === 'accept')

{{ __('Accept :total', ['total' => $money($quote->total)]) }}

{{ __('Type your name to confirm. This tells us to go ahead.') }}

@error('respondedName')

{{ $message }}

@enderror
@else

{{ __('Not this time?') }}

{{ __('Telling us why costs you nothing and helps us quote better next time.') }}

@error('respondedName')

{{ $message }}

@enderror @error('declineReason')

{{ $message }}

@enderror
@endif @endif
{{-- Notes / terms / banking --}} @php // The banking a customer would use to pay once they accept, // for this quote's currency only. Resolved through the shared // helper so this page and the quote PDF agree — including on // whether the details show at all, which follows the quote's // own payment method. $banking = \App\Support\DocumentBanking::for( $quote->team_id, $quote->currency_code, $setting, $quote->paymentMethod ); $hasBanking = $banking['showsBanking']; @endphp @if ($quote->notes || $setting?->terms_and_conditions || $hasBanking)
@if ($quote->notes)

{{ __('Notes') }}

{{ $quote->notes }}

@endif @if ($hasBanking)

{{ __('Banking Details') }} @if ($banking['accounts']->isNotEmpty()) · {{ $quote->currency_code }} @endif

@include('portal.partials.banking', ['banking' => $banking, 'setting' => $setting, 'currencyCode' => $quote->currency_code])
@endif @if ($setting?->terms_and_conditions)

{{ __('Terms & Conditions') }}

{!! \App\Support\Html::display($setting->terms_and_conditions) !!}
@endif
@endif

{{ __('Powered by') }} {{ $companyName }}