{{-- New-Unity ERP | app/Modules/Sales/Resources/Views/customers/index.blade.php | v3.1 | 30/07/2026 --}} {{-- v3.1 — Agrega botón "Importar desde Excel" en panel-toolbar (→ /customers/import). --}} {{-- v3.0 — Lazy loading AJAX por tab. Solo carga datos cuando el usuario activa el tab. --}} {{-- Una sola instancia DataTables por tab, inicializada on-demand. Sin conflictos. --}} {{-- v2.2 — responsive:false para evitar _DT_CellIndex en tabs ocultos. --}} {{-- v2.1 — Modal Bootstrap para confirmar delete + modal Permission Required + @can. --}} {{-- v2.0 — Vista rediseñada con tabs por customer_type, DataTables por tab. --}} {{-- v1.0 — Vista inicial de listado de clientes. --}} @extends('layouts.vertical', ['pageTitle' => __('customers.customers')]) @section('page-title')

{{ __('customers.customers') }} {{ __('customers.management') }}

@endsection @section('content') @if(session('success')) @endif @if(session('error')) @endif {{-- Stats Row --}}
{{ __('customers.all_customers') }}
{{ $grouped['all']->count() }}
{{ __('customers.end_users') }}
{{ $grouped['end_user']->count() }}
{{ __('customers.wholesale') }}
{{ $grouped['wholesale']->count() }}
{{ __('customers.distributors') }}
{{ $grouped['distributor']->count() }}
{{ __('customers.online_special') }}
{{ $grouped['online']->count() + $grouped['special']->count() }}
{{-- Main Panel --}}

{{ __('customers.directory') }}

@can('customers.create') Importar Excel {{ __('customers.newcustomer') }} @else @endcan
{{-- Tabs --}}
@php $tabIds = [ 'all' => 'all', 'end_user' => 'enduser', 'wholesale' => 'wholesale', 'distributor' => 'distributor', 'online' => 'online', 'special' => 'special', ]; @endphp @foreach($tabIds as $type => $tabId)
{{-- Populated via AJAX --}}
{{ __('customers.col_no') }} {{ __('customers.col_rfc') }} {{ __('customers.col_business_name') }} {{ __('customers.col_commercial_name') }} {{ __('customers.col_type') }} {{ __('customers.col_city') }} {{ __('customers.col_phone') }} {{ __('customers.col_email') }} {{ __('customers.col_actions') }}
@endforeach
{{-- Modal: Confirm Delete --}} {{-- Modal: Permission Required --}} @endsection @section('scripts') @endsection