22/11/22 - 22h30

master
cherif 2022-11-22 22:43:56 +01:00
parent 7b83b8dd5a
commit 2d6cbc94f2
10 changed files with 1577 additions and 185 deletions

View File

@ -1,16 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="18/11/22 - 23h30">
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="22/11/22 - 11h30">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Template/MySy_Demande_Info_Class_tpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/Template/MySy_Demande_Info_Class_tpl.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data_indexees.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data_indexees.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_factures_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_factures_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" beforeDir="false" afterPath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/email_inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/opco.py" beforeDir="false" afterPath="$PROJECT_DIR$/opco.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -97,7 +98,14 @@
<option name="project" value="LOCAL" />
<updated>1668811238236</updated>
</task>
<option name="localTasksCounter" value="5" />
<task id="LOCAL-00005" summary="22/11/22 - 11h30">
<created>1669114207155</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1669114207155</updated>
</task>
<option name="localTasksCounter" value="6" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -115,7 +123,8 @@
<MESSAGE value="sss" />
<MESSAGE value="sss - init new pc" />
<MESSAGE value="18/11/22 - 23h30" />
<option name="LAST_COMMIT_MESSAGE" value="18/11/22 - 23h30" />
<MESSAGE value="22/11/22 - 11h30" />
<option name="LAST_COMMIT_MESSAGE" value="22/11/22 - 11h30" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>

View File

