{{-- Customer Info & Balance Card --}}

Customer Code

{{ $customer->customer_code }}

Customer Name

{{ $customer->customer_name }}

@if($customer->business_name)

{{ $customer->business_name }}

@endif

Contact

{{ $customer->phone ?? 'N/A' }}

{{ $customer->city ?? '-' }}, {{ $customer->address ?? '' }}

Total Credit Sales

₨ {{ number_format($creditSales->sum('debit'), 2) }}

Current Outstanding

₨ {{ number_format($currentBalance, 2) }}

{{-- Salesman Breakdown --}} @if($salesmenBreakdown->count() > 0)

Credit Sales by Salesman

@php $totalAmount = $salesmenBreakdown->sum('total_amount'); @endphp @foreach ($salesmenBreakdown as $breakdown) @endforeach
Salesman Total Amount Number of Sales % of Total
{{ $breakdown->employee->full_name ?? 'Unknown' }}
{{ $breakdown->employee->employee_code ?? '' }}
₨ {{ number_format($breakdown->total_amount, 2) }} {{ $breakdown->sales_count }} {{ $totalAmount > 0 ? number_format(($breakdown->total_amount / $totalAmount) * 100, 1) : 0 }}%
@endif
@foreach ($creditSales as $index => $sale) {{ $creditSales->firstItem() + $index }} {{ $sale->created_at->format('d-m-Y') }} @if($sale->salesSettlement) {{ $sale->salesSettlement->settlement_number }}
{{ $sale->salesSettlement->settlement_date->format('d M Y') }}
@else @endif @if($sale->employee)
{{ $sale->employee->full_name }}
{{ $sale->employee->employee_code }}
@else @endif {{ $sale->invoice_number ?? '—' }} ₨ {{ number_format($sale->debit, 2) }} {{ Str::limit($sale->notes, 50) ?? '—' }} @if($sale->salesSettlement) @endif @endforeach Page Total ({{ $creditSales->count() }} sales): ₨ {{ number_format($creditSales->sum('debit'), 2) }}
{{-- Quick Actions --}}
View Full Ledger Customer Profile