21/04/2026 - 21h30

Signed-off-by: Cherif <cbalde@mysy-training.com>
master_Elyos_FI
Cherif 2026-04-21 20:23:04 +02:00
parent 109150a6db
commit cb4daee06a
7 changed files with 2727 additions and 44 deletions

View File

@ -4,12 +4,14 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="20/04/2026 - 20h30">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="21/04/2026 - 11h30">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Job_Cron.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron.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$/notes_apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/notes_apprenant_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/apprenant_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/session_admission_fi.py" beforeDir="false" afterPath="$PROJECT_DIR$/session_admission_fi.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -453,7 +455,7 @@
<option name="project" value="LOCAL" />
<updated>1747251650255</updated>
</task>
<option name="localTasksCounter" value="564" />
<option name="localTasksCounter" value="565" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -495,7 +497,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="25/02/26 - 19h30" />
<MESSAGE value="26/02/26 - 19h30" />
<MESSAGE value="27/02/26 - 19h30" />
<MESSAGE value="28/02/26 - 22h" />
@ -520,6 +521,7 @@
<MESSAGE value="18/04/2026 -19h" />
<MESSAGE value="19/04/2026 - 20h30" />
<MESSAGE value="20/04/2026 - 20h30" />
<option name="LAST_COMMIT_MESSAGE" value="20/04/2026 - 20h30" />
<MESSAGE value="21/04/2026 - 11h30" />
<option name="LAST_COMMIT_MESSAGE" value="21/04/2026 - 11h30" />
</component>
</project>

View File

