Core Entities
Customers
Customer master data with payment terms and credit limits
Suppliers
Supplier management with purchase terms
Contacts
Addresses and contact points for customers and suppliers
Customers (Clientes)
Customers represent the entities that purchase from your business.Customer Structure
Located atCore/Model/Cliente.php:
Key Features
Multiple Addresses
Bank Accounts
Payment Terms
Accounting Integration
VAT Validation
Customer Groups
Tax Withholding
Advanced Search
Suppliers (Proveedores)
Suppliers represent the entities you purchase from.Supplier Structure
Located atCore/Model/Proveedor.php:
Supplier vs Creditor
- Normal purchase transactions
- Standard payment terms
- Short-term creditors
- Different accounting treatment
- Used for non-standard payables
Supplier Features
Suppliers share similar functionality with customers:Contacts (Contactos)
Contacts represent physical addresses and contact points.Contact Structure
Located atCore/Model/Contacto.php:
Contact Features
Full Name
Country Name
Customer/Supplier Creation
VAT Validation
Advanced Search
Contact as Address
Contacts serve as addresses for customers and suppliers:- Billing addresses: Used for invoices
- Shipping addresses: Used for deliveries
- Multiple addresses: Each customer/supplier can have many
- Default addresses: Set via
idcontactofactandidcontactoenv
Common Traits
All CRM entities use shared traits:EmailAndPhonesTrait
Provides:$email: Email address$telefono1: Primary phone$telefono2: Secondary phonetestEmailAndPhones(): Validation
FiscalNumberTrait
Provides:$cifnif: Tax ID number$tipoidfiscal: Tax ID typetestFiscalNumber(): Validation
GravatarTrait
Provides:- Gravatar image integration
- Email-based avatar display
Validation
Customer Validation
Code Validation
Customer and supplier codes:- 1-10 alphanumeric characters
- Pattern:
/^[A-Z0-9_\+\.\-]{1,10}$/i - Auto-generated if not provided
Automatic Creation
Customer Creation
When a customer is created, a default contact is automatically generated:Supplier Creation
Similar automatic contact creation for suppliers.Customer Groups
Customers can be organized into groups:- Shared settings (payment terms, subaccount)
- Group-level discounts
- Reporting and segmentation
- Targeted marketing
Sales Agents
Assign sales agents to customers:- Commission tracking
- Sales performance reports
- Customer assignment
- Territory management
Privacy and GDPR
Contacts include privacy fields:- GDPR compliance
- Email marketing lists
- Communication preferences
- Consent tracking
Best Practices
Customer Codes
Customer Codes
Use meaningful customer codes if manually assigned. Consider including location, type, or registration year codes.
Credit Limits
Credit Limits
Set appropriate credit limits (riesgomax) for customers. Monitor riesgoalcanzado regularly.
Multiple Addresses
Multiple Addresses
Create separate contacts for each physical location. This improves delivery tracking and reporting.
Customer Groups
Customer Groups
Use groups for wholesale vs retail customers, or by region. Apply group-level settings to simplify management.
Data Quality
Data Quality
Validate tax IDs using checkVies() for EU customers. Keep email addresses and phone numbers up to date.
Integration Points
With Invoicing
- Default payment methods and terms
- Billing and shipping addresses
- Tax regime and withholding
- Document series and numbering
With Accounting
- Automatic subaccount creation
- Customer/supplier balances
- Aging reports
- Payment tracking
With Inventory
- Customer-specific pricing (via tariffs)
- Preferred products
- Purchase history
- Sales analysis
Related Models
Core/Model/Cliente.php- CustomersCore/Model/Proveedor.php- SuppliersCore/Model/Contacto.php- Contacts/addressesCore/Model/GrupoClientes.php- Customer groupsCore/Model/Agente.php- Sales agentsCore/Model/CuentaBancoCliente.php- Customer bank accountsCore/Model/CuentaBancoProveedor.php- Supplier bank accountsCore/Model/FormaPago.php- Payment methodsCore/Model/Retencion.php- Tax withholding
Next Steps
Invoicing
Learn how to create invoices for customers
Accounting
Understand customer/supplier accounting integration

