Signed-off-by: Cherif <cbalde@mysy-training.com>
master_Elyos_FI
Cherif 2026-05-12 09:20:26 +02:00
parent 180de3910d
commit 22cfb86fdd
6 changed files with 2551 additions and 27 deletions

View File

@ -4,15 +4,13 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="10/05/2026 - 12h30">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="11/05/2026 -22h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Dashbord_queries/factures_tbd_qries.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/factures_tbd_qries.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$/invoice_paiement_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/invoice_paiement_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/groupe_inscrit_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/groupe_inscrit_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -456,7 +454,7 @@
<option name="project" value="LOCAL" />
<updated>1747251650255</updated>
</task>
<option name="localTasksCounter" value="578" />
<option name="localTasksCounter" value="579" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -498,7 +496,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="23/03/2026 - 20h" />
<MESSAGE value="25/03/2026 - 20h" />
<MESSAGE value="26/03/2026 - 12h" />
<MESSAGE value="23/03/26 - 20h" />
@ -523,6 +520,7 @@
<MESSAGE value="08/05/2026 - 17h" />
<MESSAGE value="09/05/2025 - 20h30" />
<MESSAGE value="10/05/2026 - 12h30" />
<option name="LAST_COMMIT_MESSAGE" value="10/05/2026 - 12h30" />
<MESSAGE value="11/05/2026 -22h" />
<option name="LAST_COMMIT_MESSAGE" value="11/05/2026 -22h" />
</component>
</project>

View File

