04/09/2024 - 23h
parent
fecc9123ee
commit
d50be3292f
|
@ -1,14 +1,13 @@
|
|||
<?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/09/2024 - 20:00">
|
||||
<change afterPath="$PROJECT_DIR$/type_cours.py" afterDir="false" />
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="03/09/2024 - 20:00">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Dashbord_queries/BPF.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/BPF.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$/domaine_formation_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/domaine_formation_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/model_planning_sequence_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/model_planning_sequence_mgt.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$/unite_enseignement_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/unite_enseignement_mgt.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -79,13 +78,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00340" summary="26/06/2024 - 19h30">
|
||||
<created>1719423411649</created>
|
||||
<option name="number" value="00340" />
|
||||
<option name="presentableId" value="LOCAL-00340" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1719423411649</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00341" summary="ww">
|
||||
<created>1719519702779</created>
|
||||
<option name="number" value="00341" />
|
||||
|
@ -422,7 +414,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1725213634327</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="389" />
|
||||
<task id="LOCAL-00389" summary="03/09/2024 - 20:00">
|
||||
<created>1725389636274</created>
|
||||
<option name="number" value="00389" />
|
||||
<option name="presentableId" value="LOCAL-00389" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1725389636275</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="390" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -464,7 +463,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="03/08/2024 - 18h30" />
|
||||
<MESSAGE value="08/08/2024 - 20h30" />
|
||||
<MESSAGE value="08/08/2024 - 20h32" />
|
||||
<MESSAGE value="08/08/2024 - 20h32s" />
|
||||
|
@ -489,6 +487,7 @@
|
|||
<MESSAGE value="31/08/2024 - 18h50" />
|
||||
<MESSAGE value="01/09/2024 - 14:00" />
|
||||
<MESSAGE value="01/09/2024 - 20:00" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="01/09/2024 - 20:00" />
|
||||
<MESSAGE value="03/09/2024 - 20:00" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="03/09/2024 - 20:00" />
|
||||
</component>
|
||||
</project>
|
7094
Log/log_file.log
7094
Log/log_file.log
File diff suppressed because it is too large
Load Diff
18
main.py
18
main.py
|
@ -5802,8 +5802,8 @@ def Get_List_Partner_Order_no_filter():
|
|||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Partner_Order_no_filter payload = ",payload)
|
||||
status, retval = partner_order.Get_List_Partner_Order_no_filter(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
status, retval, total_data = partner_order.Get_List_Partner_Order_no_filter(payload)
|
||||
return jsonify(status=status, message=retval, total_data=total_data)
|
||||
|
||||
|
||||
"""
|
||||
|
@ -5815,8 +5815,8 @@ def Get_List_Partner_Order_with_filter():
|
|||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Partner_Order_with_filter payload = ",payload)
|
||||
status, retval = partner_order.Get_List_Partner_Order_with_filter(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
status, retval, total_data = partner_order.Get_List_Partner_Order_with_filter(payload)
|
||||
return jsonify(status=status, message=retval, total_data=total_data)
|
||||
|
||||
|
||||
"""
|
||||
|
@ -6452,8 +6452,8 @@ def Get_List_Partner_Invoice_no_filter():
|
|||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Partner_Invoice_no_filter payload = ",payload)
|
||||
status, retval = partner_invoice.Get_List_Partner_Invoice_no_filter(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
status, retval, total_data = partner_invoice.Get_List_Partner_Invoice_no_filter(payload)
|
||||
return jsonify(status=status, message=retval, total_data=total_data)
|
||||
|
||||
|
||||
"""
|
||||
|
@ -6471,8 +6471,8 @@ def Get_List_Partner_Invoice_with_filter():
|
|||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Partner_Invoice_with_filter payload = ",payload)
|
||||
status, retval = partner_invoice.Get_List_Partner_Invoice_with_filter(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
status, retval, total_data = partner_invoice.Get_List_Partner_Invoice_with_filter(payload)
|
||||
return jsonify(status=status, message=retval, total_data=total_data)
|
||||
|
||||
|
||||
"""
|
||||
|
@ -10906,7 +10906,7 @@ choisir un planning modele
|
|||
def Apply_Planning_Model_To_Session():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Apply_Planning_Model_To_Session payload = ",payload)
|
||||
print(" ### Apply_Planning_Model_To_Session payload = no display, trop lng",)
|
||||
status, retval = model_planning_sequence_mgt.Apply_Planning_Model_To_Session(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
|
|
@ -122,6 +122,7 @@ def Add_Sequence_Planning_Model(diction):
|
|||
for New_retVal in MYSY_GV.dbname['session_formation_sequence'].find({'session_id':str(diction['session_id']),
|
||||
'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}):
|
||||
|
||||
|
||||
user = New_retVal
|
||||
del user['_id']
|
||||
if( "update_by" in user.keys() ):
|
||||
|
@ -522,18 +523,18 @@ def Get_Given_Sequence_Planning_Model_With_Option(diction):
|
|||
lines_data.append(user)
|
||||
|
||||
|
||||
print(" ### 1ere date du planning precedent est : ", str(lines_data[0]['sequence_start'])[0:10])
|
||||
#print(" ### 1ere date du planning precedent est : ", str(lines_data[0]['sequence_start'])[0:10])
|
||||
|
||||
|
||||
"""
|
||||
Traiter l'application des options au calendrier
|
||||
"""
|
||||
print(" jounree_modele_id = ", jounree_modele_id, " date_debut = ", date_debut)
|
||||
#print(" jounree_modele_id = ", jounree_modele_id, " date_debut = ", date_debut)
|
||||
if( jounree_modele_id and date_debut ):
|
||||
mytoday = datetime.today().strftime("%d/%m/%Y")
|
||||
decalage_planning = (datetime.strptime(str(date_debut), '%d/%m/%Y') - datetime.strptime(str(str(lines_data[0]['sequence_start'])[0:10]), '%d/%m/%Y') ).days
|
||||
|
||||
print(" ### ce planning doit etre appliqué avec un de calage de "+str(decalage_planning)+" jours ")
|
||||
#print(" ### ce planning doit etre appliqué avec un de calage de "+str(decalage_planning)+" jours ")
|
||||
|
||||
|
||||
for planning_line in lines_data:
|
||||
|
@ -576,30 +577,30 @@ def Get_Given_Sequence_Planning_Model_With_Option(diction):
|
|||
|
||||
new_planning_line_sequence_end_datetime = new_planning_line_sequence_start_datetime+ timedelta(seconds=duree_sequence.seconds)
|
||||
|
||||
print(" init_planning_line_sequence_start_datetime = ", planning_line_sequence_start_datetime)
|
||||
print(" init_planning_line_sequence_end_datetime = ", planning_line_sequence_end_datetime)
|
||||
#print(" init_planning_line_sequence_start_datetime = ", planning_line_sequence_start_datetime)
|
||||
#print(" init_planning_line_sequence_end_datetime = ", planning_line_sequence_end_datetime)
|
||||
|
||||
print(" declage en jour = ", decalage_planning)
|
||||
#print(" declage en jour = ", decalage_planning)
|
||||
|
||||
print(" new_planning_line_sequence_start_datetime = ", new_planning_line_sequence_start_datetime)
|
||||
print(" new_planning_line_sequence_end_datetime = ", new_planning_line_sequence_end_datetime)
|
||||
#print(" new_planning_line_sequence_start_datetime = ", new_planning_line_sequence_start_datetime)
|
||||
#print(" new_planning_line_sequence_end_datetime = ", new_planning_line_sequence_end_datetime)
|
||||
|
||||
date_jour = str(new_planning_line_sequence_start_datetime.strftime("%Y-%m-%d"))
|
||||
jour_name = new_planning_line_sequence_start_datetime.strftime("%A")
|
||||
|
||||
print(" date_jour = ", date_jour)
|
||||
print(" jour_name = ", jour_name)
|
||||
#print(" date_jour = ", date_jour)
|
||||
#print(" jour_name = ", jour_name)
|
||||
|
||||
is_off_day_of_week = "0"
|
||||
if (str(jour_name) in jounree_modele_data.keys()):
|
||||
is_off_day_of_week = jounree_modele_data[str(jour_name)]['is_off_day']
|
||||
|
||||
if (date_jour not in jounree_modele_data['date_off'] and is_off_day_of_week != "1"):
|
||||
print(" DATE / JOUR OKKKKK")
|
||||
#if (date_jour not in jounree_modele_data['date_off'] and is_off_day_of_week != "1"):
|
||||
#print(" DATE / JOUR OKKKKK")
|
||||
|
||||
while (date_jour in jounree_modele_data['date_off'] or is_off_day_of_week == "1"):
|
||||
print(str(date_jour)+" est KOOOO ")
|
||||
print(str(jour_name) + " est KOOOO ")
|
||||
#print(str(date_jour)+" est KOOOO ")
|
||||
#print(str(jour_name) + " est KOOOO ")
|
||||
|
||||
decalage_planning = decalage_planning + 1
|
||||
new_planning_line_sequence_start_datetime = planning_line_sequence_start_datetime + timedelta(
|
||||
|
@ -608,8 +609,8 @@ def Get_Given_Sequence_Planning_Model_With_Option(diction):
|
|||
new_planning_line_sequence_end_datetime = new_planning_line_sequence_start_datetime + timedelta(
|
||||
seconds=duree_sequence.seconds)
|
||||
|
||||
print(" new_planning_line_sequence_start_datetime = ", new_planning_line_sequence_start_datetime)
|
||||
print(" new_planning_line_sequence_end_datetime = ", new_planning_line_sequence_end_datetime)
|
||||
#print(" new_planning_line_sequence_start_datetime = ", new_planning_line_sequence_start_datetime)
|
||||
#print(" new_planning_line_sequence_end_datetime = ", new_planning_line_sequence_end_datetime)
|
||||
|
||||
date_jour = str(new_planning_line_sequence_start_datetime.strftime("%Y-%m-%d"))
|
||||
jour_name = new_planning_line_sequence_start_datetime.strftime("%A")
|
||||
|
@ -617,8 +618,8 @@ def Get_Given_Sequence_Planning_Model_With_Option(diction):
|
|||
if (str(jour_name) in jounree_modele_data.keys()):
|
||||
is_off_day_of_week = jounree_modele_data[str(jour_name)]['is_off_day']
|
||||
|
||||
print(" new_planning_line_sequence_start_datetime = ", new_planning_line_sequence_start_datetime.strftime("%d/%m/%Y %H:%M"))
|
||||
print(" new_planning_line_sequence_end_datetime = ", new_planning_line_sequence_end_datetime.strftime("%d/%m/%Y %H:%M"))
|
||||
#print(" new_planning_line_sequence_start_datetime = ", new_planning_line_sequence_start_datetime.strftime("%d/%m/%Y %H:%M"))
|
||||
#print(" new_planning_line_sequence_end_datetime = ", new_planning_line_sequence_end_datetime.strftime("%d/%m/%Y %H:%M"))
|
||||
|
||||
new_planning_line_node['new_sequence_start'] = new_planning_line_sequence_start_datetime.strftime("%d/%m/%Y %H:%M")
|
||||
new_planning_line_node['new_sequence_end'] = new_planning_line_sequence_end_datetime.strftime("%d/%m/%Y %H:%M")
|
||||
|
@ -689,8 +690,6 @@ def Apply_Planning_Model_To_Session(diction):
|
|||
tab_sequence_modele = diction['tab_sequence_modele']
|
||||
tab_sequence_modele_JSON = ast.literal_eval(tab_sequence_modele)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Suppression de la planification existant de cette session s'il en existe
|
||||
1 - Suppression dans "session_formation_sequence_affectation"
|
||||
|
@ -715,17 +714,15 @@ def Apply_Planning_Model_To_Session(diction):
|
|||
for new_sequence in tab_sequence_modele_JSON:
|
||||
|
||||
local_start = str(new_sequence['start'])
|
||||
local_start_datetime = datetime.strptime(local_start, "%Y-%m-%dT%H:%M:%S.%fZ")
|
||||
local_start_datetime = datetime.strptime(local_start, "%d/%m/%Y %H:%M")
|
||||
local_start_datetime_str = str(local_start_datetime.strftime('%d/%m/%Y %H:%M'))
|
||||
|
||||
local_end = str(new_sequence['start'])
|
||||
local_end_datetime = datetime.strptime(local_end, "%Y-%m-%dT%H:%M:%S.%fZ")
|
||||
local_end_datetime_str = str(local_end_datetime.strftime('%m/%d/%Y %H:%M'))
|
||||
|
||||
|
||||
local_end = str(new_sequence['end'])
|
||||
local_end_datetime = datetime.strptime(local_end, "%d/%m/%Y %H:%M")
|
||||
local_end_datetime_str = str(local_end_datetime.strftime('%d/%m/%Y %H:%M'))
|
||||
|
||||
local_node = {}
|
||||
|
||||
local_node['session_id'] = str(diction['session_id'])
|
||||
local_node['sequence_title'] = str(new_sequence['title'])
|
||||
local_node['sequence_start'] = str(local_start_datetime_str)
|
||||
|
@ -743,12 +740,13 @@ def Apply_Planning_Model_To_Session(diction):
|
|||
local_node['locked'] = "0"
|
||||
local_node['partner_owner_recid'] = str(my_partner['recid'])
|
||||
local_node['update_by'] = str(my_partner['_id'])
|
||||
local_node['date_update'] = str(datetime.now())
|
||||
|
||||
|
||||
local_node['grp_apprenant_id'] = ""
|
||||
local_node['ue_id'] = ""
|
||||
local_node['ue_planif_line_id'] = ""
|
||||
|
||||
|
||||
MYSY_GV.dbname['session_formation_sequence'].insert_one(local_node)
|
||||
|
||||
|
||||
|
|
|
@ -1178,13 +1178,23 @@ def Get_List_Partner_Invoice_no_filter(diction):
|
|||
|
||||
#print(" ### orders new_myquery_find_invoice = ", new_myquery_find_invoice)
|
||||
RetObject = []
|
||||
val_tmp = 1
|
||||
val_tmp = 0
|
||||
|
||||
somme_header_ca_ht = 0
|
||||
nb_header_invoice = 0
|
||||
|
||||
for New_retVal in MYSY_GV.dbname['partner_invoice_header'].aggregate(new_myquery_find_invoice):
|
||||
user = New_retVal
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
"""
|
||||
recuperer le CA globale et le nombre de factures
|
||||
"""
|
||||
if ("total_header_hors_taxe_before_header_reduction" in New_retVal.keys()):
|
||||
somme_header_ca_ht = somme_header_ca_ht + mycommon.tryFloat( str(New_retVal['total_header_hors_taxe_before_header_reduction']))
|
||||
nb_header_invoice = nb_header_invoice + 1
|
||||
|
||||
# Convertir la date facture en jj/mm/aaaa
|
||||
if( 'invoice_date' in New_retVal.keys()):
|
||||
date_jjmmaaa = str(New_retVal['invoice_date'])[0:10]
|
||||
|
@ -1245,10 +1255,22 @@ def Get_List_Partner_Invoice_no_filter(diction):
|
|||
if( "credit_note_ref" not in New_retVal.keys() ):
|
||||
user['credit_note_ref'] = ""
|
||||
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
||||
total_data = []
|
||||
node = {}
|
||||
node['somme_header_ca_ht'] = str(somme_header_ca_ht)
|
||||
node['nb_header_invoice'] = str(nb_header_invoice)
|
||||
|
||||
total_data.append(node)
|
||||
|
||||
total_data = mycommon.JSONEncoder().encode(total_data)
|
||||
|
||||
#print(" ### RetObject = ", RetObject)
|
||||
|
||||
return True, RetObject, total_data
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
@ -1274,7 +1296,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
- ref_interne,
|
||||
"""
|
||||
field_list = ['token', 'date_facture_debut', 'date_facture_fin', 'client_nom', 'ref_interne_cmd',
|
||||
'ref_interne_invoice', 'ref_externe', 'formation']
|
||||
'ref_interne_invoice', 'ref_externe', 'formation', 'order_header_client_id']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -1320,7 +1342,6 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
#print(' ### filt_client_nom = ', filt_client_nom)
|
||||
|
||||
|
||||
|
||||
filt_formation_external_code = {}
|
||||
sub_filt_formation_external_code = {}
|
||||
Lists_partner_formation_internal_url = []
|
||||
|
@ -1336,6 +1357,10 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
filt_formation_external_code = {'order_line_formation': {'$in': Lists_partner_formation_internal_url }}
|
||||
|
||||
|
||||
filt_client_id = {}
|
||||
if ("order_header_client_id" in diction.keys() and diction['order_header_client_id']):
|
||||
filt_client_id = {'order_header_client_id': str(diction['order_header_client_id'])}
|
||||
|
||||
|
||||
filt_ref_interne_cmd = {}
|
||||
if ("ref_interne_cmd" in diction.keys()):
|
||||
|
@ -1354,8 +1379,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
'order_header_ref_client': {'$regex': str(diction['ref_externe']), "$options": "i"}}
|
||||
|
||||
|
||||
|
||||
find_qry = {'$and': [{'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}, filt_client_nom, filt_ref_interne_cmd, filt_ref_interne_invoice, filt_ref_externe]}
|
||||
find_qry = {'$and': [{'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}, filt_client_nom, filt_ref_interne_cmd, filt_ref_interne_invoice, filt_ref_externe, filt_client_id]}
|
||||
|
||||
new_myquery_find_order = [{'$match': find_qry},
|
||||
{"$addFields": {"partner_invoice_header_Id": {"$toString": "$_id"}}},
|
||||
|
@ -1372,9 +1396,9 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
]
|
||||
|
||||
|
||||
print(" ### Get_List_Partner_Order_with_filter orders new_myquery_find_order = ", new_myquery_find_order)
|
||||
#print(" ### Get_List_Partner_Order_with_filter orders new_myquery_find_order = ", new_myquery_find_order)
|
||||
RetObject = []
|
||||
val_tmp = 1
|
||||
val_tmp = 0
|
||||
|
||||
filter_date_debut = ""
|
||||
if ("date_facture_debut" in diction.keys()):
|
||||
|
@ -1398,10 +1422,19 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
3]) + " La date de fin (filtre) n'est pas au format 'jj/mm/aaaa' ")
|
||||
return False, " La date de fin (filtre) n'est pas au format 'jj/mm/aaaa'"
|
||||
|
||||
|
||||
|
||||
somme_header_ca_ht = 0
|
||||
nb_header_invoice = 0
|
||||
for New_retVal in MYSY_GV.dbname['partner_invoice_header'].aggregate(new_myquery_find_order):
|
||||
|
||||
"""
|
||||
recuperer le CA globale et le nombre de factures
|
||||
"""
|
||||
if("total_header_hors_taxe_before_header_reduction" in New_retVal.keys() ):
|
||||
somme_header_ca_ht = somme_header_ca_ht + mycommon.tryFloat(str(New_retVal['total_header_hors_taxe_before_header_reduction']))
|
||||
nb_header_invoice = nb_header_invoice + 1
|
||||
|
||||
|
||||
|
||||
if ('partner_invoice_line_collection' in New_retVal.keys() and len( New_retVal['partner_invoice_line_collection']) > 0):
|
||||
user = New_retVal
|
||||
|
||||
|
@ -1487,8 +1520,15 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
total_data = []
|
||||
node = {}
|
||||
node['somme_header_ca_ht'] = str(somme_header_ca_ht)
|
||||
node['nb_header_invoice'] = str(nb_header_invoice)
|
||||
total_data.append(node)
|
||||
|
||||
total_data = mycommon.JSONEncoder().encode(total_data)
|
||||
#print(" #### nb_result = ", val_tmp)
|
||||
return True, RetObject
|
||||
return True, RetObject, total_data
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -4143,13 +4143,25 @@ def Get_List_Partner_Order_no_filter(diction):
|
|||
|
||||
print(" ### orders new_myquery_find_order = ", new_myquery_find_order)
|
||||
RetObject = []
|
||||
val_tmp = 1
|
||||
val_tmp = 0
|
||||
|
||||
somme_order_ca_ht = 0
|
||||
nb_header_order = 0
|
||||
|
||||
for New_retVal in MYSY_GV.dbname['partner_order_header'].aggregate(new_myquery_find_order):
|
||||
user = New_retVal
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
"""
|
||||
recuperer le CA globale et le nombre de factures
|
||||
"""
|
||||
if ("total_lines_hors_taxe_before_lines_reduction" in New_retVal.keys()):
|
||||
somme_order_ca_ht = somme_order_ca_ht + mycommon.tryFloat(
|
||||
str(New_retVal['total_lines_hors_taxe_before_lines_reduction']))
|
||||
nb_header_order = nb_header_order + 1
|
||||
|
||||
|
||||
# Si le champ 'order_header_condition_paiement_id' alors on va chercher le code de la condition de paiement
|
||||
paiement_ction_code = ""
|
||||
if ('order_header_condition_paiement_id' in New_retVal.keys() and New_retVal['order_header_condition_paiement_id']):
|
||||
|
@ -4184,11 +4196,20 @@ def Get_List_Partner_Order_no_filter(diction):
|
|||
|
||||
user['order_header_vendeur_nom_prenom'] = str(order_header_vendeur_nom_prenom)
|
||||
|
||||
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
#RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
||||
total_data = []
|
||||
node = {}
|
||||
node['somme_order_ca_ht'] = str(somme_order_ca_ht)
|
||||
node['nb_header_order'] = str(nb_header_order)
|
||||
|
||||
total_data.append(node)
|
||||
total_data = mycommon.JSONEncoder().encode(total_data)
|
||||
|
||||
|
||||
return True, RetObject, total_data
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
@ -4214,7 +4235,7 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
- ref_interne,
|
||||
"""
|
||||
field_list = ['token', 'date_cmd_debut', 'date_cmd_fin', 'client_nom', 'ref_interne', 'ref_externe',
|
||||
'formation', 'code_session']
|
||||
'formation', 'code_session', 'order_header_client_id']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -4291,6 +4312,12 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
filt_code_session_id = {'order_line_session_id': {'$in': Lists_partner_session_id}}
|
||||
|
||||
|
||||
|
||||
filt_client_id = {}
|
||||
if ("order_header_client_id" in diction.keys() and diction['order_header_client_id']):
|
||||
filt_client_id = {'order_header_client_id': str(diction['order_header_client_id'])}
|
||||
|
||||
|
||||
filt_ref_interne = {}
|
||||
if ("ref_interne" in diction.keys()):
|
||||
filt_ref_interne = {
|
||||
|
@ -4303,7 +4330,7 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
|
||||
|
||||
|
||||
find_qry = {'$and': [{'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}, filt_client_nom, filt_ref_interne, filt_ref_externe]}
|
||||
find_qry = {'$and': [{'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}, filt_client_nom, filt_ref_interne, filt_ref_externe, filt_client_id]}
|
||||
|
||||
new_myquery_find_order = [{'$match': find_qry},
|
||||
{"$addFields": {"partner_order_header_Id": {"$toString": "$_id"}}},
|
||||
|
@ -4323,7 +4350,7 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
|
||||
print(" ### Get_List_Partner_Order_with_filter orders new_myquery_find_order = ", new_myquery_find_order)
|
||||
RetObject = []
|
||||
val_tmp = 1
|
||||
val_tmp = 0
|
||||
|
||||
filter_date_debut = ""
|
||||
if ("date_cmd_debut" in diction.keys()):
|
||||
|
@ -4347,9 +4374,18 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
3]) + " La date de fin (filtre) n'est pas au format 'jj/mm/aaaa' ")
|
||||
return False, " La date de fin (filtre) n'est pas au format 'jj/mm/aaaa'"
|
||||
|
||||
|
||||
somme_order_ca_ht = 0
|
||||
nb_header_order = 0
|
||||
|
||||
for New_retVal in MYSY_GV.dbname['partner_order_header'].aggregate(new_myquery_find_order):
|
||||
|
||||
"""
|
||||
recuperer le CA globale et le nombre de factures
|
||||
"""
|
||||
if ("total_lines_hors_taxe_before_lines_reduction" in New_retVal.keys()):
|
||||
somme_order_ca_ht = somme_order_ca_ht + mycommon.tryFloat(str(New_retVal['total_lines_hors_taxe_before_lines_reduction']))
|
||||
nb_header_order = nb_header_order + 1
|
||||
|
||||
if ('partner_order_line_collection' in New_retVal.keys() and len( New_retVal['partner_order_line_collection']) > 0):
|
||||
user = New_retVal
|
||||
|
||||
|
@ -4397,7 +4433,6 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
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))
|
||||
|
||||
elif ( filter_date_debut ):
|
||||
|
@ -4418,8 +4453,18 @@ def Get_List_Partner_Order_with_filter(diction):
|
|||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
total_data = []
|
||||
node = {}
|
||||
node['somme_order_ca_ht'] = str(somme_order_ca_ht)
|
||||
node['nb_header_order'] = str(nb_header_order)
|
||||
|
||||
total_data.append(node)
|
||||
|
||||
|
||||
total_data = mycommon.JSONEncoder().encode(total_data)
|
||||
|
||||
#print(" #### nb_result = ", val_tmp)
|
||||
return True, RetObject
|
||||
return True, RetObject, total_data
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -63,7 +63,9 @@ def Add_Unite_Enseignement(diction):
|
|||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'code', 'titre', 'description', 'objectif', 'prerequis', 'programme', 'methode_pedagogique', 'methode_evaluation',
|
||||
'support', 'duration', 'duration_unite', 'domain_id', 'bloc' ]
|
||||
'support', 'duration', 'duration_unite', 'domain_id', 'bloc' ,
|
||||
'ects', 'seuil_validation', 'niveau_competence', 'vh_cm', 'vh_tp', 'vh_tpg',
|
||||
'vh_td', 'semestre']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -176,7 +178,8 @@ def Update_Unite_Enseignement(diction):
|
|||
|
||||
field_list = ['token', '_id', 'code', 'titre', 'description', 'objectif', 'prerequis', 'programme',
|
||||
'methode_pedagogique', 'methode_evaluation', 'support', 'duration', 'duration_unite',
|
||||
'domain_id', 'bloc']
|
||||
'domain_id', 'bloc', 'ects', 'seuil_validation', 'niveau_competence',
|
||||
'vh_cm', 'vh_tp', 'vh_tpg', 'vh_td', 'semestre']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -351,11 +354,8 @@ def Get_List_Unite_Enseignement_no_filter(diction):
|
|||
user['bloc'] = ""
|
||||
|
||||
"""
|
||||
Recuperer le nombre de lignes de planification
|
||||
"""
|
||||
|
||||
|
||||
|
||||
Recuperer le nombre de lignes de planification
|
||||
"""
|
||||
|
||||
count_nb_planif_lines = MYSY_GV.dbname['unite_enseignement_planif'].count_documents(
|
||||
{'ue_id': str(New_retVal['_id']),
|
||||
|
|
Loading…
Reference in New Issue