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

{{ $client->name }}

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

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->billingAddress->pincode ?? '-' }}

Address

{{ $client->billingAddress->address_line_1 ?? '-' }}

City

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

State

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

Country

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

Billing Addresses

@forelse($client->addresses->where('address_type', 'billing') as $billing)
{{ $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->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
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 }}
{{-- ✅ FIX: Add data-id and data-name attributes --}}

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 Format File SizeUpload Date Uploaded By Action
{{ $attachment->title }} {{ $attachment->created_at->format('d M, Y') }} {{ $client->user->name }}
No attachments found
{{-- --}} @endsection @section('scripts') @endsection