Commit 824237c9 authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue

Correctifs sur les crédits solde à filtrer

parent c82d182d
......@@ -83,12 +83,12 @@ def collect_solde(annee):
conn = shortcuts.lc_ldap_readonly()
histo_solde_re = re.compile(
r'(?P<date>[0-9]{2}/[0-9]{2}/%s).*credit (?P<montant>[0-9]+.[0.*-9]{1,2}) Euros \[.*(note|carte|comnpay|paypal|intranet).*' % (annee,),
r'(?P<date>[0-9]{2}/[0-9]{2}/%s).*credit (?P<montant>[0-9]+.[0.*-9]{1,2}) Euros (?P<raison>\[.*)' % (annee,),
re.IGNORECASE,
)
# Récupère les adhérents dans un tableau.
adherents = conn.search(u'(&(aid=*)(uid=*))', sizelimit=0)
adherents = conn.search(u'(&(|(aid=*)(cid=*))(uid=*))', sizelimit=0)
with open('/usr/scripts/var/compta_solde.csv', 'w') as solde_file:
solde_file.write(FIELD_SEP.join(CHAMPS) + '\n')
......@@ -96,6 +96,8 @@ def collect_solde(annee):
for histo_line in adherent['historique']:
z = histo_solde_re.match(unicode(histo_line))
if z is not None:
if "rembo" in z.groupdict()['raison'].lower() or u'raté' in z.groupdict()['raison'].lower() or 'rate' in z.groupdict()['raison'].lower():
continue
date = z.groupdict()['date']
montant = "%.2f" % (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment