Skip to content

Commit

Permalink
[Charivari] Ajout d'un mode de compatibilité pour le décompte des con…
Browse files Browse the repository at this point in the history
…gés / factures
  • Loading branch information
bsongis committed Jan 2, 2017
1 parent 3973bad commit 7906501
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def getOptions(parser):
options |= GROUPES_SITES
if "no-backups" in str:
options |= NO_BACKUPS
if "compatibility-conges-2016" in str:
options |= COMPATIBILITY_MODE_CONGES_2016
except:
pass
return options
Expand Down
1 change: 1 addition & 0 deletions constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
READONLY = 1 << 6
GROUPES_SITES = 1 << 7
NO_BACKUPS = 1 << 8
COMPATIBILITY_MODE_CONGES_2016 = 1 << 9

# Atributs de plages horaires spéciales
PLAGE_FERMETURE = 0
Expand Down
11 changes: 8 additions & 3 deletions cotisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,14 @@ def __init__(self, inscrit, date, options=0):
else:
self.prorata = (self.fin_inscription != self.fin or self.debut_inscription != self.debut)
date = self.debut


if config.options & COMPATIBILITY_MODE_CONGES_2016:
fin_decompte_conges_et_factures = self.fin
else:
fin_decompte_conges_et_factures = self.fin_inscription

# debut_conge = None
while date <= self.fin_inscription:
while date <= fin_decompte_conges_et_factures:
heures = self.inscription.GetJourneeReference(date).GetNombreHeures()
if heures:
if date in creche.jours_fermeture:
Expand Down Expand Up @@ -336,7 +341,7 @@ def __init__(self, inscrit, date, options=0):
if creche.repartition == REPARTITION_MENSUALISATION_CONTRAT:
self.nombre_factures = GetNombreFacturesContrat(self.debut_inscription, self.fin_inscription)
else:
self.nombre_factures = GetNombreFacturesContrat(self.debut, self.fin_inscription)
self.nombre_factures = GetNombreFacturesContrat(self.debut, fin_decompte_conges_et_factures)
if self.nombre_factures == 0:
self.nombre_factures = 1
if options & TRACES:
Expand Down

0 comments on commit 7906501

Please sign in to comment.