Skip to content

Commit edff092

Browse files
committed
fix: fix get_fake_lectures
1 parent a5be153 commit edff092

File tree

1 file changed

+3
-3
lines changed
  • gestionatr/input/messages

1 file changed

+3
-3
lines changed

gestionatr/input/messages/F1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,7 @@ def get_fake_lectures(self, lectures, tipus=None):
17031703
generacio_facturada = self.factura and self.factura.get_consum_facturat(tipus='S', periode=None)
17041704
if (not tipus or "S" in tipus) and self.factura and not self.factura.has_AS_lectures():
17051705
# El mètode get_consum_facturat retorna [0.0] si no hi ha consum
1706-
if generacio_facturada and len(generacio_facturada) > 1 or generacio_facturada[0] != 0.0:
1706+
if generacio_facturada and (len(generacio_facturada) > 1 or generacio_facturada[0] != 0.0):
17071707
# Si no tenim lectures AS pero si que ens han cobrat excedents,
17081708
# creem unes lectures AS ficticies a 0 (puta ENDESA)
17091709
lectures.extend(self.factura.get_fake_AS_lectures(comptador_base=self))
@@ -2374,15 +2374,15 @@ def get_fake_AS_lectures(self, period_start=1, comptador_base=None):
23742374
comptador_amb_lectures = None
23752375
for medida in self.medidas:
23762376
for c in medida.modelos_aparatos:
2377-
if c.get_lectures_activa_sortint():
2377+
if c.get_lectures_activa_entrant():
23782378
comptador_amb_lectures = c
23792379
break
23802380
if comptador_amb_lectures:
23812381
te_autoconsum = (self.autoconsumo and self.autoconsumo.energia_excedentaria) or ([x for x in (self.conceptos_repercutibles or []) if '7' == x.concepto_repercutible[0]])
23822382
if not te_autoconsum:
23832383
return res
23842384
base_info = comptador_amb_lectures.get_lectures_activa_entrant()[0]
2385-
num_periodes = self.factura.get_num_periodes_from_tarifa_and_tipus(tipus='S')
2385+
num_periodes = self.get_num_periodes_from_tarifa_and_tipus(tipus='S')
23862386
# Depending on period_start, P1 is skipped. If we have totalizer, it will be skipped, otherwise we need to
23872387
# create readings for each tariff period
23882388
for i in range(period_start, num_periodes+1): # num_periodes not included, so we add 1

0 commit comments

Comments
 (0)