correction date d'inscription pour le mois d'aout + correction erreur scheduler deconnexion interrompue en septembre

This commit is contained in:
Romain Beuque 2014-08-27 02:48:36 +02:00
parent a75cafe44c
commit 0a7c1f7161
4 changed files with 12 additions and 16 deletions

View File

@ -97,14 +97,7 @@ class MemberAddController(AuthenticatedRestController):
member = Member.entry_attr(member_uid, prenom, nom, mail, phone, -1)
now = datetime.now()
year = 0
if now.month >= 8:
year = now.year
else:
year = now.year - 1
#endif
year = CotisationComputes.registration_current_year()
member_dn = "uid=" + member_uid + ",ou=" + str(year) + "," + ldap_config.username_base_dn + residence_dn
self.user.ldap_bind.add_entry(member_dn, member)

View File

@ -93,13 +93,7 @@ class MembersController(AuthenticatedBaseController):
cotisations = Cotisation.cotisations_of_member(self.user, member_dn, current_year)
now = datetime.now()
registration_year = 0
if now.month >= 8:
registration_year = now.year
else:
registration_year = now.year - 1
#endif
registration_year = CotisationComputes.registration_current_year()
member_dn = "uid=" + member.uid.first() + ",ou=" + str(registration_year) + "," + ldap_config.username_base_dn + residence_dn
#phone = ' '

View File

@ -34,7 +34,7 @@ def disconnect_members_from_residence(admin_user, residence_dn):
if not CotisationComputes.is_cotisation_paid(member.dn, admin_user, residence_dn):
#verification de grace pour septembre : si le membre avait cotise en Aout, on lui accorde un delai de paiement pour Septembre, et on ne le deconnecte pas
if date_actuelle.month = 9 and is_cotisation_was_paid_last_year(member_dn, admin_user, residence_dn):
if date_actuelle.month == 9 and is_cotisation_was_paid_last_year(member_dn, admin_user, residence_dn):
#le membre etait a jour en aout, on lui autorise un delai de paiement en septembre - pas de deconnexion
break
#end if

View File

@ -43,6 +43,15 @@ class CotisationComputes:
return now.year
#end def
@staticmethod
def registration_current_year():
now = datetime.datetime.now()
if now.month > 8:
return now.year
return now.year - 1
#end def
@staticmethod
def get_available_months(start, end, paid_months = []):
next_months_available = []