@extends('template.layouts.template-base') @section('title', 'Client Details - Client Master') @section('content')
@if ($client->logo) Client Logo @else client @endif

{{ $client->name }}

Customer ID: {{ $client->client_no }}

Location:{{ $client->billingAddress->city ?? '-' }},{{ $client->billingAddress->state ?? '-' }}

Status

Active

Total Quotes

{{ $totalquotes }}

{{-- ↓ 2% from last year --}}
Total Quotes

Total Sales

{{ $totalsales }}

{{-- ₹ 58.2L value --}}
Total Sales

Conversion Rate

{{ $conversionRate }}%

Conversion Rate

Last Engagement

{{ $daysAgo ?? 0 }}

days ago
Last Engagement
Customer Information

Customer Name

{{ $client->name }}

GST/VAT Number

{{ $client->gst_no }}

PAN/Tax Number

{{ $client->pan_no }}

Contact Person

{{ $client->primary_contact_person }}

Primary WhatsApp Number

{{ $client->whatsapp_no }}

Primary Contact Number

{{ $client->primary_contact_no }}

Primary Email Address

{{ $client->primary_email_address }}

PIN Code

{{ $client->pincode ?? '-' }}

Address

{{ $client->registered_address ?? '-' }}

City

{{ $client->city ?? '-' }}

State

{{ $client->state ?? '-' }}

Country

{{ $client->country ?? '-' }}
Billing & Shipping
{{-- BILLING ADDRESSES --}}

Billing Addresses

@forelse($client->addresses->where('address_type', 'billing') as $billing)
{{ $billing->unit_name ?? '-' }}
{{ $billing->address_line_1 ?? '-' }}
@if ($billing->address_line_2)
{{ $billing->address_line_2 }}
@endif

{{ $billing->city ?? '-' }}, {{ $billing->state ?? '-' }}, {{ $billing->country ?? '-' }}

@if ($billing->is_default) Default @endif
@empty

No billing address added

@endforelse
{{-- SHIPPING ADDRESSES --}}

Shipping Addresses

@forelse($client->addresses->where('address_type', 'shipping') as $shipping)
{{ $shipping->unit_name ?? '-' }}
{{ $shipping->address_line_1 ?? '-' }}
@if ($shipping->address_line_2)
{{ $shipping->address_line_2 }}
@endif

{{ $shipping->city ?? '-' }}, {{ $shipping->state ?? '-' }}, {{ $shipping->country ?? '-' }}

@if ($shipping->is_default) Default @endif
@empty

No shipping address added

@endforelse
Show entries
@forelse($quotations as $quotation) @empty @endforelse
Quotation ID Subject Amount Date Valid Till Sales Person Version Status
{{ $quotation->quotation_no }} {{ $quotation->subject ?? '-' }} ₹{{ number_format($quotation->total_amount, 2) }} {{ \Carbon\Carbon::parse($quotation->quote_date)->format('d M, Y') }} {{ \Carbon\Carbon::parse($quotation->quote_date)->addDays($quotation->validity)->format('d M, Y') }} {{ $quotation->user->name ?? '-' }} V1 @if ($quotation->is_rejected == 1) Rejected @elseif($quotation->status == 1) In-Progress @elseif($quotation->status == 2) Follow Up @elseif($quotation->status == 3) Expired @elseif($quotation->status == 4) Draft @elseif($quotation->status == 8) Converted @endif
No quotations found
Show entries
@forelse($salesOrders as $order) @empty @endforelse
Sales Order ID Quotation ID Subject Client Name Amount Convert Date Sales Person Action
{{ $order->sales_order_no }} {{ $order->quotation_no }} {{ $order->subject ?? '-' }} {{ $order->client->name ?? '-' }} ₹{{ number_format($order->total_amount, 2) }} {{ \Carbon\Carbon::parse($order->created_at)->format('d M, Y') }} {{ $order->user->name ?? '-' }}
No Sales Orders Found
Showing 1-10 of 32 Results
Registered Address

Contact Person

{{ $client->primary_contact_person }}

Primary Contact Number

{{ $client->primary_contact_no }}

Primary Email Address

{{ $client->primary_email_address }}

PIN Code

{{ $client->pincode }}

Building number/Street number(name)

{{ $client->registered_address }}

City

{{ $client->city }}

State

{{ $client->state }}

Country

{{ $client->country }}
Billing/Unit Address
Add billing/shipping address
@foreach ($client->addresses->filter(fn($a) => in_array('billing', (array) $a->address_type)) as $billing)
{{ $billing->unit_name }}

Building number/Street number(name)

{{ $billing->address_line_1 }}

PIN Code

{{ $billing->pincode }}

City

{{ $billing->city }}

State

{{ $billing->state }}

Country

{{ $billing->country }}
{{-- Contacts for THIS billing address --}}
@php // Get contacts that have this unit in their unit_name array $billingContacts = \App\Models\AddContact::whereJsonContains( 'unit_name', $billing->unit_name, ) ->whereJsonContains('address_type', 'billing') ->with('designation') ->get(); @endphp @forelse ($billingContacts as $contact) @empty @endforelse
Person Name Designation Contact Number Email Address Action
{{ $contact->contact_person_name }} {{ $contact->designation->name ?? 'N/A' }}

{{ $contact->contact_no }}

{{ $contact->email_address }}

No contacts found
@endforeach
Shipping/Unit Address
@foreach ($client->addresses->filter(fn($a) => in_array('shipping', (array) $a->address_type)) as $shipping)
{{ $shipping->unit_name }}

Building number/Street number(name)

{{ $shipping->address_line_1 }}

PIN Code

{{ $shipping->pincode }}

City

{{ $shipping->city }}

State

{{ $shipping->state }}

Country

{{ $shipping->country }}
{{-- Contacts for THIS shipping address --}}
@php $shippingContacts = \App\Models\AddContact::whereJsonContains( 'unit_name', $shipping->unit_name, ) ->whereJsonContains('address_type', 'shipping') ->with('designation') ->get(); @endphp @forelse ($shippingContacts as $contact) @empty @endforelse
Person Name Designation Contact Number Email Address Action
{{ $contact->contact_person_name }} {{ $contact->designation->name ?? 'N/A' }}

{{ $contact->contact_no }}

{{ $contact->email_address }}

{{-- ✅ EDIT CONTACT --}} {{-- ✅ DELETE CONTACT (NOT unit) --}}
No contacts found
@endforeach
{{-- --}} {{-- --}} @forelse($client->attachments as $attachment) @empty @endforelse {{-- --}}
File nameFile FormatFile SizeUpload Date Uploaded By Action
{{ $attachment->title }} {{ $attachment->created_at->format('d M, Y') }} {{ $client->user->name }}
No attachments found
{{-- --}}
@endsection @section('scripts') @endsection