13/10/2024 - sdf14h

master
cherif 2024-10-15 14:08:57 +02:00
parent 6cf17fa848
commit bf506b8c2e
5 changed files with 3558 additions and 29 deletions

View File

@ -1,19 +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="12/10/204 - 18h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="13/10/2024 - 14h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Collection_Historique.py" beforeDir="false" afterPath="$PROJECT_DIR$/Collection_Historique.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$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/apprenant_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$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/notes_apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/notes_apprenant_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_produit_service_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_produit_service_mgt.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" />
<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" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -83,13 +76,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00358" summary="23/07/2024 - 12h">
<created>1721725677746</created>
<option name="number" value="00358" />
<option name="presentableId" value="LOCAL-00358" />
<option name="project" value="LOCAL" />
<updated>1721725677746</updated>
</task>
<task id="LOCAL-00359" summary="26/07/2024 - 12h">
<created>1721997046281</created>
<option name="number" value="00359" />
@ -426,7 +412,14 @@
<option name="project" value="LOCAL" />
<updated>1728748684572</updated>
</task>
<option name="localTasksCounter" value="407" />
<task id="LOCAL-00407" summary="13/10/2024 - 14h">
<created>1728819518236</created>
<option name="number" value="00407" />
<option name="presentableId" value="LOCAL-00407" />
<option name="project" value="LOCAL" />
<updated>1728819518237</updated>
</task>
<option name="localTasksCounter" value="408" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -468,7 +461,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="dddqsdd" />
<MESSAGE value="dddqsdddd" />
<MESSAGE value="dddqsddddss" />
<MESSAGE value="31082024" />
@ -493,6 +485,7 @@
<MESSAGE value="05/10/2024 - 18h30" />
<MESSAGE value="07/10/2024 - 20h30" />
<MESSAGE value="12/10/204 - 18h" />
<option name="LAST_COMMIT_MESSAGE" value="12/10/204 - 18h" />
<MESSAGE value="13/10/2024 - 14h" />
<option name="LAST_COMMIT_MESSAGE" value="13/10/2024 - 14h" />
</component>
</project>

File diff suppressed because one or more lines are too long

View File

@ -1563,7 +1563,9 @@ Recuperation de la liste avec des filter du type like
def GetAllValideSessionPartner_List_filter_like(diction):
try:
field_list = ['token','class_title', 'code_session', 'class_external_code', 'session_start_date', 'session_end_date']
field_list = ['token','class_title', 'code_session', 'class_external_code',
'session_start_date', 'session_end_date',
'class_internal_url']
incom_keys = diction.keys()
for val in incom_keys:
if val not in field_list and val.startswith('my_') is False:
@ -1602,6 +1604,12 @@ def GetAllValideSessionPartner_List_filter_like(diction):
if ("class_title" in diction.keys()):
filt_class_title = {'title': {'$regex': str(diction['class_title']),"$options": "i"}}
filt_class_internal_url = {}
if ("class_internal_url" in diction.keys()):
filt_class_internal_url = {'internal_url': {'$regex': str(diction['class_internal_url']),"$options": "i"}}
filt_class_external_code = {}
if ("class_external_code" in diction.keys()):
filt_class_external_code = {'external_code': {'$regex': str(diction['class_external_code']), "$options": "i"}}
@ -1637,7 +1645,7 @@ def GetAllValideSessionPartner_List_filter_like(diction):
'from': 'myclass',
'localField': 'class_internal_url',
'foreignField': 'internal_url',
'pipeline': [{'$match': { '$and' : [ filt_class_title,filt_class_external_code, {'partner_owner_recid':str(my_partner['recid'])} ]} }, {'$project': {'title': 1, 'domaine':1,
'pipeline': [{'$match': { '$and' : [ filt_class_title, filt_class_internal_url, filt_class_external_code, {'partner_owner_recid':str(my_partner['recid'])} ]} }, {'$project': {'title': 1, 'domaine':1,
'duration':1, 'duration_unit':1, 'external_code':1, 'recyclage_delai':1, 'recyclage_periodicite':1}}],
'as': 'myclass_collection'
}

View File

@ -419,7 +419,7 @@ def Invoice_Partner_Order(diction):
"""
Ajout l'action dans l'historique
"""
## Add to log history
## Add to log history pour la facture
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
history_event_dict = {}
history_event_dict['token'] = diction['token']
@ -432,6 +432,20 @@ def Invoice_Partner_Order(diction):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(history_event_dict))
## Add to log history pour la commande
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
history_event_dict = {}
history_event_dict['token'] = diction['token']
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Facturé. Ref. Facture :"+str(new_invoice_data_header['invoice_header_ref_interne'])
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(history_event_dict))
return True, " La commande a été correctement facturée", str(new_invoice_data_header['invoice_header_ref_interne'])
except Exception as e:

