@extends('layouts.app') @section('style') @endsection @section('content')
{{ strtoupper(substr($customer->name, 0, 1)) }}
{{ ucfirst($customer->customer_level) }}

{{ $customer->name }}

@if($customer->company_name)

{{ $customer->company_name }}

@endif
@if($customer->customer_type == 'walk-in') Walk-in Customer @elseif($customer->customer_type == 'regular') Regular Customer @else Business Customer @endif @if($customer->status == 'active') Active @else Inactive @endif @if($customer->is_vat_registered) VAT Registered @endif @if($customer->loyalty_points > 0) {{ $customer->loyalty_points }} points @endif @if($customer->discount_percent > 0) {{ $customer->discount_percent }}% Discount @endif {{ $customer->sales_count ?? 0 }} Sales
@if($customer->customer_code) Code: {{ $customer->customer_code }} @endif Customer Since: {{ $customer->created_at->format('M d, Y') }}
KES{{ number_format($salesStats['balance'], 2) }}
Current Balance
@if($customer->credit_limit > 0)
KES{{ number_format($salesStats['available_credit'], 2) }}
Available Credit
@endif @if($customer->days_since_last_purchase !== null)
{{ $customer->days_since_last_purchase }} days since last purchase
@endif
Contact Information
Email Address
@if($customer->email) {{ $customer->email }} @else Not provided @endif
Phone Number
@if($customer->phone) {{ $customer->phone }} @else Not provided @endif
@if($customer->contact_person)
Contact Person
{{ $customer->contact_person }}
@endif @if($customer->website) @endif
Address
@if($customer->address) {{ $customer->address }} @else Address not provided @endif
@if($customer->customer_type == 'business' || $customer->vat_number || $customer->tax_id || $customer->is_vat_registered)
Business & VAT Information
@if($customer->vat_number)
VAT Number
{{ $customer->vat_number }} @if($customer->is_vat_registered) Valid @endif
@endif @if($customer->tax_id)
Tax ID
{{ $customer->tax_id }}
@endif
Customer Type
{{ ucfirst($customer->customer_type) }}
Account Status
{{ ucfirst($customer->status) }}
@if($customer->is_vat_registered)
VAT Summary
Taxable Sales
KES{{ number_format($salesStats['taxable_sales'], 2) }}
VAT Collected
KES{{ number_format($salesStats['vat_collected'], 2) }}
Effective Rate
{{ number_format($salesStats['vat_rate_effective'], 2) }}%
@endif
@endif @if($customer->notes)
Notes
{{ $customer->notes }}
@endif
Sales Statistics

{{ $salesStats['total_sales'] }}

Total Sales

KES{{ number_format($salesStats['total_spent'], 2) }}

Total Spent

KES{{ number_format($salesStats['avg_order_value'], 2) }}

Avg. Order
KES{{ number_format(abs($salesStats['balance']), 2) }}
Balance
{{ $customer->loyalty_points }}
Loyalty Points
{{ $customer->discount_percent }}%
Discount
Customer Level Progress
@php $levelProgress = 0; if ($customer->total_spent >= 100000) { $levelProgress = 100; } elseif ($customer->total_spent >= 50000) { $levelProgress = 75; } elseif ($customer->total_spent >= 10000) { $levelProgress = 50; } else { $levelProgress = ($customer->total_spent / 10000) * 100; } $levelProgress = min($levelProgress, 100); @endphp
{{ number_format($levelProgress, 1) }}% to next level
@if($customer->credit_limit)
Credit Limit: KES{{ number_format($customer->credit_limit, 2) }}
Available Credit: KES{{ number_format($salesStats['available_credit'], 2) }}
@php $creditUsed = $customer->credit_limit > 0 ? ($customer->credit_balance / $customer->credit_limit) * 100 : 0; $creditUsed = min($creditUsed, 100); @endphp
{{ number_format($creditUsed, 1) }}% of credit limit used
@endif
Quick Actions
Create New Sale @if($customer->balance > 0) @endif Send Email Call Customer
@if($customer->balance > 0) @endif
@endsection @section('script') @endsection