15/09/2023 - 18h
parent
60b0d7ac6f
commit
4d4435ac93
|
@ -1,11 +1,11 @@
|
|||
<?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="14/09/2023 - 21h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="15/09/2023 - 12h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/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" />
|
||||
<change beforePath="$PROJECT_DIR$/ressources_humaines.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -69,13 +69,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00057" summary="01/08/230- 21h">
|
||||
<created>1690918242182</created>
|
||||
<option name="number" value="00057" />
|
||||
<option name="presentableId" value="LOCAL-00057" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1690918242182</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00058" summary="03/08/23 - 19h">
|
||||
<created>1691082545383</created>
|
||||
<option name="number" value="00058" />
|
||||
|
@ -412,7 +405,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1694717319295</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="106" />
|
||||
<task id="LOCAL-00106" summary="15/09/2023 - 12h">
|
||||
<created>1694773383427</created>
|
||||
<option name="number" value="00106" />
|
||||
<option name="presentableId" value="LOCAL-00106" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1694773383428</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="107" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -427,7 +427,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="23/08/23 - 20h" />
|
||||
<MESSAGE value="24/08/23 - 12h" />
|
||||
<MESSAGE value="25/08/23 - 21h" />
|
||||
<MESSAGE value="26/08/23 - 20h" />
|
||||
|
@ -452,6 +451,7 @@
|
|||
<MESSAGE value="12/09/2023 - 18h" />
|
||||
<MESSAGE value="13/09/2023 - 18h" />
|
||||
<MESSAGE value="14/09/2023 - 21h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="14/09/2023 - 21h" />
|
||||
<MESSAGE value="15/09/2023 - 12h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="15/09/2023 - 12h" />
|
||||
</component>
|
||||
</project>
|
1281
Log/log_file.log
1281
Log/log_file.log
File diff suppressed because one or more lines are too long
126
partner_order.py
126
partner_order.py
|
@ -2920,7 +2920,7 @@ def Get_Given_Partner_Order_Lines(diction):
|
|||
'pipeline': [{'$match': {'$and': [ filt_class_partner_recid]}},
|
||||
{'$project': {'title': 1, 'domaine': 1,
|
||||
'duration': 1,
|
||||
'duration_unit': 1}}],
|
||||
'duration_unit': 1,'external_code':1}}],
|
||||
'as': 'myclass_collection'
|
||||
}
|
||||
}
|
||||
|
@ -2989,6 +2989,7 @@ def Get_Given_Partner_Order_Lines(diction):
|
|||
user['order_line_comment'] = ""
|
||||
|
||||
user['title'] = retval['myclass_collection'][0]['title']
|
||||
user['order_line_formation_external_code'] = retval['myclass_collection'][0]['external_code']
|
||||
user['domaine'] = retval['myclass_collection'][0]['domaine']
|
||||
user['duration'] = retval['myclass_collection'][0]['duration']
|
||||
user['duration_unit'] = retval['myclass_collection'][0]['duration_unit']
|
||||
|
@ -3097,7 +3098,7 @@ def Get_Given_Partner_Order_Lines_From_order_ref_interne(diction):
|
|||
'pipeline': [{'$match': {'$and': [ filt_class_partner_recid]}},
|
||||
{'$project': {'title': 1, 'domaine': 1,
|
||||
'duration': 1,
|
||||
'duration_unit': 1}}],
|
||||
'duration_unit': 1,'external_code':1}}],
|
||||
'as': 'myclass_collection'
|
||||
}
|
||||
}
|
||||
|
@ -3164,6 +3165,7 @@ def Get_Given_Partner_Order_Lines_From_order_ref_interne(diction):
|
|||
user['order_line_comment'] = ""
|
||||
|
||||
user['title'] = retval['myclass_collection'][0]['title']
|
||||
user['order_line_formation_external_code'] = retval['myclass_collection'][0]['external_code']
|
||||
user['domaine'] = retval['myclass_collection'][0]['domaine']
|
||||
user['duration'] = retval['myclass_collection'][0]['duration']
|
||||
user['duration_unit'] = retval['myclass_collection'][0]['duration_unit']
|
||||
|
@ -3364,7 +3366,7 @@ def Get_List_Partner_Order_no_filter(diction):
|
|||
{'$lookup':
|
||||
{
|
||||
'from': 'partner_order_line',
|
||||
'localField': "ressource_humaine_Id",
|
||||
'localField': "partner_order_header_Id",
|
||||
'foreignField': 'order_header_id',
|
||||
'pipeline': [{'$match': {'$and': [{}, {
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'valide': '1'}]}}, ],
|
||||
|
@ -3433,7 +3435,7 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
Verification des input acceptés. les filtres accepté sont :
|
||||
- ref_interne,
|
||||
"""
|
||||
field_list = ['token', 'date_cmd_debut', 'date_cmd_fin', 'client_nom', 'ref_interne', 'ref_externe']
|
||||
field_list = ['token', 'date_cmd_debut', 'date_cmd_fin', 'client_nom', 'ref_interne', 'ref_externe', 'formation']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -3479,6 +3481,23 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
#print(' ### filt_client_nom = ', filt_client_nom)
|
||||
|
||||
|
||||
|
||||
filt_formation_external_code = {}
|
||||
sub_filt_formation_external_code = {}
|
||||
Lists_partner_formation_internal_url = []
|
||||
if ("formation" in diction.keys()):
|
||||
sub_filt_formation_external_code = {'external_code': {'$regex': str(diction['formation']), "$options": "i"},
|
||||
'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}
|
||||
|
||||
# Recuperation des '_id' des formation dont le nom match en regexp
|
||||
print(" ### sub_filt_formation_external_code = ", sub_filt_formation_external_code)
|
||||
for Lists_partner_formation_Data in MYSY_GV.dbname['myclass'].find(sub_filt_formation_external_code, {'internal_url': 1}):
|
||||
Lists_partner_formation_internal_url.append(str(Lists_partner_formation_Data['internal_url']))
|
||||
|
||||
filt_formation_external_code = {'order_line_formation': {'$in': Lists_partner_formation_internal_url }}
|
||||
|
||||
|
||||
|
||||
filt_ref_interne = {}
|
||||
if ("ref_interne" in diction.keys()):
|
||||
filt_ref_interne = {
|
||||
|
@ -3498,9 +3517,9 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
{'$lookup':
|
||||
{
|
||||
'from': 'partner_order_line',
|
||||
'localField': "ressource_humaine_Id",
|
||||
'localField': "partner_order_header_Id",
|
||||
'foreignField': 'order_header_id',
|
||||
'pipeline': [{'$match': {'$and': [{}, {
|
||||
'pipeline': [{'$match': {'$and': [filt_formation_external_code, {
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'valide': '1'}]}}, ],
|
||||
'as': 'partner_order_line_collection'
|
||||
}
|
||||
|
@ -3537,60 +3556,61 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
|
||||
|
||||
for New_retVal in MYSY_GV.dbname['partner_order_header'].aggregate(new_myquery_find_order):
|
||||
user = New_retVal
|
||||
# Si le champ 'order_header_client_id' alors on va chercher le nom du client
|
||||
if ('order_header_client_id' in New_retVal.keys()):
|
||||
Client_data = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(str(New_retVal['order_header_client_id'])), 'valide': '1', 'locked': '0',
|
||||
'partner_recid': str(my_partner['recid'])})
|
||||
if ('partner_order_line_collection' in New_retVal.keys() and len( New_retVal['partner_order_line_collection']) > 0):
|
||||
user = New_retVal
|
||||
# Si le champ 'order_header_client_id' alors on va chercher le nom du client
|
||||
if ('order_header_client_id' in New_retVal.keys()):
|
||||
Client_data = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(str(New_retVal['order_header_client_id'])), 'valide': '1', 'locked': '0',
|
||||
'partner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (Client_data and 'nom' in Client_data.keys()):
|
||||
user['order_header_client_nom'] = str(Client_data['nom'])
|
||||
if (Client_data and 'nom' in Client_data.keys()):
|
||||
user['order_header_client_nom'] = str(Client_data['nom'])
|
||||
|
||||
# Si le champ 'order_header_vendeur_id' alors on va chercher le nom et prenom du vendeur (employe)
|
||||
if ('order_header_vendeur_id' in New_retVal.keys()):
|
||||
Employee_data = MYSY_GV.dbname['ressource_humaine'].find_one(
|
||||
{'_id': ObjectId(str(New_retVal['order_header_vendeur_id'])), 'valide': '1', 'locked': '0',
|
||||
'partner_recid': str(my_partner['recid'])})
|
||||
# Si le champ 'order_header_vendeur_id' alors on va chercher le nom et prenom du vendeur (employe)
|
||||
if ('order_header_vendeur_id' in New_retVal.keys()):
|
||||
Employee_data = MYSY_GV.dbname['ressource_humaine'].find_one(
|
||||
{'_id': ObjectId(str(New_retVal['order_header_vendeur_id'])), 'valide': '1', 'locked': '0',
|
||||
'partner_recid': str(my_partner['recid'])})
|
||||
|
||||
order_header_vendeur_nom_prenom = ""
|
||||
if (Employee_data and 'nom' in Employee_data.keys()):
|
||||
order_header_vendeur_nom_prenom = str(Employee_data['nom'])
|
||||
order_header_vendeur_nom_prenom = ""
|
||||
if (Employee_data and 'nom' in Employee_data.keys()):
|
||||
order_header_vendeur_nom_prenom = str(Employee_data['nom'])
|
||||
|
||||
if (Employee_data and 'prenom' in Employee_data.keys()):
|
||||
order_header_vendeur_nom_prenom = str(order_header_vendeur_nom_prenom) + " " + str(
|
||||
Employee_data['prenom'])
|
||||
if (Employee_data and 'prenom' in Employee_data.keys()):
|
||||
order_header_vendeur_nom_prenom = str(order_header_vendeur_nom_prenom) + " " + str(
|
||||
Employee_data['prenom'])
|
||||
|
||||
user['order_header_vendeur_nom_prenom'] = str(order_header_vendeur_nom_prenom)
|
||||
user['order_header_vendeur_nom_prenom'] = str(order_header_vendeur_nom_prenom)
|
||||
|
||||
|
||||
if( filter_date_debut and filter_date_fin ):
|
||||
if ( datetime.strptime(str(New_retVal['order_header_date_cmd'])[0:10], '%d/%m/%Y') >= datetime.strptime(str(filter_date_debut)[0:10], '%d/%m/%Y') and
|
||||
datetime.strptime(str(New_retVal['order_header_date_cmd'])[0:10], '%d/%m/%Y') <= datetime.strptime(str(filter_date_fin)[0:10], '%d/%m/%Y') ):
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
if( filter_date_debut and filter_date_fin ):
|
||||
if ( datetime.strptime(str(New_retVal['order_header_date_cmd'])[0:10], '%d/%m/%Y') >= datetime.strptime(str(filter_date_debut)[0:10], '%d/%m/%Y') and
|
||||
datetime.strptime(str(New_retVal['order_header_date_cmd'])[0:10], '%d/%m/%Y') <= datetime.strptime(str(filter_date_fin)[0:10], '%d/%m/%Y') ):
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
elif ( filter_date_debut ):
|
||||
if ( datetime.strptime(str(New_retVal['order_header_date_cmd'])[0:10], '%d/%m/%Y') >= datetime.strptime(str(filter_date_debut)[0:10], '%d/%m/%Y') ):
|
||||
elif ( filter_date_debut ):
|
||||
if ( datetime.strptime(str(New_retVal['order_header_date_cmd'])[0:10], '%d/%m/%Y') >= datetime.strptime(str(filter_date_debut)[0:10], '%d/%m/%Y') ):
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
elif ( filter_date_fin ):
|
||||
if ( datetime.strptime(str(New_retVal['order_header_date_cmd'])[0:10], '%d/%m/%Y') <= datetime.strptime(str(filter_date_fin)[0:10], '%d/%m/%Y') ):
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
else:
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
elif ( filter_date_fin ):
|
||||
if ( datetime.strptime(str(New_retVal['order_header_date_cmd'])[0:10], '%d/%m/%Y') <= datetime.strptime(str(filter_date_fin)[0:10], '%d/%m/%Y') ):
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
else:
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
|
||||
#print(" #### nb_result = ", val_tmp)
|
||||
return True, RetObject
|
||||
|
||||
|
||||
|
@ -3671,7 +3691,8 @@ def Get_Given_Line_Of_Partner_Order_Lines(diction):
|
|||
'pipeline': [{'$match': {'$and': [ filt_class_partner_recid]}},
|
||||
{'$project': {'title': 1, 'domaine': 1,
|
||||
'duration': 1,
|
||||
'duration_unit': 1}}],
|
||||
'duration_unit': 1,
|
||||
'external_code':1}}],
|
||||
'as': 'myclass_collection'
|
||||
}
|
||||
}
|
||||
|
@ -3739,6 +3760,7 @@ def Get_Given_Line_Of_Partner_Order_Lines(diction):
|
|||
user['order_line_comment'] = ""
|
||||
|
||||
user['title'] = retval['myclass_collection'][0]['title']
|
||||
user['order_line_formation_external_code'] = retval['myclass_collection'][0]['external_code']
|
||||
user['domaine'] = retval['myclass_collection'][0]['domaine']
|
||||
user['duration'] = retval['myclass_collection'][0]['duration']
|
||||
user['duration_unit'] = retval['myclass_collection'][0]['duration_unit']
|
||||
|
@ -4109,7 +4131,8 @@ def GerneratePDF_Partner_Order(diction):
|
|||
'pipeline': [{'$match': {'$and': [filt_class_partner_recid]}},
|
||||
{'$project': {'title': 1, 'domaine': 1,
|
||||
'duration': 1,
|
||||
'duration_unit': 1}}],
|
||||
'duration_unit': 1,
|
||||
'external_code':1}}],
|
||||
'as': 'myclass_collection'
|
||||
}
|
||||
}
|
||||
|
@ -4176,6 +4199,7 @@ def GerneratePDF_Partner_Order(diction):
|
|||
user['order_line_comment'] = ""
|
||||
|
||||
user['title'] = retval['myclass_collection'][0]['title']
|
||||
user['order_line_formation_external_code'] = retval['myclass_collection'][0]['external_code']
|
||||
user['domaine'] = retval['myclass_collection'][0]['domaine']
|
||||
user['duration'] = retval['myclass_collection'][0]['duration']
|
||||
user['duration_unit'] = retval['myclass_collection'][0]['duration_unit']
|
||||
|
@ -4356,7 +4380,8 @@ def Send_Partner_Order_By_Email(diction):
|
|||
'pipeline': [{'$match': {'$and': [filt_class_partner_recid]}},
|
||||
{'$project': {'title': 1, 'domaine': 1,
|
||||
'duration': 1,
|
||||
'duration_unit': 1}}],
|
||||
'duration_unit': 1,
|
||||
'external_code':1}}],
|
||||
'as': 'myclass_collection'
|
||||
}
|
||||
}
|
||||
|
@ -4423,6 +4448,7 @@ def Send_Partner_Order_By_Email(diction):
|
|||
user['order_line_comment'] = ""
|
||||
|
||||
user['title'] = retval['myclass_collection'][0]['title']
|
||||
user['order_line_formation_external_code'] = retval['myclass_collection'][0]['external_code']
|
||||
user['domaine'] = retval['myclass_collection'][0]['domaine']
|
||||
user['duration'] = retval['myclass_collection'][0]['duration']
|
||||
user['duration_unit'] = retval['myclass_collection'][0]['duration_unit']
|
||||
|
@ -4469,7 +4495,7 @@ def Send_Partner_Order_By_Email(diction):
|
|||
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)
|
||||
|
||||
print(" #### sourceHtml = ", sourceHtml)
|
||||
#print(" #### sourceHtml = ", sourceHtml)
|
||||
|
||||
|
||||
print("debut envoi mail de test ")
|
||||
|
|
|
@ -803,6 +803,7 @@ def Get_List_Profil_Ressource_Humaine(diction):
|
|||
|
||||
"""
|
||||
Recuperation de la liste des ressources humaines avec des filtres sur
|
||||
Recuperation de la liste des ressources humaines avec des filtres sur
|
||||
- nom
|
||||
- email
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue