08/02/205 - 22h30

master
cherif 2025-02-08 22:29:38 +01:00
parent a236bc50ce
commit d9cfe96ecc
7 changed files with 8234 additions and 24 deletions

View File

@ -1,10 +1,14 @@
<?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="01/02/2025 - 20h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="06-02-2025 - new_design_2025">
<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$/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$/base_specific_fields.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_specific_fields.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/agenda.py" beforeDir="false" afterPath="$PROJECT_DIR$/agenda.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_order.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_order.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -75,13 +79,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00385" summary="31082024">
<created>1725106474933</created>
<option name="number" value="00385" />
<option name="presentableId" value="LOCAL-00385" />
<option name="project" value="LOCAL" />
<updated>1725106474933</updated>
</task>
<task id="LOCAL-00386" summary="31/08/2024 - 18h50">
<created>1725123044361</created>
<option name="number" value="00386" />
@ -418,7 +415,14 @@
<option name="project" value="LOCAL" />
<updated>1738436729991</updated>
</task>
<option name="localTasksCounter" value="434" />
<task id="LOCAL-00434" summary="06-02-2025 - new_design_2025">
<created>1738857403417</created>
<option name="number" value="00434" />
<option name="presentableId" value="LOCAL-00434" />
<option name="project" value="LOCAL" />
<updated>1738857403418</updated>
</task>
<option name="localTasksCounter" value="435" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -460,7 +464,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="13/10/2024 - sdfqsdqs14h" />
<MESSAGE value="qsdsq" />
<MESSAGE value="qsdsqqs" />
<MESSAGE value="29/10/2024 - 18h30" />
@ -485,6 +488,7 @@
<MESSAGE value="20/01/2025 - 18h" />
<MESSAGE value="30/01/2025 - 16h" />
<MESSAGE value="01/02/2025 - 20h" />
<option name="LAST_COMMIT_MESSAGE" value="01/02/2025 - 20h" />
<MESSAGE value="06-02-2025 - new_design_2025" />
<option name="LAST_COMMIT_MESSAGE" value="06-02-2025 - new_design_2025" />
</component>
</project>

View File

@ -104,7 +104,7 @@ Add document du signe
def Create_E_Document(diction):
try:
diction = mycommon.strip_dictionary(diction)
print(" #### Create_E_Document diction = ", diction)
print(" #### Create_E_Document diction = (trop long cherif) ", )
"""
Verification des input acceptés
@ -754,7 +754,7 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
else:
e_docment_type = e_document_data['type']
#print(" ### e_docment_type = ", e_docment_type)
print(" ### e_docment_type 011111 = ", e_docment_type)
local_signature_digitale = ""
if ("email_destinataire" in e_document_data.keys() and e_document_data['email_destinataire']):
@ -1218,7 +1218,11 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
quotation_client_data = None
reference_document = ""
type_document = str(e_docment_type)
if(e_document_date_2['type'] == "quotation" ):
print(" #### e_document_date_2['type'] === ", str(e_document_date_2['type']))
if(e_document_date_2['type'] == "quotation" ):
qry = {'partner_owner_recid':local_partner_owner_recid,
'_id':ObjectId(str(e_document_date_2['related_collection_id'])),
'valide':'1',
@ -1305,8 +1309,8 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
Si il s'agit d'un devis, alors on procede a la resevation des places
et on valide le devis. on le met à 'gagné'
"""
if (str(e_docment_type).strip().lower() == "quotation"):
print(" ### str(e_docment_type).strip().lower() uuuuuuuuuu === ", str(e_docment_type).strip().lower())
if (str(e_docment_type).strip().lower() == "devis"):
"""
mettre le devis à gagné
@ -1880,6 +1884,8 @@ def Create_E_Signature_For_E_Invoice(file_img=None, Folder=None, diction=None):
Si il s'agit d'un devis, alors on procede a la resevation des places
"""
print(" ### e_docment_type zzzz pour resevation de place = ", e_docment_type)
if (str(e_docment_type).strip().lower() == "quotation"):
"""

View File

@ -229,11 +229,14 @@ def AddStagiairetoClass(diction):
# Verifier que le type d'apprenant est bien valide
type_apprenant = "0"
if ("type_apprenant" in diction.keys() and str(diction['type_apprenant']) not in MYSY_GV.INSCRIPTION_TYPE_APPRENANT):
mycommon.myprint(
str(inspect.stack()[0][3]) + " Le type d'apprenant est invalide ")
return False, " Le type d'apprenant est invalide "
else:
elif ("type_apprenant" in diction.keys()) :
type_apprenant = str(diction['type_apprenant'])

File diff suppressed because one or more lines are too long

View File

@ -447,6 +447,89 @@ def get_Agenda_Event_List(diction):
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 evenements "
"""
Recuperation de la liste des agenda pour plusieurs personnes
"""
def get_Agenda_Event_List_For_Many_Users(diction):
try:
diction = mycommon.strip_dictionary(diction)
"""
Verification des input acceptés
"""
field_list = ['token', 'related_collection', 'tab_related_collection_recid']
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', 'related_collection', 'tab_related_collection_recid']
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
my_related_collection_recid_ids = ""
if ("tab_related_collection_recid" in diction.keys()):
if diction['tab_related_collection_recid']:
my_related_collection_recid_ids = diction['tab_related_collection_recid']
tab_my_related_collection_recid_ids = []
tab_my_related_collection_recid_ids_tmp = str(my_related_collection_recid_ids).split(",")
for my_id in tab_my_related_collection_recid_ids_tmp:
if( my_id ):
tab_my_related_collection_recid_ids.append(str(my_id))
RetObject = []
val_tmp = 1
qry = {'related_collection':str(diction['related_collection']),
'related_collection_recid': {'$in': tab_my_related_collection_recid_ids},
'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}
print(" ### get_Agenda_Event_List_For_Many_Users QRY = ", qry)
for New_retVal in MYSY_GV.dbname['agenda'].find({'related_collection':str(diction['related_collection']), 'related_collection_recid': {
'$in': tab_my_related_collection_recid_ids},
'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}):
user = New_retVal
user['id'] = str(New_retVal['_id'])
user['group'] = str(New_retVal['related_collection_recid'])
val_tmp = val_tmp + 1
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 évènements de plusieurs utilisateur "
"""