View File

@ -565,6 +565,24 @@ def Add_Partner_Order(diction):
return False, " Impossible de créer la ligne la commande ", False
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(tmp_val)
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Creation "
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
return True, " La commande a été correctement créée", str(data['order_header_ref_interne'])
except Exception as e:
@ -1092,12 +1110,30 @@ def Add_Partner_Quotation(diction):
" Impossible de créer la ligne la commande ")
return False, " Impossible de créer la ligne la commande ", False
return True, " La commande a été correctement créée", str(data['order_header_ref_interne'])
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(tmp_val)
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Creation "
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
return True, " Le devis a été correctement créé", str(data['order_header_ref_interne'])
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 la commande ", False
return False, " Impossible de créer le devis ", False
"""
@ -1575,6 +1611,24 @@ def Update_Partner_Order_Header(diction):
print("acknowledged:", inserted_data_line.acknowledged)
print("matched_count:", inserted_data_line.matched_count)"""
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_header_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Mise à jour "
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
return True, " La commande a été correctement mise à jour"
except Exception as e:
@ -2064,6 +2118,24 @@ def Update_Partner_Quotation_Header(diction):
print("acknowledged:", inserted_data_line.acknowledged)
print("matched_count:", inserted_data_line.matched_count)"""
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_header_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Mise à jour "
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
return True, " Le devis a été correctement mis à jour"
except Exception as e:
@ -2229,6 +2301,25 @@ def Closure_Partner_Quotation_Header(diction):
print("acknowledged:", inserted_data_line.acknowledged)
print("matched_count:", inserted_data_line.matched_count)"""
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_header_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Cloture devis "
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
return True, " Le devis a été correctement mis à jour"
except Exception as e:
@ -2298,6 +2389,10 @@ def Add_Update_Partner_Order_Line(diction):
return local_status, my_partner
mytoken = ""
if("token" in diction.keys() ):
mytoken = diction['token']
data = {}
order_line_formation = ""
@ -2307,6 +2402,25 @@ def Add_Update_Partner_Order_Line(diction):
data['order_line_formation'] = order_line_formation
"""
Verifier que l'article / formation est valide
"""
myclass_data = None
if ("order_line_type_article" in diction.keys()):
if( diction['order_line_type_article'] == "formation"):
myclass_data = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(diction['order_line_formation']),
'partner_owner_recid':str(my_partner['recid'])})
elif( diction['order_line_type_article'] == "produit"):
myclass_data = MYSY_GV.dbname['partner_produit_service'].find_one({'_id': ObjectId(str(diction['order_line_formation'])),
'partner_owner_recid': str(my_partner['recid'])})
if( myclass_data is None ):
mycommon.myprint(
str(inspect.stack()[0][3]) + " L'identifiant de l'article est invalide ")
return False, " L'identifiant de l'article est invalide ",
# Si l'utilisateur a choisi une session, verifier qu'elle est valide
order_line_session_id = ""
if( "order_line_session_id" in diction.keys() and diction['order_line_session_id']):
@ -2580,6 +2694,30 @@ def Add_Update_Partner_Order_Line(diction):
upsert=False,
)
"""
12/10/2024 - loguer les action dans l'historique général
"""
## Add to log history pour l'inscrit 'inscription'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
history_event_dict = {}
history_event_dict['token'] = str(mytoken)
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_header_id'])
history_event_dict['action_date'] = str(now)
article_info = str(myclass_data['_id'])
if (diction['order_line_type_article'] == "formation" and "external_code" in myclass_data.keys() ):
article_info = article_info+', '+str(myclass_data['external_code'])
elif (diction['order_line_type_article'] == "produit" and "code" in myclass_data.keys() ):
article_info = article_info+', '+str(myclass_data['code'])
history_event_dict['action_description'] = "Ajout / MAJ ligne " + str(article_info)
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(history_event_dict))
return True, " La ligne de commande a été correctement ajoutée/mise à jour"
@ -2741,6 +2879,24 @@ def Confirm_Partner_Order_Header_And_Lines(diction):
if( local_retval is False) :
mycommon.myprint(" WARNING : Apres la confirmation, La fonction compute pour l'ordre : "+str(comput_diction)+" n'a pas fonctionnée, ")
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_header_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Confirmation "
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
return True, " Le document a été correctement mise à jour"
except Exception as e:
@ -2874,6 +3030,23 @@ def Annule_Partner_Order_Header_And_Lines(diction):
print("acknowledged:", inserted_data_line.acknowledged)
print("matched_count:", inserted_data_line.matched_count)"""
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_header_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Annulation "
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
return True, " Le document a été correctement annulé"
@ -2997,6 +3170,27 @@ def Delete_Partner_Order_Header_And_Lines(diction):
data = {}
data['partner_owner_recid'] = my_partner['recid']
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_header_id'])
history_event_dict['action_date'] = str(now)
order_info = "Suppression de :"+ str(my_order_data['_id'])
if( "order_header_ref_interne" in my_order_data.keys() ):
order_info = order_info + " Ref.interne : "+str(my_order_data['order_header_ref_interne'])
history_event_dict['action_description'] = order_info
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
delete_data = MYSY_GV.dbname['partner_order_header'].delete_one(
@ -3093,6 +3287,33 @@ def Delete_Partner_Order_Header_And_Lines_From_order_reference(diction):
return False, " L'identifiant de la commande est invalide",
my_order_data = MYSY_GV.dbname['partner_order_header'].find_one(
{'partner_owner_recid': str(my_partner['recid']),
'valide': '1', 'locked': '0',
'order_header_ref_interne': str(order_header_ref_interne)})
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_header_id'])
history_event_dict['action_date'] = str(now)
order_info = "Suppresion de :" + str(my_order_data['_id'])
if ("order_header_ref_interne" in my_order_data.keys()):
order_info = order_info + " Ref.interne : " + str(my_order_data['order_header_ref_interne'])
history_event_dict['action_description'] = order_info
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
delete_data = MYSY_GV.dbname['partner_order_header'].delete_one(
{'partner_owner_recid': str(my_partner['recid']),
@ -3187,7 +3408,32 @@ def Delete_Partner_Order_Line(diction):
str(inspect.stack()[0][3]) + " - L'identifiant de la ligne est invalide ")
return False, " L'identifiant de la ligne est invalide",
my_order_line_data = MYSY_GV.dbname['partner_order_line'].find_one(
{'partner_owner_recid': str(my_partner['recid']), 'order_header_id': str(diction['order_header_id']),
'valide': '1', 'locked': '0',
'_id': ObjectId(str(order_line_id))})
# Gestion de l'historique
# pour la collection 'partner_order_header'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(my_order_line_data['order_header_id'])
history_event_dict['action_date'] = str(now)
order_info = "Suppresion Ligne :" + str(my_order_line_data['_id'])
if ("order_line_formation" in my_order_line_data.keys()):
order_info = order_info + " Line.Ref.interne : " + str(my_order_line_data['order_line_formation'])
history_event_dict['action_description'] = order_info
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(
history_event_dict))
delete_data = MYSY_GV.dbname['partner_order_line'].delete_one(
{'partner_owner_recid': str(my_partner['recid']), 'order_header_id':str(diction['order_header_id']),
@ -3199,8 +3445,6 @@ def Delete_Partner_Order_Line(diction):
str(inspect.stack()[0][3]) + " - Impossible de supprimer la ligne de commande (2) ")
return False, " - Impossible de supprimer la ligne de commande (2) ",
return True, " La ligne de la commande a été correctement supprimée"
except Exception as e:
@ -6979,6 +7223,23 @@ def Send_Partner_Order_By_Email(tab_files, Folder, diction):
{'$set': updata_data})
# pour la collection 'myclass'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = mytoken
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(Order_header_data['_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Envoyé par email à "+str(client_main_mail_tmp)
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(history_event_dict))
return True, " Le document a été envoyé par email à : '"+str(client_main_mail_tmp)+"' "
except Exception as e:
@ -7201,12 +7462,26 @@ def Convert_Quotation_to_Order(diction):
{"$set": data_update},
)
# pour la collection 'myclass'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = mytoken
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Devis converti en Cmd (ref: "+str(new_created_order['order_header_ref_interne'])+") "
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(history_event_dict))
mycommon.myprint(
str(inspect.stack()[0][3]) + " Le devis "+str(Quotation_header_data_tmp['order_header_ref_interne'])+" a été correctement convertie en commande avec le numero : "+ new_created_order['order_header_ref_interne'])
return True, " Le devis a été correctement convertit en commande. Ref. Commande est : "+str(str(new_created_order['order_header_ref_interne'])), str(new_created_order['order_header_ref_interne'])
return True, " Le devis a été correctement convertit en commande. Ref. Commande est : "+str(new_created_order['order_header_ref_interne']), str(new_created_order['order_header_ref_interne'])
except Exception as e:
@ -7344,6 +7619,22 @@ def Order_Ready_To_Invoice(diction):
mycommon.myprint(" WARNING : Apres la confirmation, La fonction compute pour l'ordre : " + str(
comput_diction) + " n'a pas fonctionnée, ")
# logger l'historique
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
history_event_dict = {}
history_event_dict['token'] = token
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(diction['order_header_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Prêt pour facturation"
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(history_event_dict))
return True, " Le document a été correctement mise à jour"
except Exception as e:
@ -7408,6 +7699,7 @@ def Insert_Quotation_To_Session(diction):
if (local_status is not True):
return local_status, my_partner
mytoken = str(diction['token'])
"""
Verifier la validité du devis
@ -7455,6 +7747,8 @@ def Insert_Quotation_To_Session(diction):
"""
Recuperer les lignes du devis
"""
new_session_id = ""
new_session_code_session = ""
nb_resa_line = 0
@ -8693,8 +8987,23 @@ def Send_Quotation_Remind_Level1(diction):
smtpserver.close()
print(" Email envoyé " + str(val))
# pour la collection 'myclass'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
# print(" ####### laaaa diction = ", diction)
return True, " Relance envoyé à : '" + str(toaddrs) + "' "
history_event_dict = {}
history_event_dict['token'] = mytoken
history_event_dict['related_collection'] = "partner_order_header"
history_event_dict['related_collection_recid'] = str(Order_header_data['_id'])
history_event_dict['action_date'] = str(now)
history_event_dict['action_description'] = "Relance Devis envoyée à "+str(toaddrs)
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
if (local_status is False):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(history_event_dict))
return True, " Relance envoyée à : '" + str(toaddrs) + "' "
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()