25/12/2024 - 22h30

master
cherif 2024-12-25 22:25:21 +01:00
parent 9e41066257
commit 7b166ac272
5 changed files with 2781 additions and 32 deletions

View File

@ -1,13 +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="24/12/2024 - 22h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="25/12/2024 - 14h">
<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$/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$/attached_file_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/attached_file_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -78,13 +77,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00371" summary="ddd">
<created>1723555903066</created>
<option name="number" value="00371" />
<option name="presentableId" value="LOCAL-00371" />
<option name="project" value="LOCAL" />
<updated>1723555903066</updated>
</task>
<task id="LOCAL-00372" summary="dddss">
<created>1723804083490</created>
<option name="number" value="00372" />
@ -421,7 +413,14 @@
<option name="project" value="LOCAL" />
<updated>1735075121021</updated>
</task>
<option name="localTasksCounter" value="420" />
<task id="LOCAL-00420" summary="25/12/2024 - 14h">
<created>1735132675184</created>
<option name="number" value="00420" />
<option name="presentableId" value="LOCAL-00420" />
<option name="project" value="LOCAL" />
<updated>1735132675184</updated>
</task>
<option name="localTasksCounter" value="421" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -463,7 +462,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="12/09/2024 - 13:00" />
<MESSAGE value="15/09/2024 - 18:00" />
<MESSAGE value="18/09/2024 - 21h" />
<MESSAGE value="19/09/2024 - 20h" />
@ -488,6 +486,7 @@
<MESSAGE value="10/12/2024 - 22h" />
<MESSAGE value="14/12/2024 - 14h" />
<MESSAGE value="24/12/2024 - 22h" />
<option name="LAST_COMMIT_MESSAGE" value="24/12/2024 - 22h" />
<MESSAGE value="25/12/2024 - 14h" />
<option name="LAST_COMMIT_MESSAGE" value="25/12/2024 - 14h" />
</component>
</project>

View File

@ -748,7 +748,11 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
e_docment_type = ""
if( "type" in e_document_data.keys() and e_document_data['type']):
e_docment_type = e_document_data['type']
# 25/12/24 : on fait une conversion en moe bricolage de "quotation" vers "devis"
if( e_document_data['type'] == "quotation"):
e_docment_type = "devis"
else:
e_docment_type = e_document_data['type']
#print(" ### e_docment_type = ", e_docment_type)
@ -1289,7 +1293,7 @@ def Create_E_Signature_For_E_Document(file_img=None, Folder=None, diction=None):
new_file['file_name_to_store'] = outputFilename
#print(" ### new_file new_file = ", new_file)
print(" ### new_file new_file = ", new_file)
local_status, local_retval = attached_file_mgt.Internal_Usage_Store_User_Downloaded_File(MYSY_GV.upload_folder, new_file)
if( local_status is False ):

File diff suppressed because one or more lines are too long

View File

