FASE 4-5-6: Infraestructura, CRM, Service Orders, Notificaciones, Ahorro, Logistica, API Publica
FASE 4: - Redis cache de stock con fallback graceful - Multi-moneda (MXN/USD) con contabilidad en MXN - Proveedores y ordenes de compra completo - Meilisearch 1.5M+ partes indexadas - Metabase KPIs con dashboard auto-generado FASE 5: - CRM mejorado: activities, tags, loyalty program, analytics - Imagenes de partes: upload, resize, thumbnails WebP - Ordenes de servicio Kanban: received->diagnosis->repair->ready->delivered - Garantias/RMA, alertas de reorden, multi-sucursal - Stubs BNPL (APLAZO) y ERP Sync (Aspel/Contpaqi) FASE 6: - Notificaciones automaticas: push/WhatsApp/email/in-app - Reportes de ahorro vs retail_price - Logistica + tracking: DHL, FedEx, Estafeta, 99min, Uber - API Publica: API keys, rate limiting, catalog search Migraciones: v1.9-v3.0 Tests: 93/93 pasando Backup: nexus_backup_20260427_045859.tar.gz
This commit is contained in:
36
pos/migrations/v2.0_multi_currency.sql
Normal file
36
pos/migrations/v2.0_multi_currency.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
-- v2.0_multi_currency.sql
|
||||
-- Mejora #8: Soporte Multi-moneda
|
||||
--
|
||||
-- Adds currency and exchange_rate columns to sales, sale_items,
|
||||
-- quotations, quotation_items, and sale_payments.
|
||||
--
|
||||
-- Business rule: inventory prices are ALWAYS in MXN (base currency).
|
||||
-- Sales can be recorded in USD (or other currencies) with conversion
|
||||
-- at checkout time. Accounting and CFDI always use MXN.
|
||||
|
||||
-- sales
|
||||
ALTER TABLE sales
|
||||
ADD COLUMN IF NOT EXISTS currency VARCHAR(3) DEFAULT 'MXN',
|
||||
ADD COLUMN IF NOT EXISTS exchange_rate NUMERIC(12,6) DEFAULT 1.0;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_sales_currency ON sales(currency);
|
||||
|
||||
-- sale_items
|
||||
ALTER TABLE sale_items
|
||||
ADD COLUMN IF NOT EXISTS currency VARCHAR(3) DEFAULT 'MXN',
|
||||
ADD COLUMN IF NOT EXISTS exchange_rate NUMERIC(12,6) DEFAULT 1.0;
|
||||
|
||||
-- quotations
|
||||
ALTER TABLE quotations
|
||||
ADD COLUMN IF NOT EXISTS currency VARCHAR(3) DEFAULT 'MXN',
|
||||
ADD COLUMN IF NOT EXISTS exchange_rate NUMERIC(12,6) DEFAULT 1.0;
|
||||
|
||||
-- quotation_items
|
||||
ALTER TABLE quotation_items
|
||||
ADD COLUMN IF NOT EXISTS currency VARCHAR(3) DEFAULT 'MXN',
|
||||
ADD COLUMN IF NOT EXISTS exchange_rate NUMERIC(12,6) DEFAULT 1.0;
|
||||
|
||||
-- sale_payments
|
||||
ALTER TABLE sale_payments
|
||||
ADD COLUMN IF NOT EXISTS currency VARCHAR(3) DEFAULT 'MXN',
|
||||
ADD COLUMN IF NOT EXISTS exchange_rate NUMERIC(12,6) DEFAULT 1.0;
|
||||
Reference in New Issue
Block a user