feat(pos/facturapi): finalize Horux-to-Facturapi migration
- 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).
This commit is contained in:
@@ -800,7 +800,7 @@
|
||||
</div>
|
||||
<div class="config-section__body">
|
||||
|
||||
<div class="cert-status">
|
||||
<div class="cert-status" id="csd-status">
|
||||
<div class="cert-status__icon">
|
||||
<svg viewBox="0 0 24 24">
|
||||
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/>
|
||||
@@ -808,60 +808,63 @@
|
||||
</svg>
|
||||
</div>
|
||||
<div class="cert-status__info">
|
||||
<div class="cert-status__name">
|
||||
CSD Activo <span class="badge badge--vigente">Vigente</span>
|
||||
<div class="cert-status__name" id="csd-status-name">
|
||||
CSD — Consultar estado en Facturapi
|
||||
</div>
|
||||
<div class="cert-status__detail">
|
||||
No. Certificado: 20001000000300022779 · Vence: 14/07/2026
|
||||
<div class="cert-status__detail" id="csd-status-detail">
|
||||
El estado del certificado se muestra en la sección Facturapi (PAC).
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn--ghost btn--sm">Ver</button>
|
||||
</div>
|
||||
|
||||
<div class="form-grid">
|
||||
<div class="form-field">
|
||||
<label class="form-label">Archivo .cer</label>
|
||||
<button class="btn btn--secondary" style="width:100%;justify-content:center;">
|
||||
<form id="csd-form" enctype="multipart/form-data">
|
||||
<div class="form-grid">
|
||||
<div class="form-field">
|
||||
<label class="form-label">Archivo .cer</label>
|
||||
<input type="file" id="csd-cer" name="certificate" accept=".cer" style="display:none;" />
|
||||
<button type="button" class="btn btn--secondary" id="csd-cer-btn" style="width:100%;justify-content:center;" onclick="document.getElementById('csd-cer').click()">
|
||||
<svg viewBox="0 0 24 24">
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
||||
<polyline points="17 8 12 3 7 8"/>
|
||||
<line x1="12" y1="3" x2="12" y2="15"/>
|
||||
</svg>
|
||||
<span id="csd-cer-label">Subir certificado .cer</span>
|
||||
</button>
|
||||
<span class="form-hint">Certificado público del SAT</span>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label class="form-label">Archivo .key</label>
|
||||
<input type="file" id="csd-key" name="private_key" accept=".key" style="display:none;" />
|
||||
<button type="button" class="btn btn--secondary" id="csd-key-btn" style="width:100%;justify-content:center;" onclick="document.getElementById('csd-key').click()">
|
||||
<svg viewBox="0 0 24 24">
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
||||
<polyline points="17 8 12 3 7 8"/>
|
||||
<line x1="12" y1="3" x2="12" y2="15"/>
|
||||
</svg>
|
||||
<span id="csd-key-label">Subir llave privada .key</span>
|
||||
</button>
|
||||
<span class="form-hint">Llave privada del CSD</span>
|
||||
</div>
|
||||
|
||||
<div class="form-field form-field--span2">
|
||||
<label class="form-label" for="contrasena-csd">Contraseña del CSD</label>
|
||||
<input class="form-input" id="contrasena-csd" name="password" type="password" placeholder="Contraseña de la llave privada" />
|
||||
<span class="form-hint">Contraseña asignada al generar el CSD en el SAT</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:var(--space-4);display:flex;justify-content:flex-end;gap:var(--space-3);">
|
||||
<button type="button" class="btn btn--ghost" onclick="Invoicing.resetCsdForm()">Cancelar</button>
|
||||
<button type="button" class="btn btn--primary" id="csd-submit-btn" onclick="Invoicing.uploadCsd(this)">
|
||||
<svg viewBox="0 0 24 24">
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
||||
<polyline points="17 8 12 3 7 8"/>
|
||||
<line x1="12" y1="3" x2="12" y2="15"/>
|
||||
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
|
||||
<path d="M7 11V7a5 5 0 0 1 10 0v4"/>
|
||||
</svg>
|
||||
Subir certificado .cer
|
||||
Actualizar CSD
|
||||
</button>
|
||||
<span class="form-hint">Certificado público del SAT</span>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label class="form-label">Archivo .key</label>
|
||||
<button class="btn btn--secondary" style="width:100%;justify-content:center;">
|
||||
<svg viewBox="0 0 24 24">
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
||||
<polyline points="17 8 12 3 7 8"/>
|
||||
<line x1="12" y1="3" x2="12" y2="15"/>
|
||||
</svg>
|
||||
Subir llave privada .key
|
||||
</button>
|
||||
<span class="form-hint">Llave privada del CSD</span>
|
||||
</div>
|
||||
|
||||
<div class="form-field form-field--span2">
|
||||
<label class="form-label" for="contrasena-csd">Contraseña del CSD</label>
|
||||
<input class="form-input" id="contrasena-csd" type="password" placeholder="Contraseña de la llave privada" />
|
||||
<span class="form-hint">Contraseña asignada al generar el CSD en el SAT</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:var(--space-4);display:flex;justify-content:flex-end;gap:var(--space-3);">
|
||||
<button class="btn btn--ghost">Cancelar</button>
|
||||
<button class="btn btn--primary">
|
||||
<svg viewBox="0 0 24 24">
|
||||
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
|
||||
<path d="M7 11V7a5 5 0 0 1 10 0v4"/>
|
||||
</svg>
|
||||
Actualizar CSD
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user