19
main.py
View File

@ -7173,6 +7173,23 @@ def get_Agenda_Event_List():
return jsonify(status=status, message=retval)
"""
API de la recuperation de la liste des evenements dans l'agenda pour plusieurs personnes
"""
@app.route('/myclass/api/get_Agenda_Event_List_For_Many_Users/', methods=['POST','GET'])
@crossdomain(origin='*')
def get_Agenda_Event_List_For_Many_Users():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### get_Agenda_Event_List_For_Many_Users : payload = ",payload)
status, retval = agenda.get_Agenda_Event_List_For_Many_Users(payload)
return jsonify(status=status, message=retval)
"""
API de la recuperation de la liste des evenements dans l'agenda pour un stagiaire
"""
@ -10878,7 +10895,7 @@ def Update_Emargement_QR_Code_From_Inscription_No_Token():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Update_Emargement_QR_Code_From_Inscription_No_Token payload = ",payload)
print(" ### Update_Emargement_QR_Code_From_Inscription_No_Token payload (trop long cherif) = ")
file_img = None
if request.method == 'POST':

View File

@ -5970,15 +5970,23 @@ def Gernerate_Stock_PDF_Partner_Order(diction):
str(inspect.stack()[0][3]) + " - La commande n'est pas valide ")
return False, " La commande n'est pas valide", False
Order_header_data = MYSY_GV.dbname['partner_order_header'].findMYSY_GV.dbname['partner_order_header'].find_one({'_id': ObjectId(str(diction['order_id'])),
'valide': '1', 'locked': '0',
'partner_owner_recid': str(
my_partner['recid'])})
is_Order_Existe_Count_data = MYSY_GV.dbname['partner_order_header'].find_one(
{'_id': ObjectId(str(diction['order_id'])),
'valide': '1', 'locked': '0',
'partner_owner_recid': str(my_partner['recid'])})
Order_header_data = MYSY_GV.dbname['partner_order_header'].find_one(
{'_id': ObjectId(str(diction['order_id'])),
'valide': '1', 'locked': '0',
'partner_owner_recid': str(my_partner['recid'])})
partner_document_CONF_ORDER_data_qry = {'partner_owner_recid': str(my_partner['recid']),
'valide': '1', 'locked': '0', 'ref_interne': 'PART_ORDER', 'type_doc':'pdf'}
print(" ### partner_document_CONF_ORDER_data_qry = ", partner_document_CONF_ORDER_data_qry)
partner_document_CONF_ORDER_data = MYSY_GV.dbname['courrier_template'].find_one(
{'partner_owner_recid': str(my_partner['recid']),
'valide': '1', 'locked': '0', 'ref_interne': 'PART_ORDER', 'type_doc':'pdf'})
@ -6002,6 +6010,8 @@ def Gernerate_Stock_PDF_Partner_Order(diction):
return False, " Le parametrage du document est invalide "
# Recuperation des données du client
print(" ### Order_header_data 2888 = ", Order_header_data)
if ("order_header_client_id" in Order_header_data.keys()):
Order_header_client_data = MYSY_GV.dbname['partner_client'].find_one(
{'_id': ObjectId(str(Order_header_data['order_header_client_id'])),
@ -7827,6 +7837,11 @@ def Insert_Quotation_To_Session(diction):
new_data['quotation_id'] = str(qotation_line['order_header_id'])
new_data['status'] = "0"
if( "order_line_type_apprenant" in qotation_line.keys() ):
new_data['type_apprenant'] = str(qotation_line['order_line_type_apprenant'])
else:
new_data['type_apprenant'] = "0"
local_insert_status, local_insert_retval = Inscription_mgt.AddStagiairetoClass(new_data)
if( local_insert_status is False ):