@php $tabMeta = [ 'search' => ['label' => __('Search'), 'icon' => 'magnifying-glass'], 'log' => ['label' => __('Search log'), 'icon' => 'list-bullet'], ]; $metrics = [ ['label' => __('Searches today'), 'value' => number_format($usage['today']), 'icon' => 'magnifying-glass', 'accent' => '#6366f1', 'sub' => __('of :cap a day', ['cap' => number_format($usage['daily_cap'])])], ['label' => __('Searches this month'), 'value' => number_format($usage['month']), 'icon' => 'calendar-days', 'accent' => '#0ea5e9', 'sub' => __('of :cap a month', ['cap' => number_format($usage['monthly_cap'])])], ['label' => __('Searches left today'), 'value' => number_format($usage['left']), 'icon' => 'fa-solid fa-gauge', 'accent' => $usage['left'] > 0 ? '#10b981' : '#f43f5e', 'sub' => $usage['left'] > 0 ? __('Within the budget') : __('Budget used up')], ['label' => __('Prospects added this month'), 'value' => number_format($addedThisMonth), 'icon' => 'user-plus', 'accent' => '#f59e0b', 'sub' => __('From Lead Finder searches')], ]; $checkMeta = [ 'new' => ['label' => __('New'), 'color' => 'indigo'], 'possible' => ['label' => __('Possible duplicate'), 'color' => 'amber'], 'exact' => ['label' => __('Already in the CRM'), 'color' => 'slate'], ]; $statusColor = ['completed' => 'emerald', 'refused' => 'amber', 'failed' => 'rose']; $showMap = $activeSource->mayShowOnMap(); $keepsDetails = $resultsSourceObject?->mayKeepDetails() ?? true; $selectedCount = count($selected); $tz = config('app.display_timezone', 'Africa/Harare'); @endphp
@can('createOrganisation', \App\Models\Customer::class) {{ __('Scan a card') }} @endcan
@foreach ($metrics as $m)

{{ $m['label'] }}

{{ $m['value'] }}

{{ $m['sub'] }}
@endforeach
@foreach ($tabMeta as $key => $meta) @endforeach
@if ($tab === 'search') {{-- Search form --}}
@if (count($sources) > 1)
@foreach ($sources as $key => $src) @endforeach
@endif
@foreach ($suggestions as $place) @endforeach
{{ __('Search') }} {{ __('Searching…') }}

{{ trans_choice(':count search left today|:count searches left today', $usage['left'], ['count' => number_format($usage['left'])]) }} @if ($source === 'osm') {{ __('OpenStreetMap is free and open. Coverage in Zimbabwe is patchy and phone numbers are often missing, so each result shows how complete it is.') }} @else {{ __('Google results are shown as a list, not on the map, and only Google\'s place ID is kept. You confirm each organisation\'s details as you add it.') }} @endif

{{-- Map (OpenStreetMap results only) --}} @if ($showMap)
OpenStreetMap contributors', 'selectLabel' => __('Select or unselect'), ]))" x-on:crm-lead-map.window="receive($event.detail)">
{{ __('Loading the map…') }}
{{ __('The map could not load. Searching by typed area still works.') }}

{{ __('Move the map to the area you want, then search it.') }}

{{ __('Search this map area') }} {{ __('Searching…') }}
@foreach (['new' => ['#4f46e5', __('New')], 'possible' => ['#f59e0b', __('Possible duplicate')], 'exact' => ['#94a3b8', __('In the CRM')], 'added' => ['#10b981', __('Added')]] as [$colour, $label]) {{ $label }} @endforeach
@endif {{-- Results --}}
@if ($search === null) @else

{{ trans_choice(':count result|:count results', $totalResults, ['count' => number_format($totalResults)]) }} {{ __('for :category in :area', ['category' => __($categories[$search->category]['label'] ?? $search->category), 'area' => $searchedLabel]) }}

