fix: remove valor field from detallePedido; filter by PREFIJO in transaccion
- json_generator: remove valor entirely from detalle items (not even 0) - transaccion: after fetching rows, filter by prefix if user typed full factura like "LHXC03726" and query returns PREFIJO column Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
1548aadf3c
commit
ed9fead353
@@ -36,6 +36,9 @@ def _query_rows(cfg, query_text, factura, fecha_inicio, fecha_fin):
|
|||||||
fb.disconnect()
|
fb.disconnect()
|
||||||
if not ok2:
|
if not ok2:
|
||||||
return None, err, None
|
return None, err, None
|
||||||
|
# Si el usuario escribió prefijo (ej. "LHXC03726") y el query devuelve PREFIJO, filtramos
|
||||||
|
if prefix and rows and "PREFIJO" in rows[0]:
|
||||||
|
rows = [r for r in rows if str(r.get("PREFIJO") or "").strip().upper() == prefix]
|
||||||
return rows, None, fb
|
return rows, None, fb
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -153,7 +153,6 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe
|
|||||||
"codigoBodega": "00",
|
"codigoBodega": "00",
|
||||||
"cantidad": 1,
|
"cantidad": 1,
|
||||||
"tipoUnidad": "D",
|
"tipoUnidad": "D",
|
||||||
"valor": 0,
|
|
||||||
"descuento": float(row.get("DESCUENTO") or 0),
|
"descuento": float(row.get("DESCUENTO") or 0),
|
||||||
"porcentajeIva": 0,
|
"porcentajeIva": 0,
|
||||||
"impConsumo": 0,
|
"impConsumo": 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user