From de6761407bc1f9b0967d765de5e5cc41932b8acf Mon Sep 17 00:00:00 2001 From: Vilaboa Date: Tue, 21 May 2024 17:57:22 +0200 Subject: [PATCH 1/2] FIX Hacer que no se revise si el CUPS tiene nodo al generar el A1 --- libcnmc/cir_8_2021/FA1.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libcnmc/cir_8_2021/FA1.py b/libcnmc/cir_8_2021/FA1.py index b00a9308..0d6845b6 100644 --- a/libcnmc/cir_8_2021/FA1.py +++ b/libcnmc/cir_8_2021/FA1.py @@ -411,7 +411,7 @@ def consumer(self): 'name', 'id_escomesa', 'id_municipi', 'cne_anual_activa', 'cne_anual_reactiva', 'cnmc_potencia_facturada', 'et', 'polisses', 'potencia_conveni', 'potencia_adscrita', - "node_id", 'autoconsum_id', 'cnmc_numero_lectures', + 'autoconsum_id', 'cnmc_numero_lectures', 'cnmc_factures_estimades', 'cnmc_factures_total', 'cnmc_energia_autoconsumida', 'cnmc_energia_excedentaria', 'force_potencia_adscrita', 'cnmc_conexion_autoconsumo', @@ -497,7 +497,7 @@ def consumer(self): o_tensio = '' o_connexio = '' vertex = False - if cups and cups['id_escomesa'] and "node_id" not in cups: + if cups and cups['id_escomesa']: o_connexio = get_tipus_connexio( O, cups['id_escomesa'][0] ) @@ -506,14 +506,13 @@ def consumer(self): search_params ) id_escomesa = cups.get("id_escomesa") - o_nom_node = '' vertex = '' if id_escomesa: escomesa = O.GiscedataCupsEscomesa.read(id_escomesa[0], ["node_id", "geom"]) if escomesa.get("geom",False): geom = wkt.loads(escomesa["geom"]).coords[0] vertex = {"x":geom[0], "y": geom[1]} - if escomesa.get("node_id", False): + if not o_nom_node and escomesa.get("node_id", False): o_nom_node = escomesa.get("node_id")[1] if bloc_escomesa_id and not o_nom_node: bloc_escomesa = O.GiscegisBlocsEscomeses.read( From cf74445612e55f032b2f7e9a6d9081ab636a35e4 Mon Sep 17 00:00:00 2001 From: Vilaboa Date: Tue, 21 May 2024 18:00:54 +0200 Subject: [PATCH 2/2] undo useless check --- libcnmc/cir_8_2021/FA1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcnmc/cir_8_2021/FA1.py b/libcnmc/cir_8_2021/FA1.py index 0d6845b6..333397cb 100644 --- a/libcnmc/cir_8_2021/FA1.py +++ b/libcnmc/cir_8_2021/FA1.py @@ -512,7 +512,7 @@ def consumer(self): if escomesa.get("geom",False): geom = wkt.loads(escomesa["geom"]).coords[0] vertex = {"x":geom[0], "y": geom[1]} - if not o_nom_node and escomesa.get("node_id", False): + if escomesa.get("node_id", False): o_nom_node = escomesa.get("node_id")[1] if bloc_escomesa_id and not o_nom_node: bloc_escomesa = O.GiscegisBlocsEscomeses.read(