@ -87,7 +87,7 @@ def AddStagiairetoClass(diction):
'is_handicap', 'is_droit_image', 'is_rgpd', 'nationalite', 'situation_famille', 'naissance_lieu',
'naissance_departement',
'naissance_pays', 'num_secu', 'identite_type', 'piece_identite_num', 'type_mobilite',
'telephone_bis', 'frequence_facturation'
'telephone_bis', 'frequence_facturation', 'ine', 'matricule'
]
incom_keys = diction.keys()
@ -118,6 +118,22 @@ def AddStagiairetoClass(diction):
connected_user_id = my_partner['recid']
"""
Verifier qu'il n'y pas un étudiant avec le meme INE (Identifiant National Étudiant)
"""
if ("ine" in diction.keys() and diction['ine']):
is_exist_ine_count = MYSY_GV.dbname['inscription'].count_documents(
{'ine': str(diction['ine']),
'session_id': str(diction['session_id']),
'partner_owner_recid': str(my_partner['recid'])
})
if (is_exist_ine_count > 0):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) ")
return False, " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) "
if( "email" in diction.keys() and diction['email']):
diction['email'] = str(diction['email']).strip().lower()
@ -196,6 +212,19 @@ def AddStagiairetoClass(diction):
comment = str(diction['comment']).strip()
mydata['comment'] = comment
ine = ""
if ("ine" in diction.keys()):
if diction['ine']:
ine = str(diction['ine']).strip()
mydata['ine'] = ine
matricule = ""
if ("matricule" in diction.keys()):
if diction['matricule']:
matricule = str(diction['matricule']).strip()
mydata['matricule'] = matricule
if ("is_handicap" in diction.keys() and str(diction['is_handicap']) not in ['0', '1', '']):
mycommon.myprint(
@ -892,6 +921,14 @@ def AddStagiairetoClass(diction):
'valide': '1',
'locked': '0'}, {'_id': 1})
local_apprenant_matricule = ""
if ("matricule" in is_apprenant_existe.keys()):
local_apprenant_matricule = is_apprenant_existe['matricule']
local_apprenant_ine = ""
if ("ine" in is_apprenant_existe.keys()):
local_apprenant_ine = is_apprenant_existe['ine']
new_apprenant_diction = diction
champ_to_delete = ['class_internal_url', 'session_id', 'inscription_validation_date', 'apprenant_id',
@ -947,13 +984,25 @@ def AddStagiairetoClass(diction):
local_apprenant_id = str(apprenant_data['_id'])
local_apprenant_matricule = ""
if( "matricule" in apprenant_data.keys() ):
local_apprenant_matricule = apprenant_data['matricule']
local_apprenant_ine = ""
if ("ine" in apprenant_data.keys()):
local_apprenant_ine = apprenant_data['ine']
"""
Apres la creation du dossier on met à jour l'inscription en rajoutant l'apprenant_id
"""
ret_val2 = MYSY_GV.dbname['inscription'].find_one_and_update(
{'_id': ObjectId(str(inserted_id)), 'email': str(diction['email']),
'partner_owner_recid': str(my_partner['recid'])},
{"$set": {'apprenant_id': str(local_apprenant_id), 'date_update': str(datetime.now()),
{"$set": {'apprenant_id': str(local_apprenant_id),
'matricule':str(local_apprenant_matricule),
'ine': str(local_apprenant_ine),
'date_update': str(datetime.now()),
'update_by': str(my_partner['_id'])}},
return_document=ReturnDocument.AFTER,
upsert=False,
@ -1984,11 +2033,10 @@ def UpdateStagiairetoClass(diction):
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'type_apprenant', 'civilite',
'date_naissance', 'financeur_rattachement_id', 'facture_client_rattachement_id', 'memo',
'is_handicap', 'is_droit_image', 'is_rgpd', 'nationalite', 'situation_famille', 'naissance_lieu',
'naissance_departement',
'naissance_pays', 'num_secu', 'identite_type', 'piece_identite_num', 'type_mobilite',
'telephone_bis', 'frequence_facturation', 'update_dossier_apprenant'
'telephone_bis', 'frequence_facturation', 'update_dossier_apprenant', 'ine', 'matricule'
]
@ -2033,6 +2081,25 @@ def UpdateStagiairetoClass(diction):
partner_recid = my_partner['recid']
"""
Verifier qu'il n'y pas un étudiant avec le meme INE (Identifiant National Étudiant)
"""
if ("ine" in diction.keys() and diction['ine']):
is_exist_ine_count = MYSY_GV.dbname['inscription'].count_documents(
{'_id': {'$ne': ObjectId(str(diction['_id']))},
'ine': str(diction['ine']),
'session_id': str(diction[
'session_id']),
'partner_owner_recid': str(
my_partner['recid'])
})
if (is_exist_ine_count > 0):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) ")
return False, " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) "
myemail = ""
if ("email" in diction.keys()):
if diction['email']:
@ -2096,6 +2163,16 @@ def UpdateStagiairetoClass(diction):
mydata['nom'] = str(diction['nom']).strip()
user_nom = str(diction['nom']).strip()
if ("ine" in diction.keys()):
if diction['ine']:
mydata['ine'] = str(diction['ine']).strip()
if ("matricule" in diction.keys()):
if diction['matricule']:
mydata['matricule'] = str(diction['matricule']).strip()
if ("civilite" in diction.keys()):
mydata['civilite'] = str(diction['civilite']).strip().lower()
@ -2699,7 +2776,8 @@ def UpdateStagiairetoClass(diction):
#print(" ### mise à jour de l'apprenant : ", ret_val2['apprenant_id'])
local_apprenant_id = ret_val2['apprenant_id']
new_apprenant_data = {}
tab_champ = ['civilite', 'nom', 'prenom', 'employeur', 'email', 'adresse', 'code_postal', 'ville', 'pays']
tab_champ = ['civilite', 'nom', 'prenom', 'employeur', 'email', 'adresse', 'code_postal', 'ville',
'pays', 'ine', 'matricule']
for field in tab_champ:
if( str(field) in ret_val2.keys()):
new_apprenant_data[str(field)] = ret_val2[str(field)]
@ -10148,8 +10226,7 @@ def Get_Statgaire_List_Partner_with_filter(diction):
if (facture_client_rattachement_id_id_count <= 0):
client_facturation_valide = "0"
if ('myclass_collection' in retVal.keys() and len(retVal[
'myclass_collection']) > 0 and client_valide == "1" and client_facturation_valide == "1"):
if ('myclass_collection' in retVal.keys() and len(retVal['myclass_collection']) > 0 and client_valide == "1" and client_facturation_valide == "1"):
val['id'] = str(cpt)
cpt = cpt + 1
@ -10231,6 +10308,12 @@ def Get_Statgaire_List_Partner_with_filter(diction):
else:
val['domaine'] = ""
if ("is_ftion_initiale" in retVal['myclass_collection'][0].keys()):
val['is_ftion_initiale'] = retVal['myclass_collection'][0]['is_ftion_initiale']
else:
val['is_ftion_initiale'] = ""
client_rattachement_id = ""
client_rattachement_nom = ""
@ -10692,6 +10775,11 @@ def Get_Statgaire_List_Partner_with_filter_light(diction):
else:
val['domaine'] = ""
if ("is_ftion_initiale" in retVal['myclass_collection'][0].keys()):
val['is_ftion_initiale'] = retVal['myclass_collection'][0]['is_ftion_initiale']
else:
val['is_ftion_initiale'] = ""
client_rattachement_id = ""
client_rattachement_nom = ""
@ -11138,6 +11226,16 @@ def GetAttendeeDetail_perSession_from_line_id(diction):
my_retrun_dict['memo'] = memo
ine = ""
if ("ine" in local_Insc_retval.keys()):
ine = local_Insc_retval['ine']
my_retrun_dict['ine'] = ine
matricule = ""
if ("matricule" in local_Insc_retval.keys()):
matricule = local_Insc_retval['matricule']
my_retrun_dict['matricule'] = matricule
comment = ""
if ("comment" in local_Insc_retval.keys()):
comment = local_Insc_retval['comment']
@ -11145,6 +11243,8 @@ def GetAttendeeDetail_perSession_from_line_id(diction):
local_telephone = ""
if ("telephone" in local_Insc_retval.keys()):
local_telephone = local_Insc_retval['telephone']

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,7 @@ def Add_Apprenant(diction):
'is_handicap', 'is_droit_image', 'is_rgpd', 'nationalite', 'situation_famille', 'naissance_lieu',
'naissance_departement',
'naissance_pays', 'num_secu', 'identite_type', 'piece_identite_num', 'type_mobilite',
'telephone_bis',
'telephone_bis', 'matricule', 'ine'
]
incom_keys = diction.keys()
@ -221,36 +221,40 @@ def Add_Apprenant(diction):
new_data['date_naissance'] = "01/01/1900"
"""
Creation du matricule de l'apprenant
Creation du matricule de l'apprenant, si aucune valeur de matricule n'est donnée
"""
# Récuperation de la sequence de l'objet "apprenant_matricule" dans la collection : "mysy_sequence"
retval_sequence_matricule_apprenant = MYSY_GV.dbname['mysy_sequence'].find_one(
{'related_mysy_object': 'apprenant_matricule',
'valide': '1', 'partner_owner_recid': str(
my_partner['recid'])})
if (retval_sequence_matricule_apprenant is None):
# Il n'y pas de sequence pour le partenaire, on va aller chercher la sequence par defaut
if( "matricule" not in diction.keys()):
# Récuperation de la sequence de l'objet "apprenant_matricule" dans la collection : "mysy_sequence"
retval_sequence_matricule_apprenant = MYSY_GV.dbname['mysy_sequence'].find_one(
{'related_mysy_object': 'apprenant_matricule',
'valide': '1', 'partner_owner_recid': 'default'})
'valide': '1', 'partner_owner_recid': str(
my_partner['recid'])})
if (retval_sequence_matricule_apprenant is None):
# Il n'y pas de sequence pour le partenaire, on va aller chercher la sequence par defaut
retval_sequence_matricule_apprenant = MYSY_GV.dbname['mysy_sequence'].find_one(
{'related_mysy_object': 'apprenant_matricule',
'valide': '1', 'partner_owner_recid': 'default'})
apprenant_matricule = ""
if (retval_sequence_matricule_apprenant is None or "current_val" not in retval_sequence_matricule_apprenant.keys()):
mycommon.myprint(" WARNING : Impossible de récupérer la sequence 'apprenant_matricule' pour créer le matricule")
else:
current_seq_value = str(retval_sequence_matricule_apprenant['current_val'])
new_sequence_value = int(mycommon.tryInt(current_seq_value)) + 1
new_sequance_data_to_update = {'current_val': new_sequence_value}
ret_val2 = MYSY_GV.dbname['mysy_sequence'].find_one_and_update(
{'_id': ObjectId(str(retval_sequence_matricule_apprenant['_id'])), 'valide': '1'},
{"$set": new_sequance_data_to_update},
return_document=ReturnDocument.AFTER,
upsert=False,
)
apprenant_matricule = retval_sequence_matricule_apprenant['prefixe'] + str(current_seq_value)
new_data['matricule'] = str(apprenant_matricule)
apprenant_matricule = ""
if (retval_sequence_matricule_apprenant is None or "current_val" not in retval_sequence_matricule_apprenant.keys()):
mycommon.myprint(" WARNING : Impossible de récupérer la sequence 'apprenant_matricule' pour créer le matricule")
else:
current_seq_value = str(retval_sequence_matricule_apprenant['current_val'])
new_sequence_value = int(mycommon.tryInt(current_seq_value)) + 1
new_sequance_data_to_update = {'current_val': new_sequence_value}
ret_val2 = MYSY_GV.dbname['mysy_sequence'].find_one_and_update(
{'_id': ObjectId(str(retval_sequence_matricule_apprenant['_id'])), 'valide': '1'},
{"$set": new_sequance_data_to_update},
return_document=ReturnDocument.AFTER,
upsert=False,
)
apprenant_matricule = retval_sequence_matricule_apprenant['prefixe'] + str(current_seq_value)
new_data['matricule'] = str(apprenant_matricule)
new_data['matricule'] = diction['matricule']
del new_data['token']
@ -300,7 +304,7 @@ def Update_Apprenant(diction):
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'civilite', 'date_naissance',
'tuteur1_civilite', 'tuteur2_civilite',
'is_handicap', 'is_droit_image', 'is_rgpd', 'nationalite', 'situation_famille', 'naissance_lieu', 'naissance_departement',
'naissance_pays','num_secu', 'identite_type', 'piece_identite_num', 'type_mobilite', 'telephone_bis', 'matricule'
'naissance_pays','num_secu', 'identite_type', 'piece_identite_num', 'type_mobilite', 'telephone_bis', 'matricule', 'ine'
]
@ -366,6 +370,24 @@ def Update_Apprenant(diction):
str(inspect.stack()[0][3]) + " Le matricule '" + str(diction['matricule']) + "' est déjà utilisé ")
return False, " Le matricule '" + str(diction['matricule']) + "' est déjà utilisé ",
"""
Verifier qu'il n'y pas un étudiant avec le meme INE (Identifiant National Étudiant)
"""
if ("ine" in diction.keys() and diction['ine']):
is_exist_ine_count = MYSY_GV.dbname['apprenant'].count_documents(
{'_id': {'$ne': ObjectId(str(diction['_id']))},
'ine': str(diction['ine']),
'partner_owner_recid': str(
my_partner['recid'])
})
if (is_exist_ine_count > 0):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) ")
return False, " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) "
# Verifier que l'adresse email est valide
if ("email" in diction.keys() and diction['email']):

