Directorio & CRM • Clientes, Contactos & Límites de Crédito

Directorio de Clientes

Cartera de clientes, control de crédito autorizado, historial comercial y enlace directo a WhatsApp.

Total Directorio 👥

{{ number_format($totalCustomersCount) }}

Clientes registrados
Con Saldo Pendiente ⚠️

{{ number_format($withDebtCount) }}

Cuentas activas
Cartera por Cobrar $

${{ number_format($totalPortfolioDebtUsdt, 2) }}

Total en USD BCV
Clientes al Día ✓

{{ number_format($noDebtCount) }}

Solventes ($0.00)
@forelse($customers as $customer)
{{ strtoupper(substr($customer->name, 0, 2)) }}

{{ $customer->name }}

{{ $customer->identification_number ?: 'Sin C.I.' }}
@if($customer->phone) WhatsApp ({{ $customer->phone }}) @endif @if($customer->instagram_handle) {{ $customer->instagram_handle }} @endif
Saldo (USD BCV) @if($customer->hasDebt()) ${{ number_format((float)$customer->current_debt_usdt, 2) }} @else Al día ($0.00) @endif
Total (USD BCV) ${{ number_format((float)$customer->total_spent_usdt, 2) }}
@empty
No se encontraron clientes registrados.
@endforelse
Mostrando {{ $customers->firstItem() ?? 0 }}-{{ $customers->lastItem() ?? 0 }} de {{ $customers->total() }} clientes registrados
{{ $customers->links() }}
@if($viewingCustomer)
{{ strtoupper(substr($viewingCustomer->name, 0, 2)) }}

{{ $viewingCustomer->name }}

{{ $viewingCustomer->identification_number ?: 'Sin C.I.' }} • Cliente desde {{ $viewingCustomer->created_at->format('d/m/Y') }}
Canales de Contacto

Tel / WhatsApp: {{ $viewingCustomer->phone ?: 'No registrado' }}

Instagram: {{ $viewingCustomer->instagram_handle ?: 'No registrado' }}

Correo: {{ $viewingCustomer->email ?: 'No registrado' }}

@if($viewingCustomer->phone) Abrir chat de WhatsApp → @endif
Dirección para Envíos / Delivery

{{ $viewingCustomer->city ?: 'Ciudad no especificada' }}

{{ $viewingCustomer->address ?: 'Sin dirección física registrada.' }}

@if($viewingCustomer->notes)
"{{ $viewingCustomer->notes }}"
@endif
Deuda (USD BCV) ${{ number_format((float)$viewingCustomer->current_debt_usdt, 2) }}
Límite (USD BCV) ${{ number_format((float)$viewingCustomer->credit_limit_usdt, 2) }}
Total Comprado (USD BCV) ${{ number_format((float)$viewingCustomer->total_spent_usdt, 2) }}

Historial de Órdenes Recientes

Últimas transacciones
@forelse($customerSales as $sale)
{{ $sale->sale_number }} {{ $sale->payment_method === 'credit' ? 'Venta a Crédito' : 'Contado' }} @if($sale->charge_currency === 'VES') 🇻🇪 Pago en Bs (Tasa BCV: {{ number_format((float)$sale->exchange_rate_applied, 2, ',', '.') }}) @elseif($sale->charge_currency === 'USD') 💵 Efectivo USD @elseif($sale->charge_currency === 'USDT' || stripos($sale->payment_method, 'binance') !== false) 🟡 USDT Binance @endif
{{ $sale->created_at->format('d/m/Y h:i A') }} • {{ $sale->items->count() }} ítems
@foreach($sale->items as $item)
{{ (int)$item->quantity }}x {{ $item->variant?->product?->name ?? $item->variant?->name }} (${{ number_format((float)$item->unit_price_usdt, 2) }})
@endforeach
${{ number_format((float)($sale->usd_bcv_total ?? $sale->total_amount_usdt), 2) }} USD BCV @if((float)($sale->usdt_real_amount ?? 0) > 0) ≈ ${{ number_format((float)$sale->usdt_real_amount, 2) }} USDT Real @endif @if($sale->charge_currency === 'VES' && (float)$sale->total_amount_charged > 0) Bs. {{ number_format((float)$sale->total_amount_charged, 2, ',', '.') }} @endif
@if($sale->payment_method === 'credit' || $sale->credit_status === 'pending' || ($sale->receivable && (float)$sale->receivable->remaining_balance_usdt > 0)) @endif
@empty
Este cliente aún no registra compras en el terminal.
@endforelse
@endif @if($showAddItemModal && $selectedCreditSale)
Cargar a Crédito {{ $selectedCreditSale->sale_number }}

Añadir Prenda a la Factura

Cliente: {{ $selectedCreditSale->customer?->name }}

@if($addItemError)
⚠️ {{ $addItemError }}
@endif
@forelse($availableVariants as $variantItem)
@if($variantItem->image_url) {{ $variantItem->name }} @else 👗 @endif

{{ $variantItem->product?->name ?? $variantItem->name }}

SKU: {{ $variantItem->sku }}
${{ number_format((float)$variantItem->suggested_price_usdt, 2) }} USD {{ $addVariantId === $variantItem->id ? '✓ Seleccionado' : 'Elegir' }}
@empty
{{ empty($variantSearch) ? 'Escribe arriba para buscar prendas en el catálogo' : 'No se encontraron prendas con ese nombre o SKU' }}
@endforelse
@php $additionalTotal = (float)($addQuantity ?: 0) * (float)($addUnitPriceUsdt ?: 0); $currentDebt = (float)$selectedCreditSale->total_amount_usdt; $projectedTotal = $currentDebt + $additionalTotal; @endphp
Monto actual de la factura: ${{ number_format($currentDebt, 2) }} USD BCV
+ Prenda a agregar: +${{ number_format($additionalTotal, 2) }} USD BCV
Nuevo total a crédito de esta factura: ${{ number_format($projectedTotal, 2) }} USD BCV
@endif @if($showCustomerModal)
👤

{{ $editingCustomerId ? 'Editar Datos del Cliente' : 'Registrar Nuevo Cliente' }}

Directorio comercial & crédito autorizado
@error('name') {{ $message }} @enderror
@error('identification_number') {{ $message }} @enderror
@error('phone') {{ $message }} @enderror
@error('instagram_handle') {{ $message }} @enderror
@error('credit_limit_usdt') {{ $message }} @enderror
@error('city') {{ $message }} @enderror
@error('email') {{ $message }} @enderror
@error('address') {{ $message }} @enderror
@endif