@extends('layouts.layoutMaster') @section('title', __('Customer Details')) @section('vendor-style') @vite(['resources/assets/vendor/libs/sweetalert2/sweetalert2.scss']) @endsection @section('vendor-script') @vite(['resources/assets/vendor/libs/sweetalert2/sweetalert2.js']) @endsection @section('content') @php $breadcrumbs = [ ['name' => __('CRM'), 'url' => route('crm.dashboard.index')], ['name' => __('Customers'), 'url' => route('customers.index')], ['name' => $customer->name, 'url' => ''] ]; @endphp
{{ strtoupper(substr($customer->name, 0, 2)) }}

{{ $customer->name }}

{{ $customer->customer_code }}

{{ $customer->customer_type->label() }} @if($customer->customerGroup) {{ $customer->customerGroup->name }} @endif @if($customer->is_blacklisted) {{ __('Blacklisted') }} @elseif($customer->is_active) {{ __('Active') }} @else {{ __('Inactive') }} @endif
{{ __('Edit') }} @if($customer->is_blacklisted) @else @endif
{{ __('Contact Information') }}
{{ __('Email') }}:
@if($customer->email) {{ $customer->email }} @else - @endif
{{ __('Phone') }}:
@if($customer->phone) {{ $customer->phone }} @else - @endif
{{ __('Mobile') }}:
@if($customer->mobile) {{ $customer->mobile }} @else - @endif
@if($customer->company_name)
{{ __('Company') }}:
{{ $customer->company_name }}
@endif @if($customer->company)
{{ __('Company') }} ({{ __('B2B') }}):
{{ $customer->company->name }}
@endif @if($customer->website)
{{ __('Website') }}:
{{ $customer->website }}
@endif @if($customer->primaryAddress)
{{ __('Address') }}:
{{ $customer->primaryAddress->full_address }}
@endif

{{ __('Total Purchases') }}

{{ $customer->purchase_count }}

{{ __('Lifetime Value') }}

${{ number_format($customer->lifetime_value, 2) }}

{{ __('Avg Order') }}

${{ number_format($customer->average_order_value, 2) }}

{{ __('Available Credit') }}

${{ number_format($customer->available_credit, 2) }}

{{ __('Customer Since') }}:
{{ $customer->created_at->format('d M Y') }}
{{ __('First Purchase') }}:
{{ $customer->first_purchase_date ? $customer->first_purchase_date->format('d M Y') : __('No purchases yet') }}
{{ __('Last Purchase') }}:
{{ $customer->last_purchase_date ? $customer->last_purchase_date->format('d M Y') : __('No purchases yet') }}
{{ __('Payment Terms') }}:
@switch($customer->payment_terms) @case('cod') {{ __('Cash on Delivery') }} @break @case('prepaid') {{ __('Prepaid') }} @break @case('net30') {{ __('Net 30 Days') }} @break @case('net60') {{ __('Net 60 Days') }} @break @default {{ $customer->payment_terms }} @endswitch
@if($customer->tax_id)
{{ __('Tax ID') }}:
{{ $customer->tax_id }}
@endif @if($customer->vat_number)
{{ __('VAT Number') }}:
{{ $customer->vat_number }}
@endif
{{ __('Credit Limit') }}:
${{ number_format($customer->credit_limit, 2) }}
{{ __('Credit Used') }}:
${{ number_format($customer->credit_used, 2) }}
{{ __('Discount') }}:
{{ $customer->discount_percentage }}%
{{ __('Tax Status') }}:
@if($customer->tax_exempt) {{ __('Tax Exempt') }} @else {{ __('Standard Tax') }} @endif
{{ __('Status') }}:
{{ $customer->status->label() }}
@if($customer->is_blacklisted && $customer->blacklist_reason)
{{ __('Blacklist Reason') }}

{{ $customer->blacklist_reason }}

@endif
@if($customer->deals && $customer->deals->count() > 0)
@foreach($customer->deals as $deal) @endforeach
{{ __('Title') }} {{ __('Value') }} {{ __('Stage') }} {{ __('Status') }} {{ __('Created') }}
{{ $deal->title }} ${{ number_format($deal->value, 2) }} {{ $deal->stage->name ?? '-' }} @if($deal->won_at) {{ __('Won') }} @elseif($deal->lost_at) {{ __('Lost') }} @else {{ __('Open') }} @endif {{ $deal->created_at->format('d M Y') }}

{{ __('Total Deal Value') }}: ${{ number_format($stats['total_deal_value'], 2) }} ({{ $stats['won_deals'] }} {{ __('won') }})

@else

{{ __('No deals found') }}

@endif
@if($customer->notes)

{{ $customer->notes }}

@else

{{ __('No notes available') }}

@endif
@endsection @section('page-script') @vite(['Modules/CRMCore/resources/assets/js/customers-show.js']) @endsection