{{ __('Data :credit', ['credit' => $resultsSourceObject?->attribution() === 'Google Maps' ? __('from Google Maps') : '© OpenStreetMap contributors']) }}@if ($fromCache) · {{ __('from today\'s saved results, no new search was sent') }}@endif

@foreach (['hasPhone' => __('Has a phone'), 'hasWebsite' => __('Has a website'), 'hideInCrm' => __('Hide those in the CRM')] as $prop => $label) @endforeach
@if ($selectedCount > 0) @endif
@if ($portfolios !== []) @endif @can('createOrganisation', \App\Models\Customer::class) {{ trans_choice('Add :count selected as a prospect|Add :count selected as prospects', $selectedCount, ['count' => $selectedCount]) }} {{ __('Adding…') }} @endcan
    @forelse ($rows as $key => $row) @php $l = $row['listing']; $check = $row['check']; $done = $added[$key] ?? null; $isSelected = in_array($key, $selected, true); $canPick = $done === null && $check['status'] !== 'exact'; $have = collect(\App\Services\Crm\LeadFinder\Listing::DETAILS)->filter(fn ($f) => filled($l[$f] ?? null))->count(); $of = count(\App\Services\Crm\LeadFinder\Listing::DETAILS); $sourceUrl = \App\Services\Crm\LeadFinder\Listing::fromArray($l)->sourceUrl(); @endphp
  • @if ($canPick) @else @endif

    {{ $l['name'] }}

    {{ __(':have of :of details', ['have' => $have, 'of' => $of]) }} @if ($done) {{ $done['status'] === 'created' ? __('Added') : __('In the CRM') }} @else {{ $checkMeta[$check['status']]['label'] ?? $check['status'] }} @endif
    @if ($l['address'])

    {{ $l['address'] }}

    @endif @if ($done && $done['customer_id']) {{ __('Open the organisation') }} @elseif ($check['status'] === 'exact' && $check['customer_id']) {{ __('Already in the CRM as :name', ['name' => $check['customer_name']]) }} @elseif ($check['status'] === 'possible')
    {{ __('Looks like :name, already in the CRM.', ['name' => $check['customer_name']]) }} {{ __('Compare') }}
    @endif
    @if ($canPick) @can('createOrganisation', \App\Models\Customer::class)
    @endcan @endif
  • @empty
  • @endforelse
@if ($resultsSourceObject && ! $resultsSourceObject->mayShowOnMap())
{{-- Google's attribution for Places data shown without a Google map. --}} Google Maps
@endif @endif
@else {{-- Search log --}}

{{ __('Search log') }}

{{ __('Every search, who ran it and how many prospects it produced. The results themselves are not kept.') }}

@forelse ($log as $entry) @empty @endforelse
{{ __('When') }} {{ __('Who') }} {{ __('Search') }} {{ __('Results') }} {{ __('Prospects added') }} {{ __('Status') }}
{{ $entry->searched_at?->timezone($tz)->format('j M Y, H:i') }} {{ $entry->user?->name ?? __('Not available') }} {{ $entry->query }} @if ($entry->error)

{{ $entry->error }}

@endif
{{ $entry->status === 'completed' ? number_format($entry->results_count) : __('Not applicable') }} {{ $entry->status === 'completed' ? number_format($entry->prospects_added) : __('Not applicable') }} {{ __(\App\Models\Crm\LeadFinderSearch::STATUSES[$entry->status] ?? $entry->status) }}
@if ($log->hasPages())
{{ $log->links() }}
@endif
@endif
{{-- Confirm step for Google results: only the place ID is kept, so the officer confirms the details. --}} {{ __('Confirm the organisation\'s details') }} @if (count($confirmQueue) > 1) {{ __(':count still to confirm', ['count' => count($confirmQueue)]) }} @endif

{{ __('Google lets BillPro keep only its place ID. Check these details, ideally with a call or the organisation\'s own website, and correct them. What you save becomes the company\'s own record.') }}

{{ __('Cancel') }} @if (count($confirmQueue) > 1) {{ __('Skip this one') }} @endif {{ __('Add as a prospect') }} {{ __('Adding…') }}