fix: ventas JSON uses FECHAFACT (billing date) instead of FECHA_RECEPCION

- generar_factura_venta: fecha = FECHAFACT with fallback to FECHA_RECEPCION
- _SQL_VENTAS_BY_FACTURA: add JOIN FACTURA_DIAN to fetch FECHAFACT for send-one

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-28 19:35:18 -05:00
co-authored by Claude Sonnet 4.6
parent f4f135ba29
commit 64682de147
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -265,7 +265,7 @@ def generar_factura_venta(rows: list, default_vendedor: str = "00",
h = rows[0]
num_fac = (numero_override if numero_override else str(h.get("NUM_FACTURA") or "")).zfill(5)
fecha = _fmt_fecha(h.get("FECHA_RECEPCION"))
fecha = _fmt_fecha(h.get("FECHAFACT") or h.get("FECHA_RECEPCION"))
detalle_pedido = []
for row in rows: