@if ($lead->policies->count() > 0)
@csrf @method('PUT')

{{ $lead->policies?->count() }}

Policies

{{ number_format($lead->policies?->sum('premium'), 2) }}

Monthly Premium

{{ number_format($lead->policies?->sum('enrollment_fee'), 2) }}

Enrolment Fee

{{ number_format($lead->policies?->sum('admin_fee'), 2) }}

Admin Fee

{{ number_format($lead->policies?->sum('premium') + $lead->policies?->sum('admin_fee'), 2) }}

Monthly Fee

{{ number_format($lead->policies?->sum('premium') + $lead->policies?->sum('enrollment_fee') + $lead->policies?->sum('admin_fee'), 2) }}

Initial Fee

{{ number_format($lead->policyAnnualFee, 2) }}

Annualized Premium
@forelse ($lead->policies as $key => $policy)
{{-- @if ($loop->first) @else @endif --}}

Policy : {{ $policy->code }}

{{-- --}}

member_count) value="{{ $policy->member_count }}" @endif>
previous_carrier) value="{{ $policy->previous_carrier }}" @endif>
previous_plan) value="{{ $policy->previous_plan }}" @endif>
previous_agent) value="{{ $policy->previous_agent }}" @endif>
previous_agent_np) value="{{ $policy->previous_agent_np }}" @endif>

@forelse ($policy->beneficiaries ?? [] as $benificiaryKey => $benificiary)

Benificiary name: {{ $benificiary->beneficiary_name }}

@empty
@endforelse

Created at: {{ $policy->created_at ? $policy->created_at->format('Y-m-d H:i:s') : ($policy->date_created ? $policy->date_created : '') }}

Created by: {{ $policy->created_by ? $policy->createdBy->name : '' }}

Last modified: {{ $policy->updated_at ? $policy->updated_at->format('Y-m-d H:i:s') : ($policy->date_modified ? $policy->date_modified : '') }}

Last modified by: {{ $policy->updated_by ? $policy->updatedBy->name : '' }}

Date Converted: {{ $policy->date_converted ? $policy->date_converted : '' }}

Sold date: {{ $policy->sold_date ? $policy->sold_date : '' }}
@empty @endforelse
@else
@endif