{{-- Customer Edit Page - Uses Admin Panel CSS Variables Only --}} @section('title', 'Edit ' . $customer->display_name) @php $customerNotes = $customerNotes ?? collect(); $attachments = $attachments ?? collect(); @endphp
@csrf @method('PUT')
{{ strtoupper(substr($customer->display_name, 0, 1)) }}
{{ $customer->isCompany() ? 'Company' : 'Individual' }}
@if($customer->isCompany())@endif
@if($customer->isCompany())@endif
{{-- Profile Tab --}}
@if($customer->isCompany())
Company Info
Company Address
@else
Customer Info
@endif
Billing Address
Shipping Address
@if(!$customer->isCompany())
Email Notifications
@endif
{{-- Contacts Tab --}} @if($customer->isCompany())

Contacts at {{ $customer->company }}

@if($contacts && $contacts->count())
@foreach($contacts as $contact) @php $cPortal = $contact->user_id ? \App\Models\User::find($contact->user_id) : null; @endphp
{{ strtoupper(substr($contact->name, 0, 1)) }}
{{ $contact->name }}
{{ $contact->designation ?: 'No designation' }}
{{ $contact->isActive() ? 'Active' : 'Inactive' }} @if($cPortal && $cPortal->is_active)Portal@endif
@if($contact->email)@endif @if($contact->phone)
{{ $contact->phone }}
@endif
@if(!$cPortal || !$cPortal->is_active) @csrf @else
@csrf
@csrf
@endif @if($contacts->count() > 1)@endif
@endforeach
@else

No contacts yet

Add contacts to this company

@endif
@endif {{-- Invoices Tab --}}
@php $totalInvoiced = $invoices->sum('total'); $totalPaid = $invoices->sum('amount_paid'); $totalDue = $invoices->sum('amount_due'); @endphp
{{ $invoices->count() }}
Total Invoices
₹{{ number_format($totalInvoiced, 2) }}
Total Amount
₹{{ number_format($totalPaid, 2) }}
Paid
₹{{ number_format($totalDue, 2) }}
Due
Invoices + New Invoice
@if($invoices->count()) @foreach($invoices as $inv) @endforeach
Invoice # Subject Date Due Date Total Due Status Payment
{{ $inv->invoice_number }} {{ Str::limit($inv->subject, 30) ?: '-' }} {{ $inv->date ? date('d M Y', strtotime($inv->date)) : '-' }} {{ $inv->due_date ? date('d M Y', strtotime($inv->due_date)) : '-' }} ₹{{ number_format($inv->total, 2) }} ₹{{ number_format($inv->amount_due, 2) }} {{ ucfirst($inv->status) }} {{ ucfirst($inv->payment_status) }}
@else

No invoices yet

Create an invoice for this customer

Create Invoice
@endif
{{-- Estimations Tab --}}
@php $totalEstimated = $estimations->sum('total'); $acceptedCount = $estimations->whereIn('status', ['accepted', 'approved'])->count(); @endphp
{{ $estimations->count() }}
Total Estimations
₹{{ number_format($totalEstimated, 2) }}
Total Value
{{ $acceptedCount }}
Accepted
{{ $estimations->where('status', 'sent')->count() }}
Pending
Estimations + New Estimation
@if($estimations->count()) @foreach($estimations as $est) @endforeach
Estimation # Subject Date Valid Until Total Status
{{ $est->estimation_number }} {{ Str::limit($est->subject, 30) ?: '-' }} {{ $est->date ? date('d M Y', strtotime($est->date)) : '-' }} {{ $est->valid_until ? date('d M Y', strtotime($est->valid_until)) : '-' }} ₹{{ number_format($est->total, 2) }} {{ ucfirst($est->status) }}
@else

No estimations yet

Create an estimation for this customer

Create Estimation
@endif
{{-- Proposals Tab --}}
@php $totalProposed = $proposals->sum('total'); $acceptedProposals = $proposals->where('status', 'accepted')->count(); @endphp
{{ $proposals->count() }}
Total Proposals
₹{{ number_format($totalProposed, 2) }}
Total Value
{{ $acceptedProposals }}
Accepted
{{ $proposals->whereIn('status', ['sent', 'open'])->count() }}
Pending
Proposals + New Proposal
@if($proposals->count()) @foreach($proposals as $prop) @endforeach
Proposal # Subject Date Open Till Total Status
{{ $prop->proposal_number }} {{ Str::limit($prop->subject, 30) ?: '-' }} {{ $prop->date ? date('d M Y', strtotime($prop->date)) : '-' }} {{ $prop->open_till ? date('d M Y', strtotime($prop->open_till)) : '-' }} ₹{{ number_format($prop->total, 2) }} {{ ucfirst($prop->status) }}
@else

No proposals yet

Create a proposal for this customer

Create Proposal
@endif
{{-- Notes Tab (AJAX - outside main form) --}}
Notes {{ $customerNotes->count() }} {{ Str::plural('note', $customerNotes->count()) }}
@forelse($customerNotes as $note)
{{ strtoupper(substr($note->author_name, 0, 1)) }}
{{ $note->author_name }}
{{ $note->created_at->format('d M Y, h:i A') }} @if($note->updated_at->gt($note->created_at)) · edited @endif
{{ $note->content }}
@empty

No notes yet

Add a note below to keep track of important information.

@endforelse
{{-- Attachments Tab (AJAX - outside main form) --}}
Attachments {{ $attachments->count() }} {{ Str::plural('file', $attachments->count()) }}
@forelse($attachments as $attachment)
{{ strtoupper($attachment->extension) }}
{{ $attachment->original_name }}
{{ $attachment->formatted_size }} · Uploaded by {{ $attachment->author_name }} · {{ $attachment->created_at->format('d M Y, h:i A') }}
@empty

No attachments yet

Upload files to keep related documents with this customer.

@endforelse

Click to upload or drag & drop

Max file size: 20MB
Uploading...
{{-- Modals --}}
Contact Details
J
-
-
Email-
Phone-
Status-
Portal-
Edit Contact
Email Notifications
Add Contact
Email Notifications