View File

@ -4030,6 +4030,10 @@ def get_partner_class(diction):
filt_is_ftion_initiale = {}
if ("is_ftion_initiale" in diction.keys() and diction['is_ftion_initiale'] == "1"):
filt_is_ftion_initiale = {'is_ftion_initiale':"1"}
if ("is_ftion_initiale" in diction.keys() and diction['is_ftion_initiale'] == "2"):
# si la valeur = 2, on va recuperer toutes les formations
filt_is_ftion_initiale = {}
else:
filt_is_ftion_initiale = {'is_ftion_initiale': {'$ne':'1'}}
@ -4150,6 +4154,10 @@ def get_partner_class(diction):
if ("note_finale_calculation_rule_id" not in retVal.keys()):
retVal['note_finale_calculation_rule_id'] = ""
if ("is_ftion_initiale" not in retVal.keys()):
retVal['is_ftion_initiale'] = ""
# Recuperation des données du formateur
formateur_nom_prenom = ""
# Si il y a un code formateur_id, alors on va recuperer les nom et prenom du formation

View File

@ -3417,6 +3417,18 @@ def GetAttendeeDetail_perSession(diction):
else:
my_retrun_dict['pays'] = ""
if ("ine" in local_Insc_retval.keys()):
my_retrun_dict['ine'] = local_Insc_retval['ine']
else:
my_retrun_dict['ine'] = ""
if ("matricule" in local_Insc_retval.keys()):
my_retrun_dict['matricule'] = local_Insc_retval['matricule']
else:
my_retrun_dict['matricule'] = ""
if ("type_apprenant" in local_Insc_retval.keys()):
my_retrun_dict['type_apprenant'] = local_Insc_retval['type_apprenant']
else:

