@php $tabMeta = [ 'programme' => ['label' => __('Referrals'), 'icon' => 'user-plus'], 'reviews' => ['label' => __('Reviews'), 'icon' => 'star'], 'settings' => ['label' => __('Settings'), 'icon' => 'cog-6-tooth'], ]; $money = fn (?float $amount): string => $amount === null ? __('Not available') : $currency.' '.number_format($amount, 2); $metrics = [ ['label' => __('Referred enquiries'), 'value' => number_format($summary['enquiries']), 'icon' => 'user-plus', 'accent' => '#4f46e5', 'sub' => __('From personal links')], ['label' => __('Won value'), 'value' => $money($summary['won_value']), 'icon' => 'banknotes', 'accent' => '#059669', 'sub' => __('Confirmed and paid in full')], ['label' => __('Rewards credited'), 'value' => $currency.' '.number_format($summary['rewards'], 2), 'icon' => 'gift', 'accent' => '#d97706', 'sub' => __('Customer credit, after approval')], ['label' => __('Review links offered'), 'value' => number_format($summary['reviews_offered']), 'icon' => 'star', 'accent' => '#0284c7', 'sub' => __(':count below 4 stars, no link', ['count' => number_format($summary['reviews_withheld'])])], ['label' => __('Review links opened'), 'value' => number_format($summary['reviews_clicked']), 'icon' => 'arrow-up-right', 'accent' => '#7c3aed', 'sub' => __('Times the Google link was opened')], ]; $tz = config('app.display_timezone'); @endphp
{{ $m['label'] }}
{{ $m['value'] }}
{{ $m['sub'] }}{{ __('Each contact has one personal link. People who use it are recorded as their referrals.') }}
{{ $contact->name }}
{{ $contact->customer?->name }}
{{ __('Who shared a link, the enquiries it brought in, the value of jobs paid in full, and the credit a director has approved') }}
| {{ __('Referrer') }} | {{ __('Enquiries') }} | {{ __('Won value') }} | {{ __('Rewards credited') }} |
|---|---|---|---|
|
{{ $row['name'] }} @if ($row['organisation']){{ $row['organisation'] }} @endif @if ($row['token']){{ route('crm.referral-link', $row['token']) }} @endif |
{{ number_format($row['enquiries']) }} | {{ $money($row['won_value']) }} | {{ $currency }} {{ number_format($row['rewards'], 2) }} |
|
|
|||
{{ __('Credit is issued only after the job is confirmed and paid in full, and only when a director approves it') }}
| {{ __('Referrer') }} | {{ __('Enquiry') }} | {{ __('Status') }} | {{ __('Won value') }} | {{ __('Reward') }} | {{ __('Actions') }} |
|---|---|---|---|---|---|
| {{ $referral->referrer?->name ?? __('Unknown contact') }} |
@if ($referral->opportunity)
{{ $referral->opportunity->title }}
@else
{{ $referral->customer?->name ?? __('Not available') }}
@endif
{{ $referral->created_at?->timezone($tz)->format('j M Y') }} |
|
{{ in_array($referral->status, ['won', 'rewarded'], true) ? $money($value) : __('Not available') }} | @if ($referral->credit) {{ $referral->credit->currency_code }} {{ number_format((float) $referral->credit->amount, 2) }} @elseif ($referral->status === 'won') {{ __('Waiting for a director') }} @else {{ __('Not available') }} @endif |
@if ($isDirector && in_array($referral->status, ['enquiry', 'won'], true))
@if ($referral->status === 'won')
@endif
@endif
|
|
|
|||||
{{ __('Turning a link off stops new enquiries. Ones already recorded stay on the list.') }}
| {{ __('Contact') }} | {{ __('Link') }} | {{ __('Status') }} | {{ __('Actions') }} |
|---|---|---|---|
| {{ $link->contact?->name ?? __('Unknown contact') }} | {{ route('crm.referral-link', $link->token) }} |
|
{{ __('The lowest of quality, turnaround and service decides. 4 or 5 stars may see the Google link, once per job. 1 to 3 stars go to the owner and a director, and the link is not shown. Nothing is offered in return.') }}
| {{ __('Job') }} | {{ __('Client') }} | {{ __('Lowest score') }} | {{ __('Status') }} | {{ __('Offered') }} | {{ __('Opened') }} |
|---|---|---|---|---|---|
| {{ $review->job?->job_number ?? __('Not available') }} | {{ $review->customer?->name ?? __('Not available') }} | {{ $review->rating }} |
|
{{ $review->offered_at?->timezone($tz)->format('j M Y') ?? __('Not available') }} | {{ $review->clicked_at?->timezone($tz)->format('j M Y') ?? __('Not available') }} |
|
|
|||||
{{ __('Directors set both. The Google link is offered only after a 4 or 5 star rating, and never with a reward. The referral reward is customer credit, and it is credited only when a director approves a confirmed, paid job.') }}
{{ __('Leave this blank and no review link is offered, even for a 5 star rating.') }}
{{ __('Only a director can change these.') }}
@endif{{ __('This credits the referrer\'s organisation. It is customer credit, not cash, and it is not a reward for a review.') }}
@if ($approving){{ $approving->referrer?->name }}
@endif