@php $lifecycleColours = ['prospect' => 'indigo', 'active' => 'emerald', 'dormant' => 'amber', 'partner' => 'cyan', 'do_not_contact' => 'rose']; $facts = array_filter([ __('Sector') => $organisation->sector ? ($sectors[$organisation->sector] ?? $organisation->sector) : null, __('Type') => $organisation->organisation_type ? ($types[$organisation->organisation_type] ?? $organisation->organisation_type) : null, __('First source') => $organisation->source ? ($sources[$organisation->source] ?? $organisation->source) : null, __('Country') => $organisation->country, __('TIN') => $organisation->tin_number, __('Procurement cycle') => $organisation->procurement_cycle, __('Supplier registration') => $organisation->supplier_registration_status, __('Next account review') => $organisation->next_review_on?->format('j M Y'), ], fn ($value) => $value !== null && $value !== ''); @endphp
{{ __('Organisations') }} @if ($canDelete) {{ __('Delete') }} @endif @if ($canMerge) {{ __('Merge into another') }} @endif @if ($canEdit) {{ __('Edit') }} @endif
{{ __(\App\Models\Customer::LIFECYCLES[$organisation->lifecycle] ?? $organisation->lifecycle) }} @if ($organisation->priority_tier) {{ __(\App\Models\Customer::PRIORITY_TIERS[$organisation->priority_tier] ?? '') }} @endif @if ($organisation->is_strategic) {{ __('Strategic account') }} @endif @foreach ($organisation->tags ?? [] as $tag) {{ $tag }} @endforeach

{{ __('Ownership') }}

{{ __('Relationship owner') }}
{{ $organisation->relationshipOwner?->name ?? __('No owner') }}
{{ __('Brought in by') }}
{{ $organisation->originator?->name ?? __('Not recorded') }}
{{ __('Open opportunities') }}
{{ number_format($openOpportunities) }}
{{ __('On record since') }}
{{ $organisation->created_at?->timezone(config('app.display_timezone'))->format('j M Y') }}

{{ __('Reaching them') }}

@if ($primaryContact)
{{ $primaryContact->is_primary ? __('Main contact') : __('Contact') }}
@can('view', $primaryContact) {{ $primaryContact->name }} @else {{ $primaryContact->name }} @endcan
@endif @if ($organisation->email) @endif @if ($organisation->phone)
{{ __('Phone') }}
{{ $organisation->phone }}
@endif @if ($organisation->website)
{{ __('Website') }}
{{ $organisation->website }}
@endif @if ($organisation->address)
{{ __('Address') }}
{{ $organisation->address }}
@endif @if (! $primaryContact && ! $organisation->email && ! $organisation->phone && ! $organisation->website && ! $organisation->address)

{{ __('No contact details yet.') }}

@endif

{{ __('About them') }}

@forelse ($facts as $label => $value)
{{ $label }}
{{ $value }}
@empty

{{ __('Sector, type and buying details have not been filled in.') }}

@endforelse
@if ($organisation->buying_needs)

{{ __('Buys:') }} {{ $organisation->buying_needs }}

@endif
@if ($tabs !== [])
@foreach ($tabs as $key => $meta) @endforeach
@livewire($tabs[$currentTab]['component'], ['organisationId' => $organisation->id], key('org-tab-'.$currentTab.'-'.$organisation->id)) @endif
@if ($canMerge) {{ __('Merge :name into another organisation', ['name' => $organisation->name]) }}

{{ __('Use this when the same organisation is on record twice. Choose the record to keep. Everything on this one (contacts, opportunities, activity, quotes, invoices, jobs, tasks, notes and files) moves onto it, and this record is removed. The merge is written to the kept record\'s history.') }}

@forelse ($mergeCandidates as $candidate) @empty

{{ __('No organisation matches that name.') }}

@endforelse
@if ($mergeTarget)

{{ __(':from will be merged into :to.', ['from' => $organisation->name, 'to' => $mergeTarget->name]) }}

@if ($mergePreview === [])

{{ __('Nothing is linked to :from, so only its details move across where :to has none.', ['from' => $organisation->name, 'to' => $mergeTarget->name]) }}

@else
    @foreach ($mergePreview as $table => $rows)
  • {{ trans_choice('{1}:count :what record|[2,*]:count :what records', $rows, ['count' => $rows, 'what' => str_replace(['crm_', '_'], ['', ' '], $table)]) }}
  • @endforeach
@endif
@endif
{{ __('Cancel') }} {{ __('Merge') }} {{ __('Merging…') }}
@endif