- create_vehicle endpoints now require make and model; plate is optional; VIN is no longer stored.
- Updated new-vehicle modal: removed VIN field, plate is optional, brand/model marked required.
- get_customer now returns fleet_vehicles assigned to the customer.
- Added DELETE /pos/api/customers/<id> soft-delete (is_active=false) with customers.delete permission.
- Added Vehicles section in customer detail panel.
- Added Eliminar button in quick actions (owner/admin/customers.delete).
- Added customer_id column to fleet_vehicles with FK to customers.
- Enforced customer_id on create_vehicle endpoints (workshop and fleet).
- New vehicle modal now requires a selected customer and stores customer_id.
- Migration v4.13 applied to all tenants.
- Raised z-index of newCustomerModal and newVehicleModal so they appear above the order modal.
- Added '+ Nuevo' customer button in the edit-order modal as well.
- Added POST /pos/api/service-orders/customers endpoint for workshop.edit users.
- Added 'Nuevo cliente' modal reachable from the new service order form.
- After creation the customer is automatically selected in the order.
- Added POST /pos/api/service-orders/vehicles endpoint for workshop.edit users.
- Added 'Nuevo vehiculo' modal in edit order with plate, VIN, make, model, year, color and owner.
- After creation the vehicle is automatically selected in the order.
- Removed 'Control de calidad' from service order pipeline (VALID_TRANSITIONS, status labels, Kanban columns).
- Added editable fields for customer, vehicle, branch, mechanic, priority, mileage, fuel level, estimated completion/cost and reception notes.
- Added customer/vehicle autocomplete in the edit order modal.
- i18n.js now locks currentLang to 'es' and overwrites pos_lang in localStorage.
- Disabled setLang language switching.
- Removed ES/EN toggle from sidebar.
- Bumped i18n.js and sidebar.js cache version on all templates.
- Added DELETE /pos/api/config/branches/<id> that soft-deletes the branch (is_active=false).
- Restricted to owner/admin; main branch cannot be deleted.
- Added 'Eliminar' button in the branches grid for admin/owner.
- Soft-delete service orders via is_deleted flag.
- Added DELETE /pos/api/service-orders/<id> restricted to owner/admin.
- Updated list, detail, summary, status and assignment queries to exclude deleted orders.
- Added 'Eliminar orden' button in the detail modal for administrators.
- Service orders can no longer move backwards through the workshop pipeline.
- Added editable Reception / Diagnosis / Repair / Delivery notes in the detail modal.
- Added inventory-aware autocomplete when attaching parts to a service order.
- login.html ya no redirige automaticamente si hay token; esto permite
cambiar de usuario en dispositivos compartidos.
- Limpia token/empleado expirados.
- Tras login exitoso, redirige a /pos/workshop para taller/mecanico y a
/pos/catalog para los demas roles.
Esto facilita probar el login con distintos usuarios en La Casita.
- auth_bp.py: login acepta employee_id y verifica el PIN solo de ese empleado.
Fallback legacy se mantiene para clientes antiguos.
- login.html: guarda el id del empleado seleccionado y lo envia en la peticion.
- Se agrega cookie pos_role en el login inline del HTML.
Esto corrige el problema donde seleccionar cualquier usuario accedia siempre
al mismo empleado (el primero con el mismo PIN).
Tests: 35 passed
- Elimina el script inline que redirigia a todos los usuarios.
- auth_bp.py: la respuesta de login ahora setea cookie pos_role.
- app.py: before_request redirige a /pos/workshop solo cuando la cookie
indica rol workshop/mechanic (no depende de JS cacheado).
- login.js/login.min.js/app-init.js: sincronizan/limpian la cookie pos_role
junto con el token en login y logout.
Tests: 35 passed
- Agrega script inline en todas las plantillas (excepto login/workshop) que lee
el rol del JWT y redirige a /pos/workshop si es workshop/mechanic.
- Desregistra el Service Worker antes de redirigir para forzar carga fresca
de assets y evitar que menus antiguos permanezcan por cache.
- Actualiza labels de rol en auth_bp.py para taller y mecanico.
Tests: 35 passed
- Fuerza recarga del sidebar.js, app-init.js y workshop.js actualizados
- Soluciona que usuarios workshop/mechanic veian todos los menus por cache anterior
- sidebar.js: itemAllowed incluye mechanic junto a workshop -> solo muestra Taller
- app-init.js: redirige a /pos/workshop si el rol es workshop/mechanic
- config_bp.py: remueve customers.view y fleet.view de los permisos por defecto de workshop/mechanic
- workshop.js: hidePrices ahora tambien aplica para mechanic; oculta columnas/inputs de precio
- app-init.js/config.js: agrega etiquetas de rol para workshop y mechanic
- workshop.html: marca columnas de precio con price-col y oculta input catRate
Tests: 35 passed
- Agrega opciones workshop y mechanic al select de rol en config.html
- Actualiza ROLE_LABELS y ROLE_BADGE en config.js
- Valida roles mechanic y workshop en config_bp.py con permisos por defecto
- Añade clases CSS badge--orange y badge--teal
Tests: 35 passed
- Nuevos endpoints /pos/api/config/receipt (GET/PUT)
- Sección en config.html para subir logo, datos del negocio y toggles visuales
- pos.js carga la config y renderiza el ticket usando logo, RFC, dirección,
teléfono, mensajes y opciones de desglose/empleado/pago configurables
- Logo se redimensiona a 300px de ancho y se guarda como base64 JPEG en tenant_config
Tests: 35 passed
- Arregla @require_auth, permisos, race conditions, locks de caja/stock
- Elimina N+1 en layaway, flotilla, dashboard y global_invoice
- Asegura folios atomicos para CFDI, ordenes de servicio y polizas
- Protege client_secret de MercadoLibre en backend
- Conecta botones/filtros de config, customers, accounting e invoicing
- Mejora accesibilidad (labels/aria-label) y estados de carga/vacio
- Limpia accounting.js obsoleto y consolida accounting.v9.js
- Actualiza cache busting a v32 y Service Worker a v32
- Documenta todo en docs/AUDIT_Y_MEJORAS_2026-06-15.md
Tests: 35 passed
- Hace clickeables las filas de la tabla para seleccionar un cliente y
mostrar su panel de detalle (donde ya existe el botón Editar).
- Agrega botón de acción rápida con icono de lápiz en cada fila para
abrir directamente el modal de edición.
- Extrae openEditModal y agrega editCustomer(id) para cargar el cliente
vía API y abrir el modal sin depender de la selección previa.
- Actualiza colspan del estado vacío de 9 a 11 por la nueva columna.
El enlace <a> a /pos/api/supplier-catalog/prices/template fallaba con 401
porque la navegación normal no envía el header Authorization. Se reemplaza
por un botón que descarga el blob vía fetch con Bearer token y dispara la
descarga del cliente. También se corrige clase btn-primary -> btn--primary.
- Usa app-shell/main, page-header con eyebrow, summary-strip y cards con iconos.
- Reemplaza badges personalizados por .badge del design system.
- Unifica tablas con .data-table y .table-wrapper.
- Estandariza modales con .modal-overlay/.modal y formularios con .form-grid.
- Actualiza workshop.js para usar clases del sistema y toggle is-open en modales.
- Corrige tokens rotos (--text-sm, --color-warn, etc.) y usa variables del tema.
- Normalize Facturapi key/org_id resolution (supports both cfdi_ prefixed
tenant_config keys and short names used by invoicing_bp).
- Add CSD upload end-to-end (backend + frontend).
- Add helper scripts: setup_facturapi_orgs.py and check_facturapi_tenants.py.
- Add 20 unit tests with mocks (pos/tests/test_facturapi_service.py).
- Add CI workflow for lint + console tests on Python 3.11/3.13.
- Add pyproject.toml and requirements-dev.txt with ruff/pytest config.
- Update FASES_IMPLEMENTADAS.md with FASE 8 documentation.
Tests: 81 passing (61 console + 20 Facturapi).
- Replace ID Producto input with autocomplete search by name/part number/barcode
- Support Enter key for barcode/part number exact match
- Keep hidden inventory_id field for API compatibility
- Bump inventory.js cache version
- Month view now groups by weeks of the current calendar month
- Labels are Sem 1, Sem 2, Sem 3, Sem 4
- Historical sales grouped by day-of-month into the 4 week buckets
- Bump dashboard.js to ?v=7
- Replace placeholder setPeriod() with functional period switcher
- loadChart() supports Hoy (1 day), Semana (7 days), Mes (4 weeks), Año (12 months)
- Includes both normal POS sales and imported historical sales
- Updates chart title, total label and legend dynamically
- Bump dashboard.js to ?v=6
- Add 'Histórico' tab inside Reports page with date/customer filters
- Show historical sales KPIs and detail table in reports
- Add historical sales summary cards to Dashboard
- Load current month totals and total imported records