View File

@ -842,7 +842,7 @@ def Add_Stagiaire_To_Admission_Session(diction):
'type_apprenant', 'civilite', 'date_naissance', 'memo', 'comment',
"num_secu", "is_rgpd", "situation_famille", "piece_identite_type", "piece_identite_num",
"type_mobilite", "telephone_bis", "nationalite", "is_handicap", "is_handicap", "is_droit_image",
'naissance_lieu', 'naissance_departement', 'naissance_pays', 'session_etape'
'naissance_lieu', 'naissance_departement', 'naissance_pays', 'session_etape', 'ine'
]
incom_keys = diction.keys()
@ -874,6 +874,21 @@ def Add_Stagiaire_To_Admission_Session(diction):
if (local_status is not True):
return local_status, my_partner
"""
Verifier qu'il n'y pas un étudiant avec le meme INE (Identifiant National Étudiant)
"""
if ("ine" in diction.keys() and diction['ine']):
is_exist_ine_count = MYSY_GV.dbname['admission_session_inscrit'].count_documents(
{'ine': str(diction['ine']),
'session_id':str(diction['session_id']),
'partner_owner_recid':str(my_partner['recid'])
})
if (is_exist_ine_count > 0):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) ")
return False, " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) "
"""
Verififier l'existance et la valididé de la session
@ -1282,7 +1297,7 @@ def Update_Stagiaire_To_Admission_Session(diction):
'type_apprenant', 'civilite', 'date_naissance', 'memo', 'comment',
"num_secu", "is_rgpd", "situation_famille", "piece_identite_type", "piece_identite_num",
"type_mobilite", "telephone_bis", "nationalite", "is_handicap", "is_droit_image",
'naissance_lieu', 'naissance_departement', 'naissance_pays', 'session_etape', 'rang'
'naissance_lieu', 'naissance_departement', 'naissance_pays', 'session_etape', 'rang', 'ine'
]
incom_keys = diction.keys()
@ -1313,6 +1328,24 @@ def Update_Stagiaire_To_Admission_Session(diction):
if (local_status is not True):
return local_status, my_partner
"""
Verifier qu'il n'y pas un étudiant avec le meme INE (Identifiant National Étudiant)
"""
if( "ine" in diction.keys() and diction['ine']):
is_exist_ine_count = MYSY_GV.dbname['admission_session_inscrit'].count_documents({'_id':{'$ne':ObjectId(str(diction['_id']))},
'ine':str(diction['ine']),
'session_id': str(diction[
'session_id']),
'partner_owner_recid': str(
my_partner['recid'])
})
if( is_exist_ine_count > 0 ):
mycommon.myprint(
str(inspect.stack()[0][3]) + " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) ")
return False, " Il y a déjà un candidat avec le même numéro Identifiant National Étudiant (INE) "
"""
Verifier la validé de l'inscrit
"""
@ -1419,7 +1452,7 @@ def Update_Stagiaire_To_Admission_Session(diction):
data_cle['valide'] = "1"
data_cle['locked'] = "0"
print(" ### data_cle = ", data_cle)
#print(" ### data_cle = ", data_cle)
result = MYSY_GV.dbname['admission_session_inscrit'].find_one_and_update(
@ -3157,7 +3190,6 @@ def Candidat_Inscrire_To_Session(diction):
list_apprenant_id.append(result['_id'])
is_blocking_message = False
blocking_message = "Erreur : "