@extends('layouts.app') @section('title', $lead->company_name) @section('content')
Back to Leads

{{ $lead->company_name }}

Lead ID: {{ $lead->id }}

Edit
@csrf @method('DELETE')

Lead Status

{{ ucfirst(str_replace('_', ' ', $lead->lead_status)) }}

Created: {{ $lead->created_at->format('M d, Y H:i A') }}

Last Updated: {{ $lead->updated_at->format('M d, Y H:i A') }}

Contact Information

Contact Person

{{ $lead->contact_person_name }}

Email Address

{{ $lead->email }}

Location Information

Address

{{ $lead->address }}

City

{{ $lead->city }}

State

{{ $lead->state }}

Postal Code

{{ $lead->postal_code }}

Country

{{ $lead->country }}

Questionnaire Responses

@if($lead->questionnaireResponses->count() > 0)
@foreach($lead->questionnaireResponses as $response)

{{ $response->question?->question_text ?? 'Question not available' }}

Answer:

@if(is_array(json_decode($response->answer)))
@foreach(json_decode($response->answer) as $answer) {{ $answer }} @endforeach
@else

{{ $response->answer }}

@endif
{{ ucfirst($response->question?->question_type ?? 'unknown') }} @if($response->question?->is_mandatory) Required @endif @if($response->question?->help_text) {{ $response->question?->help_text }} @endif
@endforeach
@else

No questionnaire responses recorded

@endif

Selected Inventory Items

@if($lead->inventorySelections->count() > 0)
@foreach($lead->inventorySelections as $selection)

{{ $selection->inventoryItem->name }}

{{ ucfirst($selection->status) }}

{{ $selection->inventoryItem->description }}

SKU

{{ $selection->inventoryItem->sku }}

Category

{{ $selection->inventoryItem->category->name }}

Unit

{{ $selection->inventoryItem->unit }}

Unit Price

₹{{ number_format($selection->unit_price_at_selection) }}

Quantity

{{ $selection->quantity_requested }}

Total Price

₹{{ number_format($selection->total_price) }}

@endforeach
@if($lead->inventorySummary)

Inventory Summary

Total Items

{{ $lead->inventorySummary->total_items_count }}

Total Cost

₹{{ number_format($lead->inventorySummary->total_inventory_cost) }}

Total Price

₹{{ number_format($lead->inventorySummary->total_inventory_price) }}

@endif @else

No inventory items selected

@endif

Quick Actions

Summary

Lead Age: {{ $lead->created_at->diffForHumans() }}
Last Contact: {{ $lead->updated_at->diffForHumans() }}

Responses & Inventory

Questionnaire Responses: {{ $lead->questionnaireResponses->count() }}
Inventory Items: {{ $lead->inventorySelections->count() }}
@if($lead->inventorySummary)
Total Value: ₹{{ number_format($lead->inventorySummary->total_inventory_price) }}
@endif
@if($lead->questionnaireResponses->count() > 0 || $lead->inventorySelections->count() > 0)
@if($lead->questionnaireResponses->count() > 0) View Responses @endif @if($lead->inventorySelections->count() > 0) View Inventory @endif
@endif
@endsection