@ -183,7 +183,7 @@ Mettre à jour les infomration d'un stgiaire
def UpdateStagiairetoClass(diction):
try:
field_list = ['token', 'email', 'nom', 'prenom', 'telephone', 'modefinancement', 'opco',
'status', 'class_internal_url', 'session_id', 'price', 'employeur']
'status', 'class_internal_url', 'session_id', 'price', 'employeur', 'comment']
incom_keys = diction.keys()
for val in incom_keys:
if val not in field_list:
@ -226,6 +226,9 @@ def UpdateStagiairetoClass(diction):
mysession_id = diction['session_id']
query_key['session_id'] = diction['session_id']
partner_recid = mycommon.get_parnter_recid_from_token(mytoken)
if (partner_recid is False):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de mettre à jour le stagiaire ")
@ -276,8 +279,12 @@ def UpdateStagiairetoClass(diction):
mydata['status'] = diction['status']
print(" ### query_key = "+str(query_key))
print(' ### mydata = '+str(mydata))
if ("comment" in diction.keys()):
if diction['comment']:
mydata['comment'] = diction['comment']
#print(" ### query_key = "+str(query_key))
#print(' ### mydata = '+str(mydata))
coll_inscription = MYSY_GV.dbname['inscription']
ret_val2 = coll_inscription.find_one_and_update(query_key,
@ -288,7 +295,9 @@ def UpdateStagiairetoClass(diction):
if (ret_val2 and ret_val2['_id']):
"""
Si le status == 1; alors il s'agit d'une validation d'une inscription.
- Si le status == 1; alors il s'agit d'une validation d'une inscription.
- Si le status == -1; alors il s'agit d'une refus d'une inscription.
Du coup, il faut envoyer le mail de confirmation de l'inscription:
1 - recuperation des infos de la session
1 BIS - recuperation du title
@ -299,6 +308,10 @@ def UpdateStagiairetoClass(diction):
email_data['prenom'] = user_prenom
email_data['email'] = myemail
if ("comment" in diction.keys()):
if diction['comment']:
email_data['comment'] = diction['comment']
# ici recup du titre
for local_tmp_myclass in MYSY_GV.dbname['myclass'].find(
{'internal_url': str(myinternal_url)}):
@ -331,12 +344,19 @@ def UpdateStagiairetoClass(diction):
local_adresse = local_tmp_session['adresse']
email_data['adresse'] = local_adresse
if ( diction['status'] == "1" ):
# Il s'agit d'envoyer le message de confirmation d'une inscription
local_status, local_message = email_session.incription_training_confirmation_mail(email_data)
local_status, local_message = email_session.incription_training_confirmation_mail(email_data)
elif ( diction['status'] == "-1" ):
# Il s'agit d'envoyer le message de refus d'une inscription
local_status, local_message = email_session.incription_training_refused_mail(email_data)
mycommon.myprint(" Les données du stagiaire ont été correctement mise à jour")
return True, "Les données du stagiaire ont été correctement mise à jour"
else:
mycommon.myprint(" Impossible de mettre à jour les données du stagiaire 1")
return False, "Impossible de mettre à jour les données du stagiaire "

File diff suppressed because one or more lines are too long

View File

@ -1,139 +1,173 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--[if gtemso 9]><xml>
<!--[if gtemso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml><![endif]-->
</xml><![endif]-->
<title>MySy Pro Account actif</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<style>
html, body {
font-famliy: 'Arial', sans-serif;
html,
body {
font-famliy: 'Arial', sans-serif;
}
</style>
</head>
<body bgcolor="#fff" style="margin:0px; padding:0px; -webkit-text-size-adjust:none;"><!--[if gtemso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width"><!--[if gtemso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width">
<table bgcolor="#fff" border="0" cellpadding="0" cellspacing="0" height="100%" style="margin:0 auto;" width="100%">
<tbody>
<tr>
<td align="center" bgcolor="#C0C0C0" height="100%" width="600">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td bgcolor="#104277" height="69" style="height:69px;" width="600">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="center" height="69" style="height:69px;" valign="middle" width="600"><img alt="Mysy Training Logo" src="https://img.mysy-training.com/MYSY-LOGO-WHITE.png" alt="Mysy Training Logo" width="18%" style="display: block;" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" height="165" style="height:165px;" width="600">
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff" style="background-color:#ffffff">
<tbody>
<tr>
<td align="center" height="165" style="height:165px; padding-left: 10px; padding-right: 10px;background-color:#ffffff" valign="middle" width="600">
<div style="display: block;">
<div style="margin-left: auto; margin-right: auto">
<div style="text-align: center; font-famliy: Verdana, Geneva, Tahoma, sans-serif;
font-size: small; line-height: 1.4rem;color: #3b3e40;">
<p style="font-size:small; font-weight:bold; margin-top: 1rem;"> Demande d'information pour la formation {{params.class_internal_url}}</p>
<p > Bonjour </p>
<p style="text-align:justify">
<p style="text-align:justify">
L'utliisateur : <br/>
<ul style="text-align:left">
<li> Nom & Prenom : {{params.nom}} &nbsp; {{params.prenom}} </li>
<li> Email : {{params.email}} </li>
<li> Telephone : {{params.telephone}} </li>
<li> Employeur : {{params.employeur}} </li>
<li> Message : {{params.message}} </li>
</ul>
</p>
<p style="text-align:justify">
Souhaite s'informer sur la formation <font color="red"> {{params.title}} </font>.</p>
<p style="font-size:x-small;margin-top: 1rem; line-height: normal;margin-bottom: 1rem;">
Cordialement<br/>
MySy Training Technology<br/>
Contact : +337 69 20 39 45<br/>
Emali : contact@mysy-training.com<br/>
</p>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td bgcolor="#104277" width="600">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="center" valign="middle" width="600">
<div style="
<body bgcolor="#fff" style="margin:0px; padding:0px; -webkit-text-size-adjust:none;">
<!--[if gtemso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<!--[if gtemso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<table bgcolor="#fff" border="0" cellpadding="0" cellspacing="0" height="100%" style="margin:0 auto;" width="100%">
<tbody>
<tr>
<td align="center" bgcolor="#C0C0C0" height="100%" width="600">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td bgcolor="#104277" height="69" style="height:69px;" width="600">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="center" height="69" style="height:69px;" valign="middle"
width="600"><img alt="Mysy Training Logo"
src="https://img.mysy-training.com/MYSY-LOGO-WHITE.png"
alt="Mysy Training Logo" width="18%" style="display: block;" />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" height="165" style="height:165px;" width="600">
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff"
style="background-color:#ffffff">
<tbody>
<tr>
<td align="center" height="165"
style="height:165px; padding-left: 10px; padding-right: 10px;background-color:#ffffff"
valign="middle" width="600">
<div style="display: block;">
<div style="margin-left: auto; margin-right: auto">
<div style="text-align: center; font-famliy: Verdana, Geneva, Tahoma, sans-serif;
font-size: small; line-height: 1.4rem;color: #3b3e40;">
<p
style="font-size:small; font-weight:bold; margin-top: 1rem;">
Demande d'information pour la formation <u>
{{params.class_title}} </u>
</p>
<p> Bonjour </p>
<p style="text-align:justify">
<p style="text-align:justify">
L'utliisateur : <br />
<ul style="text-align:left">
<li> Nom & Prenom : {{params.nom}} &nbsp;
{{params.prenom}} </li>
<li> Email : {{params.email}} </li>
<li> Telephone : {{params.telephone}} </li>
<li> Employeur : {{params.employeur}} </li>
<li> Message : {{params.message}} </li>
</ul>
</p>
<p style="text-align:justify">
Souhaite s'informer sur la formation <font
color="blue"> {{params.class_title}} </font>.
</p>
<p
style="font-size:x-small;margin-top: 1rem; line-height: normal;margin-bottom: 1rem;">
Cordialement<br />
MySy Training Technology<br />
Contact : +337 69 20 39 45<br />
Emali : contact@mysy-training.com<br />
</p>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td bgcolor="#104277" width="600">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="center" valign="middle" width="600">
<div style="
padding: 10px 20px;
margin-bottom: 1rem;
color: #858588;
">
<p style="font-size:xx-small; text-align: center;font-famliy: Verdana, Geneva, Tahoma, sans-serif;">
Cet emali a été envoyé à {{params.user_name}} <br />
Ce mali vous est adressé par MYSY Training dont le siège social est situé au 1 Cr du Havre, 75008 Paris. Conformément à la Loi Informatique et Liberté Loi n° 78-17 du 6 janvier 1978 modifiée et au Règlement Général sur la Protection des Données Règlement (UE) 2016/679 du Parlement européen et du Conseli du 27 avrli 2016 dit RGPD, vous disposez d'un droit d'accès, de rectification, d'effacement, de limitation et d'opposition au traitement de vos données. Vous pouvez exercer vos droits par courrier postal envoyé à : MYSY Training 1 Cr du Havre, 75008 Paris ou par mali : contact@mysy-training.com.
<br/>
<a href="#">Se désinscrire</a><br/>
</p>
</div>
<p
style="font-size:xx-small; text-align: center;font-famliy: Verdana, Geneva, Tahoma, sans-serif;">
Cet emali a été envoyé à {{params.email_partnair}} <br />
Ce mali vous est adressé par MYSY Training dont le siège
social est situé au 1 Cr du Havre, 75008 Paris. Conformément
à la Loi Informatique et Liberté Loi n° 78-17 du 6 janvier
1978 modifiée et au Règlement Général sur la Protection des
Données Règlement (UE) 2016/679 du Parlement européen et du
Conseli du 27 avrli 2016 dit RGPD, vous disposez d'un droit
d'accès, de rectification, d'effacement, de limitation et
d'opposition au traitement de vos données. Vous pouvez
exercer vos droits par courrier postal envoyé à : MYSY
Training 1 Cr du Havre, 75008 Paris ou par mali :
contact@mysy-training.com.
<br />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</p>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -2779,10 +2779,30 @@ def RenseignementClass(diction):
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
return False, " : La valeur '" + val + "' n'est pas presente dans liste "
"""
Recuperation des informations de la formation et du formation (adresse email)
"""
local_class_info = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(diction['class_internal_url'])})
if( not local_class_info['partner_owner_recid'] ):
mycommon.myprint( str(inspect.stack()[0][3]) + " - Impossible de recuperer les informations de la formation ")
return False, " Impossible de recuperer les informations de la formation "
local_partner_info = MYSY_GV.dbname['partnair_account'].find_one({'recid': str(local_class_info['partner_owner_recid'])})
if (not local_partner_info['email']):
mycommon.myprint(
str(inspect.stack()[0][3]) + " - Impossible de recuperer les informaton du formateur ")
return False, " Impossible de recuperer les informaton du formateur "
diction['class_title'] = local_class_info['title']
diction['email_partnair'] = local_partner_info['email']
#print(" #### diction demande info = "+str(diction))
email.EmailDemandeInfoClass(diction)
return True, " La demande d'information a bien ete envoyé"
return True, " La demande d'information a bien été envoyée"
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()

View File

@ -1,5 +1,4 @@
,index,mots,occurence,moyenne,id_formation,source_field
0,0,base,1,0.25,Edu_10002,title
1,1,gestion,1,0.25,Edu_10002,title
2,2,donne,1,0.25,Edu_10002,title
3,3,sql,1,0.25,Edu_10002,title
0,0,effect,1,0.33,VP14120,title
1,1,essentiel,1,0.33,VP14120,title
2,2,after,1,0.33,VP14120,title

1 index mots occurence moyenne id_formation source_field
2 0 0 base effect 1 0.25 0.33 Edu_10002 VP14120 title
3 1 1 gestion essentiel 1 0.25 0.33 Edu_10002 VP14120 title
4 2 2 donne after 1 0.25 0.33 Edu_10002 VP14120 title
3 3 sql 1 0.25 Edu_10002 title

View File

@ -538,55 +538,11 @@ def createOrder(diction):
str(inspect.stack()[0][3]) + "Aucune donnée client, Impossible de créer la commande ")
return False, "Aucune donnée client, Impossible de créer la commande ", None
part_account = coll_part_account.find({'recid':user_recid, 'active':'1'})
if ("invoice_nom" in part_account[0].keys()):
if part_account[0]['invoice_nom']:
new_data['invoice_nom'] = part_account[0]['invoice_nom']
if ("invoice_adr_city" in part_account[0].keys()):
if part_account[0]['invoice_adr_city']:
new_data['invoice_adr_city'] = part_account[0]['invoice_adr_city']
if ("invoice_adr_country" in part_account[0].keys()):
if part_account[0]['invoice_adr_country']:
new_data['invoice_adr_country'] = part_account[0]['invoice_adr_country']
if ("invoice_adr_street" in part_account[0].keys()):
if part_account[0]['invoice_adr_street']:
new_data['invoice_adr_street'] = part_account[0]['invoice_adr_street']
if ("invoice_adr_zip" in part_account[0].keys()):
if part_account[0]['invoice_adr_zip']:
new_data['invoice_adr_zip'] = part_account[0]['invoice_adr_zip']
if ("invoice_adr_street" in part_account[0].keys()):
if part_account[0]['invoice_adr_street']:
new_data['invoice_adr_street'] = part_account[0]['invoice_adr_street']
if ("invoice_email" in part_account[0].keys()):
if part_account[0]['invoice_email']:
new_data['invoice_email'] = part_account[0]['invoice_email']
if ("invoice_vat_num" in part_account[0].keys()):
if part_account[0]['invoice_vat_num']:
new_data['invoice_vat_num'] = part_account[0]['invoice_vat_num']
if ("invoice_telephone" in part_account[0].keys()):
if part_account[0]['invoice_telephone']:
new_data['invoice_telephone'] = part_account[0]['invoice_telephone']
total_ht = 0
# Recuperation ds données de payement
coll_part_payment = MYSY_GV.dbname['payement_mode']
part_account = coll_part_payment.find({'client_recid': user_recid, 'valide': '1'})
new_data['nb_product'] = str(nb_line)
i = 0
total_ht = 0
while (i < nb_line):
#print("PRODUIT N° " + str((i + 1)) + " : " )
@ -614,6 +570,7 @@ def createOrder(diction):
i = i + 1
new_data['total_ht'] = total_ht
new_data['total_tva'] = mycommon.tryFloat(str(total_ht)) * MYSY_GV.TVA_TAUX
new_data['total_ttc'] = mycommon.tryFloat(str(total_ht)) + mycommon.tryFloat(str(new_data['total_tva']))
@ -624,9 +581,109 @@ def createOrder(diction):
if (tmp_count <= 0 and total_ttc_float > 0):
mycommon.myprint(
str(inspect.stack()[0][3]) + " Aucune donnée de payement, Impossible de créer la commande ")
return False, " Aucune donnée de payement,, Impossible de créer la commande ", None
return False, " Aucune donnée de payement, Impossible de créer la commande ", None
part_account = coll_part_account.find({'recid':user_recid, 'active':'1'})
"""
/!\ : Si le montant à facturé à superieur à 0 alors on force le controle des données de facturation (email, adresse, etc)
"""
#print(" ### TOTAL TTC à FACTURER = "+str(total_ttc_float))
invoice_nom_check = ""
if ("invoice_nom" in part_account[0].keys()):
if part_account[0]['invoice_nom']:
invoice_nom_check = part_account[0]['invoice_nom']
if(len(invoice_nom_check.strip()) == 0 and total_ttc_float > 0 ):
mycommon.myprint(
str(inspect.stack()[0][3]) + " Les données de facturation sont incompletes. Verifiez la raison sociale ")
return False, "Les données de facturation sont incompletes. Verifiez la raison sociale ", None
new_data['invoice_nom'] = invoice_nom_check
invoice_adr_city_check = ""
if ("invoice_adr_city" in part_account[0].keys()):
if part_account[0]['invoice_adr_city']:
invoice_adr_city_check = part_account[0]['invoice_adr_city']
if (len(invoice_adr_city_check.strip()) == 0 and total_ttc_float > 0 ):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Les données de facturation sont incompletes. Verifiez la ville ")
return False, "Les données de facturation sont incompletes. Verifiez la ville ", None
new_data['invoice_adr_city'] = invoice_adr_city_check
invoice_adr_country_check = ""
if ("invoice_adr_country" in part_account[0].keys()):
if part_account[0]['invoice_adr_country']:
invoice_adr_country_check = part_account[0]['invoice_adr_country']
if (len(invoice_adr_country_check.strip()) == 0 and total_ttc_float > 0 ):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Les données de facturation sont incompletes. Verifiez le pays ")
return False, "Les données de facturation sont incompletes. Verifiez le pays ", None
new_data['invoice_adr_country'] = invoice_adr_country_check
invoice_adr_street_check = ""
if ("invoice_adr_street" in part_account[0].keys()):
if part_account[0]['invoice_adr_street']:
invoice_adr_street_check = part_account[0]['invoice_adr_street']
if (len(invoice_adr_street_check.strip()) == 0 and total_ttc_float > 0 ):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Les données de facturation sont incompletes. Verifiez l'adresse ")
return False, "Les données de facturation sont incompletes. Verifiez l'adresse ", None
new_data['invoice_adr_street'] = invoice_adr_street_check
invoice_adr_zip_check = ""
if ("invoice_adr_zip" in part_account[0].keys()):
if part_account[0]['invoice_adr_zip']:
invoice_adr_zip_check = part_account[0]['invoice_adr_zip']
if (len(invoice_adr_zip_check.strip()) == 0 and total_ttc_float > 0 ):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Les données de facturation sont incompletes. Verifiez le code postal ")
return False, "Les données de facturation sont incompletes. Verifiez le code postal ", None
new_data['invoice_adr_zip'] = invoice_adr_zip_check
invoice_email_check = ""
if ("invoice_email" in part_account[0].keys()):
if part_account[0]['invoice_email']:
invoice_email_check = part_account[0]['invoice_email']
if (len(invoice_email_check.strip()) == 0 ):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Les données de facturation sont incompletes. Verifiez l'adresse email ")
return False, "Les données de facturation sont incompletes. Verifiez l'adresse email ", None
new_data['invoice_email'] = invoice_email_check
invoice_vat_num_check = ""
if ("invoice_vat_num" in part_account[0].keys()):
if part_account[0]['invoice_vat_num']:
invoice_vat_num_check = part_account[0]['invoice_vat_num']
if ("invoice_telephone" in part_account[0].keys()):
if part_account[0]['invoice_telephone']:
new_data['invoice_telephone'] = part_account[0]['invoice_telephone']
new_data['invoice_vat_num'] = invoice_vat_num_check
# Recuperation ds données de payement
coll_part_payment = MYSY_GV.dbname['payement_mode']
part_account = coll_part_payment.find({'client_recid': user_recid, 'valide': '1'})
#print(" new_data['total_ht'] = "+str(new_data['total_ht']) + " -- new_data['total_tva'] "
# +str(new_data['total_tva'])+ " -- new_data['total_ttc'] = "+ str(new_data['total_ttc']))

View File

@ -1,5 +1,4 @@
mots occurence moyenne id_formation source_field
0 base 1 0.25 Edu_10002 title
1 gestion 1 0.25 Edu_10002 title
2 donne 1 0.25 Edu_10002 title
3 sql 1 0.25 Edu_10002 title
mots occurence moyenne id_formation source_field
0 effect 1 0.33 VP14120 title
1 essentiel 1 0.33 VP14120 title
2 after 1 0.33 VP14120 title

View File

@ -131,6 +131,109 @@ def incription_training_confirmation_mail(diction):
return False, " Impossible d'envoyer l'email de notification "
"""
Envoi de l'email de refus d'une d'inscription à une formation
"""
def incription_training_refused_mail(diction):
try:
print(" ### incription_training_refused_mail = "+str(diction))
"""
Verification de la liste des champs obligatoires
"""
field_list_obligatoire = ['nom', 'prenom', 'email', 'date_du', 'date_au', 'adresse', 'title']
for val in field_list_obligatoire:
if val not in diction:
mycommon.myprint(
str(inspect.stack()[0][3]) + " - : La valeur '" + val + "' n'est pas presente dans liste ")
return False, "Impossible d'envoyer l'email de refus de l'inscritpion"
tomorrow = datetime.date.today() + datetime.timedelta(days=1)
tomorrow_day = tomorrow.strftime("%A")
print("debut envoi mail de test ")
"""
Verification si c'est une formation en ligne.
auquel cas, l'adresse est du type : enligne"""
print(" ### Adresse = "+str(diction['adresse']) )
adresse_session = str(diction['adresse'])
trim_adr = str(diction['adresse']).strip().replace(" ","").lower()
if (trim_adr == "enligne"):
adresse_session = "enligne"
print("debut envoi mail de test ")
# on rentre les renseignements pris sur le site du fournisseur
# msg = MIMEMultipart("alternative")
smtpserver = smtplib.SMTP(MYSY_GV.O365_SMTP_COUNT_smtpsrv, MYSY_GV.O365_SMTP_COUNT_port)
msg = EmailMessage()
# JINJA2
templateLoader = jinja2.FileSystemLoader(searchpath="./")
templateEnv = jinja2.Environment(loader=templateLoader)
TEMPLATE_FILE = "Template/MySy_refus_inscription_formation_tpl.html"
template = templateEnv.get_template(TEMPLATE_FILE)
# This data can come from database query
body = {}
if ("comment" in diction.keys()):
if diction['comment']:
body = {
"params" :{"nom": str(diction['nom']),
"prenom": str(diction['prenom']),
"date_du": str(diction['date_du']),
"date_fin": str(diction['date_au']),
"adresse": str(adresse_session),
"title": str(diction['title']),
"email": str(diction['email']),
"comment": str(diction['comment'])},
}
else:
body = {
"params": {"nom": str(diction['nom']),
"prenom": str(diction['prenom']),
"date_du": str(diction['date_du']),
"date_fin": str(diction['date_au']),
"adresse": str(adresse_session),
"title": str(diction['title']),
"email": str(diction['email'])},
}
sourceHtml = template.render(params=body["params"])
msg.set_content(sourceHtml, subtype='html')
msg['From'] = MYSY_GV.O365_SMTP_COUNT_From_User
msg['Cc'] = 'contact@mysy-training.com'
msg['Subject'] = '[MySy Training]: Inscription formation refusée'
msg['To'] = str(diction['email'])
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.login(MYSY_GV.O365_SMTP_COUNT_user, MYSY_GV.O365_SMTP_COUNT_password)
val = smtpserver.send_message(msg)
smtpserver.close()
print(" Email confirlation envoyé " + str(val))
return True, " Email confirlation inscritpion bien envoyé"
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
return False, " Impossible d'envoyer l'email de notification "
"""
Email de pre-inscription
"""

View File

@ -961,8 +961,12 @@ def SalesOrderConfirmationEmail(account_mail, diction):
Une fois qu'on a controlé que toutes les clés mise dans l'API sont correcte. etape precedente,
On controle que les champs obligatoires sont presents dans la liste
'''
field_list_obligatoire = ['invoice_nom', 'invoice_adr_city', 'invoice_adr_country', 'invoice_adr_street',
'invoice_adr_zip', 'periodicite', 'total_ht', 'total_tva', 'total_ttc',
if(len(str(account_mail).strip()) == 0 ):
mycommon.myprint(str(inspect.stack()[0][3]) + " - La valeur '" + str(account_mail) + "' est vide ")
return False, " Impossible d'envoyer l'email de confirmation. l'adresse email est vide"
field_list_obligatoire = ['invoice_nom', 'periodicite', 'total_ht', 'total_tva', 'total_ttc',
'order_id', 'date_update', 'nb_product', 'order_date']
for val in field_list_obligatoire:
@ -1467,6 +1471,8 @@ def EmailDemandeInfoClass( diction):
"params":{"nom": str(diction['nom']),
"prenom": str(diction['prenom']),
"email": str(diction['email']),
"email_partnair": str(diction['email_partnair']),
"class_title": str(diction['class_title']),
"telephone": str(diction['telephone']),
"employeur": str(diction['employeur']),
"message": str(diction['message']),
@ -1479,8 +1485,8 @@ def EmailDemandeInfoClass( diction):
msg.set_content(sourceHtml, subtype='html')
msg['From'] = MYSY_GV.O365_SMTP_COUNT_From_User
msg['Cc'] = 'contact@mysy-training.com'
msg['Subject'] = "[MySy Training Technology] : Demande d'information"
msg['To'] = 'contact@mysy-training.com'
msg['Subject'] = "[MySy Training Technology] : Demande d'information sur une formation"
msg['To'] = str(diction['email_partnair'])
smtpserver.ehlo()
smtpserver.starttls()