@ -150,7 +150,7 @@ def Store_User_Downloaded_File(file=None, Folder=None, diction=None):
type_document = ""
if ("type_document" in diction.keys()):
if diction['type_document']:
type_document = diction['type_document']
type_document = str(diction['type_document']).lower()
metadata_field = ""
if ("metadata_field" in diction.keys()):
@ -309,7 +309,7 @@ def Internal_Usage_Store_User_Downloaded_File(Folder=None, diction=None):
type_document = ""
if ("type_document" in diction.keys()):
if diction['type_document']:
type_document = diction['type_document']
type_document = str(diction['type_document']).lower()
metadata_field = ""
if ("metadata_field" in diction.keys()):
@ -944,7 +944,7 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter(diction):
Verification des input acceptés
"""
field_list = ['token', 'filter_object_owner_collection', 'filter_object_owner_id',
'date_create_start_date', 'date_create_end_date', 'filter_type_document',
'filter_file_business_object', 'date_create_start_date', 'date_create_end_date', 'filter_type_document',
'filter_nom_client', 'filter_formation_external_code', 'filter_session_code',
'filter_class_external_code']
@ -981,6 +981,14 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter(diction):
if (local_status is not True):
return local_status, my_partner
# Ici le nom du document
filt_file_business_object = {}
if ("filter_file_business_object" in diction.keys() and diction['filter_file_business_object']):
filt_file_business_object = {
'file_business_object': {'$regex': str(diction['filter_file_business_object']) , "$options": 'i'}}
filt_object_owner_collection = {}
if ("filter_object_owner_collection" in diction.keys() and diction['filter_object_owner_collection']):
filt_object_owner_collection = {'object_owner_collection': str(diction['filter_object_owner_collection'])}
@ -1014,8 +1022,6 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter(diction):
return False, " Le filtre : 'date de fin' n'est pas au format jj/mm/aaaa."
"""
Gestion du filtre code session.
Si ce champs est fourni, voici comment il faut proceder :
@ -1068,7 +1074,7 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter(diction):
'partner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}
# Recuperation des '_id' des session dont le nom match en regexp
print(" ## verif sub_filt_partner_client_nom = ", sub_filt_partner_client_nom)
for List_partner_client_Data in MYSY_GV.dbname['partner_client'].find(sub_filt_partner_client_nom, {'_id': 1}):
Lists_partner_client_id.append(str(List_partner_client_Data['_id']))
@ -1089,35 +1095,50 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter(diction):
filt_date_create_end_date_ISODATE = datetime.strptime(str(filt_date_create_end_date), '%d/%m/%Y')
filt_date_creation = {}
if(filt_date_create_start_date_ISODATE and filt_date_create_end_date_ISODATE ):
filt_date_creation = { 'created_date': {'$gte': filt_date_create_start_date_ISODATE,
filt_date_creation = { 'mysy_download_files_date_creation': {'$gte': filt_date_create_start_date_ISODATE,
'$lte': filt_date_create_end_date_ISODATE}
}
elif (filt_date_create_start_date_ISODATE ):
filt_date_creation = {'created_date': {'$gte': filt_date_create_start_date_ISODATE,
filt_date_creation = {'mysy_download_files_date_creation': {'$gte': filt_date_create_start_date_ISODATE,
}
}
elif (filt_date_create_end_date_ISODATE ):
filt_date_creation = {'created_date': {'$lte': filt_date_create_end_date_ISODATE,
filt_date_creation = {'mysy_download_files_date_creation': {'$lte': filt_date_create_end_date_ISODATE,
}
}
my_query = {'$and': [ filt_object_owner_collection, filt_filter_object_owner_id, filt_date_creation,
filt_type_document, filt_session_code,filt_partner_client_nom,
filt_type_document, filt_session_code,filt_partner_client_nom, filt_file_business_object,
filt_class_external_code, {'partner_owner_recid': str(my_partner['recid']),
'valide':'1'}]}
new_query = ([ {"$addFields": {
"mysy_download_files_date_creation": {
'$dateFromString': {
'dateString': {"$substr": ["$created_date", 0, 10]},
"format": "%Y-%m-%d"
}
}
}
},
{'$match': my_query
},
{
'$sort': {'_id':-1, 'mysy_download_files_date_creation': -1}
},
])
print(" ##### new_query = " + str(new_query))
print(" ##### myquery = " + str(my_query))
RetObject = []
nb_val = 0
for retval in MYSY_GV.dbname['download_files'].find(my_query).sort(
[("_id", pymongo.DESCENDING), ("document_display_order", pymongo.DESCENDING)]):
for retval in MYSY_GV.dbname['download_files'].aggregate(new_query):
ret_file = {}
ret_file['id'] = str(nb_val)

View File

@ -1490,7 +1490,10 @@ def Get_List_Partner_Invoice_with_filter(diction):
'partner_owner_recid': str(my_partner['recid'])}, {'valide': '1'}]}}, ],
'as': 'partner_invoice_line_collection'
}
}
},
{
'$sort': {'_id':-1, }
},
]