170 Commits

Author SHA1 Message Date
a4f90cd4a3 Remove Cobrar button from Notas de Remision list
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-18 17:25:24 +00:00
8e6c1f2887 Add ticket paper width selector and improve thermal cut/print layout
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-18 09:22:58 +00:00
6d07eab5c0 Add workshop module toggle in Modules & Integrations settings
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-16 08:13:56 +00:00
c90012ca37 Add allow_negative_stock toggle for sales, remissions, quotes, layaways and service orders
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-15 18:02:43 +00:00
116d4452da Add allow_zero_price_sales toggle: config UI, POS enforcement and backend validation
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-15 17:50:02 +00:00
1cce81b75f Facturapi: fix legal payload (name/legal_name/tax_system, address, no tax_id), reuse local org, status via user key; add fiscal address fields; embed Carta Manifiesto iframe
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-13 06:35:36 +00:00
b2f23ef3cf fix(facturapi): configure legal data after org creation/reuse to enable Live mode
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-09 07:25:07 +00:00
a8e748e08f fix(invoicing): wire emisor config save/load and align fiscal config keys
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-06 23:49:23 +00:00
0bd5ee8ee8 fix(permissions): honor module permissions for cashier/counter in sidebar and page guard
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-03 08:10:22 +00:00
e270e848d7 fix(config): use cfg-tab-btn style for permissions tabs
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-03 08:05:27 +00:00
6e85497e42 feat(permissions): granular module permissions + workshop permissions matrix
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-03 07:55:17 +00:00
1ff4d80277 fix(pos): print tickets via iframe with measured height and configurable paper width
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-02 23:11:55 +00:00
982315bdaf feat(permissions): add dashboard.view permission for cashier/counter/workshop
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-02 22:37:28 +00:00
1b51fe65b5 fix(pos): hide Sistema button for non-admin roles and allow login/logout in page guard
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-02 22:27:50 +00:00
53ec0cc3e5 fix(inventory): read refreshed token dynamically in inventory.js
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-02 19:27:22 +00:00
944b9b51b3 fix(customers): allow cashiers to view customers and use refreshed token
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-02 14:49:47 +00:00
c226b1cf77 fix(workshop): restrict workshop/mechanic views to only 'autorizada' status
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-07-02 14:38:29 +00:00
f42910f4f6 feat: cashier/counter reports, service-order & remission flows, Rached migration utils
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- Add "Mis cortes de caja" report for cashiers/counters with sales detail.
- Cash register history scoped to own cuts for non-admin roles; new /register/<id>/sales endpoint.
- Remove dashboard from cashier menu; add Reports to cashier/counter.
- Service orders: assign mechanic, budget field, invoice flag, counter/cashier can add items/remissions, convert to remission.
- Remission notes module (UI, CSS, courier, counter remissions).
- Customer hard-delete and vehicle/customer linkage in workshop.
- POS: always show search results, compact payment grid, credit validation, tier pricing (5%/10%), ticket with customer/folio.
- Inventory: CSV template with sku_secondary, alias import.
- Rached migration scripts and DB migrations.
- Version-bump cached JS/CSS query strings.

Excludes local Rached session tokens/captures (rached_*.json / rached_*.txt).
2026-07-02 12:51:56 +00:00
483498cfcc fix: define global toast utility in app-init
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- Added window.toast() in app-init.js so workshop/customers/inventory pages can use it.

- Bumped app-init.js cache version on all templates.
2026-06-30 20:13:32 +00:00
7dc34f68ab feat(workshop): make brand/model required, plate optional, remove VIN
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 20:08:56 +00:00
073c97406b feat(customers): show vehicles and delete customer
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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).
2026-06-30 19:58:45 +00:00
66b8fe3d69 feat(workshop): vehicles must be assigned to a customer
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 19:53:00 +00:00
1af66cb302 fix(workshop): ensure new-customer/new-vehicle modals open on top
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 19:49:42 +00:00
5c700e98c3 feat(workshop): add new customer from new order modal
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 19:45:41 +00:00
603046cb09 feat(inventory): edit items in inventory grid
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- Added 'Editar' button in inventory rows.

