WIP: contrôle cotisation
This commit is contained in:
parent
0784f10954
commit
9f2cd6d774
|
@ -152,6 +152,20 @@ def gestion_get_unpaid():
|
|||
|
||||
return unpaid_members_list.copy()
|
||||
|
||||
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 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) " +\
|
||||
"FROM services_users " +\
|
||||
"GROUP BY id_user, id_service) " +\
|
||||
"AS su2 ON su2.id = su.id " +\
|
||||
"WHERE id_user = {};".format(member)
|
||||
|
||||
|
||||
return gestion_read(request_unpaid)["results"][-1]["id_user"]
|
||||
|
||||
def get_member_infos(member):
|
||||
request = "SELECT * FROM membres " +\
|
||||
"WHERE id = '{}';".format(member)
|
||||
|
@ -189,6 +203,8 @@ def notify_unpaid(member):
|
|||
|
||||
# Get member infos
|
||||
name, numero, email = get_member_infos(member)
|
||||
amount = gestion_get_amount(member)
|
||||
print(amount)
|
||||
|
||||
BUF.append("* {} (numero {}), {}".format(member, numero, name))
|
||||
BUF.append(" NOTIFICATION MEMBRE")
|
||||
|
@ -199,6 +215,8 @@ def renotify_unpaid(member):
|
|||
|
||||
# Get member infos
|
||||
name, numero, email = get_member_infos(member)
|
||||
amount = gestion_get_amount(member)
|
||||
print(amount)
|
||||
|
||||
BUF.append("* {} (numero {}), {}".format(member, numero, name))
|
||||
BUF.append(" RENOTIFICATION MEMBRE")
|
||||
|
|
Loading…
Reference in New Issue