- 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.
DELETE /customers/<id> now removes the row.
- Deletes layaways and dependent items/payments.
- Nullifies customer_id in sales, service_orders, fleet_vehicles, plate_vehicles, quotations, returns, warranties, bnpl_transactions, customer_payments.
- Cascade-delete CRM tables are handled by FK constraints.
- 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.
- 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.
- Backend: nuevo endpoint DELETE /employees/<id> que desactiva (soft-delete).
No permite eliminar cuentas de dueno.
- Frontend: boton Eliminar en la tabla de empleados con confirmacion.
- Exponer deleteEmployee en el modulo Config.
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
- 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