Skip to content

Commit

Permalink
Merge pull request #239 from gisce/fix_consum
Browse files Browse the repository at this point in the history
FIx zeta
  • Loading branch information
eberloso authored Dec 1, 2023
2 parents 3be607b + 34ba834 commit 115de84
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gestionatr/input/messages/B70.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,18 @@ def get_lectures_info(self):
'temperatura_gas': float(temperatura_gas),
'pressio_atmosferica': float(pressio_atmosferica),
}
# Si el consum que calculem amb el factor_k i el pcs no dona el consum informat en el tag consumokwh
# pero si fem servir el factor de conversio informat per la distri si que dona, modfiquem el factor_k perque
# el factor de conversio calculat sigui igual al informat i aixi el consum també quadri.
# TODO
# Revisant un cas concret, sembla que realment ens falta aplicar la zeta, per aixo no quadra.
# Normalment es 1 pero pot no ser-ho. Aixó es una mandanga per no ahver de treballar amb la zeta.
consum_calculat = round(vals['consum_m3'] * vals['pcs'] * vals['factor_k'], 3)
consum_facturat = round(vals['consum'], 3)
if consum_facturat != consum_calculat:
consum_calculat = round(vals['consum_m3'] * meter.factorconver, 3)
if consum_facturat == consum_calculat:
vals['factor_k'] = meter.factorconver / vals['pcs']
res.append(vals)
return res

Expand Down

0 comments on commit 115de84

Please sign in to comment.