From d651ad1dbb788a39fcfbb248f927162f24260af5 Mon Sep 17 00:00:00 2001 From: Tresorier de Libre en Communs Date: Mon, 16 Sep 2024 16:35:41 +0200 Subject: [PATCH] fix database changes --- controle_cotisation/main.py | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/controle_cotisation/main.py b/controle_cotisation/main.py index d70f526..6c8a168 100755 --- a/controle_cotisation/main.py +++ b/controle_cotisation/main.py @@ -145,7 +145,7 @@ def sendmail_with_attachment(headers, data, attachment_path, filename): def gestion_get_expired(): request_expired = "SELECT id_user FROM services_users su " +\ - "INNER JOIN membres m ON m.id = su.id_user " +\ + "INNER JOIN users m ON m.id = su.id_user " +\ "INNER JOIN services s ON s.id = su.id_service " +\ "LEFT JOIN services_fees sf ON sf.id = su.id_fee " +\ "INNER JOIN (SELECT id, MAX(date) " +\ @@ -165,7 +165,7 @@ def gestion_get_expired(): def gestion_get_unpaid(): request_unpaid = "SELECT id_user FROM services_users su " +\ - "INNER JOIN membres m ON m.id = su.id_user " +\ + "INNER JOIN users m ON m.id = su.id_user " +\ "INNER JOIN services s ON s.id = su.id_service " +\ "LEFT JOIN services_fees sf ON sf.id = su.id_fee " +\ "INNER JOIN (SELECT id, MAX(date) " +\ @@ -187,7 +187,7 @@ def gestion_get_unpaid(): def gestion_get_amount(member): request_unpaid = "SELECT amount FROM services_users su " +\ - "INNER JOIN membres m ON m.id = su.id_user " +\ + "INNER JOIN users m ON m.id = su.id_user " +\ "INNER JOIN services s ON s.id = su.id_service " +\ "LEFT JOIN services_fees sf ON sf.id = su.id_fee " +\ "INNER JOIN (SELECT id, MAX(date) " +\ @@ -201,7 +201,7 @@ def gestion_get_amount(member): def gestion_get_date(member): request_unpaid = "SELECT date FROM services_users su " +\ - "INNER JOIN membres m ON m.id = su.id_user " +\ + "INNER JOIN users m ON m.id = su.id_user " +\ "INNER JOIN services s ON s.id = su.id_service " +\ "LEFT JOIN services_fees sf ON sf.id = su.id_fee " +\ "INNER JOIN (SELECT id, MAX(date) " +\ @@ -214,7 +214,7 @@ def gestion_get_date(member): return gestion_read(request_unpaid)["results"][-1]["date"] def get_member_infos(member): - request = "SELECT * FROM membres " +\ + request = "SELECT * FROM users " +\ "WHERE id = '{}';".format(member) try: name = gestion_read(request)['results'][-1]['nom'] @@ -246,7 +246,27 @@ def check_email_created(member): } answer2 = git_mail_ticket_read(request) - if len(answer1) + len(answer2) >= 1: + + request = { + 'state' : "closed", + 'q' : "Inscription {}".format(numero) + } + answer3 = git_mail_ticket_read(request) + + + request = { + 'state' : "closed", + 'q' : "Adhésion {}".format(numero) + } + answer4 = git_mail_ticket_read(request) + + request = { + 'state' : "closed", + 'q' : "Adhésion n° {}".format(numero) + } + answer4 = git_mail_ticket_read(request) + + if len(answer1) + len(answer2) + len(answer3) + len(answer4) >= 1: return True return False @@ -383,7 +403,7 @@ def validate(member): # Get infos request = "SELECT *, l.reference true_reference " +\ "FROM services_users su " +\ - "INNER JOIN membres m ON m.id = su.id_user " +\ + "INNER JOIN users m ON m.id = su.id_user " +\ "INNER JOIN services_fees sf ON sf.id = su.id_fee " +\ "LEFT JOIN acc_transactions_users tu ON tu.id_service_user = su.id " +\ "LEFT JOIN acc_transactions_lines l ON l.id_transaction = tu.id_transaction " +\