18/02/2024 - 14h
parent
79f298a523
commit
c79e7710b0
|
@ -1,17 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="13/02/2024 - 11h">
|
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="17/02/2024 - 11h">
|
||||||
<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$/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$/lms_chamilo/mysy_lms.py" beforeDir="false" afterPath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/partner_document_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_document_mgt.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/partner_order.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_order.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ressources_humaines.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/ressources_materiels.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_materiels.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" />
|
||||||
|
@ -81,13 +76,6 @@
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1680804787304</updated>
|
<updated>1680804787304</updated>
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00173" summary="14/12/2023 - 22h">
|
|
||||||
<created>1702588091723</created>
|
|
||||||
<option name="number" value="00173" />
|
|
||||||
<option name="presentableId" value="LOCAL-00173" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1702588091723</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00174" summary="15/12/2023 - 18h">
|
<task id="LOCAL-00174" summary="15/12/2023 - 18h">
|
||||||
<created>1702658652894</created>
|
<created>1702658652894</created>
|
||||||
<option name="number" value="00174" />
|
<option name="number" value="00174" />
|
||||||
|
@ -424,7 +412,14 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1707817778813</updated>
|
<updated>1707817778813</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="222" />
|
<task id="LOCAL-00222" summary="17/02/2024 - 11h">
|
||||||
|
<created>1708179293702</created>
|
||||||
|
<option name="number" value="00222" />
|
||||||
|
<option name="presentableId" value="LOCAL-00222" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1708179293703</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="223" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
<component name="Vcs.Log.Tabs.Properties">
|
||||||
|
@ -439,7 +434,6 @@
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="15/01/2024 - 22h" />
|
|
||||||
<MESSAGE value="16/01/2024 - 19h" />
|
<MESSAGE value="16/01/2024 - 19h" />
|
||||||
<MESSAGE value="19/01/2024 - 16h" />
|
<MESSAGE value="19/01/2024 - 16h" />
|
||||||
<MESSAGE value="21/01/2024 -18h30" />
|
<MESSAGE value="21/01/2024 -18h30" />
|
||||||
|
@ -464,6 +458,7 @@
|
||||||
<MESSAGE value="11/02/2024 - 22h" />
|
<MESSAGE value="11/02/2024 - 22h" />
|
||||||
<MESSAGE value="sdsdqs" />
|
<MESSAGE value="sdsdqs" />
|
||||||
<MESSAGE value="13/02/2024 - 11h" />
|
<MESSAGE value="13/02/2024 - 11h" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="13/02/2024 - 11h" />
|
<MESSAGE value="17/02/2024 - 11h" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="17/02/2024 - 11h" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
1918
Log/log_file.log
1918
Log/log_file.log
File diff suppressed because it is too large
Load Diff
14
main.py
14
main.py
|
@ -5696,6 +5696,20 @@ def Get_List_Partner_Document_no_filter():
|
||||||
return jsonify(status=status, message=retval)
|
return jsonify(status=status, message=retval)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
API qui permet de récupérer la liste des documents personnalisables d'un partenaire avec filtre
|
||||||
|
"""
|
||||||
|
@app.route('/myclass/api/Get_List_Partner_Document_with_filter/', methods=['POST','GET'])
|
||||||
|
@crossdomain(origin='*')
|
||||||
|
def Get_List_Partner_Document_with_filter():
|
||||||
|
# On recupere le corps (payload) de la requete
|
||||||
|
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||||
|
print(" ### Get_List_Partner_Document_with_filter payload = ",payload)
|
||||||
|
status, retval = partner_document_mgt.Get_List_Partner_Document_with_filter(payload)
|
||||||
|
return jsonify(status=status, message=retval)
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
API d'impression pdf d'un commande / devis
|
API d'impression pdf d'un commande / devis
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -39,7 +39,8 @@ def Add_Partner_Document(diction):
|
||||||
Verification des input acceptés
|
Verification des input acceptés
|
||||||
"""
|
"""
|
||||||
field_list = ['token', "nom", "ref_interne", "type_doc", "cible", "sujet",'contenu_doc', 'duplicate',
|
field_list = ['token', "nom", "ref_interne", "type_doc", "cible", "sujet",'contenu_doc', 'duplicate',
|
||||||
'joint_pdf', 'default_version', 'corps_mail', 'edit_by_client', 'courrier_template_type_document_ref_interne']
|
'joint_pdf', 'default_version', 'corps_mail', 'edit_by_client',
|
||||||
|
'courrier_template_type_document_ref_interne', 'original_courrier_template_id']
|
||||||
|
|
||||||
incom_keys = diction.keys()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
|
@ -100,6 +101,21 @@ def Add_Partner_Document(diction):
|
||||||
data['nom'] = nom
|
data['nom'] = nom
|
||||||
|
|
||||||
|
|
||||||
|
if( "original_courrier_template_id" in diction.keys() and diction['original_courrier_template_id']):
|
||||||
|
is_original_courrier_template_id_valide = MYSY_GV.dbname['courrier_template'].count_documents({'_id':ObjectId(str(diction['original_courrier_template_id'])),
|
||||||
|
'valide':'1',
|
||||||
|
'locked':'0',
|
||||||
|
'partner_owner_recid':'default'})
|
||||||
|
if( is_original_courrier_template_id_valide != 1 ):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][
|
||||||
|
3]) + " L'identifiant du courrier d'origine (original_courrier_template_id) est invalide ")
|
||||||
|
|
||||||
|
return False, " L'identifiant du courrier d'origine (original_courrier_template_id) est invalide "
|
||||||
|
|
||||||
|
# Cette n'est ajoutée que le champ existe et est valide. donc l'indemtation est dans le 'if', normal
|
||||||
|
data['original_courrier_template_id'] = diction['original_courrier_template_id']
|
||||||
|
|
||||||
|
|
||||||
sujet = ""
|
sujet = ""
|
||||||
if ("sujet" in diction.keys()):
|
if ("sujet" in diction.keys()):
|
||||||
|
@ -945,6 +961,95 @@ def Get_List_Partner_Document_no_filter(diction):
|
||||||
return False, " Impossible de récupérer la liste des modèles de document "
|
return False, " Impossible de récupérer la liste des modèles de document "
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
Recherche de la liste des modèles de document avec des filter
|
||||||
|
"""
|
||||||
|
def Get_List_Partner_Document_with_filter(diction):
|
||||||
|
try:
|
||||||
|
diction = mycommon.strip_dictionary(diction)
|
||||||
|
|
||||||
|
"""
|
||||||
|
Verification des input acceptés
|
||||||
|
"""
|
||||||
|
field_list = ['token', 'nom', 'ref_interne', ]
|
||||||
|
|
||||||
|
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 = ['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, " 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.Check_Connexion_And_Return_Partner_Data(diction)
|
||||||
|
if (local_status is not True):
|
||||||
|
return local_status, my_partner
|
||||||
|
|
||||||
|
filt_nom = {}
|
||||||
|
if ("nom" in diction.keys()):
|
||||||
|
filt_nom = {'nom': {'$regex': str(diction['nom']), "$options": "i"}}
|
||||||
|
|
||||||
|
filt_ref_interne = {}
|
||||||
|
if ("ref_interne" in diction.keys()):
|
||||||
|
filt_ref_interne = {
|
||||||
|
'ref_interne': {'$regex': str(diction['ref_interne']), "$options": "i"}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
Clés de mise à jour
|
||||||
|
"""
|
||||||
|
data_cle = {}
|
||||||
|
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||||
|
|
||||||
|
data_cle['locked'] = "0"
|
||||||
|
data_cle['valide'] = "1"
|
||||||
|
|
||||||
|
|
||||||
|
find_qry = {'$and': [ {'partner_owner_recid': str(my_partner['recid']), 'valide':'1', 'locked':'0' }, filt_nom,
|
||||||
|
filt_ref_interne, ]}
|
||||||
|
|
||||||
|
#print(" ### materiel find_qry = ", find_qry)
|
||||||
|
RetObject = []
|
||||||
|
val_tmp = 1
|
||||||
|
|
||||||
|
for retval in MYSY_GV.dbname['courrier_template'].find(find_qry).sort([("_id", pymongo.DESCENDING)]):
|
||||||
|
user = retval
|
||||||
|
user['id'] = str(val_tmp)
|
||||||
|
val_tmp = val_tmp + 1
|
||||||
|
if( "duplicate" not in retval.keys()):
|
||||||
|
user['duplicate'] = "0"
|
||||||
|
|
||||||
|
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||||
|
|
||||||
|
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 modèles de document "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Pour permettre de rénitialiser un template 'detruit' par un user,
|
Pour permettre de rénitialiser un template 'detruit' par un user,
|
||||||
|
@ -957,7 +1062,7 @@ def Get_Default_Partner_Document_By_Internal_Ref(diction):
|
||||||
"""
|
"""
|
||||||
Verification des input acceptés
|
Verification des input acceptés
|
||||||
"""
|
"""
|
||||||
field_list = ['token', 'ref_interne']
|
field_list = ['token', 'ref_interne', 'original_courrier_template_id']
|
||||||
|
|
||||||
incom_keys = diction.keys()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
|
@ -969,7 +1074,7 @@ def Get_Default_Partner_Document_By_Internal_Ref(diction):
|
||||||
"""
|
"""
|
||||||
Verification des champs obligatoires
|
Verification des champs obligatoires
|
||||||
"""
|
"""
|
||||||
field_list_obligatoire = ['token', 'ref_interne']
|
field_list_obligatoire = ['token', 'ref_interne', 'original_courrier_template_id']
|
||||||
for val in field_list_obligatoire:
|
for val in field_list_obligatoire:
|
||||||
if val not in diction:
|
if val not in diction:
|
||||||
mycommon.myprint(
|
mycommon.myprint(
|
||||||
|
@ -990,21 +1095,33 @@ def Get_Default_Partner_Document_By_Internal_Ref(diction):
|
||||||
return local_status, my_partner
|
return local_status, my_partner
|
||||||
|
|
||||||
|
|
||||||
|
# Verifier que le 'original_courrier_template_id' existe et est valide
|
||||||
|
if( 'original_courrier_template_id' in diction.keys()):
|
||||||
|
is_original_courrier_template_id_valide = MYSY_GV.dbname['courrier_template'].count_documents({'_id':ObjectId(str(diction['original_courrier_template_id'])),
|
||||||
|
'valide':'1',
|
||||||
|
'locked':'0',
|
||||||
|
'partner_owner_recid':'default'})
|
||||||
|
|
||||||
|
if (is_original_courrier_template_id_valide != 1):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " Le champ 'original_courrier_template_id' n'est pas valide ")
|
||||||
|
return False, " Le champ 'original_courrier_template_id' n'est pas valide "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Clés de mise à jour
|
Clés de mise à jour
|
||||||
"""
|
"""
|
||||||
data_cle = {}
|
|
||||||
data_cle['partner_owner_recid'] = 'default'
|
|
||||||
data_cle['ref_interne'] = str(diction['ref_interne'])
|
|
||||||
|
|
||||||
data_cle['valide'] = "1"
|
|
||||||
data_cle['locked'] = "0"
|
|
||||||
|
|
||||||
RetObject = []
|
RetObject = []
|
||||||
val_tmp = 1
|
val_tmp = 1
|
||||||
|
|
||||||
#print(" ### data_cle = ", data_cle)
|
#print(" ### data_cle = ", data_cle)
|
||||||
for retval in MYSY_GV.dbname['courrier_template'].find(data_cle):
|
for retval in MYSY_GV.dbname['courrier_template'].find({'_id':ObjectId(str(diction['original_courrier_template_id'])),
|
||||||
|
'valide':'1',
|
||||||
|
'locked':'0',
|
||||||
|
'partner_owner_recid':'default'}):
|
||||||
user = retval
|
user = retval
|
||||||
user['id'] = str(val_tmp)
|
user['id'] = str(val_tmp)
|
||||||
val_tmp = val_tmp + 1
|
val_tmp = val_tmp + 1
|
||||||
|
|
|
@ -4320,7 +4320,7 @@ def GerneratePDF_Partner_Order(diction):
|
||||||
user['order_line_type_valeur'] = "0"
|
user['order_line_type_valeur'] = "0"
|
||||||
|
|
||||||
if ("order_line_montant_hors_taxes" in retval.keys()):
|
if ("order_line_montant_hors_taxes" in retval.keys()):
|
||||||
user['order_line_montant_hors_taxes'] = retval['order_line_montant_hors_taxes']
|
user['order_line_montant_hors_taxes'] = str(round(mycommon.tryFloat(str(retval['order_line_montant_hors_taxes'])), 2))
|
||||||
else:
|
else:
|
||||||
user['order_line_montant_hors_taxes'] = "0"
|
user['order_line_montant_hors_taxes'] = "0"
|
||||||
|
|
||||||
|
@ -4379,6 +4379,8 @@ def GerneratePDF_Partner_Order(diction):
|
||||||
|
|
||||||
#print(" #### Order_header_data = ", Order_header_data)
|
#print(" #### Order_header_data = ", Order_header_data)
|
||||||
#sourceHtml = contenu_doc_Template.render(params=Order_header_data)
|
#sourceHtml = contenu_doc_Template.render(params=Order_header_data)
|
||||||
|
Order_header_data['order_header_type'] = str(Order_header_data['order_header_type']).capitalize()
|
||||||
|
|
||||||
sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
||||||
|
|
||||||
|
|
||||||
|
@ -4574,7 +4576,7 @@ def Send_Partner_Order_By_Email(diction):
|
||||||
user['order_line_type_valeur'] = "0"
|
user['order_line_type_valeur'] = "0"
|
||||||
|
|
||||||
if ("order_line_montant_hors_taxes" in retval.keys()):
|
if ("order_line_montant_hors_taxes" in retval.keys()):
|
||||||
user['order_line_montant_hors_taxes'] = retval['order_line_montant_hors_taxes']
|
user['order_line_montant_hors_taxes'] = str(round(mycommon.tryFloat(str(retval['order_line_montant_hors_taxes'])), 2))
|
||||||
else:
|
else:
|
||||||
user['order_line_montant_hors_taxes'] = "0"
|
user['order_line_montant_hors_taxes'] = "0"
|
||||||
|
|
||||||
|
@ -4637,6 +4639,7 @@ def Send_Partner_Order_By_Email(diction):
|
||||||
contenu_doc_Template_subject = jinja2.Template(str(partner_document_CONF_ORDER_data['sujet']))
|
contenu_doc_Template_subject = jinja2.Template(str(partner_document_CONF_ORDER_data['sujet']))
|
||||||
|
|
||||||
#print(" #### Order_header_data = ", Order_header_data)
|
#print(" #### Order_header_data = ", Order_header_data)
|
||||||
|
Order_header_data['order_header_type'] = str(Order_header_data['order_header_type']).capitalize()
|
||||||
sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
||||||
sujetHtml = contenu_doc_Template_subject.render(params=Order_header_data)
|
sujetHtml = contenu_doc_Template_subject.render(params=Order_header_data)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue