fff
parent
c5aeb47364
commit
918df47b52
|
@ -1,18 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="25/03/2024 - 18h30">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="26/03/2024 - 21h30">
|
||||
<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$/Ela_Spacy.py" beforeDir="false" afterPath="$PROJECT_DIR$/Ela_Spacy.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$/attached_file_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/attached_file_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_order.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_order.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -82,13 +76,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00201" summary="24/01/2024 -12h00">
|
||||
<created>1706182967822</created>
|
||||
<option name="number" value="00201" />
|
||||
<option name="presentableId" value="LOCAL-00201" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1706182967824</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00202" summary="rrr">
|
||||
<created>1706219904725</created>
|
||||
<option name="number" value="00202" />
|
||||
|
@ -425,7 +412,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1711387309256</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="250" />
|
||||
<task id="LOCAL-00250" summary="26/03/2024 - 21h30">
|
||||
<created>1711484853704</created>
|
||||
<option name="number" value="00250" />
|
||||
<option name="presentableId" value="LOCAL-00250" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1711484853705</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="251" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -467,7 +461,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="ddr" />
|
||||
<MESSAGE value="23/02/2024 - 22h30" />
|
||||
<MESSAGE value="24/02/2024 - 22h30" />
|
||||
<MESSAGE value="25/02/2024 - 22h30" />
|
||||
|
@ -492,6 +485,7 @@
|
|||
<MESSAGE value="20/03/2024 - 22h30d" />
|
||||
<MESSAGE value="20/03/2024 - 22h30dss" />
|
||||
<MESSAGE value="25/03/2024 - 18h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="25/03/2024 - 18h30" />
|
||||
<MESSAGE value="26/03/2024 - 21h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="26/03/2024 - 21h30" />
|
||||
</component>
|
||||
</project>
|
|
@ -7554,6 +7554,102 @@ def Get_List_Convocations_Stagiaire_With_Filter(diction):
|
|||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction recupere les differentes modele de courrier d'emargement
|
||||
de stagiaire avec des option comme :
|
||||
- ref_interne
|
||||
- nom
|
||||
- type_doc
|
||||
|
||||
On accepte plusieurs versions du meme doc
|
||||
"""
|
||||
|
||||
def Get_List_Emargement_With_Filter(diction):
|
||||
try:
|
||||
|
||||
field_list = ['token', 'type_doc' ]
|
||||
|
||||
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, "Le champ '" + val + "' n'est pas autorisé"
|
||||
|
||||
|
||||
|
||||
field_list_obligatoire = ['token', ]
|
||||
|
||||
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, " La valeur '" + val + "' n'est pas presente dans liste"
|
||||
|
||||
my_token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
my_token = diction['token']
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
|
||||
# Recuperation des option de filter
|
||||
filt_type_doc = {}
|
||||
if ("type_doc" in diction.keys()):
|
||||
filt_type_doc = {'type_doc': str(diction['type_doc'])}
|
||||
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
"""
|
||||
# Recuperation des documents (collection : courrier_template) de ce partenaire avec 'ref_interne' = 'EMARGEMENT'
|
||||
1 - On regarde le partenaire à des conventions qui sont personnalisées, si non
|
||||
2 - On va sortir les conventions par defaut de MySy.
|
||||
|
||||
/!\ : On ne melange pas les 2. c'est l'un ou l'autre
|
||||
"""
|
||||
|
||||
qry = {'$and': [{'ref_interne': 'EMARGEMENT',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])},
|
||||
filt_type_doc ]}
|
||||
|
||||
print(" #### qry = ", qry)
|
||||
|
||||
for retval in MYSY_GV.dbname['courrier_template'].find({'$and': [{'ref_interne': 'EMARGEMENT',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])},
|
||||
filt_type_doc ]}):
|
||||
user = retval
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
# 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': 'EMARGEMENT',
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': 'default'}, filt_type_doc]}):
|
||||
user = retval
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
#print(" ### Get_List_Convocations_Stagiaire_With_Filter RetObject = ", RetObject)
|
||||
return True, RetObject
|
||||
|
||||
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 emargements"
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperatin des convention SEULEMENT Individuelles
|
||||
|
|
4360
Log/log_file.log
4360
Log/log_file.log
File diff suppressed because one or more lines are too long
|
@ -584,7 +584,7 @@ Cette fonction genere un fichier pdf pour les liste d'emargement
|
|||
|
||||
def GerneratePDFEmargementList(diction):
|
||||
try:
|
||||
field_list = ['session_id', 'email', 'date', 'token', 'class_internal_url']
|
||||
field_list = ['session_id', 'email', 'date', 'token', 'class_internal_url', 'courrier_template_id']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
|
@ -620,6 +620,35 @@ def GerneratePDFEmargementList(diction):
|
|||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible d'imprimer la liste d'emargement ")
|
||||
return False, " Impossible d'imprimer la liste d'emargement"
|
||||
|
||||
"""
|
||||
28/03/2024 :
|
||||
Verifier que le modele de courrier est valide
|
||||
"""
|
||||
courrier_template_id = ""
|
||||
if( "courrier_template_id" in diction.keys() ):
|
||||
courrier_template_id = diction['courrier_template_id']
|
||||
|
||||
if( courrier_template_id == ""):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le modèle de courrier est invalide ")
|
||||
return False, " Le modèle de courrier est invalide "
|
||||
|
||||
courrier_template_id_count = MYSY_GV.dbname['courrier_template'].count_documents({"_id":ObjectId(courrier_template_id),
|
||||
'partner_owner_recid':my_partner['recid'],
|
||||
'valide':'1',
|
||||
'locked':'0'})
|
||||
|
||||
|
||||
if( courrier_template_id_count != 1):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le modèle de courrier est invalide (1) ")
|
||||
return False, " Le modèle de courrier est invalide (1)"
|
||||
|
||||
courrier_template_id_data = MYSY_GV.dbname['courrier_template'].find_one(
|
||||
{"_id": ObjectId(courrier_template_id),
|
||||
'partner_owner_recid': my_partner['recid'],
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
|
||||
myclass_internal_url = ""
|
||||
if ("class_internal_url" in diction.keys()):
|
||||
if diction['class_internal_url']:
|
||||
|
@ -783,7 +812,6 @@ def GerneratePDFEmargementList(diction):
|
|||
else:
|
||||
|
||||
local_JSON = ast.literal_eval(local_part_imgs[0])
|
||||
|
||||
new_field_logo = {'societe_logo': "data:image/png;base64," + local_JSON['logo_img']}
|
||||
new_field_cachet = {'societe_cachet': "data:image/png;base64," + local_JSON['cachet_img']}
|
||||
company_data.update(new_field_logo)
|
||||
|
@ -802,7 +830,7 @@ def GerneratePDFEmargementList(diction):
|
|||
|
||||
### Recuperation du modèle de courrier pdf pour l'emargement
|
||||
|
||||
|
||||
"""
|
||||
data_doc = {}
|
||||
data_doc['document_ref_intere'] = "EMARGEMENT"
|
||||
data_doc['document_type'] = "pdf"
|
||||
|
@ -812,8 +840,9 @@ def GerneratePDFEmargementList(diction):
|
|||
if( local_retval_status is False):
|
||||
return local_retval_status, local_retval_message
|
||||
|
||||
partner_document_data = local_retval_message
|
||||
"""
|
||||
|
||||
partner_document_data = courrier_template_id_data
|
||||
contenu_doc_Template = jinja2.Template(str(partner_document_data['contenu_doc']))
|
||||
|
||||
|
||||
|
|
17
main.py
17
main.py
|
@ -2255,15 +2255,16 @@ def Prepare_and_Send_Default_Convention_From_Session_By_PDF(token, session_id, c
|
|||
"""
|
||||
API de generation de liste PDF des liste d'emargement
|
||||
"""
|
||||
@app.route('/myclass/api/GerneratePDFEmargementList/<token>/<session_id>/<internal_url>', methods=['POST','GET'])
|
||||
@app.route('/myclass/api/GerneratePDFEmargementList/<token>/<session_id>/<internal_url>/<courrier_modele_id>', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def GerneratePDFEmargementList(token, session_id, internal_url):
|
||||
def GerneratePDFEmargementList(token, session_id, internal_url, courrier_modele_id):
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
payload = {}
|
||||
payload['token'] = str(token)
|
||||
payload['session_id'] = str(session_id)
|
||||
payload['class_internal_url'] = str(internal_url)
|
||||
payload['courrier_template_id'] = str(courrier_modele_id)
|
||||
|
||||
print(" ### GerneratePDFEmargementList : payload = ",str(payload))
|
||||
|
||||
|
@ -4488,6 +4489,18 @@ def Get_List_Conventions_Stagiaire_Individuelles():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API qui permet de recuperer la liste des modèle de courrier pour
|
||||
les emargements
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Emargement_With_Filter/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Emargement_With_Filter():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Emargement_With_Filter payload = ",payload)
|
||||
status, retval = inscription.Get_List_Emargement_With_Filter(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue