From c8bc25dbd767d17923f6e5c790e8863d3ceea07f Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Thu, 15 Sep 2022 00:20:06 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20contr=C3=B4le=20cotisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controle_cotisation/main.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/controle_cotisation/main.py b/controle_cotisation/main.py index 163a25f..6415503 100755 --- a/controle_cotisation/main.py +++ b/controle_cotisation/main.py @@ -239,12 +239,22 @@ def renotify_unpaid(member): # Get member infos name, numero, email = get_member_infos(member) - amount = gestion_get_amount(member) + amount = "{},{}".format(str(gestion_get_amount(member))[:-2], + str(gestion_get_amount(member))[-2:]) + year = gestion_get_year(member)[:4] - BUF.append("* {} (numero {}), {}, {}".format(member, numero, name, amount)) - BUF.append(" RENOTIFICATION MEMBRE") + BUF.append("* {} (numero {}), {}, {} €".format(member, numero, name, amount)) + BUF.append(" NOTIFICATION MEMBRE") BUF.append("") - pass + + mailtext = get_file_content_all(MODALITY_MAIL) + "\n" + mailtext = mailtext.replace("NOM_COTISANT", name) + mailtext = mailtext.replace("NUMERO_MEMBRE", numero) + mailtext = mailtext.replace("MONTANT_COTISATION", amount) + mailheaders = get_file_content_all(MODALITY_MAIL_HEADERS).replace("ANNEE_CIVILE", year) + mailheaders = mailheaders.replace("COURRIEL-COTISANT", email) + + sendmail(mailheaders, mailtext) def check_expired_unpaid(): expired_members = gestion_get_expired()