@php $sv = $proposal->status instanceof \App\Enums\ProposalStatus ? $proposal->status->value : $proposal->status; $currencySymbol = $proposal->currency instanceof \App\Enums\Currency ? $proposal->currency->symbol() : (string) $proposal->currency; $currencyCode = $proposal->currency instanceof \App\Enums\Currency ? $proposal->currency->value : (string) $proposal->currency; $daysLeft = (int) now()->diffInDays($proposal->valid_until, false); $isAlreadyActioned = in_array($sv, ['approved', 'rejected']); $isApproved = $sv === 'approved'; $isRejected = $sv === 'rejected'; @endphp
{{-- Already actioned banner --}} @if ($isApproved)

This proposal has been approved. Thank you!

@elseif ($isRejected)

This proposal has been declined.

@endif {{-- Header card --}}
{{-- Company branding --}}
@if ($company && $company->logo_path) {{ $company->name }} @else
{{ strtoupper(substr($company->name ?? 'E', 0, 1)) }}
@endif

{{ $company->name ?? 'Echt Solutions' }}

Agency Management

{{-- Proposal reference --}}

Proposal

Valid until {{ $proposal->valid_until->format('d M Y') }}

@if (!$isAlreadyActioned) @if ($daysLeft > 0)

{{ $daysLeft }} {{ Str::plural('day', $daysLeft) }} remaining

@else

Expires today

@endif @endif
{{-- Hero section --}}

Prepared for

{{ $proposal->client->name }}

{{ $proposal->title }}

@if ($proposal->project)

Project: {{ $proposal->project->title }}

@endif
{{-- Scope of Work --}}

Scope of Work

{{ $proposal->scope }}
{{-- Financial card --}}

Total Value

{{ $currencySymbol }}{{ number_format((float) $proposal->amount, 2) }} {{ strtoupper($currencyCode) }}
@if (!$isAlreadyActioned) @if ($daysLeft > 0)

This offer is valid for {{ $daysLeft }} more {{ Str::plural('day', $daysLeft) }}

@elseif ($daysLeft === 0)

Valid until end of today

@endif @endif
{{-- FX: Currency Conversion Box --}} @php $deckFxService = app(\App\Services\FxService::class); $deckRates = $deckFxService->getRates($proposal->currency->value); @endphp

Approximate value in other currencies

@foreach($deckRates as $deckCur => $deckRate) @if($deckCur !== $proposal->currency->value) @php $deckConverted = bcmul((string) $proposal->amount, number_format((float) $deckRate, 8, '.', ''), 2); $deckSym = \App\Enums\Currency::from($deckCur)->symbol(); @endphp
{{ $deckSym !== $deckCur ? $deckSym . ' ' . $deckCur : $deckCur }} {{ $deckSym }} {{ number_format($deckConverted, 2) }}
@endif @endforeach

Rates from exchangerate-api.com · Updated daily

{{-- Review & Sign section --}} @if (!$isAlreadyActioned)
{{-- Step 1: Contract Terms --}}

Contract Terms

Revision rounds {{ $proposal->revision_rounds ?? 2 }} included
Post-launch support {{ $proposal->support_weeks ?? 2 }} weeks
Emergency SLA {{ $proposal->emergency_support_months ?? 3 }} months
Late payment penalty {{ $proposal->late_payment_penalty_pct ?? 10 }}% after {{ $proposal->late_payment_days ?? 7 }} days
Governing law {{ $proposal->governing_law ?? 'United Kingdom' }}
@if ($proposal->ip_ownership_note)
IP ownership {{ $proposal->ip_ownership_note }}
@endif
{{-- Step 2: Payment Schedule (if milestones exist) --}} @if ($proposal->milestones && $proposal->milestones->count())

Payment Schedule

@foreach ($proposal->milestones as $milestone) @php $mSym = $milestone->currency instanceof \App\Enums\Currency ? $milestone->currency->symbol() : $currencySymbol; $mTrigger = match($milestone->due_trigger) { 'on_signing' => 'Due on signing', 'on_milestone' => 'Due on milestone', 'on_delivery' => 'Due on delivery', 'custom_date' => $milestone->due_date?->format('d M Y') ?? 'Custom date', default => $milestone->due_trigger, }; @endphp

{{ $milestone->title }}

{{ $mTrigger }}

{{ $mSym }}{{ number_format((float) $milestone->amount, 2) }}

@if ($milestone->percentage)

{{ number_format((float) $milestone->percentage, 1) }}%

@endif
@endforeach
@endif {{-- Step 3: Sign --}}

Sign & Approve

@csrf {{-- Part A: Agreement checkbox --}}
{{-- Part B: Typed name --}}

Your typed name serves as your electronic signature

{{-- Email --}}
{{-- Part C: Draw signature --}}

Sign using your mouse or finger

{{-- Hidden signature data --}}

Electronic signatures are legally valid under the Electronic Communications Act 2000 and eIDAS.

{{-- Decline option --}}

— or —

@endif {{-- Footer --}}

Prepared by {{ $company->name ?? 'Echt Solutions' }}

@if ($company && $company->email) {{ $company->email }} @endif @if ($company && $company->phone) {{ $company->phone }} @endif

This proposal was prepared exclusively for {{ $proposal->client->name }}. Please do not share.