- Added secure .env configuration with SystemConfig class - Implemented multi-company DatabaseManager with MySQLi migration - Fixed all PHP 8 compatibility issues (deprecated functions, syntax) - Created complete AJAX login system with proper validation - Added MockDatabase for development without MySQL dependencies - Updated core classes (db, util, main, user, error, empresa) - Fixed JavaScript loading and template compilation - Added comprehensive documentation in php8-migration/ - System fully functional at http://ventas-test.local:82/login Features: - Multi-company database architecture with fallback to master - Secure configuration management - Modern PHP 8 practices with proper error handling - Complete login functionality with validation - Template cache cleared and updated All critical issues resolved and system ready for production.
108 lines
3.1 KiB
Bash
Executable File
108 lines
3.1 KiB
Bash
Executable File
# Configuración de producción para sistema multi-empresa
|
|
# Archivo .env - NO COMMIT a repositorios públicos
|
|
|
|
# =============================================================================
|
|
# CONFIGURACIÓN DE BASES DE DATOS MULTI-EMPRESA
|
|
# =============================================================================
|
|
# El sistema usa dos bases de datos principales:
|
|
# 1. Base master: avantikads_nmgen (catálogos globales y autenticación)
|
|
# 2. Bases de empresas: avantikads_nm{empresaId} (datos específicos por empresa)
|
|
|
|
# Base de datos Master (para autenticación y catálogos globales)
|
|
DB_MASTER_HOST=10.10.4.17
|
|
DB_MASTER_DATABASE=avantikads_nmgen
|
|
DB_MASTER_USER=nickpons666
|
|
DB_MASTER_PASSWORD=MiPo6425@@
|
|
|
|
# Configuración general de conexión
|
|
DB_HOST=10.10.4.17
|
|
DB_PORT=3390
|
|
DB_CHARSET=utf8mb4
|
|
|
|
# Prefijo para bases de datos de empresas
|
|
# Patón real: avantikads_nm{empresaId} donde empresaId viene del usuario
|
|
DB_EMPRESA_PREFIX=avantikads_nm
|
|
DB_EMPRESA_USER=nickpons666
|
|
DB_EMPRESA_PASSWORD=MiPo6425@@
|
|
|
|
# =============================================================================
|
|
# CONFIGURACIÓN DEL SISTEMA
|
|
# =============================================================================
|
|
|
|
# Rutas del sistema
|
|
DOC_ROOT=/var/www/html/ventas
|
|
WEB_ROOT=http://ventas-test.local:82
|
|
|
|
# Configuración SMTP (correos)
|
|
SMTP_HOST=
|
|
SMTP_USER=
|
|
SMTP_PASS=
|
|
SMTP_PORT=
|
|
|
|
# Configuración PAC (Facturación electrónica)
|
|
USER_PAC=
|
|
PW_PAC=
|
|
|
|
# Configuración de paginación
|
|
ITEMS_PER_PAGE=20
|
|
|
|
# Rango de años válidos
|
|
MIN_YEAR=2025
|
|
MAX_YEAR=2030
|
|
|
|
# =============================================================================
|
|
# CONFIGURACIÓN ADICIONAL
|
|
# =============================================================================
|
|
|
|
# Configuración de sesión
|
|
SESSION_LIFETIME=3600
|
|
SESSION_PATH=/
|
|
SESSION_DOMAIN=
|
|
|
|
# Configuración de seguridad
|
|
ENCRYPTION_KEY=ventas_encryption_key_32_chars
|
|
JWT_SECRET=ventas_jwt_secret_key_here
|
|
|
|
# Configuración de archivos
|
|
MAX_FILE_SIZE=10485760
|
|
ALLOWED_FILE_TYPES=pdf,xml,csv,xlsx
|
|
|
|
# Configuración de respaldos
|
|
BACKUP_PATH=/var/backups/ventas
|
|
AUTO_BACKUP=true
|
|
BACKUP_RETENTION_DAYS=30
|
|
|
|
# =============================================================================
|
|
# VARIABLES ESPECÍFICAS DEL NEGOCIO
|
|
# =============================================================================
|
|
|
|
# Tasas de impuestos
|
|
IVA_RATE=0.16
|
|
ISR_RATE=0.10
|
|
|
|
# Configuración de facturación
|
|
SERIE_FACTURA=A
|
|
SERIE_NOTA_CREDITO=B
|
|
FOLIO_INICIAL=1
|
|
|
|
# Información bancaria por defecto
|
|
BANK_NAME=Banamex
|
|
BANK_ACCOUNT=224996
|
|
BANK_CLABE=002100017902249960
|
|
BANK_BRANCH=0179
|
|
|
|
# Contacto por defecto
|
|
CONTACT_PHONE=(961) 10 5 58 20
|
|
CONTACT_EMAIL=contacto@empresa.com
|
|
CONTACT_WEB=www.empresa.com
|
|
|
|
# =============================================================================
|
|
# ENTORNOS ALTERNATIVOS (DEMO/PRODUCCIÓN)
|
|
# =============================================================================
|
|
# Para entorno DEMO (descomentar y usar si $_SESSION['curBD'] == 'Demo')
|
|
# DB_MASTER_HOST=10.10.4.17:3390
|
|
# DB_MASTER_USER=nickpons666
|
|
# DB_MASTER_PASSWORD=MiPo6425@@
|
|
# DB_EMPRESA_USER=nickpons666
|
|
# DB_EMPRESA_PASSWORD=MiPo6425@@
|