From 46d8ba2c8364cdfc4a2279c99791c01eee13e85e Mon Sep 17 00:00:00 2001 From: Marc Calvo Date: Mon, 25 Nov 2024 11:11:55 +0100 Subject: [PATCH] Permitir obtener lecturas del F1 si el CG tiene mas periodos que la tarifa del contrato --- gestionatr/input/messages/F1.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gestionatr/input/messages/F1.py b/gestionatr/input/messages/F1.py index a989872..4932966 100644 --- a/gestionatr/input/messages/F1.py +++ b/gestionatr/input/messages/F1.py @@ -2000,8 +2000,11 @@ def get_lectures_amb_periodes_td(self, lectures, tipus): base_lectura = None for l in lectures: if l.tipus == tipus: - lectures_per_periode[l.periode].append(l) - base_lectura = l + # Mandanga (Puta Fenosa) En cas que ens arribin lectures de periodes fora de la tarifa del contracte + # ignorem les lectures dels periodes que estiguin fora de la tarifa ATR del contracte + if l.periode in lectures_per_periode.keys(): + lectures_per_periode[l.periode].append(l) + base_lectura = l if not base_lectura: return [x for x in lectures if x.tipus == tipus]