@ -5265,6 +5265,24 @@ def AddStagiairetoClass_mass_for_many_session(file=None, Folder=None, diction=No
pays = str(df['pays'].values[n]).strip()
mydata['pays'] = pays
civilite = ""
if ("civilite" in df.keys()):
if (str(df['civilite'].values[n])):
civilite = str(df['civilite'].values[n]).lower()
mydata['civilite'] = str(civilite).lower()
if (str(civilite).strip() == ""):
mydata['civilite'] = "neutre"
if (civilite not in MYSY_GV.CIVILITE):
mycommon.myprint(
str(inspect.stack()[0][3]) + " Ligne : " + str(
n + 2) + ". La civilité :" + str(
civilite) + " est invalide. Les valeurs acceptées sont : " + str(MYSY_GV.CIVILITE))
return False, " Ligne : " + str(
n + 2) + ". La civilité :" + str(
civilite) + " est invalide. Les valeurs acceptées sont : " + str(MYSY_GV.CIVILITE)
""""
Gestion du client de rattachement/

File diff suppressed because one or more lines are too long

View File

@ -18119,7 +18119,7 @@ def Add_Update_UE_To_Session(diction):
Verifier la validité du formateur
"""
local_formateur_id = ""
if( "formateur_id" in diction.keys() ):
if( "formateur_id" in diction.keys() and diction['formateur_id'] ):
local_formateur_id = diction['formateur_id']
is_valide_formateur = MYSY_GV.dbname['ressource_humaine'].count_documents({'_id':ObjectId(diction['formateur_id']),
'partner_recid':str(my_partner['recid'])})
@ -18475,7 +18475,7 @@ def Get_List_UE_Given_SessionFormation(diction):
local_formateur_prenom = ""
local_formateur_prenom_nom = ""
if( "formateur_id" in local_ue.keys()):
if( "formateur_id" in local_ue.keys() and local_ue['formateur_id']):
local_formateur_id = local_ue['formateur_id']
formateur_data = MYSY_GV.dbname['ressource_humaine'].find_one(

View File

@ -1664,7 +1664,7 @@ def Automatic_Creation_Groupe_Member_Inscrit(diction):
"""
Verification des input acceptés
"""
field_list = ['token', 'type_groupe_code', 'class_id', 'session_id', 'nb_groupe',
field_list = ['token', 'groupe_inscription_type_id', 'class_id', 'session_id', 'nb_groupe',
'split_type', 'racine']
incom_keys = diction.keys()
@ -1677,7 +1677,7 @@ def Automatic_Creation_Groupe_Member_Inscrit(diction):
"""
Verification des champs obligatoires
"""
field_list_obligatoire = ['token', 'type_groupe_code', 'class_id', 'session_id', 'nb_groupe', 'split_type']
field_list_obligatoire = ['token', 'groupe_inscription_type_id', 'class_id', 'session_id', 'nb_groupe', 'split_type']
for val in field_list_obligatoire:
if val not in diction:
@ -1731,6 +1731,27 @@ def Automatic_Creation_Groupe_Member_Inscrit(diction):
str(inspect.stack()[0][3]) + " L'identifiant de classe est invalide ")
return False, " L'identifiant de classe est invalide "
"""
Verifier la validité du groupe_inscription_type_id
"""
groupe_inscription_type_id_count = MYSY_GV.dbname['groupe_inscription_type'].count_documents(
{'_id': ObjectId(str(diction['groupe_inscription_type_id'])),
'valide': '1', 'locked': '0',
'partner_owner_recid': str(my_partner['recid'])})
if (groupe_inscription_type_id_count != 1):
mycommon.myprint(
str(inspect.stack()[0][3]) + " L'identifiant du type de groupe est invalide ")
return False, " L'identifiant du type de groupe est invalide "
groupe_inscription_type_data = MYSY_GV.dbname['groupe_inscription_type'].find_one(
{'_id': ObjectId(str(diction['groupe_inscription_type_id'])),
'valide': '1', 'locked': '0',
'partner_owner_recid': str(my_partner['recid'])})
"""
Verifier qu'il y des inscrits valides : On ne prend que les inscriptions validée (status = 1)
"""
@ -1775,13 +1796,6 @@ def Automatic_Creation_Groupe_Member_Inscrit(diction):
suff_curr_timestamp = diction['racine']
"""
Generer des couleur pour l'affichage coloré dans les
agendas
"""
tab_color_random = ["#" + ''.join([random.choice('0123456789ABCDEF') for j in range(6)])
for i in range(nb_groupe+2)]
while ( cpt < nb_groupe ):
cpt = cpt +1
@ -1789,10 +1803,10 @@ def Automatic_Creation_Groupe_Member_Inscrit(diction):
local_node['code'] = suff_curr_timestamp+"_"+str(cpt)
local_node['nom'] = suff_curr_timestamp+" Grp_" + str(cpt)
local_node['description'] = suff_curr_timestamp+" Description Grp_" + str(cpt)
local_node['type_groupe_code'] = str(diction['type_groupe_code'])
local_node['groupe_inscription_type_id'] = str(diction['groupe_inscription_type_id'])
local_node['class_id'] = str(diction['class_id'])
local_node['session_id'] = str(diction['session_id'])
local_node['color'] = str(tab_color_random[cpt])
local_node['color'] = str(groupe_inscription_type_data["code_couleur"])
local_node['liste_inscrit'] = []
global_tab_groupe.append(local_node)
@ -1839,10 +1853,10 @@ def Automatic_Creation_Groupe_Member_Inscrit(diction):
new_data['code'] = str(val['code'])
new_data['nom'] = str(val['nom'])
new_data['description'] = str(val['description'])
new_data['type_groupe_code'] = str(diction['type_groupe_code'])
new_data['groupe_inscription_type_id'] = str(groupe_inscription_type_data['_id'])
new_data['class_id'] = str(diction['class_id'])
new_data['session_id'] = str(diction['session_id'])
new_data['color'] = str(val['color'])
new_data['color'] = str(groupe_inscription_type_data['code_couleur'])
new_data['valide'] = "1"
@ -1858,7 +1872,7 @@ def Automatic_Creation_Groupe_Member_Inscrit(diction):
new_data = {}
new_data['groupe_inscription_id'] = str(inserted_grp_id)
new_data['inscription_id'] = str(my_inscription)
new_data['type_groupe_code'] = str(diction['type_groupe_code'])
new_data['groupe_inscription_type_id'] = str(diction['groupe_inscription_type_id'])
mytoday = datetime.today()
new_data['date_ajout_groupe'] = str(mytoday)

View File

@ -6503,7 +6503,7 @@ def Create_Evaluation_QR_Code_From_Survey(diction):
data_update['qr_code_safe_token'] = str(local_QR_Code_safe_token)
result = MYSY_GV.dbname['survey'].find_one_and_update(
local_survey_retval = MYSY_GV.dbname['survey'].find_one_and_update(
{'session_id': str(diction['session_id']),
'_id': ObjectId(str(my_survey_id)),
'partner_owner_recid': str(my_partner['recid']),
@ -6515,6 +6515,82 @@ def Create_Evaluation_QR_Code_From_Survey(diction):
)
print("check result == ", local_survey_retval)
"""
Apres que l'envoie est fait, on va loguer le traitement dans la collection : courrier_template_tracking_history
"""
if ("related_collection_id" in local_survey_retval.keys() and 'related_collection' in local_survey_retval.keys()):
# Cette demande d'enquete concerne une inscription
courrier_ref_interne = ""
if ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "pos"):
courrier_ref_interne = "QUESTION_POSITIONNEMENT"
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval[
'survey_type'] == "hot_eval"):
courrier_ref_interne = "EVAL_FORMATION"
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval[
'survey_type'] == "cold_eval"):
courrier_ref_interne = "EVAL_FORMATION"
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval[
'survey_type'] == "human_eval"):
courrier_ref_interne = "EVAL_RESSOURCE_HUMAINE"
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval[
'survey_type'] == "autre_eval"):
courrier_ref_interne = "EVAL_AUTRE"
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval[
'survey_type'] == "stage_eval"):
courrier_ref_interne = "EVAL_STAGE_ENTREPRISE"
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval[
'survey_type'] == "specific_survey"):
if ("client_id" in local_survey_retval.keys() and local_survey_retval['client_id']):
courrier_ref_interne = "SPECIFIC_SURVEY_CLIENT"
elif ("employe_id" in local_survey_retval.keys() and local_survey_retval['employe_id']):
courrier_ref_interne = "SPECIFIC_SURVEY_EMPLOYEE"
else:
courrier_ref_interne = "SPECIFIC_SURVEY"
else:
mycommon.myprint(str(inspect.stack()[0][3]) + " Le type d'enquete est invalide ")
return False, " Le type d'enquete est invalide"
local_inscription_id = local_survey_retval['related_collection_id']
qry = {'_id': ObjectId(str(local_inscription_id)),
'status': '1',
'partner_owner_recid': str(my_partner['recid'])}
partner_owner_recid = "partner_owner_recid"
if (str(local_survey_retval['related_collection']) == "ressource_humaine"):
partner_owner_recid = "partner_recid"
inscription_data = MYSY_GV.dbname[str(local_survey_retval['related_collection'])].find_one(
{'_id': ObjectId(str(local_inscription_id)),
'valide': '1',
str(partner_owner_recid): str(my_partner['recid'])})
# print(" inscription_data = ", inscription_data)
if (inscription_data and "session_id" in inscription_data.keys() and inscription_data[
'session_id']):
local_status, local_retval = module_editique.Editic_Log_History_Action_From_courrier_template_type_document_ref_interne(
my_partner, str(courrier_ref_interne), str(inscription_data['session_id']), 'inscription',
str(local_inscription_id), "")
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'inscrit (2) : " + str(
local_inscription_id))
return True, send_file(qr_code_img_file, as_attachment=True)
return False, " Impossible de générer les QR Code (1) "