diff --git a/gestionatr/input/messages/B70.py b/gestionatr/input/messages/B70.py index cc9d636..c4e8991 100644 --- a/gestionatr/input/messages/B70.py +++ b/gestionatr/input/messages/B70.py @@ -1389,7 +1389,7 @@ def get_lectures_info(self): # Normalment es 1 pero pot no ser-ho. Aixó es una mandanga per no ahver de treballar amb la zeta. consum_calculat_sefons_fomrula = round(vals['consum_m3'] * vals['pcs'] * vals['factor_k'], 3) consum_calculat_segons_factor = round(vals['consum'], 3) - if consum_calculat_segons_factor != consum_calculat_sefons_fomrula: + if consum_calculat_segons_factor != consum_calculat_sefons_fomrula and vals['pcs']: consum_calculat = round(vals['consum_m3'] * meter.factorconver, 3) if consum_calculat_segons_factor == consum_calculat: vals['factor_k'] = meter.factorconver / vals['pcs'] @@ -1400,7 +1400,7 @@ def get_lectures_info(self): # ultima lectura # Per tant: si el consum facturat per la distri no coincideix amb el consum calculat, ero aplicant # el faactor de conversio del ultim dia siq ue aplica, recalculem el factor k perque quadri tot. - if consum_kwh_facturat != consum_calculat_segons_factor: + if consum_kwh_facturat != consum_calculat_segons_factor and vals['pcs']: if not factor_ultima_lectura and self.meters[-1].factorconver: factor_ultima_lectura = float(self.meters[-1].factorconver) if factor_ultima_lectura: