Skip to content

Commit

Permalink
Evitar errores con los totalizadores
Browse files Browse the repository at this point in the history
  • Loading branch information
eberloso committed May 14, 2020
1 parent 75000a9 commit d342f54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gestionatr/input/messages/F1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,9 +1250,11 @@ def get_lectures_amb_ajust_quadrat_amb_consum(self, tipus='S', ajust_balancejat=
lectures_per_periode[periode] = []
lectures_per_periode[periode].append(lectura)

nperiodes = len(lectures_per_periode.keys())
nperiodes = len([l for l in lectures_per_periode.keys() if l])
if self.periodes_facturats_agrupats(nperiodes, tipus=tipus) and ajust_balancejat:
for periode in lectures_per_periode.keys():
if not periode:
continue
periode_agrupat = "P{0}".format(int(periode[1:]) + nperiodes/2)
if lectures_per_periode.get(periode_agrupat):
lectures_per_periode[periode].extend(lectures_per_periode.get(periode_agrupat))
Expand Down

0 comments on commit d342f54

Please sign in to comment.