fix: remove duplicate agrupar_por_factura that was overriding the correct one
The second definition (for RIPS 2.0 transacción grouping) was never called but silently overrode the CMXC ventas grouper, causing grupos_vta to always be empty (values were dicts, not lists, so isinstance(v, list) was False). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
8747ff950e
commit
7ac17e29a9
@@ -378,16 +378,6 @@ def generar_procedimiento(row: dict, consecutivo: int) -> dict:
|
||||
}
|
||||
|
||||
|
||||
def agrupar_por_factura(rows: list, factura_default: str = "") -> dict:
|
||||
grupos = defaultdict(lambda: {"factura": "", "procedimientos": []})
|
||||
for row in rows:
|
||||
doc_key = (row.get("tipo_doc_paciente", "CC"), row.get("num_doc_paciente", ""))
|
||||
fact = row.get("num_factura", factura_default)
|
||||
grupos[(fact, doc_key)]["factura"] = fact
|
||||
grupos[(fact, doc_key)]["procedimientos"].append(dict(row))
|
||||
return grupos
|
||||
|
||||
|
||||
def generar_transaccion(
|
||||
factura: str,
|
||||
num_doc_obligado: str,
|
||||
|
||||
Reference in New Issue
Block a user