@extends('layouts.app', ['title' => $pipeline->name]) @section('content') @php($canManage = auth()->user()->can('contacts.manage')) @php($cur = $currentAccount->currency)

{{ $pipeline->name }}

{{ $totals['count'] }} open deals worth {{ money_format_short($totals['open'], $cur) }} ยท {{ money_format_short($totals['won'], $cur) }} won

@if ($pipelines->count() > 1) @endif @if ($canManage) Edit stages @endif
@foreach (['open' => 'Open', 'won' => 'Won', 'lost' => 'Lost'] as $key => $label) {{ $label }} @endforeach
@foreach ($pipeline->stages as $stage)
{{ $stage->name }} {{ $stage->opportunities->count() }}
{{ money_format_short($stage->opportunities->sum('value'), $cur) }}
@foreach ($stage->opportunities as $opp)
{{ $opp->title }} @if ($canManage) @endif
@php($tz = $currentAccount->timezone) @if (in_array('contact', $cardFields, true) && $opp->contact) {{ $opp->contact->full_name }} @endif
@if (in_array('phone', $cardFields, true) && $opp->contact?->phone)
{{ $opp->contact->phone }}
@endif @if (in_array('source', $cardFields, true) && $opp->contact?->source)
{{ $opp->contact->source }}
@endif @if (in_array('utm_campaign', $cardFields, true) && $opp->contact?->utm('campaign'))
{{ $opp->contact->utm('campaign') }}
@endif @if (in_array('created', $cardFields, true))
+ {{ $opp->created_at->timezone($tz)->format('d M Y, h:i A') }}
@endif @if (in_array('updated', $cardFields, true))
{{ $opp->updated_at->timezone($tz)->format('d M Y, h:i A') }}
@endif @if (in_array('notes', $cardFields, true) && $opp->notes_count)
{{ $opp->notes_count }} {{ \Illuminate\Support\Str::plural('note', $opp->notes_count) }}
@endif
@if (in_array('value', $cardFields, true)){{ money_format_short($opp->value, $cur) }}@endif @if (in_array('close_date', $cardFields, true) && $opp->expected_close_date) {{ $opp->expected_close_date->format('d M') }}@endif @if (in_array('owner', $cardFields, true) && $opp->owner){{ $opp->owner->initials }}@endif
@endforeach
@endforeach
@if ($canManage) @endif @if ($canManage) @endif @endsection @push('scripts') @if ($canManage && $status === 'open') @endif @endpush