parent
9923938c67
commit
fe3b8bb7a5
|
|
@ -4,10 +4,22 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="wds">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="22/10*2025 - 22h">
|
||||
<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$/Job_Cron.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Job_Cron_Common.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron_Common.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$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/attestation_formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/attestation_formation.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/base_class_calcul_note.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_class_calcul_note.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/internal_email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/internal_email_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" beforeDir="false" afterPath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_base_setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_base_setup.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/wrapper.py" beforeDir="false" afterPath="$PROJECT_DIR$/wrapper.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -450,7 +462,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1747251650255</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="506" />
|
||||
<option name="localTasksCounter" value="507" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
|
@ -492,7 +504,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="08/06/2025 - 16h30" />
|
||||
<MESSAGE value="09/06/2025 - 21h30" />
|
||||
<MESSAGE value="11/06/2025 - 16h30" />
|
||||
<MESSAGE value="19/06/2025 -18h" />
|
||||
|
|
@ -517,6 +528,7 @@
|
|||
<MESSAGE value="20/10/2025 - 14hsd" />
|
||||
<MESSAGE value="21/10/2025 - 22h" />
|
||||
<MESSAGE value="wds" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="wds" />
|
||||
<MESSAGE value="22/10*2025 - 22h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="22/10*2025 - 22h" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -78,7 +78,7 @@ elif (MYSY_ENV == "REC"):
|
|||
elif (MYSY_ENV == "DEM"):
|
||||
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_demo"
|
||||
client = MongoClient(CONNECTION_STRING)
|
||||
dbname = client['cherifdb_demo']
|
||||
dbname = client['cherifdb_demo_fi']
|
||||
CLIENT_URL_BASE = 'https://demo.mysy-training.com/'
|
||||
MYSY_DEBUG_LEVEL = 1
|
||||
|
||||
|
|
@ -548,9 +548,10 @@ elif (MYSY_ENV == "DEM"):
|
|||
MYSY_MARIADB_HOST = "192.168.1.21"
|
||||
MYSY_MARIADB_PORT = 3306
|
||||
MYSY_LMS_BDD = "mysy_db_chamilo_rec"
|
||||
MYSY_LMS_URL = "https://demolms.mysy-training.com/"
|
||||
MYSY_LMS_URL = "https://demolmsmysy-hosting.com/"
|
||||
MYSY_LMS_BASE_DIRECTORY = "/var/www/html/chamilo_mysy_demo/"
|
||||
LMS_BAS_URL = "mysytraining.fr/"
|
||||
#LMS_BAS_URL = "mysytraining.fr/"
|
||||
LMS_BAS_URL = "demolmsmysy-hosting.com/"
|
||||
MYSY_ENV_API = "https://demoapi.mysy-training.com/myclass/api/"
|
||||
|
||||
|
||||
|
|
|
|||
511
Job_Cron.py
511
Job_Cron.py
|
|
@ -1411,6 +1411,17 @@ def Send_document_from_base_document_automatic_setup(diction):
|
|||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
session_data = MYSY_GV.dbname['session_formation'].find_one({'_id':ObjectId(str(diction['session_id'])), 'partner_owner_recid':str(diction['partner_owner_recid'])})
|
||||
session_class_id = ""
|
||||
if( session_data and "class_id" in session_data.keys()):
|
||||
session_class_id = session_data['class_id']
|
||||
else:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La session "+str(diction['session_id'])+" a une formation invalide ")
|
||||
return False, " La session "+str(diction['session_id'])+" a une formation invalide "
|
||||
|
||||
|
||||
|
||||
if( str(diction['document_ref_intern']) == 'CONVENTION_STAGIAIRE_ENTREPRISE' or str(diction['document_ref_intern']) == 'CONVENTION_STAGIAIRE_INDIVIDUELLE' ):
|
||||
|
||||
|
|
@ -1454,29 +1465,47 @@ def Send_document_from_base_document_automatic_setup(diction):
|
|||
"""
|
||||
print(" ### DEBUT Initialiser le questionnaire de positionnement ")
|
||||
|
||||
local_default_form_count = MYSY_GV.dbname['formulaire'].count_documents(
|
||||
{'type':'pos',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
"""
|
||||
Si il ya un Q. position par defaut sur la formation, alors aller la chercher
|
||||
"""
|
||||
document_q_position = ""
|
||||
local_diction_doc = {}
|
||||
local_diction_doc['document_type'] = "QUESTION_POSITIONNEMENT"
|
||||
local_diction_doc['class_id'] = session_class_id
|
||||
local_diction_doc['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
if(local_default_form_count != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " La configuration du questionnaire de positionnement par défaut est invalide. Nb formulaire = "+str(local_default_form_count))
|
||||
return False, " La configuration du questionnaire de positionnement par défaut est invalide"
|
||||
local_document_q_position_doc_status, local_document_q_position_doc_retval = Job_Cron_Common.Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(
|
||||
local_diction_doc)
|
||||
if (local_document_q_position_doc_status):
|
||||
document_q_position = local_document_q_position_doc_retval
|
||||
|
||||
local_default_form_data = MYSY_GV.dbname['formulaire'].find_one(
|
||||
{'type': 'pos',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id':1})
|
||||
if (document_q_position == ""):
|
||||
|
||||
local_default_form_count = MYSY_GV.dbname['formulaire'].count_documents(
|
||||
{'type':'pos',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if(local_default_form_count != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " La configuration du questionnaire de positionnement par défaut est invalide. Nb formulaire = "+str(local_default_form_count))
|
||||
return False, " La configuration du questionnaire de positionnement par défaut est invalide"
|
||||
|
||||
local_default_form_data = MYSY_GV.dbname['formulaire'].find_one(
|
||||
{'type': 'pos',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id':1})
|
||||
|
||||
document_q_position = str(local_default_form_data['_id'])
|
||||
|
||||
init_diction = {}
|
||||
init_diction['token']= my_partner['token']
|
||||
init_diction['session_id'] = diction['session_id']
|
||||
init_diction['formulaire_id'] = local_default_form_data['_id']
|
||||
init_diction['formulaire_id'] = document_q_position
|
||||
init_diction['survey_type'] = "pos"
|
||||
init_diction['sending_date'] = ""
|
||||
init_diction['related_collection'] = "inscription"
|
||||
|
|
@ -1498,33 +1527,51 @@ def Send_document_from_base_document_automatic_setup(diction):
|
|||
"""
|
||||
Evaluation à chaud
|
||||
"""
|
||||
print(" ### DEBUT Initialiser le questionnaire d'evaluation à chaud ")
|
||||
"""
|
||||
Si il ya une evaluation à chaud par defaut sur la formation, alors aller la chercher
|
||||
"""
|
||||
document_hot_eval = ""
|
||||
local_diction_doc = {}
|
||||
local_diction_doc['document_type'] = "EVAL_FORMATION_HOT"
|
||||
local_diction_doc['class_id'] = session_class_id
|
||||
local_diction_doc['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
local_default_form_count = MYSY_GV.dbname['formulaire'].count_documents(
|
||||
{'type': 'hot_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
local_document_hot_eval_status, local_document_hot_eval_retval = Job_Cron_Common.Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(
|
||||
local_diction_doc)
|
||||
if (local_document_hot_eval_status):
|
||||
document_hot_eval = local_document_hot_eval_retval
|
||||
|
||||
if (local_default_form_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La configuration du questionnaire de positionnement par défaut est invalide. Nb formulaire = ",
|
||||
local_default_form_count)
|
||||
return False, " La configuration du questionnaire d'évaluation à chaud par défaut est invalide"
|
||||
if (document_hot_eval == ""):
|
||||
|
||||
local_default_form_data = MYSY_GV.dbname['formulaire'].find_one(
|
||||
{'type': 'hot_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id': 1})
|
||||
print(" ### DEBUT Initialiser le questionnaire d'evaluation à chaud ")
|
||||
|
||||
local_default_form_count = MYSY_GV.dbname['formulaire'].count_documents(
|
||||
{'type': 'hot_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (local_default_form_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La configuration du questionnaire de positionnement par défaut est invalide. Nb formulaire = ",
|
||||
local_default_form_count)
|
||||
return False, " La configuration du questionnaire d'évaluation à chaud par défaut est invalide"
|
||||
|
||||
local_default_form_data = MYSY_GV.dbname['formulaire'].find_one(
|
||||
{'type': 'hot_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id': 1})
|
||||
|
||||
document_hot_eval = str(local_default_form_data['_id'])
|
||||
|
||||
init_diction = {}
|
||||
init_diction['token'] = my_partner['token']
|
||||
init_diction['session_id'] = diction['session_id']
|
||||
init_diction['formulaire_id'] = local_default_form_data['_id']
|
||||
init_diction['formulaire_id'] = str(document_hot_eval)
|
||||
init_diction['survey_type'] = "hot_eval"
|
||||
init_diction['sending_date'] = ""
|
||||
init_diction['related_collection'] = "inscription"
|
||||
|
|
@ -1547,38 +1594,56 @@ def Send_document_from_base_document_automatic_setup(diction):
|
|||
"""
|
||||
Evaluation du formateur mis que la session de formation, si formateur
|
||||
"""
|
||||
print(" ### DEBUT Initialiser le questionnaire d'évaluation du formateur mis sur la session ")
|
||||
"""
|
||||
Si il ya une evaluation formateur par defaut sur la formation, alors aller la chercher
|
||||
"""
|
||||
document_formateur_eval = ""
|
||||
local_diction_doc = {}
|
||||
local_diction_doc['document_type'] = "EVAL_FORMATION_FORMATEUR"
|
||||
local_diction_doc['class_id'] = session_class_id
|
||||
local_diction_doc['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
#1 - Verifier s'il y a un formateur valide sur la session
|
||||
session_data = MYSY_GV.dbname['session_formation'].find_one({'_id':ObjectId(str(diction['session_id']))}, {'_id':1, 'formateur_id':1})
|
||||
local_document_formateur_eval_status, local_document_formateur_eval_retval = Job_Cron_Common.Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(
|
||||
local_diction_doc)
|
||||
if (local_document_formateur_eval_status):
|
||||
document_formateur_eval = local_document_formateur_eval_retval
|
||||
|
||||
if( session_data and "formateur_id" in session_data.keys() and session_data['formateur_id']):
|
||||
# Aller chercher le formulaire par défaut pour l'evaluation des enseignants
|
||||
local_default_form_count = MYSY_GV.dbname['formulaire'].count_documents(
|
||||
{'type': 'human_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
if (document_formateur_eval == ""):
|
||||
print(" ### DEBUT Initialiser le questionnaire d'évaluation du formateur mis sur la session ")
|
||||
|
||||
if (local_default_form_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La configuration du questionnaire d'évaluation du formateur par défaut est invalide. Nb formulaire = " + str(
|
||||
local_default_form_count))
|
||||
return False, " La configuration du questionnaire d'évaluation du formateur par défaut est invalide"
|
||||
#1 - Verifier s'il y a un formateur valide sur la session
|
||||
session_data = MYSY_GV.dbname['session_formation'].find_one({'_id':ObjectId(str(diction['session_id']))}, {'_id':1, 'formateur_id':1})
|
||||
|
||||
if( session_data and "formateur_id" in session_data.keys() and session_data['formateur_id']):
|
||||
# Aller chercher le formulaire par défaut pour l'evaluation des enseignants
|
||||
local_default_form_count = MYSY_GV.dbname['formulaire'].count_documents(
|
||||
{'type': 'human_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (local_default_form_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La configuration du questionnaire d'évaluation du formateur par défaut est invalide. Nb formulaire = " + str(
|
||||
local_default_form_count))
|
||||
return False, " La configuration du questionnaire d'évaluation du formateur par défaut est invalide"
|
||||
|
||||
local_default_form_data = MYSY_GV.dbname['formulaire'].find_one(
|
||||
{'type': 'human_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id': 1})
|
||||
|
||||
document_formateur_eval = str(local_default_form_data['_id'])
|
||||
|
||||
local_default_form_data = MYSY_GV.dbname['formulaire'].find_one(
|
||||
{'type': 'human_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id': 1})
|
||||
|
||||
init_diction = {}
|
||||
init_diction['token'] = my_partner['token']
|
||||
init_diction['session_id'] = diction['session_id']
|
||||
init_diction['formulaire_id'] = local_default_form_data['_id']
|
||||
init_diction['formulaire_id'] = document_formateur_eval
|
||||
init_diction['survey_type'] = "human_eval"
|
||||
init_diction['sending_date'] = ""
|
||||
|
||||
|
|
@ -1603,29 +1668,47 @@ def Send_document_from_base_document_automatic_setup(diction):
|
|||
"""
|
||||
Evaluation à froid à envoyer 3 mois plus tard
|
||||
"""
|
||||
"""
|
||||
Si il ya une evaluation à froid par defaut sur la formation, alors aller la chercher
|
||||
"""
|
||||
document_cold_eval = ""
|
||||
local_diction_doc = {}
|
||||
local_diction_doc['document_type'] = "EVAL_FORMATION_HOT"
|
||||
local_diction_doc['class_id'] = session_class_id
|
||||
local_diction_doc['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
print(" ### DEBUT Initialiser le questionnaire d'evaluation à froid à faire 3 mois plus tard ")
|
||||
local_document_cold_eval_status, local_document_cold_eval_retval = Job_Cron_Common.Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(
|
||||
local_diction_doc)
|
||||
if (local_document_cold_eval_status):
|
||||
document_cold_eval = local_document_cold_eval_retval
|
||||
|
||||
local_default_form_count = MYSY_GV.dbname['formulaire'].count_documents(
|
||||
{'type': 'cold_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
if (document_cold_eval == ""):
|
||||
|
||||
if (local_default_form_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La configuration du questionnaire d'évaluation à froid par défaut est invalide. Nb formulaire = "+str(
|
||||
local_default_form_count))
|
||||
return False, "La configuration du questionnaire d'évaluation à froid par défaut est invalide"
|
||||
print(" ### DEBUT Initialiser le questionnaire d'evaluation à froid à faire 3 mois plus tard ")
|
||||
|
||||
local_default_form_count = MYSY_GV.dbname['formulaire'].count_documents(
|
||||
{'type': 'cold_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (local_default_form_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La configuration du questionnaire d'évaluation à froid par défaut est invalide. Nb formulaire = "+str(
|
||||
local_default_form_count))
|
||||
return False, "La configuration du questionnaire d'évaluation à froid par défaut est invalide"
|
||||
|
||||
local_default_form_data = MYSY_GV.dbname['formulaire'].find_one(
|
||||
{'type': 'cold_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id': 1})
|
||||
|
||||
document_cold_eval = str(local_default_form_data['_id'])
|
||||
|
||||
local_default_form_data = MYSY_GV.dbname['formulaire'].find_one(
|
||||
{'type': 'cold_eval',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'default': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id': 1})
|
||||
|
||||
today_plus_90_jours = date.today() + timedelta(days=90)
|
||||
today_plus_90_jours_string = str(today_plus_90_jours.strftime("%d/%m/%Y"))
|
||||
|
|
@ -1633,7 +1716,7 @@ def Send_document_from_base_document_automatic_setup(diction):
|
|||
init_diction = {}
|
||||
init_diction['token'] = my_partner['token']
|
||||
init_diction['session_id'] = diction['session_id']
|
||||
init_diction['formulaire_id'] = local_default_form_data['_id']
|
||||
init_diction['formulaire_id'] = document_cold_eval
|
||||
init_diction['survey_type'] = "cold_eval"
|
||||
init_diction['sending_date'] = str(today_plus_90_jours_string)
|
||||
init_diction['related_collection'] = "inscription"
|
||||
|
|
@ -1645,35 +1728,51 @@ def Send_document_from_base_document_automatic_setup(diction):
|
|||
return local_status_init, local_retval_init
|
||||
|
||||
elif ( str(diction['document_ref_intern']) == 'ATTESTATION_FORMATION' ):
|
||||
print(" ### Debut Initialisation les attestations de formation ")
|
||||
# 1 Recuperer le modele d'attestation par défaut
|
||||
"""
|
||||
Si il ya une evaluation à froid par defaut sur la formation, alors aller la chercher
|
||||
"""
|
||||
document_attestation_mail = ""
|
||||
local_diction_doc = {}
|
||||
local_diction_doc['document_type'] = "ATTESTATION_FORMATION_MAIL"
|
||||
local_diction_doc['class_id'] = session_class_id
|
||||
local_diction_doc['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
local_diction = {}
|
||||
local_diction['ref_interne'] = "ATTESTATION_FORMATION"
|
||||
local_diction['type_doc'] = "email"
|
||||
local_diction['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
local_diction['default_version'] = "1"
|
||||
local_document_attestation_mail_status, local_document_document_attestation_mail_retval = Job_Cron_Common.Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(
|
||||
local_diction_doc)
|
||||
if (local_document_attestation_mail_status):
|
||||
document_attestation_mail = local_document_document_attestation_mail_retval
|
||||
|
||||
courrier_data_status, courrier_data_retval = mycommon.Get_Courrier_Template_Include_Default_Data(
|
||||
local_diction)
|
||||
if (courrier_data_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Impossible de récuperer le modèle de courrier 'ATTESTATION_FORMATION', (type : Email) ")
|
||||
return False, " Impossible de récuperer le modèle de courrier 'ATTESTATION_FORMATION', (type : Email) "
|
||||
if (document_attestation_mail == ""):
|
||||
|
||||
if ("contenu_doc" not in courrier_data_retval.keys() or str(courrier_data_retval['contenu_doc']) == ""):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Le modèle de courrier 'ATTESTATION_FORMATION', (type : Email) n'est pas correctement configuré ")
|
||||
return False, " Le modèle de courrier 'ATTESTATION_FORMATION', (type : Email) n'est pas correctement configuré"
|
||||
print(" ### Debut Initialisation les attestations de formation ")
|
||||
# 1 Recuperer le modele d'attestation par défaut
|
||||
|
||||
local_diction = {}
|
||||
local_diction['ref_interne'] = "ATTESTATION_FORMATION"
|
||||
local_diction['type_doc'] = "email"
|
||||
local_diction['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
local_diction['default_version'] = "1"
|
||||
|
||||
courrier_data_status, courrier_data_retval = mycommon.Get_Courrier_Template_Include_Default_Data(
|
||||
local_diction)
|
||||
if (courrier_data_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Impossible de récuperer le modèle de courrier 'ATTESTATION_FORMATION', (type : Email) ")
|
||||
return False, " Impossible de récuperer le modèle de courrier 'ATTESTATION_FORMATION', (type : Email) "
|
||||
|
||||
if ("contenu_doc" not in courrier_data_retval.keys() or str(courrier_data_retval['contenu_doc']) == ""):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Le modèle de courrier 'ATTESTATION_FORMATION', (type : Email) n'est pas correctement configuré ")
|
||||
return False, " Le modèle de courrier 'ATTESTATION_FORMATION', (type : Email) n'est pas correctement configuré"
|
||||
|
||||
document_attestation_mail = str(courrier_data_retval['_id'])
|
||||
|
||||
init_diction = {}
|
||||
init_diction['token'] = my_partner['token']
|
||||
init_diction['session_id'] = diction['session_id']
|
||||
init_diction['courrier_template_id'] = courrier_data_retval['_id']
|
||||
init_diction['courrier_template_id'] = document_attestation_mail
|
||||
|
||||
local_status_init, local_retval_init = Job_Cron_Common.Cron_Init_Attestation_Formation_With_Template(init_diction)
|
||||
|
||||
|
|
@ -1748,7 +1847,7 @@ def Send_document_from_base_document_automatic_setup(diction):
|
|||
"""
|
||||
Cette fonction permet d'envoyer les convocation par defaut avec les cron
|
||||
Algo :
|
||||
1 - Recuperer le modele de document par defaut pour les convocations
|
||||
1 - Recuperer le modele de document par defaut pour les convocations
|
||||
2 - Envoyer les convocations
|
||||
"""
|
||||
def Cron_Session_Convocation_Sending(diction):
|
||||
|
|
@ -1784,33 +1883,57 @@ def Cron_Session_Convocation_Sending(diction):
|
|||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
|
||||
local_diction = {}
|
||||
local_diction['ref_interne'] = "CONVOCATION_STAGIAIRE"
|
||||
local_diction['type_doc'] = "email"
|
||||
local_diction['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
local_diction['default'] = "1"
|
||||
|
||||
courrier_data_status, courrier_data_retval = mycommon.Get_Courrier_Template_Include_Default_Data(local_diction)
|
||||
if (courrier_data_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Impossible de récuperer le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : Email) ")
|
||||
return False, " Impossible de récuperer le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : Email) "
|
||||
|
||||
if ("contenu_doc" not in courrier_data_retval.keys() or str(courrier_data_retval['contenu_doc']) == ""):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : Email) n'est pas correctement configuré ")
|
||||
return False, " Le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : Email) n'est pas correctement configuré"
|
||||
"""
|
||||
Recuperer le class_id depuis la session
|
||||
"""
|
||||
local_class_id = ""
|
||||
class_data = MYSY_GV.dbname['session_formation'].find_one({'_id':ObjectId(str(diction['session_id']))}, {"class_id":1})
|
||||
if( class_data and "class_id" in class_data.keys()):
|
||||
local_class_id = class_data['class_id']
|
||||
|
||||
|
||||
print(" ### On a trouver un modele de convocation (type EMAIL) par defaut OKK")
|
||||
|
||||
"""
|
||||
Si il ya une convocation "mail" par defaut sur la formation, alors aller la chercher
|
||||
"""
|
||||
document_convention_individuelle_email = ""
|
||||
local_diction_doc= {}
|
||||
local_diction_doc['document_type'] = "CONVOCATION_STAGIAIRE_MAIL"
|
||||
local_diction_doc['class_id'] = local_class_id
|
||||
local_diction_doc['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
local_convention_doc_status, local_convention_doc_retval = Job_Cron_Common.Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(local_diction_doc)
|
||||
if (local_convention_doc_status):
|
||||
document_convention_individuelle_email = local_convention_doc_retval
|
||||
|
||||
|
||||
if( document_convention_individuelle_email == ""):
|
||||
local_diction = {}
|
||||
local_diction['ref_interne'] = "CONVOCATION_STAGIAIRE"
|
||||
local_diction['type_doc'] = "email"
|
||||
local_diction['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
local_diction['default'] = "1"
|
||||
|
||||
courrier_data_status, courrier_data_retval = mycommon.Get_Courrier_Template_Include_Default_Data(local_diction)
|
||||
if (courrier_data_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Impossible de récuperer le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : Email) ")
|
||||
return False, " Impossible de récuperer le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : Email) "
|
||||
|
||||
if ("contenu_doc" not in courrier_data_retval.keys() or str(courrier_data_retval['contenu_doc']) == ""):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : Email) n'est pas correctement configuré ")
|
||||
return False, " Le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : Email) n'est pas correctement configuré"
|
||||
|
||||
document_convention_individuelle_email = str(courrier_data_retval['_id'])
|
||||
|
||||
|
||||
local_diction_convocation_by_email = {}
|
||||
local_diction_convocation_by_email['token'] = my_partner['token']
|
||||
local_diction_convocation_by_email['session_id'] = diction['session_id']
|
||||
local_diction_convocation_by_email['courrier_template_id'] = str(courrier_data_retval['_id'])
|
||||
local_diction_convocation_by_email['courrier_template_id'] = document_convention_individuelle_email
|
||||
local_diction_convocation_by_email['email_test'] = ""
|
||||
local_diction_convocation_by_email['email_production'] = ""
|
||||
|
||||
|
|
@ -1820,37 +1943,51 @@ def Cron_Session_Convocation_Sending(diction):
|
|||
local_status, local_retval = Job_Cron_Common.Prepare_and_Send_Convocation_From_Session_By_Email(tab_files,
|
||||
Folder, local_diction_convocation_by_email)
|
||||
|
||||
|
||||
"""
|
||||
Aller chercher le modele de courrier de type PDF
|
||||
Si il ya une convocation "PDF" par defaut sur la formation, alors aller la chercher
|
||||
"""
|
||||
document_convention_individuelle_pdf = ""
|
||||
local_diction_doc = {}
|
||||
local_diction_doc['document_type'] = "CONVOCATION_STAGIAIRE_PDF"
|
||||
local_diction_doc['class_id'] = local_class_id
|
||||
local_diction_doc['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
local_diction = {}
|
||||
local_diction['ref_interne'] = "CONVOCATION_STAGIAIRE"
|
||||
local_diction['type_doc'] = "pdf"
|
||||
local_diction['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
local_diction['default'] = "1"
|
||||
local_convention_doc_status, local_convention_doc_retval = Job_Cron_Common.Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(
|
||||
local_diction_doc)
|
||||
if (local_convention_doc_status):
|
||||
document_convention_individuelle_pdf = local_convention_doc_retval
|
||||
|
||||
courrier_data_status, courrier_data_retval_pdf = mycommon.Get_Courrier_Template_Include_Default_Data(local_diction)
|
||||
if (courrier_data_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Impossible de récuperer le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : PDF) ")
|
||||
return False, " Impossible de récuperer le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : PDF) "
|
||||
if (document_convention_individuelle_pdf == ""):
|
||||
"""
|
||||
Aller chercher le modele de courrier de type PDF
|
||||
"""
|
||||
|
||||
if ("contenu_doc" not in courrier_data_retval_pdf.keys() or str(courrier_data_retval_pdf['contenu_doc']) == ""):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : PDF) n'est pas correctement configuré ")
|
||||
return False, " Le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : PDF) n'est pas correctement configuré"
|
||||
local_diction = {}
|
||||
local_diction['ref_interne'] = "CONVOCATION_STAGIAIRE"
|
||||
local_diction['type_doc'] = "pdf"
|
||||
local_diction['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
local_diction['default'] = "1"
|
||||
|
||||
print(" ### On a trouver un modele de convocation (Type : PDF) par defaut OKK")
|
||||
courrier_data_status, courrier_data_retval_pdf = mycommon.Get_Courrier_Template_Include_Default_Data(local_diction)
|
||||
if (courrier_data_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Impossible de récuperer le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : PDF) ")
|
||||
return False, " Impossible de récuperer le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : PDF) "
|
||||
|
||||
if ("contenu_doc" not in courrier_data_retval_pdf.keys() or str(courrier_data_retval_pdf['contenu_doc']) == ""):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : PDF) n'est pas correctement configuré ")
|
||||
return False, " Le modèle de courrier 'CONVOCATION_STAGIAIRE', (type : PDF) n'est pas correctement configuré"
|
||||
|
||||
document_convention_individuelle_pdf = str(courrier_data_retval_pdf['_id'])
|
||||
|
||||
|
||||
local_diction_convocation_by_PDF = {}
|
||||
local_diction_convocation_by_PDF['token'] = my_partner['token']
|
||||
local_diction_convocation_by_PDF['session_id'] = diction['session_id']
|
||||
local_diction_convocation_by_PDF['courrier_template_id'] = str(courrier_data_retval_pdf['_id'])
|
||||
local_diction_convocation_by_PDF['courrier_template_id'] = document_convention_individuelle_pdf
|
||||
local_status, local_retval = Job_Cron_Common.Prepare_and_Send_Convocation_From_Session_By_PDF(local_diction_convocation_by_PDF)
|
||||
|
||||
return True, "Les convocations ont été envoyées (CRON) "
|
||||
|
|
@ -2288,51 +2425,51 @@ def Cron_Send_Mail_Queue_Message_With_Filter(diction):
|
|||
for local_partner_owner_recid in tab_partner_owner_recid:
|
||||
for email_queue_data in MYSY_GV.dbname['mail_queue'].find({'statut':'0', 'valide':'1', 'locked':'0',
|
||||
'partner_owner_recid':local_partner_owner_recid}):
|
||||
msg = MIMEMultipart("alternative")
|
||||
|
||||
msg['From'] = email_queue_data['from']
|
||||
if( "cc" in email_queue_data.keys() and email_queue_data['cc']):
|
||||
msg['cc'] = email_queue_data['cc']
|
||||
|
||||
if ("bcc" in email_queue_data.keys() and email_queue_data['bcc']):
|
||||
msg['bcc'] = email_queue_data['bcc']
|
||||
|
||||
if ("subject" in email_queue_data.keys() and email_queue_data['subject']):
|
||||
msg['subject'] = email_queue_data['subject']
|
||||
else:
|
||||
msg['subject'] = ""
|
||||
|
||||
msg['to'] = email_queue_data['to']
|
||||
# Traitement de l'eventuel fichier joint
|
||||
tab_files_to_attache_to_mail = []
|
||||
|
||||
html_mime = MIMEText(email_queue_data['message'], 'html')
|
||||
msg.attach(html_mime)
|
||||
|
||||
#print(" ### msg = ", str(msg) )
|
||||
smtpserver = smtplib.SMTP(email_queue_data['smtp_account_smtpsrv'], email_queue_data['smtp_account_port'])
|
||||
|
||||
if( "tab_saved_file_full_path" in email_queue_data.keys() ):
|
||||
for myfile in email_queue_data['tab_saved_file_full_path']:
|
||||
file_to_attache_to_mail = MIMEBase('application', "octet-stream")
|
||||
file_to_attache_to_mail.set_payload(open(myfile, "rb").read())
|
||||
encoders.encode_base64(file_to_attache_to_mail)
|
||||
file_to_attache_to_mail.add_header('Content-Disposition',
|
||||
'attachment; filename="{0}"'.format(os.path.basename(myfile)))
|
||||
|
||||
new_node = {"attached_file": file_to_attache_to_mail}
|
||||
tab_files_to_attache_to_mail.append(new_node)
|
||||
|
||||
# Attacher l'eventuelle pièces jointes
|
||||
for myfile in tab_files_to_attache_to_mail:
|
||||
msg.attach(myfile['attached_file'])
|
||||
|
||||
smtpserver.ehlo()
|
||||
smtpserver.starttls()
|
||||
smtpserver.login(email_queue_data['smtp_account_user'], email_queue_data['smtp_account_password'])
|
||||
|
||||
|
||||
try:
|
||||
msg = MIMEMultipart("alternative")
|
||||
|
||||
msg['From'] = email_queue_data['from']
|
||||
if( "cc" in email_queue_data.keys() and email_queue_data['cc']):
|
||||
msg['cc'] = email_queue_data['cc']
|
||||
|
||||
if ("bcc" in email_queue_data.keys() and email_queue_data['bcc']):
|
||||
msg['bcc'] = email_queue_data['bcc']
|
||||
|
||||
if ("subject" in email_queue_data.keys() and email_queue_data['subject']):
|
||||
msg['subject'] = email_queue_data['subject']
|
||||
else:
|
||||
msg['subject'] = ""
|
||||
|
||||
msg['to'] = email_queue_data['to']
|
||||
# Traitement de l'eventuel fichier joint
|
||||
tab_files_to_attache_to_mail = []
|
||||
|
||||
html_mime = MIMEText(email_queue_data['message'], 'html')
|
||||
msg.attach(html_mime)
|
||||
|
||||
#print(" ### msg = ", str(msg) )
|
||||
|
||||
|
||||
smtpserver = smtplib.SMTP(email_queue_data['smtp_account_smtpsrv'], email_queue_data['smtp_account_port'])
|
||||
|
||||
if( "tab_saved_file_full_path" in email_queue_data.keys() ):
|
||||
for myfile in email_queue_data['tab_saved_file_full_path']:
|
||||
file_to_attache_to_mail = MIMEBase('application', "octet-stream")
|
||||
file_to_attache_to_mail.set_payload(open(myfile, "rb").read())
|
||||
encoders.encode_base64(file_to_attache_to_mail)
|
||||
file_to_attache_to_mail.add_header('Content-Disposition',
|
||||
'attachment; filename="{0}"'.format(os.path.basename(myfile)))
|
||||
|
||||
new_node = {"attached_file": file_to_attache_to_mail}
|
||||
tab_files_to_attache_to_mail.append(new_node)
|
||||
|
||||
# Attacher l'eventuelle pièces jointes
|
||||
for myfile in tab_files_to_attache_to_mail:
|
||||
msg.attach(myfile['attached_file'])
|
||||
|
||||
smtpserver.ehlo()
|
||||
smtpserver.starttls()
|
||||
smtpserver.login(email_queue_data['smtp_account_user'], email_queue_data['smtp_account_password'])
|
||||
val = smtpserver.send_message(msg)
|
||||
smtpserver.close()
|
||||
except Exception as error_send_mail:
|
||||
|
|
|
|||
|
|
@ -2718,8 +2718,6 @@ def Cron_Qualiopi_Automatic_Traitement_Notification(diction):
|
|||
traitement_global_status = "Ok"
|
||||
|
||||
dictionnary_data['traitement_global_status'] = str(traitement_global_status)
|
||||
|
||||
|
||||
body = {
|
||||
"params": dictionnary_data,
|
||||
}
|
||||
|
|
@ -3323,3 +3321,73 @@ def Cron_Relance_Emargement_By_Email(diction):
|
|||
return False, " Impossible d'envoyer les demandes d'émargement "
|
||||
|
||||
|
||||
"""
|
||||
Recuperation du document par defaut d'un type de document
|
||||
"""
|
||||
def Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['partner_owner_recid', 'class_id', 'document_type']
|
||||
|
||||
print("#zzzzzzzzzzzzzz diction = ",diction)
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ '" + val + "' n'existe pas")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['partner_owner_recid', 'class_id', 'document_type']
|
||||
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 la liste des arguments ")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification de l'identité et autorisation de l'entité qui
|
||||
appelle cette API
|
||||
"""
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
local_status, my_partner = mycommon.Get_Connected_User_Partner_Data_From_RecID(
|
||||
str(diction['partner_owner_recid']))
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
"""
|
||||
Clés de mise à jour
|
||||
"""
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['class_id'] = str(diction['class_id'])
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
#print(" ### Get_Partner_List_Partner_Client data_cle = ", data_cle)
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
retval_document_id = ""
|
||||
for retval in MYSY_GV.dbname['myclass_default_document'].find(data_cle, {str(diction['document_type']):1}):
|
||||
if( str(diction['document_type']) in retval.keys() ):
|
||||
retval_document_id = retval[str(diction['document_type'])]
|
||||
|
||||
|
||||
return True, retval_document_id
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de récupérer la liste des documents par défaut"
|
||||
|
|
|
|||
12972
Log/log_file.log
12972
Log/log_file.log
File diff suppressed because one or more lines are too long
|
|
@ -19,6 +19,7 @@ from xhtml2pdf import pisa
|
|||
|
||||
import Contact
|
||||
import E_Sign_Document
|
||||
import Job_Cron_Common
|
||||
import Session_Formation_Sequence
|
||||
import attached_file_mgt
|
||||
import email_mgt
|
||||
|
|
@ -6522,8 +6523,6 @@ def Prepare_and_Send_Default_Convention_From_Session_By_Email(tab_files, Folder,
|
|||
- type_doc = "email"
|
||||
"""
|
||||
|
||||
|
||||
|
||||
default_courrier_template_individuel_count = MYSY_GV.dbname['courrier_template'].count_documents(
|
||||
{"$or": [{'valide': '1',
|
||||
'locked': '0',
|
||||
|
|
@ -7102,6 +7101,18 @@ def Prepare_and_Send_Default_Convention_From_Session_By_PDF(diction):
|
|||
'valide': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (is_session_valide != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " L'identifiant de La promotion est invalide ")
|
||||
return False, " L'identifiant de La promotion est invalide "
|
||||
|
||||
is_session_data = MYSY_GV.dbname['session_formation'].find_one(
|
||||
{'_id': ObjectId(str(diction['session_id'])),
|
||||
'valide': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
|
||||
if (is_session_valide != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
|
|
@ -7126,15 +7137,15 @@ def Prepare_and_Send_Default_Convention_From_Session_By_PDF(diction):
|
|||
On verifie s'il y a des convention d'entreprise à faire, si oui on verifie si il y a un document
|
||||
qui a été configuré
|
||||
"""
|
||||
|
||||
"""
|
||||
if (len(liste_client_rattachement_id) > 0):
|
||||
"""
|
||||
"" "
|
||||
# Recupération de la convention d'entreprise par defaut de à envoyer par email :
|
||||
- ref_interne = "CONVENTION_STAGIAIRE"
|
||||
- default_version = "1"
|
||||
- edit_by_client = "1"
|
||||
- type_doc = "pdf"
|
||||
"""
|
||||
"" "
|
||||
|
||||
default_courrier_template_client_count = MYSY_GV.dbname['courrier_template'].count_documents(
|
||||
{'valide': '1',
|
||||
|
|
@ -7159,7 +7170,7 @@ def Prepare_and_Send_Default_Convention_From_Session_By_PDF(diction):
|
|||
default_courrier_template_client_count) + " conventions d'entreprise par défaut configurées. Il ne doit y avoir qu'une seule ")
|
||||
return False, " Il y a " + str(
|
||||
default_courrier_template_client_count) + " conventions d'entreprise par défaut configurées. Il ne doit y avoir qu'une seule "
|
||||
|
||||
"""
|
||||
nb_liste_inscription_no_client = MYSY_GV.dbname['inscription'].count_documents(
|
||||
{"$or": [{'session_id': str(diction['session_id']),
|
||||
'status': '1',
|
||||
|
|
@ -7178,34 +7189,16 @@ def Prepare_and_Send_Default_Convention_From_Session_By_PDF(diction):
|
|||
On verifie s'il y a des conventions individuelles à faire, si oui on verifie si il y a un document
|
||||
qui a été configuré
|
||||
"""
|
||||
|
||||
"""
|
||||
if (nb_liste_inscription_no_client > 0):
|
||||
"""
|
||||
"" "
|
||||
# Recupération de la convention individuelle par defaut de à envoyer par email :
|
||||
- ref_interne = "CONVENTION_STAGIAIRE"
|
||||
- default_version = "1"
|
||||
- edit_by_client = "0"
|
||||
- type_doc = "pdf"
|
||||
"""
|
||||
qry_indi = {"$or": [{'valide': '1',
|
||||
'locked': '0',
|
||||
'ref_interne': 'CONVENTION_STAGIAIRE',
|
||||
'default_version': '1',
|
||||
'edit_by_client': '0',
|
||||
'type_doc': 'pdf',
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
,
|
||||
{'valide': '1',
|
||||
'locked': '0',
|
||||
'ref_interne': 'CONVENTION_STAGIAIRE',
|
||||
'default_version': '1',
|
||||
'edit_by_client': {'$exists': False},
|
||||
'type_doc': 'pdf',
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
"" "
|
||||
|
||||
|
||||
|
||||
default_courrier_template_individuel_count = MYSY_GV.dbname['courrier_template'].count_documents(
|
||||
|
|
@ -7242,7 +7235,7 @@ def Prepare_and_Send_Default_Convention_From_Session_By_PDF(diction):
|
|||
default_courrier_template_individuel_count) + " conventions individuelles configurées. Il ne doit y avoir qu'une seule ")
|
||||
return False, " Il y a " + str(
|
||||
default_courrier_template_individuel_count) + " conventions individuelles configurées. Il ne doit y avoir qu'une seule "
|
||||
|
||||
"""
|
||||
# -------------
|
||||
|
||||
# Stokage des nom de fichier à zipper
|
||||
|
|
@ -7267,16 +7260,40 @@ def Prepare_and_Send_Default_Convention_From_Session_By_PDF(diction):
|
|||
# Envoi des conventions d'entreprise par default
|
||||
if (len(liste_client_rattachement_id) > 0):
|
||||
|
||||
# Recuperer les datas de la convention par defautl
|
||||
default_courrier_template_client_data = MYSY_GV.dbname['courrier_template'].find_one(
|
||||
{'valide': '1',
|
||||
'locked': '0',
|
||||
'ref_interne': 'CONVENTION_STAGIAIRE',
|
||||
'default_version': '1',
|
||||
'edit_by_client': '1',
|
||||
'type_doc': 'pdf',
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
)
|
||||
"""
|
||||
Si il ya une convent "mail" par defait sur la formation, alors aller la chercher
|
||||
"""
|
||||
document_convocation_entreprise_pdf = ""
|
||||
local_diction_doc = {}
|
||||
local_diction_doc['document_type'] = "CONVENTION_STAGIAIRE_ENTREPRISE_PDF"
|
||||
local_diction_doc['class_id'] = is_session_data['class_id']
|
||||
local_diction_doc['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
local_convention_entreprise_pdf_doc_status, local_convention_entreprise_pdf_doc_retval = Job_Cron_Common.Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(
|
||||
local_diction_doc)
|
||||
if (local_convention_entreprise_pdf_doc_status):
|
||||
document_convocation_entreprise_pdf = local_convention_entreprise_pdf_doc_retval
|
||||
|
||||
if( document_convocation_entreprise_pdf == ""):
|
||||
# Recuperer les datas de la convention par defautl
|
||||
default_courrier_template_client_data = MYSY_GV.dbname['courrier_template'].find_one(
|
||||
{'valide': '1',
|
||||
'locked': '0',
|
||||
'ref_interne': 'CONVENTION_STAGIAIRE',
|
||||
'default_version': '1',
|
||||
'edit_by_client': '1',
|
||||
'type_doc': 'pdf',
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
)
|
||||
|
||||
if( default_courrier_template_client_data ):
|
||||
document_convocation_entreprise_pdf = str(default_courrier_template_client_data['_id'])
|
||||
|
||||
if( default_courrier_template_client_data == ""):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Aucune convention d'entreprise (PDF) n'est configurée ")
|
||||
return False, " Aucune convention d'entreprise (PDF) n'est configurée "
|
||||
|
||||
|
||||
for val in liste_client_rattachement_id:
|
||||
|
|
@ -7284,7 +7301,7 @@ def Prepare_and_Send_Default_Convention_From_Session_By_PDF(diction):
|
|||
# field_list_obligatoire = ['token', 'session_id', 'courrier_template_id', 'client_id']
|
||||
local_diction['token'] = diction['token']
|
||||
local_diction['session_id'] = diction['session_id']
|
||||
local_diction['courrier_template_id'] = default_courrier_template_client_data['_id']
|
||||
local_diction['courrier_template_id'] = document_convocation_entreprise_pdf
|
||||
local_diction['client_id'] = str(val)
|
||||
|
||||
#print(" #### Traitemnt de local_diction aaa = ", local_diction)
|
||||
|
|
@ -7312,34 +7329,58 @@ def Prepare_and_Send_Default_Convention_From_Session_By_PDF(diction):
|
|||
}]
|
||||
}
|
||||
)
|
||||
# Recuperer les datas de la convention par defautl
|
||||
default_courrier_template_individuel_data = MYSY_GV.dbname['courrier_template'].find_one(
|
||||
{"$or": [{'valide': '1',
|
||||
'locked': '0',
|
||||
'ref_interne': 'CONVENTION_STAGIAIRE',
|
||||
'default_version': '1',
|
||||
'edit_by_client': '0',
|
||||
'type_doc': 'pdf',
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
,
|
||||
{'valide': '1',
|
||||
'locked': '0',
|
||||
'ref_interne': 'CONVENTION_STAGIAIRE',
|
||||
'default_version': '1',
|
||||
'edit_by_client': {'$exists': False},
|
||||
'type_doc': 'pdf',
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
|
||||
]
|
||||
}
|
||||
)
|
||||
"""
|
||||
Si il ya une convent "mail" par defait sur la formation, alors aller la chercher
|
||||
"""
|
||||
document_convocation_individuelle_pdf = ""
|
||||
local_diction_doc = {}
|
||||
local_diction_doc['document_type'] = "CONVENTION_STAGIAIRE_INDIVIDUELLE_PDF"
|
||||
local_diction_doc['class_id'] = is_session_data['class_id']
|
||||
local_diction_doc['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
local_convention_individuelle_pdf_doc_status, local_convention_individuelle_pdf_doc_retval = Job_Cron_Common.Cron_Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(
|
||||
local_diction_doc)
|
||||
if (local_convention_individuelle_pdf_doc_status):
|
||||
document_convocation_individuelle_pdf = local_convention_individuelle_pdf_doc_retval
|
||||
|
||||
if (document_convocation_individuelle_pdf == ""):
|
||||
# Recuperer les datas de la convention par defautl
|
||||
default_courrier_template_individuel_data = MYSY_GV.dbname['courrier_template'].find_one(
|
||||
{"$or": [{'valide': '1',
|
||||
'locked': '0',
|
||||
'ref_interne': 'CONVENTION_STAGIAIRE',
|
||||
'default_version': '1',
|
||||
'edit_by_client': '0',
|
||||
'type_doc': 'pdf',
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
,
|
||||
{'valide': '1',
|
||||
'locked': '0',
|
||||
'ref_interne': 'CONVENTION_STAGIAIRE',
|
||||
'default_version': '1',
|
||||
'edit_by_client': {'$exists': False},
|
||||
'type_doc': 'pdf',
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
|
||||
]
|
||||
}
|
||||
)
|
||||
if (default_courrier_template_individuel_data):
|
||||
document_convocation_individuelle_pdf = str(default_courrier_template_individuel_data['_id'])
|
||||
|
||||
if (default_courrier_template_individuel_data == ""):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Aucune convention Individuelle (PDF) n'est configurée ")
|
||||
return False, " Aucune convention Individuelle (PDF) n'est configurée "
|
||||
|
||||
for val in liste_inscription_no_client:
|
||||
local_diction = {}
|
||||
# field_list_obligatoire = ['token', 'session_id', 'courrier_template_id', 'client_id']
|
||||
local_diction['token'] = diction['token']
|
||||
local_diction['session_id'] = diction['session_id']
|
||||
local_diction['courrier_template_id'] = default_courrier_template_individuel_data['_id']
|
||||
local_diction['courrier_template_id'] = default_courrier_template_individuel_data
|
||||
local_diction['inscription_id'] = str(val['_id'])
|
||||
|
||||
#print(" #### Traitemnt de local_diction bb = ", local_diction)
|
||||
|
|
|
|||
|
|
@ -489,14 +489,6 @@ def Get_List_Modele_Attestion_Formation_With_Filter(diction):
|
|||
Important : : On ne melange pas les 2. c'est l'un ou l'autre
|
||||
"""
|
||||
|
||||
qry = {'$and': [{'ref_interne': 'ATTESTATION_FORMATION',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, filt_courrier_template_type_document_ref_interne,
|
||||
filt_type_doc, filt_nom, filt_ref_interne ]}
|
||||
|
||||
|
||||
|
||||
for retval in MYSY_GV.dbname['courrier_template'].find({'$and': [{'ref_interne': 'ATTESTATION_FORMATION',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
|
|
@ -508,10 +500,13 @@ def Get_List_Modele_Attestion_Formation_With_Filter(diction):
|
|||
|
||||
# Si aucune convention personnalisée, on va chercher les conventions mysy
|
||||
if (val_tmp == 0):
|
||||
|
||||
for retval in MYSY_GV.dbname['courrier_template'].find({'$and': [{'ref_interne': 'ATTESTATION_FORMATION',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': 'default'}, filt_courrier_template_type_document_ref_interne, filt_type_doc, filt_nom, filt_ref_interne ]}):
|
||||
'partner_owner_recid': 'default'},
|
||||
filt_courrier_template_type_document_ref_interne,
|
||||
filt_type_doc, filt_nom, filt_ref_interne ]}):
|
||||
user = retval
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
|
|
|||
|
|
@ -2927,7 +2927,6 @@ def Prepare_and_Send_Inscrit_Bulletin_Note_By_PDF(diction):
|
|||
"""
|
||||
Cette fonction créer le PDF bulletin pour chaque inscrit et retourne l'url complet du fichier pdf
|
||||
"""
|
||||
from spire.pdf.common import *
|
||||
from spire.pdf import *
|
||||
|
||||
from reportlab.pdfgen.canvas import Canvas
|
||||
|
|
|
|||
50
class_mgt.py
50
class_mgt.py
|
|
@ -2421,6 +2421,9 @@ def get_class(diction):
|
|||
connection_type = diction['connection_type']
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'''
|
||||
Gestion des filters.
|
||||
'''
|
||||
|
|
@ -2580,6 +2583,8 @@ def get_class(diction):
|
|||
).limit(1):
|
||||
"""
|
||||
|
||||
|
||||
|
||||
#print('#### ICI retVal = '+str(retVal))
|
||||
tab_selected_business_prices = []
|
||||
|
||||
|
|
@ -2709,6 +2714,18 @@ def get_class(diction):
|
|||
if (len(no_html) > MYSY_GV.MAX_CARACT_DETAIL):
|
||||
retVal['methode_pedagogique'] = no_html[:MYSY_GV.MAX_CARACT_DETAIL] + " ..."
|
||||
|
||||
"""
|
||||
24/10/2025 - Pour verifie si le prix est HT ou TTC du PRORITAIRE DE LA FORMATION
|
||||
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
|
||||
"""
|
||||
partnaire_tva = ""
|
||||
partner_tva_retval = mycommon.Get_Class_Owner_class(str(retVal['partner_owner_recid']))
|
||||
if (partner_tva_retval is False):
|
||||
partnaire_tva = ""
|
||||
else:
|
||||
partnaire_tva = partner_tva_retval
|
||||
retVal['partnaire_tva'] = str(partnaire_tva)
|
||||
|
||||
|
||||
if ("condition_handicape" in retVal.keys()):
|
||||
tmp_str = retVal['condition_handicape']
|
||||
|
|
@ -3572,7 +3589,18 @@ def get_class_for_partner_catalog(diction):
|
|||
if ("website" in tmp_partenaire_data.keys() and tmp_partenaire_data['website']):
|
||||
retVal['website_partenaire'] = tmp_partenaire_data['website']
|
||||
|
||||
"""
|
||||
24/10/2025 - Pour verifie si le prix est HT ou TTC
|
||||
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
|
||||
"""
|
||||
partnaire_tva = ""
|
||||
partner_tva_retval = mycommon.Get_Class_Owner_class(str(retVal['partner_owner_recid']))
|
||||
if (partner_tva_retval is False):
|
||||
partnaire_tva = ""
|
||||
else:
|
||||
partnaire_tva = partner_tva_retval
|
||||
|
||||
retVal['partnaire_tva'] = str(partnaire_tva)
|
||||
|
||||
|
||||
if ("description" in retVal.keys()):
|
||||
|
|
@ -6470,6 +6498,7 @@ def get_associated_class_of_partnair(diction):
|
|||
|
||||
|
||||
|
||||
|
||||
RetObject = []
|
||||
filt_external_code = {}
|
||||
internal_url = ""
|
||||
|
|
@ -6524,6 +6553,18 @@ def get_associated_class_of_partnair(diction):
|
|||
if (len(no_html) > MYSY_GV.MAX_CARACT_DETAIL):
|
||||
retVal['pedagogie'] = no_html[:MYSY_GV.MAX_CARACT_DETAIL] + " ..."
|
||||
|
||||
"""
|
||||
24/10/2025 - Pour verifie si le prix est HT ou TTC
|
||||
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
|
||||
"""
|
||||
partnaire_tva = ""
|
||||
partner_tva_retval = mycommon.Get_Class_Owner_class(str(partner_recid))
|
||||
if (partner_tva_retval is False):
|
||||
partnaire_tva = ""
|
||||
else:
|
||||
partnaire_tva = partner_tva_retval
|
||||
|
||||
retVal['partnaire_tva'] = str(partnaire_tva)
|
||||
|
||||
#mycommon.myprint(str(retVal))
|
||||
user = retVal
|
||||
|
|
@ -8198,7 +8239,7 @@ def Update_Class_Default_Document(diction):
|
|||
'CONVENTION_STAGIAIRE_INDIVIDUELLE_MAIL', 'CONVENTION_STAGIAIRE_INDIVIDUELLE_PDF',
|
||||
'ATTESTATION_FORMATION', 'CONVOCATION_STAGIAIRE_MAIL',
|
||||
'CONVOCATION_STAGIAIRE_PDF', 'QUESTION_POSITIONNEMENT',
|
||||
'EVAL_FORMATION_HOT', 'EVAL_FORMATION_COLD', 'EVAL_FORMATION_FORMATEUR']
|
||||
'EVAL_FORMATION_HOT', 'EVAL_FORMATION_COLD', 'EVAL_FORMATION_FORMATEUR', 'ATTESTATION_FORMATION_MAIL', 'ATTESTATION_FORMATION_PDF']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -8253,7 +8294,7 @@ def Update_Class_Default_Document(diction):
|
|||
local_keys = ['CONF_INSCRIPTION', 'EMARGEMENT_FORMATION','CONVENTION_STAGIAIRE_ENTREPRISE_MAIL', 'CONVENTION_STAGIAIRE_ENTREPRISE_PDF',
|
||||
'CONVENTION_STAGIAIRE_INDIVIDUELLE_MAIL', 'CONVENTION_STAGIAIRE_INDIVIDUELLE_PDF',
|
||||
'ATTESTATION_FORMATION', 'CONVOCATION_STAGIAIRE_MAIL',
|
||||
'CONVOCATION_STAGIAIRE_PDF']
|
||||
'CONVOCATION_STAGIAIRE_PDF', 'ATTESTATION_FORMATION_MAIL', 'ATTESTATION_FORMATION_PDF']
|
||||
|
||||
for tmp in local_keys:
|
||||
if( tmp in diction.keys() and diction[str(tmp)] ):
|
||||
|
|
@ -8291,9 +8332,10 @@ def Update_Class_Default_Document(diction):
|
|||
|
||||
local_keys = [ 'CONF_INSCRIPTION', 'EMARGEMENT_FORMATION', 'CONVENTION_STAGIAIRE_ENTREPRISE_MAIL', 'CONVENTION_STAGIAIRE_ENTREPRISE_PDF',
|
||||
'CONVENTION_STAGIAIRE_INDIVIDUELLE_MAIL', 'CONVENTION_STAGIAIRE_INDIVIDUELLE_PDF',
|
||||
'ATTESTATION_FORMATION', 'CONVOCATION_STAGIAIRE_MAIL',
|
||||
'CONVOCATION_STAGIAIRE_MAIL',
|
||||
'CONVOCATION_STAGIAIRE_PDF', 'QUESTION_POSITIONNEMENT',
|
||||
'EVAL_FORMATION_HOT', 'EVAL_FORMATION_COLD', 'EVAL_FORMATION_FORMATEUR']
|
||||
'EVAL_FORMATION_HOT', 'EVAL_FORMATION_COLD', 'EVAL_FORMATION_FORMATEUR',
|
||||
'ATTESTATION_FORMATION_MAIL', 'ATTESTATION_FORMATION_PDF']
|
||||
updated_type_doc = []
|
||||
|
||||
# Suppression de l'existant pour cette formation
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ from email import encoders
|
|||
import survey_mgt as survey_mgt
|
||||
import attached_file_mgt
|
||||
import Inscription_mgt as Inscription_mgt
|
||||
|
||||
from email_queu import email_queu_mgt
|
||||
|
||||
"""
|
||||
Cette fonction permet de créer un email à vide, jute pour recuperer un _id
|
||||
|
|
@ -326,7 +326,7 @@ def Update_Message_To_Internal_Mail(tab_files, Folder, diction):
|
|||
print(" ## WARINNGGG Impossible de stocker le fichier de Convocation ")
|
||||
|
||||
|
||||
tab_saved_file_full_path.append(saved_file_full_path)
|
||||
tab_saved_file_full_path.append(local_retval)
|
||||
|
||||
|
||||
|
||||
|
|
@ -341,6 +341,10 @@ def Update_Message_To_Internal_Mail(tab_files, Folder, diction):
|
|||
if( tmp ):
|
||||
tab_message_id.append(tmp)
|
||||
|
||||
# Recuperation des donnes smtp
|
||||
(local_stpm_status, local_SMTP_COUNT_smtpsrv, local_own_smtp_value, local_SMTP_COUNT_password,
|
||||
local_SMTP_COUNT_user, local_SMTP_COUNT_From_User,
|
||||
local_SMTP_COUNT_port) = mycommon.Get_Partner_SMTP_Param(str(my_partner['recid']))
|
||||
|
||||
for local_message_id in tab_message_id :
|
||||
|
||||
|
|
@ -359,6 +363,8 @@ def Update_Message_To_Internal_Mail(tab_files, Folder, diction):
|
|||
return False, " L'identifiant du message "+str(local_message_id)+" n'est pas valide "
|
||||
|
||||
|
||||
my_token = diction['token']
|
||||
|
||||
del diction['token']
|
||||
del diction['tab_message_id']
|
||||
|
||||
|
|
@ -384,6 +390,47 @@ def Update_Message_To_Internal_Mail(tab_files, Folder, diction):
|
|||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
|
||||
"""
|
||||
Une fois l'email mis dans la table interne, on va aller le mettre dans le queu d'envoie
|
||||
pour qu'un DOUBLE DU MAIL soit aussi envoyé directement
|
||||
Important : On le fait pour chaque mail destinataire
|
||||
"""
|
||||
if (local_stpm_status is True and local_SMTP_COUNT_smtpsrv and local_own_smtp_value):
|
||||
tmp_mail_to = str(diction['to']).replace(";", ",")
|
||||
tab_tmp_mail_to = tmp_mail_to.split(",")
|
||||
for mail_to in tab_tmp_mail_to:
|
||||
if( tmp ):
|
||||
queue_mail_diction = {}
|
||||
queue_mail_diction['token'] = str(my_token)
|
||||
queue_mail_diction['from'] = local_SMTP_COUNT_From_User
|
||||
queue_mail_diction['cc'] = []
|
||||
queue_mail_diction['bcc'] = []
|
||||
if( diction['subject']):
|
||||
queue_mail_diction['subject'] = diction['subject']
|
||||
else:
|
||||
queue_mail_diction['subject'] = "[MySy Training] Vous avez un nouveau message"
|
||||
|
||||
queue_mail_diction['to'] = str(mail_to)
|
||||
queue_mail_diction['message'] = diction['message']
|
||||
|
||||
queue_mail_diction['tab_saved_file_full_path'] = tab_saved_file_full_path
|
||||
|
||||
queue_mail_diction['smtp_account_password'] = local_SMTP_COUNT_password
|
||||
queue_mail_diction['smtp_account_smtpsrv'] = local_SMTP_COUNT_smtpsrv
|
||||
queue_mail_diction['smtp_account_user'] = local_SMTP_COUNT_user
|
||||
queue_mail_diction['smtp_account_From_User'] = local_SMTP_COUNT_From_User
|
||||
queue_mail_diction['smtp_account_port'] = local_SMTP_COUNT_port
|
||||
|
||||
internal_mail_diction = {}
|
||||
for tmp in queue_mail_diction.keys():
|
||||
internal_mail_diction[str(tmp)] = queue_mail_diction[str(tmp)]
|
||||
|
||||
tab_files = []
|
||||
queue_mail_status, queue_mail_retval = email_queu_mgt.Add_Message_To_Mail_Queue(tab_files,
|
||||
queue_mail_diction)
|
||||
if (queue_mail_status is False):
|
||||
print(" ## WARNING queue_mail_retval = ", queue_mail_retval)
|
||||
|
||||
|
||||
return True, "Le message a été mis à jour"
|
||||
|
||||
|
|
|
|||
|
|
@ -1176,7 +1176,7 @@ def Check_MySy_LMS_Account(diction):
|
|||
mycommon.myprint(str(inspect.stack()[0][3]) + " - impossible de récupérer les données du partenaire")
|
||||
return False, str(inspect.stack()[0][3]) +" - impossible de récupérer les données du partenaire"
|
||||
|
||||
#print(" ### my_partner = ", str(my_partner))
|
||||
print(" ### my_partner gggggg = ", str(my_partner))
|
||||
mysy_lms_user_id = ""
|
||||
if ("mysy_lms_user_id" in my_partner.keys()):
|
||||
if my_partner['mysy_lms_user_id']:
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ def Get_Given_Partner_Basic_Setup(diction):
|
|||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(retval_json))
|
||||
|
||||
#print(" ### retval_json =", retval_json)
|
||||
print(" ### retval_json =", retval_json)
|
||||
return True, RetObject
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -5380,6 +5380,65 @@ def Get_Partner_Currency(partner_owner_recid):
|
|||
return False
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperation de la valeur de TVA du partenaire
|
||||
"""
|
||||
def Get_Partner_TVA(partner_owner_recid):
|
||||
try:
|
||||
|
||||
partnair_tva_value = ""
|
||||
partnair_tva_setup = MYSY_GV.dbname['base_partner_setup'].find_one({'config_name':"tva",
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid':str(partner_owner_recid)},)
|
||||
|
||||
if( partnair_tva_setup and "config_value" in partnair_tva_setup.keys() ):
|
||||
local_isfloat_status, local_isfloat_retval = IsFloat(str(partnair_tva_setup['config_value']))
|
||||
partnair_tva_value = str(local_isfloat_retval)
|
||||
|
||||
|
||||
|
||||
return partnair_tva_value
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction va recuperer la TVA associée au proprietaire d'une formation
|
||||
"""
|
||||
def Get_Class_Owner_class(class_id_partner_owner_recid):
|
||||
try:
|
||||
|
||||
partnair_tva_value = ""
|
||||
partnair_tva_setup = MYSY_GV.dbname['base_partner_setup'].find_one({'config_name':"tva",
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid':str(class_id_partner_owner_recid)},)
|
||||
|
||||
if( partnair_tva_setup and "config_value" in partnair_tva_setup.keys() ):
|
||||
local_isfloat_status, local_isfloat_retval = IsFloat(str(partnair_tva_setup['config_value']))
|
||||
partnair_tva_value = str(local_isfloat_retval)
|
||||
|
||||
|
||||
# Si aucune valeur n'est saisi, comme '' par exemple, alors on met une TVA a 20
|
||||
if( partnair_tva_value == ""):
|
||||
partnair_tva_value = "20"
|
||||
|
||||
return partnair_tva_value
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return "20"
|
||||
|
||||
|
||||
|
||||
"""
|
||||
12/03/2024 :
|
||||
** initialiser / initialisation / **
|
||||
|
|
|
|||
|
|
@ -1110,6 +1110,9 @@ def Init_Survey_Tab_For_All_Session_Inscrit(diction):
|
|||
1 - suppression des data existate et
|
||||
2 - la creation de l'enquete
|
||||
"""
|
||||
print(" ## DEL QUERY = ", {"$and":[{'partner_owner_recid':str(my_partner['recid']),
|
||||
'session_id':str(diction['session_id']),
|
||||
'survey_type':str(diction['survey_type'])}, filt_inscrit_for_survey_collection]})
|
||||
|
||||
MYSY_GV.dbname['survey'].delete_many({"$and":[{'partner_owner_recid':str(my_partner['recid']),
|
||||
'session_id':str(diction['session_id']),
|
||||
|
|
@ -3291,7 +3294,7 @@ def Get_List_Survey_with_filter(diction):
|
|||
}
|
||||
])
|
||||
|
||||
#print(" ### pipe_qry = ", pipe_qry)
|
||||
print(" ### pipe_qry = ", pipe_qry)
|
||||
|
||||
for New_retVal in MYSY_GV.dbname['survey'].aggregate(pipe_qry):
|
||||
user = New_retVal
|
||||
|
|
|
|||
86
wrapper.py
86
wrapper.py
|
|
@ -119,6 +119,7 @@ def update_class_by_attribut(objId, attribut, value):
|
|||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False
|
||||
|
||||
|
||||
def get_all_class(diction):
|
||||
try:
|
||||
|
||||
|
|
@ -220,6 +221,8 @@ def get_all_class(diction):
|
|||
str(inspect.stack()[0][3]) + " - Impossible de récupérer le token de l'utilisateur")
|
||||
return False, " Impossible de récupérer le token de l'utilisateur"
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Travail à faire :
|
||||
le bug actuel vient du fait que la 2ieme requete ci-dessous qui complete la liste des formation
|
||||
|
|
@ -283,6 +286,19 @@ def get_all_class(diction):
|
|||
mytoday = datetime.today()
|
||||
for x in coll_name.aggregate(pipe):
|
||||
|
||||
"""
|
||||
24/10/2025 - Pour verifie si le prix est HT ou TTC du PRORITAIRE DE LA FORMATION
|
||||
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
|
||||
"""
|
||||
partnaire_tva = ""
|
||||
partner_tva_retval = mycommon.Get_Class_Owner_class(str(x['partner_owner_recid']))
|
||||
if (partner_tva_retval is False):
|
||||
partnaire_tva = ""
|
||||
else:
|
||||
partnaire_tva = partner_tva_retval
|
||||
|
||||
x['partnaire_tva'] = str(partnaire_tva)
|
||||
|
||||
#print("AVANT ==> "+str(x['description']))
|
||||
if ("description" in x.keys()):
|
||||
val = x['description']
|
||||
|
|
@ -536,7 +552,18 @@ def get_all_class_Given_partner_owner_recid_No_Login(diction):
|
|||
mytoday = datetime.today()
|
||||
#print(" ### get_all_class_Given_partner_owner_recid_No_Login pipe = ", pipe)
|
||||
for x in coll_name.aggregate(pipe):
|
||||
"""
|
||||
24/10/2025 - Pour verifie si le prix est HT ou TTC du PRORITAIRE DE LA FORMATION
|
||||
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
|
||||
"""
|
||||
partnaire_tva = ""
|
||||
partner_tva_retval = mycommon.Get_Class_Owner_class(str(x['partner_owner_recid']))
|
||||
if (partner_tva_retval is False):
|
||||
partnaire_tva = ""
|
||||
else:
|
||||
partnaire_tva = partner_tva_retval
|
||||
|
||||
x['partnaire_tva'] = str(partnaire_tva)
|
||||
|
||||
# print("AVANT ==> "+str(x['description']))
|
||||
if ("description" in x.keys()):
|
||||
|
|
@ -839,6 +866,8 @@ def recherche_text_simple(diction):
|
|||
|
||||
#mycommon.myprint(" On recehrche la phrase +'" + search_text + "' + user_recid = "+user_recid)
|
||||
|
||||
|
||||
|
||||
# Enregistrerment de la recherche
|
||||
retval, message, store_recherche_Id = store_recherche(diction, user_recid)
|
||||
if (retval is False):
|
||||
|
|
@ -957,6 +986,22 @@ def recherche_text_simple(diction):
|
|||
return False, "La recheche est impossible "
|
||||
|
||||
user = x
|
||||
|
||||
|
||||
"""
|
||||
24/10/2025 - Pour verifie si le prix est HT ou TTC du PRORITAIRE DE LA FORMATION
|
||||
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
|
||||
"""
|
||||
partnaire_tva = ""
|
||||
partner_tva_retval = mycommon.Get_Class_Owner_class(str(x['partner_owner_recid']))
|
||||
if (partner_tva_retval is False):
|
||||
partnaire_tva = ""
|
||||
else:
|
||||
partnaire_tva = partner_tva_retval
|
||||
|
||||
x['partnaire_tva'] = str(partnaire_tva)
|
||||
|
||||
|
||||
val = x['description']
|
||||
no_html = mycommon.cleanhtml(x['description'])
|
||||
if (len(no_html) > MYSY_GV.MAX_CARACT):
|
||||
|
|
@ -1100,6 +1145,21 @@ def recherche_text_simple(diction):
|
|||
return False, "La recheche est impossible "
|
||||
|
||||
user = x
|
||||
|
||||
"""
|
||||
24/10/2025 - Pour verifie si le prix est HT ou TTC du PRORITAIRE DE LA FORMATION
|
||||
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
|
||||
"""
|
||||
partnaire_tva = ""
|
||||
partner_tva_retval = mycommon.Get_Class_Owner_class(str(x['partner_owner_recid']))
|
||||
if (partner_tva_retval is False):
|
||||
partnaire_tva = ""
|
||||
else:
|
||||
partnaire_tva = partner_tva_retval
|
||||
|
||||
|
||||
x['partnaire_tva'] = str(partnaire_tva)
|
||||
|
||||
user['business_prices'] = tab_selected_business_prices
|
||||
|
||||
val = mycommon.clean_emoji(str(x['description']))
|
||||
|
|
@ -1387,6 +1447,19 @@ def recherche_text_simple_for_partner_catalog(diction):
|
|||
sort([("display_rank", pymongo.DESCENDING), ("price", pymongo.ASCENDING),
|
||||
("date_update", pymongo.DESCENDING), ]):
|
||||
|
||||
"""
|
||||
24/10/2025 - Pour verifie si le prix est HT ou TTC du PRORITAIRE DE LA FORMATION
|
||||
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
|
||||
"""
|
||||
partnaire_tva = ""
|
||||
partner_tva_retval = mycommon.Get_Class_Owner_class(str(x['partner_owner_recid']))
|
||||
if (partner_tva_retval is False):
|
||||
partnaire_tva = ""
|
||||
else:
|
||||
partnaire_tva = partner_tva_retval
|
||||
|
||||
x['partnaire_tva'] = str(partnaire_tva)
|
||||
|
||||
nb_result = nb_result + 1
|
||||
my_recid = {}
|
||||
my_recid['user_rec_id'] = str(user_recid)
|
||||
|
|
@ -1503,6 +1576,19 @@ def recherche_text_simple_for_partner_catalog(diction):
|
|||
print(" ### pipe recherche_text_simple = ", pipe)
|
||||
for x in coll_name.aggregate(pipe):
|
||||
|
||||
"""
|
||||
24/10/2025 - Pour verifie si le prix est HT ou TTC du PRORITAIRE DE LA FORMATION
|
||||
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
|
||||
"""
|
||||
partnaire_tva = ""
|
||||
partner_tva_retval = mycommon.Get_Class_Owner_class(str(x['partner_owner_recid']))
|
||||
if (partner_tva_retval is False):
|
||||
partnaire_tva = ""
|
||||
else:
|
||||
partnaire_tva = partner_tva_retval
|
||||
|
||||
x['partnaire_tva'] = str(partnaire_tva)
|
||||
|
||||
nb_result = nb_result + 1
|
||||
|
||||
tab_selected_business_prices = []
|
||||
|
|
|
|||
Loading…
Reference in New Issue