Conversation
…s periodos facturados
eberloso
previously approved these changes
Jan 15, 2026
eberloso
approved these changes
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objetivos
Si hay que crear lecturas ficticias, crearlas para todos los periodos de la tarifa según el tipo.
Comportamiento antiguo
Se creaban tantas lecturas ficticias como periodos facturados por la distribuidora:
Por ejemplo:
Si habia excedentes en P1, P2, P3: Se creaban 3 lecturas ficticias, y posteriormente se aplicaban los ajustes correspondientes.
Si habia excedentes en P1, P3: Se creaban solo 2 lecturas ficticias (P1, P2), provocando que posteriormente no se aplicasen los ajustes correspondientes en P3.
Comportamiento nuevo
Se crean las lecturas ficticias según los periodos de la tarifa:
Por ejemplo: una 2.0TD, tiene 3 periodos de excedentes. Aunque no haya excedentes en algún periodo, se crearan las lecturas a 0 de todos los periodos, y para los periodos que no haya excedentes no se aplicará ningún ajuste.
Se dan de alta dos métodos nuevos en la clase
FacturaATR:get_num_periodes_from_tarifa_and_tipus(): Devuelve el número de periodos según la tarifa ATR y el tipo de lectura ('A', 'S', 'R', ...)get_periodes_from_tarifa_and_tipus(): Devuelve un diccionario donde las claves son los periodos (P1, P2, ...), y los valores son listas vacías.