24/03/2024 - 13h
parent
c9e4a6e1a8
commit
a0a955ed0e
|
@ -4,7 +4,16 @@
|
||||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="20/03/2024 - 22h30dss">
|
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="20/03/2024 - 22h30dss">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/E_Sign_Document.py" beforeDir="false" afterPath="$PROJECT_DIR$/E_Sign_Document.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/E_Sign_Document.py" beforeDir="false" afterPath="$PROJECT_DIR$/E_Sign_Document.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/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$/Session_Formation_Sequence.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation_Sequence.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/crm_opportunite.py" beforeDir="false" afterPath="$PROJECT_DIR$/crm_opportunite.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -74,13 +83,6 @@
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1680804787304</updated>
|
<updated>1680804787304</updated>
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00199" summary="21/01/2024 -18h30">
|
|
||||||
<created>1705859319077</created>
|
|
||||||
<option name="number" value="00199" />
|
|
||||||
<option name="presentableId" value="LOCAL-00199" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1705859319077</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00200" summary="22/01/2024 -22h00">
|
<task id="LOCAL-00200" summary="22/01/2024 -22h00">
|
||||||
<created>1705957023841</created>
|
<created>1705957023841</created>
|
||||||
<option name="number" value="00200" />
|
<option name="number" value="00200" />
|
||||||
|
@ -417,7 +419,14 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1711148467160</updated>
|
<updated>1711148467160</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="248" />
|
<task id="LOCAL-00248" summary="20/03/2024 - 22h30dss">
|
||||||
|
<created>1711149396482</created>
|
||||||
|
<option name="number" value="00248" />
|
||||||
|
<option name="presentableId" value="LOCAL-00248" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1711149396483</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="249" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
<component name="Vcs.Log.Tabs.Properties">
|
||||||
|
|
|
@ -176,6 +176,8 @@ def Create_E_Document(diction):
|
||||||
new_diction['source_document'] = str(diction['source_document'])
|
new_diction['source_document'] = str(diction['source_document'])
|
||||||
new_diction['date_update'] = str(datetime.now())
|
new_diction['date_update'] = str(datetime.now())
|
||||||
new_diction['update_by'] = str(my_partner['_id'])
|
new_diction['update_by'] = str(my_partner['_id'])
|
||||||
|
new_diction['created_by'] = str(my_partner['_id'])
|
||||||
|
|
||||||
|
|
||||||
val = MYSY_GV.dbname['e_document_signe'].insert_one(new_diction)
|
val = MYSY_GV.dbname['e_document_signe'].insert_one(new_diction)
|
||||||
|
|
||||||
|
@ -509,7 +511,7 @@ def checkIntegrity(calculated_hash, decrypted_hash):
|
||||||
"""
|
"""
|
||||||
Signature du document
|
Signature du document
|
||||||
"""
|
"""
|
||||||
def Create_E_Signature_For_E_Document(diction):
|
def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
|
||||||
try:
|
try:
|
||||||
diction = mycommon.strip_dictionary(diction)
|
diction = mycommon.strip_dictionary(diction)
|
||||||
|
|
||||||
|
@ -545,6 +547,18 @@ def Create_E_Signature_For_E_Document(diction):
|
||||||
if diction['token']:
|
if diction['token']:
|
||||||
token = diction['token']
|
token = diction['token']
|
||||||
|
|
||||||
|
saved_file = ""
|
||||||
|
image_signature_manuelle_string = ""
|
||||||
|
if( file_img ):
|
||||||
|
status, saved_file = mycommon.Upload_Save_IMG_File(file_img, Folder)
|
||||||
|
if (status is False):
|
||||||
|
mycommon.myprint(str(saved_file))
|
||||||
|
return False, str(saved_file)
|
||||||
|
|
||||||
|
print(" signature manuelle = ", saved_file)
|
||||||
|
with open(saved_file, "rb") as imageFile:
|
||||||
|
image_signature_manuelle_string = base64.b64encode(imageFile.read()).decode()
|
||||||
|
|
||||||
"""
|
"""
|
||||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||||
if (local_status is not True):
|
if (local_status is not True):
|
||||||
|
@ -626,6 +640,7 @@ def Create_E_Signature_For_E_Document(diction):
|
||||||
new_data['signed_email'] = str(diction['email_destinataire'])
|
new_data['signed_email'] = str(diction['email_destinataire'])
|
||||||
new_data['signed_ip_adress'] = str(diction['user_ip'])
|
new_data['signed_ip_adress'] = str(diction['user_ip'])
|
||||||
new_data['statut'] = "1"
|
new_data['statut'] = "1"
|
||||||
|
new_data['signature_nanuelle_img'] = image_signature_manuelle_string
|
||||||
|
|
||||||
|
|
||||||
qry_key = {'valide': '1', 'locked': '0',
|
qry_key = {'valide': '1', 'locked': '0',
|
||||||
|
@ -665,6 +680,22 @@ def Create_E_Signature_For_E_Document(diction):
|
||||||
|
|
||||||
e_document_date_2 = MYSY_GV.dbname['e_document_signe'].find_one(qry_key)
|
e_document_date_2 = MYSY_GV.dbname['e_document_signe'].find_one(qry_key)
|
||||||
|
|
||||||
|
user_created_e_document = MYSY_GV.dbname['partnair_account'].find_one({'_id':ObjectId(e_document_date_2['created_by']),
|
||||||
|
'active':'1',
|
||||||
|
'locked':'0',
|
||||||
|
})
|
||||||
|
if( user_created_e_document is None or "email" not in user_created_e_document.keys() ):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " L'initiateur du document est invalide ")
|
||||||
|
return False, " L'initiateur du document est invalide "
|
||||||
|
|
||||||
|
if( mycommon.isEmailValide(user_created_e_document['email']) is False ):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " L'adresse email de initiateur du document est invalide ")
|
||||||
|
return False, " L'adresse email de initiateur du document est invalide "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local_partner_owner_recid = e_document_date_2['partner_owner_recid']
|
local_partner_owner_recid = e_document_date_2['partner_owner_recid']
|
||||||
|
|
||||||
local_signature_digitale = decrypt.decrypt(e_document_date_2['signature_digitale'])
|
local_signature_digitale = decrypt.decrypt(e_document_date_2['signature_digitale'])
|
||||||
|
@ -703,7 +734,7 @@ def Create_E_Signature_For_E_Document(diction):
|
||||||
str(inspect.stack()[0][3]) + " Impossible de recupérer les données du partenaire ")
|
str(inspect.stack()[0][3]) + " Impossible de recupérer les données du partenaire ")
|
||||||
return False, " Impossible de recupérer les données du partenaire "
|
return False, " Impossible de recupérer les données du partenaire "
|
||||||
|
|
||||||
Create_E_Signature_For_E_Document
|
|
||||||
# Creation du dictionnaire d'information à utiliser pour la creation du doc
|
# Creation du dictionnaire d'information à utiliser pour la creation du doc
|
||||||
convention_dictionnary_data = {}
|
convention_dictionnary_data = {}
|
||||||
new_diction = {}
|
new_diction = {}
|
||||||
|
@ -724,6 +755,7 @@ def Create_E_Signature_For_E_Document(diction):
|
||||||
convention_dictionnary_data["mysy_signature_digitale"] = str(local_signature_digitale)
|
convention_dictionnary_data["mysy_signature_digitale"] = str(local_signature_digitale)
|
||||||
convention_dictionnary_data["mysy_url_securite"] = local_url_securite
|
convention_dictionnary_data["mysy_url_securite"] = local_url_securite
|
||||||
convention_dictionnary_data["mysy_qrcode_securite"] = "data:image/png;base64," + qr_code_converted_string
|
convention_dictionnary_data["mysy_qrcode_securite"] = "data:image/png;base64," + qr_code_converted_string
|
||||||
|
convention_dictionnary_data["mysy_manual_signature_img"] = "data:image/png;base64," + image_signature_manuelle_string
|
||||||
|
|
||||||
body = {
|
body = {
|
||||||
"params": convention_dictionnary_data
|
"params": convention_dictionnary_data
|
||||||
|
@ -940,8 +972,8 @@ def Create_E_Signature_For_E_Document(diction):
|
||||||
msg.attach(html_mime)
|
msg.attach(html_mime)
|
||||||
msg['From'] = partner_SMTP_COUNT_From_User
|
msg['From'] = partner_SMTP_COUNT_From_User
|
||||||
msg['Bcc'] = 'contact@mysy-training.com'
|
msg['Bcc'] = 'contact@mysy-training.com'
|
||||||
msg['Subject'] = " Votre Document Signé "
|
msg['Subject'] = " Votre Convention Signée "
|
||||||
# msg['to'] = "billardman01@hotmail.com"
|
msg['cc'] = user_created_e_document['email']
|
||||||
msg['to'] = str(diction['email_destinataire'])
|
msg['to'] = str(diction['email_destinataire'])
|
||||||
|
|
||||||
# Attacher l'eventuelle pièces jointes
|
# Attacher l'eventuelle pièces jointes
|
||||||
|
@ -956,8 +988,8 @@ def Create_E_Signature_For_E_Document(diction):
|
||||||
msg.attach(html_mime)
|
msg.attach(html_mime)
|
||||||
msg['From'] = MYSY_GV.O365_SMTP_COUNT_From_User
|
msg['From'] = MYSY_GV.O365_SMTP_COUNT_From_User
|
||||||
msg['Bcc'] = 'contact@mysy-training.com'
|
msg['Bcc'] = 'contact@mysy-training.com'
|
||||||
msg['Subject'] = " Votre Document Signé "
|
msg['Subject'] = " Votre Convention Signée"
|
||||||
# msg['to'] = "billardman01@hotmail.com"
|
msg['cc'] = user_created_e_document['email']
|
||||||
|
|
||||||
msg['to'] = msg['to'] = str(diction['email_destinataire'])
|
msg['to'] = msg['to'] = str(diction['email_destinataire'])
|
||||||
|
|
||||||
|
|
|
@ -659,4 +659,12 @@ Statut de facturation d'un session de formation : invoiced_statut
|
||||||
- Si au moins une inscription associée à une session est facturé ==> invoiced_statut de la session = 1
|
- Si au moins une inscription associée à une session est facturé ==> invoiced_statut de la session = 1
|
||||||
- Si non invoiced_statut de la session =0
|
- Si non invoiced_statut de la session =0
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Gestion des sequences de formation ( en rapport avec les emargements) :
|
||||||
|
- option = 0 ==> on prend le calendrier
|
||||||
|
- option = 1 ==> on prend la demi-journée
|
||||||
|
- option = 2 ==> on prend la journée
|
||||||
|
"""
|
||||||
|
EMARGEMENT_OPTION = ["0", "1", "2"]
|
|
@ -7683,6 +7683,23 @@ def Sent_Convention_Stagiaire_By_Email(tab_files, Folder, diction):
|
||||||
if (local_status is not True):
|
if (local_status is not True):
|
||||||
return local_status, my_partner
|
return local_status, my_partner
|
||||||
|
|
||||||
|
"""
|
||||||
|
20/03/2024 : Creation du E-Document à signer
|
||||||
|
On verifier si le partenaire dispose de l'option "signature_digital" dans la collection base_partner_setup
|
||||||
|
|
||||||
|
ET SI DEPUIS LE FRONT, L'UTILISATEUR DECIDE DE L'UTILISER
|
||||||
|
"""
|
||||||
|
is_partner_digital_signature = ""
|
||||||
|
if ("request_digital_signature" in diction.keys() and diction['request_digital_signature'] == "1"):
|
||||||
|
|
||||||
|
is_signature_digital_count = MYSY_GV.dbname['base_partner_setup'].count_documents(
|
||||||
|
{'partner_owner_recid': str(my_partner['recid']),
|
||||||
|
'config_name': 'signature_digital',
|
||||||
|
'valide': '1',
|
||||||
|
'locked': '0',
|
||||||
|
'config_value': '1'})
|
||||||
|
if (is_signature_digital_count == 1):
|
||||||
|
is_partner_digital_signature = "1"
|
||||||
|
|
||||||
# Verifier que le stagiaire est bien inscrit. Le statut de l'inscription doit etre "1"
|
# Verifier que le stagiaire est bien inscrit. Le statut de l'inscription doit etre "1"
|
||||||
is_inscription_valide = MYSY_GV.dbname['inscription'].count_documents({'_id':ObjectId(str(diction['inscription_id'])),
|
is_inscription_valide = MYSY_GV.dbname['inscription'].count_documents({'_id':ObjectId(str(diction['inscription_id'])),
|
||||||
|
@ -7922,6 +7939,10 @@ def Sent_Convention_Stagiaire_By_Email(tab_files, Folder, diction):
|
||||||
|
|
||||||
sourceHtml = contenu_doc_Template.render(params=body["params"])
|
sourceHtml = contenu_doc_Template.render(params=body["params"])
|
||||||
|
|
||||||
|
new_model_courrier_with_code_tag = str(
|
||||||
|
sourceHtml) + " <p style='width: 300px; text-align: right;'> Signature Client <br/> <img style='height:250px; width:250px;' src='{{ params.mysy_manual_signature_img }}'> </p> <br/> " \
|
||||||
|
" <p style='width: 300px; text-align: center;'> <img style='height:150px; width:150px;' src='{{ params.mysy_qrcode_securite }}'> </p> "
|
||||||
|
|
||||||
todays_date = str(date.today().strftime("%d/%m/%Y"))
|
todays_date = str(date.today().strftime("%d/%m/%Y"))
|
||||||
ts = datetime.now().timestamp()
|
ts = datetime.now().timestamp()
|
||||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||||
|
@ -7963,6 +7984,42 @@ def Sent_Convention_Stagiaire_By_Email(tab_files, Folder, diction):
|
||||||
# Creation de l'email à enoyer
|
# Creation de l'email à enoyer
|
||||||
msg = MIMEMultipart("alternative")
|
msg = MIMEMultipart("alternative")
|
||||||
|
|
||||||
|
"""
|
||||||
|
20/03/2024 : la convention pdf a été créée.
|
||||||
|
Si le partenaire a l'option de signature digitale, alors on créé le e-document
|
||||||
|
"""
|
||||||
|
if (is_partner_digital_signature == "1"):
|
||||||
|
new_e_document_diction = {}
|
||||||
|
new_e_document_diction['token'] = diction['token']
|
||||||
|
new_e_document_diction['file_name'] = outputFilename
|
||||||
|
toaddrs = ", ".join(tab_emails_destinataire)
|
||||||
|
new_e_document_diction['email_destinataire'] = str(toaddrs)
|
||||||
|
new_e_document_diction['source_document'] = new_model_courrier_with_code_tag
|
||||||
|
|
||||||
|
new_e_document_diction['related_collection'] = ""
|
||||||
|
new_e_document_diction['related_collection_id'] = ""
|
||||||
|
local_status_e_doc, local_retval_e_doc = E_Sign_Document.Create_E_Document(new_e_document_diction)
|
||||||
|
|
||||||
|
if (local_status_e_doc is False):
|
||||||
|
return local_status_e_doc, local_retval_e_doc
|
||||||
|
|
||||||
|
"""
|
||||||
|
Apres la creation du document electronique, on envoie la demande de validation
|
||||||
|
/!\ on envoie le mail à chaque destinataire
|
||||||
|
"""
|
||||||
|
|
||||||
|
for email in tab_emails_destinataire:
|
||||||
|
print(" ### traitement du mail : ", email)
|
||||||
|
new_send_e_document_diction = {}
|
||||||
|
new_send_e_document_diction['token'] = diction['token']
|
||||||
|
new_send_e_document_diction['e_doc_id'] = str(local_retval_e_doc)
|
||||||
|
new_send_e_document_diction['user_email'] = str(email)
|
||||||
|
|
||||||
|
local_status_send_e_doc, local_send_retval_e_doc = E_Sign_Document.Sent_E_Document_Signature_Request(
|
||||||
|
new_send_e_document_diction)
|
||||||
|
if (local_status_send_e_doc is False):
|
||||||
|
return local_status_send_e_doc, local_send_retval_e_doc
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Il s'agit d'une simple email
|
# Il s'agit d'une simple email
|
||||||
|
|
||||||
|
@ -9447,7 +9504,8 @@ donc on n'envoie pas l'email à l'adresss de prod ou contact du client
|
||||||
def Sent_Convention_Stagiaire_By_Email_By_Partner_client(tab_files_name_full_path, Folder, diction):
|
def Sent_Convention_Stagiaire_By_Email_By_Partner_client(tab_files_name_full_path, Folder, diction):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
field_list_obligatoire = ['token', 'courrier_template_id', 'email_test', 'email_production', 'partner_client_id', 'session_id']
|
field_list_obligatoire = ['token', 'courrier_template_id', 'email_test', 'email_production', 'partner_client_id', 'session_id',
|
||||||
|
'request_digital_signature']
|
||||||
|
|
||||||
for val in field_list_obligatoire:
|
for val in field_list_obligatoire:
|
||||||
if val not in diction:
|
if val not in diction:
|
||||||
|
@ -9468,16 +9526,20 @@ def Sent_Convention_Stagiaire_By_Email_By_Partner_client(tab_files_name_full_pat
|
||||||
"""
|
"""
|
||||||
20/03/2024 : Creation du E-Document à signer
|
20/03/2024 : Creation du E-Document à signer
|
||||||
On verifier si le partenaire dispose de l'option "signature_digital" dans la collection base_partner_setup
|
On verifier si le partenaire dispose de l'option "signature_digital" dans la collection base_partner_setup
|
||||||
|
|
||||||
|
ET SI DEPUIS LE FRONT, L'UTILISATEUR DECIDE DE L'UTILISER
|
||||||
"""
|
"""
|
||||||
is_partner_digital_signature = ""
|
is_partner_digital_signature = ""
|
||||||
is_signature_digital_count = MYSY_GV.dbname['base_partner_setup'].count_documents(
|
if( "request_digital_signature" in diction.keys() and diction['request_digital_signature'] == "1"):
|
||||||
{'partner_owner_recid': str(my_partner['recid']),
|
|
||||||
'config_name': 'signature_digital',
|
is_signature_digital_count = MYSY_GV.dbname['base_partner_setup'].count_documents(
|
||||||
'valide': '1',
|
{'partner_owner_recid': str(my_partner['recid']),
|
||||||
'locked': '0',
|
'config_name': 'signature_digital',
|
||||||
'config_value': '1'})
|
'valide': '1',
|
||||||
if (is_signature_digital_count == 1):
|
'locked': '0',
|
||||||
is_partner_digital_signature = "1"
|
'config_value': '1'})
|
||||||
|
if (is_signature_digital_count == 1):
|
||||||
|
is_partner_digital_signature = "1"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -9719,8 +9781,8 @@ def Sent_Convention_Stagiaire_By_Email_By_Partner_client(tab_files_name_full_pat
|
||||||
|
|
||||||
sourceHtml = contenu_doc_Template.render(params=body["params"])
|
sourceHtml = contenu_doc_Template.render(params=body["params"])
|
||||||
|
|
||||||
new_model_courrier_with_code_tag = str(sourceHtml) + "<br/> <div> Lien sécurisé = {{ params.mysy_url_securite }} </div> <br/> " \
|
new_model_courrier_with_code_tag = str(sourceHtml) + " <p style='width: 300px; text-align: right;'> Signature Client <br/> <img style='height:250px; width:250px;' src='{{ params.mysy_manual_signature_img }}'> </p> <br/> " \
|
||||||
" <p style='width: 300px; text-align: center;'> <img style='height:200px; width:200px;' src='{{ params.mysy_qrcode_securite }}'> </p> "
|
" <p style='width: 300px; text-align: center;'> <img style='height:150px; width:150px;' src='{{ params.mysy_qrcode_securite }}'> </p> "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
6744
Log/log_file.log
6744
Log/log_file.log
File diff suppressed because one or more lines are too long
|
@ -4329,6 +4329,10 @@ def Prepare_and_Send_Convention_From_Session_By_Email(tab_files, Folder, diction
|
||||||
new_diction_client['email_test'] = diction['email_test']
|
new_diction_client['email_test'] = diction['email_test']
|
||||||
new_diction_client['email_production'] = str(list_local_email_production)
|
new_diction_client['email_production'] = str(list_local_email_production)
|
||||||
new_diction_client['session_id'] = diction['session_id']
|
new_diction_client['session_id'] = diction['session_id']
|
||||||
|
new_diction_client['request_digital_signature'] = ""
|
||||||
|
if( "request_digital_signature" in diction.keys() ):
|
||||||
|
new_diction_client['request_digital_signature'] = diction['request_digital_signature']
|
||||||
|
|
||||||
|
|
||||||
print(" ##### new_diction_client 0102 = ", new_diction_client)
|
print(" ##### new_diction_client 0102 = ", new_diction_client)
|
||||||
|
|
||||||
|
@ -4367,6 +4371,9 @@ def Prepare_and_Send_Convention_From_Session_By_Email(tab_files, Folder, diction
|
||||||
new_diction_no_client['session_id'] = diction['session_id']
|
new_diction_no_client['session_id'] = diction['session_id']
|
||||||
new_diction_no_client['email_test'] = diction['email_test']
|
new_diction_no_client['email_test'] = diction['email_test']
|
||||||
new_diction_no_client['email_production'] = diction['email_production']
|
new_diction_no_client['email_production'] = diction['email_production']
|
||||||
|
new_diction_no_client['request_digital_signature'] = ""
|
||||||
|
if ("request_digital_signature" in diction.keys()):
|
||||||
|
new_diction_no_client['request_digital_signature'] = diction['request_digital_signature']
|
||||||
|
|
||||||
print(" ##### new_diction_no_client = ", new_diction_no_client)
|
print(" ##### new_diction_no_client = ", new_diction_no_client)
|
||||||
local_status, local_retval = Inscription_mgt.Sent_Convention_Stagiaire_By_Email(tab_saved_file_full_path, Folder, new_diction_no_client)
|
local_status, local_retval = Inscription_mgt.Sent_Convention_Stagiaire_By_Email(tab_saved_file_full_path, Folder, new_diction_no_client)
|
||||||
|
@ -4626,6 +4633,9 @@ def Prepare_and_Send_Default_Convention_From_Session_By_Email(tab_files, Folder,
|
||||||
|
|
||||||
new_diction_client['session_id'] = diction['session_id']
|
new_diction_client['session_id'] = diction['session_id']
|
||||||
|
|
||||||
|
new_diction_client['request_digital_signature'] = ""
|
||||||
|
if ("request_digital_signature" in diction.keys()):
|
||||||
|
new_diction_client['request_digital_signature'] = diction['request_digital_signature']
|
||||||
|
|
||||||
local_status, local_retval = Inscription_mgt.Sent_Convention_Stagiaire_By_Email_By_Partner_client(tab_saved_file_full_path, Folder, new_diction_client)
|
local_status, local_retval = Inscription_mgt.Sent_Convention_Stagiaire_By_Email_By_Partner_client(tab_saved_file_full_path, Folder, new_diction_client)
|
||||||
|
|
||||||
|
|
|
@ -243,7 +243,7 @@ Alogo :
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def Create_Automatic_Sequence(diction):
|
def Create_Automatic_Sequence_ORIG(diction):
|
||||||
try:
|
try:
|
||||||
diction = mycommon.strip_dictionary(diction)
|
diction = mycommon.strip_dictionary(diction)
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ def Create_Automatic_Sequence(diction):
|
||||||
date_debut_session = datetime.strptime(str(date_debut_session), '%d/%m/%Y')
|
date_debut_session = datetime.strptime(str(date_debut_session), '%d/%m/%Y')
|
||||||
date_fin_session = datetime.strptime(str(date_fin_session), '%d/%m/%Y')
|
date_fin_session = datetime.strptime(str(date_fin_session), '%d/%m/%Y')
|
||||||
|
|
||||||
print(" les jours travaillé ")
|
|
||||||
liste_jours_travaille = []
|
liste_jours_travaille = []
|
||||||
liste_jours_travaille_code_day = []
|
liste_jours_travaille_code_day = []
|
||||||
if ("jours" in is_existe_valide_journee_model_data.keys()):
|
if ("jours" in is_existe_valide_journee_model_data.keys()):
|
||||||
|
@ -492,6 +492,379 @@ def Create_Automatic_Sequence(diction):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
Cette fonction des sequences automatiques en travaillant en fonction des options :
|
||||||
|
- option = 0 ==> on prend le calendrier
|
||||||
|
- option = 1 ==> on prend la demi-journée
|
||||||
|
- option = 2 ==> on prend la journée
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def Create_Automatic_Sequence(diction):
|
||||||
|
try:
|
||||||
|
diction = mycommon.strip_dictionary(diction)
|
||||||
|
|
||||||
|
"""
|
||||||
|
Verification des input acceptés
|
||||||
|
"""
|
||||||
|
field_list = ['token', 'session_id', 'jounree_modele_id', 'option' ]
|
||||||
|
|
||||||
|
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'est pas autorisé")
|
||||||
|
return False, " Les informations fournies sont incorrectes"
|
||||||
|
|
||||||
|
"""
|
||||||
|
Verification des champs obligatoires
|
||||||
|
"""
|
||||||
|
field_list_obligatoire = ['token', 'session_id', 'jounree_modele_id', 'option' ]
|
||||||
|
|
||||||
|
for val in field_list_obligatoire:
|
||||||
|
if val not in diction:
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
|
||||||
|
return False, " 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']
|
||||||
|
|
||||||
|
|
||||||
|
if( diction['option'] not in MYSY_GV.EMARGEMENT_OPTION ):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " La valeur '" + diction['option'] + "' n'est pas autorisé. Les valeurs autorisées sont : "+str(MYSY_GV.EMARGEMENT_OPTION))
|
||||||
|
return False, " La valeur '" + diction['option'] + "' n'est pas autorisé. Les valeurs autorisées sont : "+str(MYSY_GV.EMARGEMENT_OPTION)
|
||||||
|
|
||||||
|
|
||||||
|
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||||
|
if (local_status is not True):
|
||||||
|
return local_status, my_partner
|
||||||
|
|
||||||
|
# Verification de l'existence et de la session
|
||||||
|
is_existe_valide_session_id = MYSY_GV.dbname["session_formation"].count_documents(
|
||||||
|
{'_id': ObjectId(str(diction['session_id'])),
|
||||||
|
'partner_owner_recid': str(my_partner['recid']),
|
||||||
|
'valide': '1'})
|
||||||
|
|
||||||
|
if (is_existe_valide_session_id <= 0):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " - L'identifiant de la session n'est pas valide ")
|
||||||
|
return False, "L'identifiant de la session n'est pas valide "
|
||||||
|
|
||||||
|
"""
|
||||||
|
Si le "jounree_modele_id" est vide, cela veut dire qu'il faut aller chercher le modele par default
|
||||||
|
"""
|
||||||
|
jounree_modele_id = ""
|
||||||
|
if (str(diction['jounree_modele_id']) == ""):
|
||||||
|
jounree_modele_data = MYSY_GV.dbname['base_config_modele_journee'].find_one(
|
||||||
|
{'partner_owner_recid': str(my_partner['recid']),
|
||||||
|
'valide': '1', 'locked': '0'})
|
||||||
|
|
||||||
|
if (jounree_modele_data is None):
|
||||||
|
# On ne trouve pas de modele par defaut pour ce client. On va aller le chercher le modele par defaut de MySy
|
||||||
|
jounree_modele_data_mysy = MYSY_GV.dbname['base_config_modele_journee'].find_one(
|
||||||
|
{'partner_owner_recid': "default", 'valide': '1', 'locked': '0'})
|
||||||
|
|
||||||
|
if (jounree_modele_data_mysy is None):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " - Aucun modèle de journée n'est configuré dans le système ")
|
||||||
|
return False, " Aucun modèle de journée n'est configuré dans le système "
|
||||||
|
|
||||||
|
jounree_modele_id = str(jounree_modele_data_mysy['_id'])
|
||||||
|
|
||||||
|
|
||||||
|
else:
|
||||||
|
jounree_modele_id = str(jounree_modele_data['_id'])
|
||||||
|
|
||||||
|
|
||||||
|
else:
|
||||||
|
jounree_modele_id = str(diction['jounree_modele_id'])
|
||||||
|
|
||||||
|
if (str(jounree_modele_id).strip() == ""):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " - Aucun modèle de journée n'est configuré dans le système (2) ")
|
||||||
|
return False, " Aucun modèle de journée n'est configuré dans le système (2) "
|
||||||
|
|
||||||
|
# Verification de l'existence du modele de journée
|
||||||
|
is_existe_valide_journee_model_id = MYSY_GV.dbname["base_config_modele_journee"].count_documents(
|
||||||
|
{'_id': ObjectId(str(jounree_modele_id)),
|
||||||
|
'partner_owner_recid': str(my_partner['recid']),
|
||||||
|
'valide': '1', 'locked': '0'})
|
||||||
|
|
||||||
|
if (is_existe_valide_journee_model_id <= 0):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " - L'identifiant du modèle de journee n'est pas valide ")
|
||||||
|
return False, " L'identifiant du modèle de journee n'est pas valide "
|
||||||
|
|
||||||
|
# Recuperation des data de la journée modele
|
||||||
|
is_existe_valide_journee_model_data = MYSY_GV.dbname["base_config_modele_journee"].find_one(
|
||||||
|
{'_id': ObjectId(str(jounree_modele_id)),
|
||||||
|
'partner_owner_recid': str(my_partner['recid']),
|
||||||
|
'valide': '1', 'locked': '0'})
|
||||||
|
|
||||||
|
is_existe_valide_session_data = MYSY_GV.dbname["session_formation"].find_one(
|
||||||
|
{'_id': ObjectId(str(diction['session_id'])),
|
||||||
|
'partner_owner_recid': str(my_partner['recid']),
|
||||||
|
'valide': '1'})
|
||||||
|
|
||||||
|
date_debut_session = ""
|
||||||
|
if ("date_debut" in is_existe_valide_session_data.keys()):
|
||||||
|
if is_existe_valide_session_data['date_debut']:
|
||||||
|
date_debut_session = str(is_existe_valide_session_data['date_debut'])[0:10]
|
||||||
|
local_status = mycommon.CheckisDate(date_debut_session)
|
||||||
|
if (local_status is False):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][
|
||||||
|
3]) + " La date de debut de session " + str(
|
||||||
|
date_debut_session) + " n'est pas au format 'jj/mm/aaaa' ")
|
||||||
|
return False, " La date de debut de session " + str(
|
||||||
|
date_debut_session) + " n'est pas au format 'jj/mm/aaaa' "
|
||||||
|
|
||||||
|
date_fin_session = ""
|
||||||
|
if ("date_fin" in is_existe_valide_session_data.keys()):
|
||||||
|
if is_existe_valide_session_data['date_fin']:
|
||||||
|
date_fin_session = str(is_existe_valide_session_data['date_fin'])[0:10]
|
||||||
|
local_status = mycommon.CheckisDate(date_fin_session)
|
||||||
|
if (local_status is False):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][
|
||||||
|
3]) + " La date de fin de session " + str(
|
||||||
|
date_fin_session) + " n'est pas au format 'jj/mm/aaaa'")
|
||||||
|
return False, " La date de fin de session " + str(
|
||||||
|
date_fin_session) + " n'est pas au format 'jj/mm/aaaa'"
|
||||||
|
|
||||||
|
|
||||||
|
date_debut_session = datetime.strptime(str(date_debut_session), '%d/%m/%Y')
|
||||||
|
date_fin_session = datetime.strptime(str(date_fin_session), '%d/%m/%Y')
|
||||||
|
|
||||||
|
liste_jours_travaille = []
|
||||||
|
liste_jours_travaille_code_day = []
|
||||||
|
if ("jours" in is_existe_valide_journee_model_data.keys()):
|
||||||
|
for jour in is_existe_valide_journee_model_data['jours']:
|
||||||
|
if (str(jour['travail']) == "1"):
|
||||||
|
liste_jours_travaille.append(str(jour['jour']))
|
||||||
|
liste_jours_travaille_code_day.append(str(jour['day_name']))
|
||||||
|
|
||||||
|
"""
|
||||||
|
/!\ Suppression des sequences qui existe et reservation dans les agenda par rapport à cette session
|
||||||
|
"""
|
||||||
|
for local_retval in MYSY_GV.dbname['session_formation_sequence'].find({'session_id': str(diction['session_id']),
|
||||||
|
'partner_owner_recid': str(
|
||||||
|
my_partner['recid']), }):
|
||||||
|
deleted_data_agenda = MYSY_GV.dbname['agenda'].delete_many({'sequence_session_id': str(local_retval['_id']),
|
||||||
|
'partner_owner_recid': str(
|
||||||
|
my_partner['recid']), })
|
||||||
|
|
||||||
|
deleted_data_affectation = MYSY_GV.dbname['session_formation_sequence_affectation'].delete_many(
|
||||||
|
{'sequence_session_id': str(local_retval['_id']),
|
||||||
|
'partner_owner_recid': str(my_partner['recid']), })
|
||||||
|
|
||||||
|
deleted_data_sequence = MYSY_GV.dbname['session_formation_sequence'].delete_many(
|
||||||
|
{'session_id': str(diction['session_id']),
|
||||||
|
'partner_owner_recid': str(my_partner['recid']), })
|
||||||
|
|
||||||
|
cpt = 10
|
||||||
|
|
||||||
|
nb_sequence = 0
|
||||||
|
|
||||||
|
for single_date in mycommon.daterange(date_debut_session, date_fin_session):
|
||||||
|
# print(single_date.strftime("%Y-%m-%d"))
|
||||||
|
# print(single_date.strftime("%A"))
|
||||||
|
|
||||||
|
# print(" Les date off sont : ", is_existe_valide_journee_model_data['date_off'])
|
||||||
|
date_jour = str(single_date.strftime("%Y-%m-%d"))
|
||||||
|
jour_name = single_date.strftime("%A")
|
||||||
|
|
||||||
|
# Recuperation des sequences associées à jour_name
|
||||||
|
jours_name_list_sequence = is_existe_valide_journee_model_data[jour_name]["tab_sequence"]
|
||||||
|
|
||||||
|
# print(" ### les sequences du ", jour_name, " sont ", jours_name_list_sequence)
|
||||||
|
#
|
||||||
|
if( diction['option'] == "1"):
|
||||||
|
# Sequences / Emargement à la demi journée (matin & apres midi )
|
||||||
|
# Vu qu'on prend les journée
|
||||||
|
|
||||||
|
#Verifer que le jour n'est pas off. (ex : les dimanches sont paramettré comme off)
|
||||||
|
is_off_day_of_week = "0"
|
||||||
|
if (str(jour_name) in is_existe_valide_journee_model_data.keys()):
|
||||||
|
is_off_day_of_week = is_existe_valide_journee_model_data[str(jour_name)]['is_off_day']
|
||||||
|
|
||||||
|
|
||||||
|
# Verifier que ce n'est pas une date off (ex : 01/01/aaaa)
|
||||||
|
if (date_jour not in is_existe_valide_journee_model_data['date_off'] and is_off_day_of_week != "1"):
|
||||||
|
# La sequence de la matinée
|
||||||
|
|
||||||
|
# Recuperation des heures de debut et fin des matinée et appres midi
|
||||||
|
matine_heure_debut = ""
|
||||||
|
matine_heure_fin = ""
|
||||||
|
apres_midi_heure_debut = ""
|
||||||
|
apres_midi_heure_fin = ""
|
||||||
|
|
||||||
|
if( "decoupage_journee" in is_existe_valide_journee_model_data.keys()):
|
||||||
|
if( "matinee_debut" in is_existe_valide_journee_model_data['decoupage_journee'].keys() ):
|
||||||
|
matine_heure_debut = is_existe_valide_journee_model_data['decoupage_journee']['matinee_debut']
|
||||||
|
|
||||||
|
if ("matinee_fin" in is_existe_valide_journee_model_data['decoupage_journee'].keys()):
|
||||||
|
matine_heure_fin = is_existe_valide_journee_model_data['decoupage_journee'][
|
||||||
|
'matinee_fin']
|
||||||
|
|
||||||
|
if ("apres_midi_debut" in is_existe_valide_journee_model_data['decoupage_journee'].keys()):
|
||||||
|
apres_midi_heure_debut = is_existe_valide_journee_model_data['decoupage_journee'][
|
||||||
|
'apres_midi_debut']
|
||||||
|
|
||||||
|
if ("apres_midi_fin" in is_existe_valide_journee_model_data['decoupage_journee'].keys()):
|
||||||
|
apres_midi_heure_fin = is_existe_valide_journee_model_data['decoupage_journee'][
|
||||||
|
'apres_midi_fin']
|
||||||
|
|
||||||
|
if( matine_heure_debut == "" or matine_heure_fin == "" or apres_midi_heure_debut == "" or apres_midi_heure_fin == ""):
|
||||||
|
mycommon.myprint(str(
|
||||||
|
inspect.stack()[0][3]) + " La configuration de decoupage de la journée en matinée et apres midi est invalide ")
|
||||||
|
return False, " La configuration de decoupage de la journée en matinée et apres midi est invalide "
|
||||||
|
|
||||||
|
|
||||||
|
sequence_data = {}
|
||||||
|
sequence_data['token'] = diction['token']
|
||||||
|
sequence_data['session_id'] = diction['session_id']
|
||||||
|
sequence_data['sequence_title'] = "Seq_Auto_" + str(cpt)
|
||||||
|
sequence_data['sequence_start'] = str(single_date.strftime("%d/%m/%Y")) + " "+str(matine_heure_debut)
|
||||||
|
sequence_data['sequence_end'] = str(single_date.strftime("%d/%m/%Y")) + " "+str(matine_heure_fin)
|
||||||
|
|
||||||
|
# print(" ### sequence_data = ", sequence_data)
|
||||||
|
|
||||||
|
local_status, local_val = Add_Session_Sequence(sequence_data)
|
||||||
|
|
||||||
|
if (local_status is False):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " WARNING : " + str(local_val))
|
||||||
|
else:
|
||||||
|
nb_sequence = nb_sequence + 1
|
||||||
|
|
||||||
|
# La sequence de la l'apres midi
|
||||||
|
sequence_data = {}
|
||||||
|
sequence_data['token'] = diction['token']
|
||||||
|
sequence_data['session_id'] = diction['session_id']
|
||||||
|
sequence_data['sequence_title'] = "Seq_Auto_" + str(cpt)
|
||||||
|
sequence_data['sequence_start'] = str(single_date.strftime("%d/%m/%Y")) + " "+str(apres_midi_heure_debut)
|
||||||
|
sequence_data['sequence_end'] = str(single_date.strftime("%d/%m/%Y")) + " "+str(apres_midi_heure_fin)
|
||||||
|
|
||||||
|
# print(" ### sequence_data = ", sequence_data)
|
||||||
|
|
||||||
|
local_status, local_val = Add_Session_Sequence(sequence_data)
|
||||||
|
|
||||||
|
if (local_status is False):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " WARNING : " + str(local_val))
|
||||||
|
else:
|
||||||
|
nb_sequence = nb_sequence + 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cpt = cpt + 1
|
||||||
|
|
||||||
|
# Pour chaque sequence de la journée
|
||||||
|
if (diction['option'] == "2"):
|
||||||
|
# Sequences / Emargement à la journée
|
||||||
|
|
||||||
|
|
||||||
|
# Verifer que le jour n'est pas off. (ex : les dimanches sont paramettré comme off)
|
||||||
|
is_off_day_of_week = "0"
|
||||||
|
if (str(jour_name) in is_existe_valide_journee_model_data.keys()):
|
||||||
|
is_off_day_of_week = is_existe_valide_journee_model_data[str(jour_name)]['is_off_day']
|
||||||
|
|
||||||
|
|
||||||
|
if (date_jour not in is_existe_valide_journee_model_data['date_off'] and is_off_day_of_week != "1"):
|
||||||
|
|
||||||
|
# Recuperation des heures de debut et fin des matinée et appres midi
|
||||||
|
matine_heure_debut = ""
|
||||||
|
matine_heure_fin = ""
|
||||||
|
apres_midi_heure_debut = ""
|
||||||
|
apres_midi_heure_fin = ""
|
||||||
|
|
||||||
|
if ("decoupage_journee" in is_existe_valide_journee_model_data.keys()):
|
||||||
|
if ("matinee_debut" in is_existe_valide_journee_model_data['decoupage_journee'].keys()):
|
||||||
|
matine_heure_debut = is_existe_valide_journee_model_data['decoupage_journee'][
|
||||||
|
'matinee_debut']
|
||||||
|
|
||||||
|
if ("matinee_fin" in is_existe_valide_journee_model_data['decoupage_journee'].keys()):
|
||||||
|
matine_heure_fin = is_existe_valide_journee_model_data['decoupage_journee'][
|
||||||
|
'matinee_fin']
|
||||||
|
|
||||||
|
if ("apres_midi_debut" in is_existe_valide_journee_model_data['decoupage_journee'].keys()):
|
||||||
|
apres_midi_heure_debut = is_existe_valide_journee_model_data['decoupage_journee'][
|
||||||
|
'apres_midi_debut']
|
||||||
|
|
||||||
|
if ("apres_midi_fin" in is_existe_valide_journee_model_data['decoupage_journee'].keys()):
|
||||||
|
apres_midi_heure_fin = is_existe_valide_journee_model_data['decoupage_journee'][
|
||||||
|
'apres_midi_fin']
|
||||||
|
if (
|
||||||
|
matine_heure_debut == "" or matine_heure_fin == "" or apres_midi_heure_debut == "" or apres_midi_heure_fin == ""):
|
||||||
|
mycommon.myprint(str(
|
||||||
|
inspect.stack()[0][
|
||||||
|
3]) + " La configuration de decoupage de la journée en matinée et apres midi est invalide ")
|
||||||
|
return False, " La configuration de decoupage de la journée en matinée et apres midi est invalide "
|
||||||
|
|
||||||
|
|
||||||
|
sequence_data = {}
|
||||||
|
sequence_data['token'] = diction['token']
|
||||||
|
sequence_data['session_id'] = diction['session_id']
|
||||||
|
sequence_data['sequence_title'] = "Seq_Auto_" + str(cpt)
|
||||||
|
sequence_data['sequence_start'] = str(single_date.strftime("%d/%m/%Y")) + " "+str(matine_heure_debut)
|
||||||
|
sequence_data['sequence_end'] = str(single_date.strftime("%d/%m/%Y")) + " "+str(apres_midi_heure_fin)
|
||||||
|
|
||||||
|
# print(" ### sequence_data = ", sequence_data)
|
||||||
|
|
||||||
|
local_status, local_val = Add_Session_Sequence(sequence_data)
|
||||||
|
|
||||||
|
if (local_status is False):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " WARNING : " + str(local_val))
|
||||||
|
else:
|
||||||
|
nb_sequence = nb_sequence + 1
|
||||||
|
|
||||||
|
cpt = cpt + 1
|
||||||
|
|
||||||
|
else:
|
||||||
|
# Si pas la journée, ni la demi journée alors on crée les sequences selon le calendrier
|
||||||
|
# print(" ### les sequences du ", jour_name, " sont ", jours_name_list_sequence)
|
||||||
|
# Pour chaque sequence de la journée
|
||||||
|
if (date_jour not in is_existe_valide_journee_model_data['date_off']):
|
||||||
|
for local_val in jours_name_list_sequence:
|
||||||
|
|
||||||
|
sequence_data = {}
|
||||||
|
sequence_data['token'] = diction['token']
|
||||||
|
sequence_data['session_id'] = diction['session_id']
|
||||||
|
sequence_data['sequence_title'] = "Seq_Auto_" + str(cpt)
|
||||||
|
sequence_data['sequence_start'] = str(single_date.strftime("%d/%m/%Y")) + " " + str(
|
||||||
|
local_val['heure_debut']).strip()
|
||||||
|
sequence_data['sequence_end'] = str(single_date.strftime("%d/%m/%Y")) + " " + str(
|
||||||
|
local_val['heure_fin']).strip()
|
||||||
|
|
||||||
|
# print(" ### sequence_data = ", sequence_data)
|
||||||
|
|
||||||
|
local_status, local_val = Add_Session_Sequence(sequence_data)
|
||||||
|
|
||||||
|
if (local_status is False):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " WARNING : " + str(local_val))
|
||||||
|
else:
|
||||||
|
nb_sequence = nb_sequence + 1
|
||||||
|
|
||||||
|
cpt = cpt + 1
|
||||||
|
|
||||||
|
return True, str(nb_sequence) + " séquence(s) automatiquement créée(s) "
|
||||||
|
|
||||||
|
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 créer automatiquement les séquences "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -73,7 +73,7 @@ def Add_CRM_Opportunite(diction):
|
||||||
"""
|
"""
|
||||||
field_list = ['token', 'partner_client_id', 'contact_civilite', 'contact_nom', 'contact_email', 'contact_telephone',
|
field_list = ['token', 'partner_client_id', 'contact_civilite', 'contact_nom', 'contact_email', 'contact_telephone',
|
||||||
'titre', 'description', 'revenu_cible', 'probabilite_gain', 'statut_id', 'priorite', 'commentaire',
|
'titre', 'description', 'revenu_cible', 'probabilite_gain', 'statut_id', 'priorite', 'commentaire',
|
||||||
'vendeur_id', 'date_fermeture']
|
'vendeur_id', 'date_fermeture', 'raison_perte', 'raison_gain' ]
|
||||||
|
|
||||||
incom_keys = diction.keys()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
|
@ -199,7 +199,7 @@ def Update_CRM_Opportunite(diction):
|
||||||
"""
|
"""
|
||||||
field_list = ['token', 'partner_client_id', 'contact_civilite', 'contact_nom', 'contact_email', 'contact_telephone',
|
field_list = ['token', 'partner_client_id', 'contact_civilite', 'contact_nom', 'contact_email', 'contact_telephone',
|
||||||
'titre', 'description', 'revenu_cible', 'probabilite_gain', 'statut_id', 'priorite', 'commentaire',
|
'titre', 'description', 'revenu_cible', 'probabilite_gain', 'statut_id', 'priorite', 'commentaire',
|
||||||
'vendeur_id', 'date_fermeture', 'opport_id']
|
'vendeur_id', 'date_fermeture', 'opport_id', 'date_fermeture', 'raison_perte', 'raison_gain',]
|
||||||
|
|
||||||
incom_keys = diction.keys()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
|
|
|
@ -1929,7 +1929,7 @@ def SendEmargementMail( diction):
|
||||||
A présent que la demande d'émargement est envoyée, on met à jour la collection 'emargement' pour
|
A présent que la demande d'émargement est envoyée, on met à jour la collection 'emargement' pour
|
||||||
dire que la demande a été envoyé, et quel jour
|
dire que la demande a été envoyé, et quel jour
|
||||||
"""
|
"""
|
||||||
now = str(datetime.datetime.now().strftime("%d/%m/%Y, %H:%M:%S"))
|
now = str(datetime.datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
|
||||||
updata_data = {}
|
updata_data = {}
|
||||||
updata_data['date_update'] = now
|
updata_data['date_update'] = now
|
||||||
updata_data['update_by'] = str(my_partner['_id'])
|
updata_data['update_by'] = str(my_partner['_id'])
|
||||||
|
|
|
@ -469,6 +469,9 @@ def GetTableauEmargement(diction):
|
||||||
if ("date_envoi" not in retval.keys()):
|
if ("date_envoi" not in retval.keys()):
|
||||||
user['date_envoi'] = ""
|
user['date_envoi'] = ""
|
||||||
|
|
||||||
|
if ("date_emargement" not in retval.keys()):
|
||||||
|
user['date_emargement'] = ""
|
||||||
|
|
||||||
user['id'] = str(val_tmp)
|
user['id'] = str(val_tmp)
|
||||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||||
val_tmp = val_tmp + 1
|
val_tmp = val_tmp + 1
|
||||||
|
|
25
main.py
25
main.py
|
@ -2170,7 +2170,7 @@ API : pour préparer et envoyer les convention en partant d'une session
|
||||||
def Prepare_and_Send_Convention_From_Session_By_Email():
|
def Prepare_and_Send_Convention_From_Session_By_Email():
|
||||||
# On recupere le corps (payload) de la requete
|
# On recupere le corps (payload) de la requete
|
||||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||||
print(" ### Prepare_Convention_From_Session_By_Email : payload = ",str(payload))
|
print(" ### Prepare_and_Send_Convention_From_Session_By_Email : payload = ",str(payload))
|
||||||
|
|
||||||
file = []
|
file = []
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
@ -7971,6 +7971,20 @@ def Configure_Partner_Init_Setup_No_Token():
|
||||||
return jsonify(status=status, message=retval)
|
return jsonify(status=status, message=retval)
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
API permet de savoir si un partenaire dispose de la signature digital
|
||||||
|
"""
|
||||||
|
@app.route('/myclass/api/Is_Partnair_Has_Digital_Signature/', methods=['POST','GET'])
|
||||||
|
@crossdomain(origin='*')
|
||||||
|
def Is_Partnair_Has_Digital_Signature():
|
||||||
|
# On recupere le corps (payload) de la requete
|
||||||
|
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||||
|
print(" ### Is_Partnair_Has_Digital_Signature payload = ",payload)
|
||||||
|
status, retval = mycommon.Is_Partnair_Has_Digital_Signature(payload)
|
||||||
|
return jsonify(status=status, message=retval)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
API pour ajouter un document electronique à signer
|
API pour ajouter un document electronique à signer
|
||||||
|
@ -8023,13 +8037,20 @@ def Create_E_Signature_For_E_Document():
|
||||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||||
print(" ### Create_E_Signature_For_E_Document payload = ",payload)
|
print(" ### Create_E_Signature_For_E_Document payload = ",payload)
|
||||||
|
|
||||||
|
file_img = None
|
||||||
|
if request.method == 'POST':
|
||||||
|
# Create variable for uploaded file
|
||||||
|
if ('signature_img' in request.files.keys()):
|
||||||
|
file_img = request.files['signature_img']
|
||||||
|
|
||||||
|
|
||||||
user_ip = ""
|
user_ip = ""
|
||||||
headers_list = request.headers.getlist("X-Forwarded-For")
|
headers_list = request.headers.getlist("X-Forwarded-For")
|
||||||
user_ip = headers_list[0] if headers_list else request.remote_addr
|
user_ip = headers_list[0] if headers_list else request.remote_addr
|
||||||
|
|
||||||
payload['user_ip'] = user_ip
|
payload['user_ip'] = user_ip
|
||||||
|
|
||||||
status, retval = E_Sign_Document.Create_E_Signature_For_E_Document(payload)
|
status, retval = E_Sign_Document.Create_E_Signature_For_E_Document(file_img, MYSY_GV.TEMPORARY_DIRECTORY_V2, payload)
|
||||||
return jsonify(status=status, message=retval)
|
return jsonify(status=status, message=retval)
|
||||||
|
|
||||||
|
|
||||||
|
|
6674
prj_common.py
6674
prj_common.py
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue