Commit Graph

16 Commits

Author SHA1 Message Date
Horux Dev
4e1a100b2a fix(sat-client): format dates in Mexico City timezone for SAT
formatDateForSat now uses Intl.DateTimeFormat with America/Mexico_City
timezone instead of UTC local time. Fixes 'Fecha final invalida' errors
when server runs in UTC and SAT interprets dates as Mexico local time.
2026-04-30 04:31:40 +00:00
Horux Dev
746d00bb66 fix(sat-sync): fallback to central FIEL for despacho tenants without per-contribuyente FIEL 2026-04-30 04:22:11 +00:00
Horux Dev
dd8484a800 feat(sat-sync): iterate contribuyentes for despacho tenants in daily sync
syncTenant now handles despacho mode by:
1. Querying fiel_contribuyente for active FIELs in the tenant DB
2. Running startSync per-contribuyente with contribuyenteId
3. Keeping legacy mode (tenant-wide sync) for Horux 360 tenants
2026-04-30 04:20:36 +00:00
Horux Dev
67cf2ae6fe fix(fiel): detect FIEL for despacho tenants via contribuyentes
hasFielConfigured() now checks both:
1. Legacy mode: fiel_credentials in central DB (Horux 360)
2. Despacho mode: fiel_contribuyente in tenant DB

This fixes the SAT daily sync omitting despacho tenants that have
FIEL loaded per-contribuyente but not in the central fiel_credentials table.
2026-04-30 04:17:18 +00:00
Horux Dev
8e83dd2276 feat(sat-sync): expand incremental sync to all plans except Custom and Mi empresa
- Daily sync already covers all active tenants with FIEL (no plan filter)
- Incremental sync now runs for all plans EXCEPT:
  - 'custom'
  - 'mi_empresa'
  - 'mi_empresa_plus'
- Renamed getEnterpriseTenantsWithFiel -> getIncrementalTenantsWithFiel
- Updated logs to reflect new eligibility
2026-04-30 03:02:19 +00:00
Horux Dev
380fd7ca9f feat(conceptos): add Excel export with extra columns
- Add exportConceptosToExcel function that fetches all filtered
  conceptos (limit 10000) and generates Excel
- Export button now works for both CFDIs and Conceptos tabs
- Extra columns in Conceptos Excel (not visible in table):
  Nombre Emisor, Nombre Receptor, Descuento, IVA Trasladado,
  IVA Retencion, ISR Retencion, Tipo Comprobante, Estatus CFDI
2026-04-30 01:20:08 +00:00
Horux Dev
740a5ac758 feat(cfdi): add hidden Excel columns
Add Subtotal MXN, Saldo Insoluto, Metodo de Pago, Forma de Pago,
ISR Retencion, IVA Retencion, and Descuento to Excel export.
These columns are not visible in the frontend table but included
in both bulk and single CFDI exports.
2026-04-30 01:15:54 +00:00
Horux Dev
e7dbae1ab7 feat: conceptos tab, filters, backfill, facturapi live keys, fixes
- Add Conceptos tab in CFDI page with column filters, sorting, pagination
- Add GET /cfdi/conceptos endpoint with filters and orderBy
- Backfill cfdi_conceptos from legacy XMLs (824k concepts inserted)
- Fix CFDI delete button (bypass subscription check, add alerts)
- Fix export to Excel (fetch all filtered results, limit 10k)
- Fix facturacion page concepto delete bug (immutable updates, unique ids)
- Add Facturapi live key auto-generation and caching
- Fix SAT fechaPagoP parsing
- Add metrics cache support for current year
- Increase DB pool max to 15
2026-04-29 21:03:41 +00:00
Horux Dev
066ba7deda fix: fechaPagoP pipe timestamp, admin redirects, despacho plans, CSF parsing 2026-04-28 22:24:30 +00:00
Horux Dev
3eb0f33f3b feat(timbres): 50 timbres mensuales auto para tenants plan custom 2026-04-28 15:35:05 +00:00
Horux Dev
ee9c76612e feat(facturacion): seccion CFDIs Relacionados para tipos I y E 2026-04-28 15:22:24 +00:00
Horux Dev
066c9cdb74 feat(registro): agrega Mi Empresa y Mi Empresa+ a pagina de registro 2026-04-28 14:52:42 +00:00
Horux Dev
2ac8e4d055 fix: TypeScript build errors in frontend
- Fix CFDI type errors (ivaTraslado, tipoCambio, id types)
- Fix sidebar navigation type errors (Role vs literal tuples)
- Fix user invite type errors (UserInvite['role'])
- Fix login page PlatformRole type cast
2026-04-28 04:51:52 +00:00
Horux Dev
2896eea4f2 fix: allow platform_admin/platform_ti login without active tenant memberships
- login(): check platformRoles before membership validation; fallback to first active tenant for superset admins
- refreshTokens(): allow refresh for superset admins even without memberships
- tenantMiddleware: skip tenantPool resolution when tenantId is empty for superset admins
2026-04-28 04:24:16 +00:00
Horux Dev
9e9e874dc5 feat: re-integrate Metabase auto-registration
- Add metabase.service.ts for automatic DB registration
- Hook createTenant, addTenantToOwner and deleteTenant to sync with Metabase
- Keep all existing features from latest version
2026-04-28 04:17:02 +00:00
consultoria-as
6b36db1403 Update: nueva version Horux Despachos 2026-04-27 22:09:36 -06:00