fix: quitar codFormaPago header, fechaAutorizacion=hoy, descuento de Firebird
- Elimina codFormaPago del header RDA (no va segun JSON de referencia) - fechaAutorizacion usa fecha de hoy, no la de recepcion - descuento toma rel.DESCUENTO de Firebird en vez de hardcodeado 0 - Agrega rel.DESCUENTO al SELECT en test_rda y automation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
543af23779
commit
c7428a196b
@@ -61,6 +61,7 @@ SELECT
|
||||
rel.COD_EXAMEN,
|
||||
rel.PRECIO,
|
||||
rel.FECHA_REPORTADO,
|
||||
rel.DESCUENTO,
|
||||
m.COD_ESPECIALIDAD,
|
||||
COALESCE(NULLIF(TRIM(m.CODIGO), ''), NULLIF(TRIM(r.USUARIO), ''), '') AS profesional,
|
||||
e.CODCONTRATO,
|
||||
|
||||
@@ -21,6 +21,7 @@ SELECT
|
||||
r.IDRECEPCION, r.PREFIJO, r.NUM_FACTURA, r.FECHA_RECEPCION, r.COD_PACIENTE,
|
||||
r.NIT_EMPRESA, r.DIAG_PPAL, r.TIPOUSU, r.TIPOUSUSISPRO, r.AUTORIZACION, r.CLASEPROC,
|
||||
r.HORAINICIORECEPCION, r.VALORTOTAL, rel.COD_EXAMEN, rel.PRECIO, rel.FECHA_REPORTADO,
|
||||
rel.DESCUENTO,
|
||||
m.COD_ESPECIALIDAD,
|
||||
COALESCE(NULLIF(TRIM(m.CODIGO), ''), NULLIF(TRIM(r.USUARIO), ''), '') AS profesional,
|
||||
e.CODCONTRATO,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
from datetime import datetime, date
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe
|
||||
"cantidad": 1,
|
||||
"tipoUnidad": "D",
|
||||
"valor": float(row.get("PRECIO") or 0),
|
||||
"descuento": 0,
|
||||
"descuento": float(row.get("DESCUENTO") or 0),
|
||||
"porcentajeIva": 0,
|
||||
"impConsumo": 0,
|
||||
"observacion": "",
|
||||
@@ -183,7 +183,6 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe
|
||||
"fecha": fecha,
|
||||
"codTercero": str(h.get("COD_PACIENTE") or "").strip(),
|
||||
"codVendedor": "00",
|
||||
"codFormaPago": cod_forma_pago,
|
||||
"codBanco": "00",
|
||||
"codigoCentroCosto": "00",
|
||||
"tipoIngreso": str(h.get("CLASEPROC") or "1").strip() or "1",
|
||||
@@ -197,7 +196,7 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe
|
||||
"esTerapia": False,
|
||||
"esProcedimiento": False,
|
||||
"numeroAutorizacion": autorizacion,
|
||||
"fechaAutorizacion": fecha,
|
||||
"fechaAutorizacion": date.today().strftime("%d/%m/%Y"),
|
||||
"vigenciaAutorizacion": vigencia,
|
||||
"detallePedido": detalle_pedido,
|
||||
"detalleFormaPago": [{
|
||||
|
||||
Reference in New Issue
Block a user