- Reused create modal as create/edit with pre-filled data.

- Added fields: unit, max_stock, tax_rate, description, is_active.

- Added /inventory/categories/all endpoint for flat category selector.

- Price/cost inputs are disabled for users without config.edit_prices.
2026-06-30 19:43:03 +00:00
b6679c6d9c feat(workshop): add vehicle from new order modal too
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
The '+ Nuevo' vehicle button is now available in both the edit and new service order modals.
2026-06-30 19:36:05 +00:00
52cb01eb4e feat(workshop): add vehicle from service order
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 19:33:07 +00:00
ff600ed7df feat(workshop): remove quality_check and add edit order modal
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 19:30:51 +00:00
b539c92daf feat(i18n): force Spanish as the only language across all tenants
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 18:13:43 +00:00
37b7f94f54 fix(config): saveAll crash when saving modules
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
saveModules() used event.target, which is undefined when called from saveAll.

Replaced with direct checkbox lookups and null checks.
2026-06-30 18:04:22 +00:00
7e3205b03a feat(config): allow admin/owner to delete branches
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 17:57:29 +00:00
e9cfb2e756 feat(workshop): allow admin/owner to delete service orders
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 17:51:09 +00:00
2863cf8e9f feat(workshop): restrict status flow, add mechanic notes, inventory part picker
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 17:43:19 +00:00
1ca056ad0f fix(login): deshabilita auto-redirect y redirige segun rol tras login
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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.
2026-06-30 17:17:56 +00:00
93eebe0662 fix(login): el login ahora respeta el empleado seleccionado
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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
2026-06-30 17:02:40 +00:00
a37e60eb2a fix(auth): restringe workshop/mecanico solo por servidor y cookie
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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
2026-06-30 16:57:11 +00:00
688ea8c70c fix(auth): redirige a taller y limpia SW para usuarios workshop/mechanic
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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
2026-06-30 16:46:30 +00:00
4d971dd1a4 chore(cache): bump static assets y service worker a v33
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- Fuerza recarga del sidebar.js, app-init.js y workshop.js actualizados
- Soluciona que usuarios workshop/mechanic veian todos los menus por cache anterior
2026-06-30 16:41:54 +00:00
c2db68b184 fix(roles): restringe usuarios Taller y Mecanico a solo la seccion de Taller y oculta precios
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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
2026-06-30 16:36:38 +00:00
c58f622486 fix(config): agrega roles Taller y Mecanico en creacion de empleados
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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
2026-06-30 16:31:45 +00:00
c1e481fb79 feat(config): agrega personalización de ticket con logo y opciones
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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
2026-06-30 08:35:10 +00:00
2bdeb2973a fix(audit): corrige errores criticos y mayores, mejora UX/accesibilidad y optimiza rendimiento
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
- 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
2026-06-29 23:54:58 +00:00
59a4893e84 fix: reporte de Clientes usa /aging-summary agrupado por cliente
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-06-26 00:36:50 +00:00
66d1268bfb fix: separa Cuentas por Cobrar (ventas a crédito) y Cuentas por Pagar (órdenes de compra)
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-06-26 00:32:46 +00:00
9a55e15142 fix: botón Historial en clientes abre modal con historial completo de compras
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-06-26 00:28:18 +00:00
2ed672c3c3 fix: agrega helper esc en accounting.js y placeholder para pagos a proveedor
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-06-26 00:21:18 +00:00
6b00e45f5d feat: detalle de cuentas por cobrar con opción de cancelar ticket
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-06-26 00:17:25 +00:00
0da4bcd9d9 feat: agrega botón Venta a Crédito en barra de cliente del POS
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-06-26 00:10:18 +00:00
d3e1660cb1 fix: formatea fechas de historial de inventario a hora local del navegador
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-06-25 23:29:25 +00:00
74118a3247 Merge branch 'desarrollo_hector' into main
Some checks failed
CI / lint-and-test (3.11) (push) Has been cancelled
CI / lint-and-test (3.13) (push) Has been cancelled
2026-06-22 22:51:05 +00:00