@php use App\Models\SalesDoc; $badge = [ 'draft' => 'bg-paper-200 text-ink-600', 'sent' => 'bg-[#E0F2FE] text-[#0369A1]', 'accepted' => 'bg-wa-mint text-wa-deep', 'rejected' => 'bg-accent-coral/10 text-accent-coral', 'expired' => 'bg-amber-100 text-amber-700', 'invoiced' => 'bg-wa-deep/10 text-wa-deep', ]; $sym = \App\Models\Currency::symbolFor($currency); $openDisplay = $sym . number_format($openMinor / (10 ** $exponent), $exponent); $routePrefix = $type === SalesDoc::TYPE_ESTIMATE ? 'estimates' : 'proposals'; @endphp
{{ __('CRM') }}

{{ $typeLabel === 'Proposal' ? __('Your proposals') : __('Your estimates') }}

{{ $type === SalesDoc::TYPE_ESTIMATE ? __('Quote a price before you invoice. Send, get accepted, convert to a real invoice in one click.') : __('Pitch scope and price. Track sent / accepted, then convert the winner straight into an invoice.') }}

{{ __('Open value') }}
{{ $openDisplay }}
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @if ($errors->any())
@foreach ($errors->all() as $e)
{{ $e }}
@endforeach
@endif
@forelse ($docs as $doc) @empty @endforelse
{{ __('Number') }} {{ __('Title / Buyer') }} {{ __('Total') }} {{ __('Status') }} {{ __('Valid until') }} {{ __('Actions') }}
{{ $doc->number }}
{{ $doc->title ?: '—' }}
{{ $doc->buyer_name ?: ($doc->company?->name ?: '—') }}
{{ $doc->total_display }} {{ __(ucfirst($doc->status)) }} {{ $doc->valid_until ? $doc->valid_until->format('d M Y') : '—' }}
@csrf
{{ __('View') }} @if (in_array($doc->status, ['draft']))
@csrf @method('PATCH')
@endif @if (in_array($doc->status, ['draft', 'sent', 'expired']))
@csrf @method('PATCH')
@endif @if (in_array($doc->status, ['sent', 'accepted']) && ! $doc->invoice_id)
@csrf
@endif
@csrf @method('DELETE')
{{ __('No :type yet — create your first one.', ['type' => strtolower($typePlural)]) }}
@if ($docs->hasPages())
{{ $docs->links() }}
@endif
{{-- New-doc modal --}}