Commit Graph

131 Commits

Author SHA1 Message Date
bdbbc78a15 feat: script de instalacion automatizado para Debian/Ubuntu/RPi
Adds install.sh and uninstall.sh for one-command deployment of Nexus POS
on Debian 12+, Ubuntu 22.04+, and Raspberry Pi OS. The installer handles
PostgreSQL setup, tenant provisioning, systemd service, and nginx reverse
proxy with interactive business configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 07:15:06 +00:00
fa7015e642 docs: documentacion completa — README, guia de uso, instalacion, API POS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 03:38:10 +00:00
a389228048 feat: selector de region en catalogo publico (MX/USA/CA, Europa, Asia, Todos)
Filtra marcas por mercado regional. 4 opciones:
- Mexico/USA/Canada (36 marcas)
- Europa (27 marcas)
- Asia (15 marcas)
- Todos (546 marcas)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:33:43 +00:00
989a178143 feat: rebuild web — landing page + catalogo publico con navegacion por vehiculo
Removidas paginas viejas (demo, tienda, admin, pos, captura, cuentas).
Nueva landing page con estilo del design system (tokens.css, 2 temas).
Catalogo publico sin auth con navegacion Marca>Modelo>Ano>Motor>Categoria>Partes.
Endpoints /api/catalog/* publicos con filtro NORTH_AMERICA_BRANDS (36 marcas).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:21:45 +00:00
e7376ddaed fix(pos): wire buttons in contabilidad, facturacion, inventario, dashboard
- Contabilidad: Nueva Poliza modal + Exportar placeholder
- Facturacion: Nueva Factura modal (sale_id input) + Nota Credito placeholder
- Inventario: click en producto abre detalle con historial
- Dashboard: Ver Detalles navega a paginas relevantes, campana a alertas

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:36:49 +00:00
a74fe94187 feat(pos): filtrar marcas a solo Mexico/USA/Canada (36 marcas)
Eliminadas marcas de otros mercados (China, Australia, etc.)
Solo se muestran las relevantes para Norteamerica.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:21:52 +00:00
d5569d0cb6 perf(pos): eliminar JOIN vehicle_parts de queries de navegacion
vehicle_parts tiene 14B+ rows. Las queries de brands, models, years,
engines ahora solo usan model_year_engine (mucho mas rapido).
vehicle_parts solo se consulta para categories/groups/parts donde
se filtra por un mye_id especifico.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:16:31 +00:00
a3abb6d3a8 fix(pos): restaurar catalog_service.py real (sobreescrito por stub)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:10:55 +00:00
41a96ec1a4 feat(pos): rewrite catalog UI — vehicle hierarchy navigation with detail panel
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:49:35 +00:00
33cb053519 feat(pos): rewrite catalog blueprint — 9 endpoints for vehicle hierarchy navigation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:42:58 +00:00
e88988f478 feat(pos): add catalog service — TecDoc hierarchy + stock enrichment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:41:35 +00:00
4e08e12826 docs: add catalog vehicle navigation implementation plan
5-task plan: catalog_service.py, catalog_bp.py rewrite (9 endpoints),
catalog.html + catalog.js rewrite with hierarchical vehicle navigation,
integration test. Performance-optimized for 14B+ vehicle_parts table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:37:13 +00:00
2ac9b90afc docs: add catalog vehicle navigation design spec
Catalog redesign: TecDoc hierarchical navigation
(Brand→Model→Year→Engine→Category→Parts) with local stock +
bodega availability + aftermarket alternatives. Offline fallback
to local inventory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:22:55 +00:00
168a5df50a fix(pos): filtros de catalogo dinamicos por marca del inventario
- Chips de filtro se cargan desde API /catalog/brands
- Muestran marcas reales (Bosch, KYB, NGK...) con conteo
- Boton 'Todos' para quitar filtro
- Filtrado por brand via API en vez de category_id

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:02:30 +00:00
2848b4c181 fix(pos): habilitar botones de inventario — Nuevo Producto, Exportar, Sincronizar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:52:25 +00:00
5ade1275de fix(pos): sidebar con estilo del design system — SVG icons, secciones, clip-path
Reescrito sidebar.js para coincidir exactamente con el design system:
- Logo NA con clip-path en tema industrial, border-radius en moderno
- Secciones: Principal, Gestion, Sistema
- SVG icons de Feather (mismo trazo 1.75px)
- Border-left accent en item activo
- Toggle de tema con iconos luna/sol
- Footer con avatar, nombre, rol, y boton logout
- 260px width, colapsa a 56px en mobile
- Usa CSS variables del tokens.css

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:35:02 +00:00
d0a1740291 fix(pos): eliminar flash de tema al navegar entre paginas
Script inline en <head> aplica el tema guardado ANTES de que
el CSS se renderice. Elimina el flash blanco→oscuro o viceversa.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:28:43 +00:00
e8b53f0b1b fix(pos): tema consistente en todas las paginas + theme bar ocultada
- app-init.js: aplica tema guardado en localStorage, oculta theme-bars
  que tapaban contenido (position:fixed), sobrescribe setTheme() de
  cada pagina para usar version persistente
- sidebar.js: toggle de tema (sol/luna) integrado en el sidebar
- Tema se mantiene al navegar entre paginas

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:27:25 +00:00
76c9c2d2db fix(pos): sidebar unificado en todas las paginas
Nuevo sidebar.js compartido que reemplaza el sidebar de cada pagina
con una version consistente:
- Misma estructura y orden de links en todas las paginas
- Nombre y rol del empleado real (de POS_USER)
- Link activo resaltado segun pagina actual
- Boton de logout
- Responsive (colapsa a iconos en <768px)
- Elimina inconsistencias de estilo entre paginas

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:20:55 +00:00
b887f0c032 fix(pos): arreglar 29 enlaces rotos del sidebar en todas las paginas
Reemplazados todos los href="#" en nav-items y nav-links con
las rutas reales (/pos/dashboard, /pos/sale, /pos/catalog, etc.)
en catalog, inventory, customers, dashboard, config, reports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:13:34 +00:00
6558e289f3 fix(pos): reemplazar datos demo con datos reales del empleado logueado
- Nuevo app-init.js: auth check, inyecta nombre/rol real del empleado
  en sidebar, header, y status bar de TODAS las páginas
- Eliminados 6 productos demo hardcodeados del catálogo
- Sidebar muestra nombre real del usuario logueado
- Links de navegación marcan la página activa correctamente
- Función posLogout() global para cerrar sesión

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:09:12 +00:00
5244c1dcd6 fix(pos): default tenant ID en login para evitar error sin parametro URL
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 08:47:37 +00:00
7810005a57 fix(pos): cargar empleados reales en login en vez de datos demo
- Nuevo endpoint GET /pos/api/auth/employees/<tenant_id>
- Login carga empleados dinamicamente del tenant
- Si hay 1 solo empleado, se auto-selecciona
- Removidos 6 usuarios hardcodeados del design system

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 08:46:25 +00:00
56fed52253 fix(pos): rewrite customers.js to match design system HTML structure
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 08:35:19 +00:00
004cca7ccc fix(pos): rewrite inventory.js to match design system HTML structure
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 08:29:14 +00:00
761e56e87f fix(pos): rewrite invoicing + accounting JS to match design system HTML
Invoicing JS now targets panel-facturas/notas/complementos/cancelaciones/config
panels, modalDetalleOverlay/modalCancelOverlay modals, and switchTab() calls.
Loads CFDI queue data dynamically into data-table tbodies replacing demo rows.

Accounting JS now targets panel-cxc/cxp/balance/resultados/flujo/conciliacion/cierre
panels and finance-card elements. Wires aging, balance sheet, income statement,
and period close to real API endpoints.

Both files include auth check, live clock, and global switchTab binding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 08:27:59 +00:00
3ea6f181ff fix(pos): rewrite catalog.js to match design system HTML structure + add cart sidebar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 08:09:21 +00:00
6ec3a90d57 fix(pos): corregir enlaces de navegacion en todas las paginas
Reemplaza enlaces del design system (dashboard.html, pos.html, etc.)
con rutas reales del POS (/pos/dashboard, /pos/sale, etc.).
Limpia archivos backup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 07:52:03 +00:00
0112b7dca4 feat(pos): integrate design system into POS — payment modal, F-keys, ticket, margins
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 07:31:18 +00:00
9641b0af80 feat(pos): integrate design system for clients, inventory, catalog + offline banner
- Replace customers.html with design system clientes page, add slide panel + wire to customers.js
- Replace inventory.html with design system inventario page, load inventory.js
- Add empty state component to catalog product grid (hidden, shown when no results)
- Add offline banner HTML/CSS to all three pages
- Create offline-banner.js: listens online/offline events, auto-dismisses restored banner after 3s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 07:28:41 +00:00
21427c4dd2 feat(pos): integrate design system for facturacion, contabilidad, dashboard, config, reportes
Replace 5 POS templates with updated design system pages using tokens.css.
Add routes for dashboard, config, and reports pages.
Create stub JS files for dashboard, config, and reports modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 07:26:38 +00:00
Lucy
ccd3962458 feat(design): add 16 new components + update 5 pages (ronda 2)
Bloqueantes POS: modal-pago, ticket-termico, banner-cliente, fkeys-footer, columnas-costo-margen
Componentes nuevos: calculadora-cambio, panel-deslizante, badge-cfdi, arbol-colapsable, tarjeta-metrica, grafica-barras, selector-periodo, etiqueta-codigo-barras
Estados: estado-vacio, banner-offline, modal-confirmacion
Páginas actualizadas: facturación, contabilidad, dashboard, configuración, reportes
2026-04-01 07:06:34 +00:00
380698258a feat: agregar design system completo con 2 temas (Industrial + Moderno)
- Login: PIN pad con seleccion de usuario + auth real via API
- Catalogo: grid de productos con sidebar nav y filtros
- POS: layout split con numpad y area de venta
- tokens.css: sistema completo de CSS variables (colores, tipografia, espaciado)
- 2 temas: Industrial Robusto (dark/amber) y Tecnico Moderno (light/orange)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 06:22:46 +00:00
Lucy
46360b6827 feat: agregar design system completo con 2 temas (Industrial + Moderno)
- Tokens CSS con variables para ambos temas (dark/light)
- 21 componentes reutilizables (buttons, cards, tables, modals, etc.)
- 10 pantallas POS (login, catálogo, POS, inventario, clientes, facturación, contabilidad, dashboard, configuración, reportes)
- Preview interactivo con selector de tema
- Generado por el equipo de Hugo (Milo-UX, Iris-UI, Zara-Frontend)
2026-04-01 01:41:04 +00:00
5fc47473b6 docs: add POS screen design guide for design team
10 screens, 20 reusable components, 6 states/variants,
CSS theme system. Complete wireframes and specifications
for each page, modal, and component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 21:18:14 +00:00
bc950efc26 fix(pos): resolve integration test failures for CFDI + accounting
- Fix sat_accounts.sql: split multi-row INSERT into individual statements
  so parent_id subqueries resolve correctly (was producing all NULLs)
- Add tenant_config table to v1.0 schema (required by CFDI invoicing)
- Seed tenant_config with RFC/regimen during tenant provisioning
- Fix cancel_sale to pass complete sale data for accounting reversal
- Fix CFDI XML builder: use `or` instead of dict.get() defaults to
  handle explicit None values from DB (clave_prod_serv, clave_unidad)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:54:50 +00:00
c56709d45e feat(pos): hook accounting auto-entries into sale/cancel flow (non-blocking)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 04:14:15 +00:00
4e6bac8661 feat(pos): add CFDI 4.0 XML builder — Ingreso, Egreso, Pago with lxml
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:13:08 +00:00
62ea08de9f feat(pos): add accounting frontend — reports, entries, periods
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:11:48 +00:00
9a9031fd27 feat(pos): add accounting blueprint — reports, entries, periods
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:11:02 +00:00
e0773cdc1e feat(pos): add invoicing blueprint — CFDI generation, queue, cancel
Six endpoints: POST invoice, GET queue, GET queue/<id>, POST queue/process,
POST cancel/<id>, GET <sale_id>/pdf. Also adds cfdi_builder stub (Task 2).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:10:48 +00:00
fe8eff5ea0 feat(pos): add invoicing frontend — CFDI queue, XML preview, cancel
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:10:48 +00:00
40e7dd371a feat(pos): add accounting engine — auto journal entries for sales/purchases
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:10:30 +00:00
a665cdb737 feat(pos): add CFDI queue — offline timbrado with retry backoff
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:10:13 +00:00
3b804f2c34 feat(pos): register invoicing + accounting blueprints 2026-03-31 04:09:25 +00:00
aeac4387df docs: add CFDI + Accounting implementation plan (4 of 5)
10-task plan covering:
- Accounting engine (auto journal entries for sales/purchases/cuts)
- CFDI 4.0 XML builder (Ingreso/Egreso/Pago with lxml)
- CFDI queue (offline timbrado with retry backoff via Horux API)
- Invoicing blueprint (6 endpoints)
- Accounting blueprint (11 endpoints: reports, periods, entries)
- Hooks into POS engine (non-blocking try/except)
- Frontends for both modules

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 04:08:21 +00:00
09980c1cdb fix(pos): enrich quotation/layaway items from inventory and allow final payment on layaway complete
Quotation and layaway endpoints were calling calculate_totals() on raw
input items without looking up unit_price/tax_rate from inventory, causing
KeyError. Added _enrich_items() helper (with customer price tier support).
Also removed non-existent discount_total column from quotations INSERT,
and made layaway complete accept a final payment for the remaining balance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 03:51:21 +00:00
b2484af0fb feat(pos): add POS sale page — F-keys, payment modal, margin display, ticket print
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 03:38:31 +00:00
76f738652b feat(pos): add customers page — search, credit, vehicles, statements
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 03:36:42 +00:00
c66fb13c15 feat(pos): add POS blueprint — sales, quotations, layaways with stock reservation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 03:36:04 +00:00