parent
973b82bfa7
commit
5a3c04aef0
|
|
@ -4,10 +4,23 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="23/11/25 - 21h30dd">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="25/11/25 - 21h30dd">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Job_Cron_Common.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron_Common.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$/email_inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_inscription_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ent_alert_messages.py" beforeDir="false" afterPath="$PROJECT_DIR$/ent_alert_messages.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/invoice_paiement_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/invoice_paiement_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/jury_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/jury_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -450,7 +463,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1747251650255</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="516" />
|
||||
<option name="localTasksCounter" value="517" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
|
@ -492,7 +505,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="03/07/2025 - 19h30" />
|
||||
<MESSAGE value="06/07/2025 - 12h" />
|
||||
<MESSAGE value="12/07/2025 - 12h" />
|
||||
<MESSAGE value="qsd" />
|
||||
|
|
@ -517,6 +529,7 @@
|
|||
<MESSAGE value="16/11/25 - 16h30" />
|
||||
<MESSAGE value="23/11/25 - 21h30" />
|
||||
<MESSAGE value="23/11/25 - 21h30dd" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="23/11/25 - 21h30dd" />
|
||||
<MESSAGE value="25/11/25 - 21h30dd" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="25/11/25 - 21h30dd" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -1000,4 +1000,10 @@ Statut des stage
|
|||
1 : réalisé
|
||||
2 : Verrouillé
|
||||
"""
|
||||
STAGE_STATUS = ['0', '1', '2']
|
||||
STAGE_STATUS = ['0', '1', '2']
|
||||
|
||||
|
||||
"""
|
||||
Nombre maximum de message Public ENT
|
||||
"""
|
||||
MAX_ENT_PUBLIC_MESSAGE = 5
|
||||
|
|
@ -9852,7 +9852,7 @@ def Sent_Convention_Stagiaire_By_Email(tab_files, Folder, diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convention_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convent_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -9911,7 +9911,7 @@ def Sent_Convention_Stagiaire_By_Email(tab_files, Folder, diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-2:]
|
||||
|
||||
cononic_name = "Convention_" + str(todays_date) + "_" + str(ts)
|
||||
cononic_name = "Convent_" + str(todays_date) + "_" + str(ts)
|
||||
new_e_document_diction['file_cononical_name'] = cononic_name
|
||||
new_e_document_diction['type'] = "convention"
|
||||
|
||||
|
|
@ -10496,7 +10496,7 @@ def Sent_Convention_Individuelle_Stagiaire_By_Email(tab_files, Folder, diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convention_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convent_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -11057,7 +11057,7 @@ def Download_Convention_Stagiaire_PDF(diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convention_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convent_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -11298,7 +11298,7 @@ def Download_Convention_Individuelle_Stagiaire_PDF(diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convention_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convent_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -11502,7 +11502,7 @@ def Download_Convention_Stagiaire_PDF_By_Partner_client(diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convention_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convent_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -11849,7 +11849,7 @@ def Sent_Convention_Stagiaire_By_Email_By_Partner_client(tab_files_name_full_pat
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convention_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convent_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -11908,7 +11908,7 @@ def Sent_Convention_Stagiaire_By_Email_By_Partner_client(tab_files_name_full_pat
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-2:]
|
||||
|
||||
cononic_name = "Convention_" + str(todays_date) + "_" + str(ts)
|
||||
cononic_name = "Convent_" + str(todays_date) + "_" + str(ts)
|
||||
new_e_document_diction['file_cononical_name'] = cononic_name
|
||||
new_e_document_diction['type'] = "convention"
|
||||
|
||||
|
|
|
|||
|
|
@ -676,7 +676,7 @@ def Sent_Convocation_Stagiaire_By_Email(tab_files, Folder, diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convocation_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convoc_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -1020,7 +1020,7 @@ def Create_Convocation_By_Stagiaire_PDF(diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convocation_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convoc_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
|
|||
176984
Log/log_file.log
176984
Log/log_file.log
File diff suppressed because one or more lines are too long
|
|
@ -7738,7 +7738,7 @@ def Create_Convention_By_Client_PDF(diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convention_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convent_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -7911,7 +7911,7 @@ def Create_Convention_By_Stagiaire_PDF(diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convention_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convent_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -8465,7 +8465,7 @@ def Create_Convocation_By_Stagiaire_PDF(diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convocation_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convoc_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
|
|||
|
|
@ -1870,6 +1870,12 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter_No_Token(diction):
|
|||
if ("object_owner_id" in retval.keys()):
|
||||
ret_file['object_owner_id'] = retval['object_owner_id']
|
||||
|
||||
if ("partner_owner_recid" in retval.keys()):
|
||||
ret_file['partner_owner_recid'] = retval['partner_owner_recid']
|
||||
else:
|
||||
ret_file['partner_owner_recid'] = ""
|
||||
|
||||
|
||||
if ("file_name" in retval.keys()):
|
||||
ret_file['file_name'] = retval['file_name']
|
||||
|
||||
|
|
|
|||
|
|
@ -908,11 +908,11 @@ def incription_training_cancelled_mail(diction):
|
|||
msg['To'] = str(diction['email'])
|
||||
|
||||
|
||||
smtpserver.ehlo()
|
||||
"""smtpserver.ehlo()
|
||||
smtpserver.starttls()
|
||||
smtpserver.login(MYSY_GV.O365_SMTP_COUNT_user, MYSY_GV.O365_SMTP_COUNT_password)
|
||||
val = smtpserver.send_message(msg)
|
||||
smtpserver.close()
|
||||
smtpserver.close()"""
|
||||
print(" Email confirmation (cancellation) envoyé " + str(val))
|
||||
|
||||
"""
|
||||
|
|
|
|||
20
email_mgt.py
20
email_mgt.py
|
|
@ -2705,24 +2705,24 @@ def ManualSendInvoiceEmailRIB_CIC_BureauVallee(diction):
|
|||
body = {
|
||||
"params": {"order_id": "N/A",
|
||||
"date_order": ": 12/08/2025",
|
||||
"periode":"01/10/2025 au 31/10/2025",
|
||||
"total_ht": "12 749",
|
||||
"tva": "2 549,8",
|
||||
"total_ttc": "15 298,8",
|
||||
"periode":"01/11/2025 au 30/11/2025",
|
||||
"total_ht": "8 932,74",
|
||||
"tva": "1 786,55",
|
||||
"total_ttc": "10 719,29",
|
||||
"client_name": "BVD Fr (Bureau Vallée)",
|
||||
"client_address": "25 rue du Gros Caillou",
|
||||
"client_zip_ville": "78340 – Les Clayes-sous-Bois",
|
||||
"client_pays": "France",
|
||||
"packs": "Prestation de service ",
|
||||
"detail_packs": "Accompagnement au déploiement de l'ERP CoQliQo",
|
||||
"qty": "23 jours",
|
||||
"qty": "15.5 jours",
|
||||
"unit_price": "550 €",
|
||||
"montant": "12 650 €",
|
||||
"montant": "8 525 €",
|
||||
|
||||
|
||||
"invoice_id": "FACT_20251020",
|
||||
"invoice_date": "31/10/2025",
|
||||
"due_date": "15/11/2025",
|
||||
"invoice_id": "FACT_20251121",
|
||||
"invoice_date": "30/11/2025",
|
||||
"due_date": "15/12/2025",
|
||||
"orign_order": "N/A",
|
||||
}
|
||||
}
|
||||
|
|
@ -2756,7 +2756,7 @@ def ManualSendInvoiceEmailRIB_CIC_BureauVallee(diction):
|
|||
#print(" ### body 22 = ", body)
|
||||
|
||||
sourceHtml = template.render(json_data=body["params"])
|
||||
orig_file_name = "invoice_FACT_20251020.pdf"
|
||||
orig_file_name = "invoice_FACT_20251121.pdf"
|
||||
outputFilename = str(MYSY_GV.INVOICE_DIRECTORY) + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ def Add_Ent_Alert_Message(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'code', 'priorite', 'message', 'date_debut', 'date_fin']
|
||||
field_list = ['token', 'code', 'priorite', 'message', 'date_debut', 'date_fin', 'publish_ent']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -120,12 +120,36 @@ def Add_Ent_Alert_Message(diction):
|
|||
return False, " Le niveau de priorité est invalide "
|
||||
|
||||
|
||||
if ("publish_ent" in diction.keys() and diction['publish_ent']):
|
||||
if (diction['publish_ent'] not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La publication ENT est invalide ")
|
||||
|
||||
return False, " La publication ENT est invalide "
|
||||
|
||||
"""
|
||||
Nombre de massage actuel
|
||||
"""
|
||||
nb_message_ent = MYSY_GV.dbname['ent_alert_message'].count_documents({ 'valide':'1', 'partner_owner_recid':str(my_partner['recid'])})
|
||||
if( nb_message_ent >= MYSY_GV.MAX_ENT_PUBLIC_MESSAGE):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + "Nombre maximal de messages autorisés est "+str(MYSY_GV.MAX_ENT_PUBLIC_MESSAGE))
|
||||
|
||||
return False, "Nombre maximal de messages autorisés est "+str(MYSY_GV.MAX_ENT_PUBLIC_MESSAGE)
|
||||
|
||||
|
||||
new_data = diction
|
||||
del diction['token']
|
||||
|
||||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
new_data['publish_ent'] = "0"
|
||||
|
||||
if ("publish_ent" in diction.keys() and diction['publish_ent']):
|
||||
new_data['publish_ent'] = diction['publish_ent']
|
||||
else:
|
||||
new_data['publish_ent'] = "0"
|
||||
|
||||
new_data['creation_date'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
|
|
@ -157,7 +181,7 @@ def Update_Ent_Alert_Message(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'code', 'priorite', 'message', 'date_debut', 'date_fin', '_id']
|
||||
field_list = ['token', 'code', 'priorite', 'message', 'date_debut', 'date_fin', '_id', 'publish_ent']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -244,6 +268,16 @@ def Update_Ent_Alert_Message(diction):
|
|||
|
||||
return False, " Le niveau de priorité est invalide "
|
||||
|
||||
|
||||
if ("publish_ent" in diction.keys() and diction['publish_ent']):
|
||||
if (diction['publish_ent'] not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La publication ENT est invalide ")
|
||||
|
||||
return False, " La publication ENT est invalide "
|
||||
|
||||
|
||||
local_id = str(diction['_id'])
|
||||
|
||||
del diction['token']
|
||||
|
|
@ -396,7 +430,7 @@ def Get_List_Published_Ent_Alert_Message(diction):
|
|||
Clés de mise à jour
|
||||
"""
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['partner_owner_recid'] = str(my_partner['partner_owner_recid'])
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
data_cle['publish_ent'] = "1"
|
||||
|
|
@ -483,7 +517,7 @@ def Delete_Ent_Alert_Message(diction):
|
|||
{'_id': {'$in': tab_message_Object_ids},
|
||||
'partner_owner_recid': my_partner['recid']})
|
||||
|
||||
return True, " (" + str(delete_row.deleted_count) + " message(s) supprimé(s) "
|
||||
return True, str(delete_row.deleted_count) + " message(s) supprimé(s) "
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
|
@ -573,7 +607,7 @@ def Publish_to_ENT_Alert_Message(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', '_id']
|
||||
field_list = ['token', 'tab_ids']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -585,7 +619,7 @@ def Publish_to_ENT_Alert_Message(diction):
|
|||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', '_id',]
|
||||
field_list_obligatoire = ['token', 'tab_ids',]
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
|
|
@ -606,26 +640,30 @@ def Publish_to_ENT_Alert_Message(diction):
|
|||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
tab_message_ids = ""
|
||||
if ("tab_ids" in diction.keys()):
|
||||
if diction['tab_ids']:
|
||||
tab_message_ids = diction['tab_ids']
|
||||
|
||||
tab_message_Object_ids = []
|
||||
|
||||
tab_my_message_ids = str(tab_message_ids).split(",")
|
||||
for message_id in tab_my_message_ids:
|
||||
if (message_id):
|
||||
tab_message_Object_ids.append(ObjectId(str(message_id)))
|
||||
|
||||
local_id = str(diction['_id'])
|
||||
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['_id'] = ObjectId(local_id)
|
||||
data_cle['_id'] = {'$in':tab_message_Object_ids}
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
result = MYSY_GV.dbname['ent_alert_message'].find_one_and_update(
|
||||
result = MYSY_GV.dbname['ent_alert_message'].update_many(
|
||||
data_cle,
|
||||
{"$set": {'publish_ent':'1'}},
|
||||
upsert=False,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
|
||||
if ("_id" not in result.keys()):
|
||||
mycommon.myprint(
|
||||
" Impossible de publier le message vers l'ENT (2) ")
|
||||
return False, " Impossible de publier le message vers l'ENT (2) "
|
||||
)
|
||||
|
||||
return True, " Le message a été correctement publié vers l'ENT"
|
||||
|
||||
|
|
@ -647,7 +685,7 @@ def Unpublish_to_ENT_Alert_Message(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', '_id']
|
||||
field_list = ['token', 'tab_ids']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -659,7 +697,7 @@ def Unpublish_to_ENT_Alert_Message(diction):
|
|||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', '_id', ]
|
||||
field_list_obligatoire = ['token', 'tab_ids', ]
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
|
|
@ -681,25 +719,31 @@ def Unpublish_to_ENT_Alert_Message(diction):
|
|||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
local_id = str(diction['_id'])
|
||||
tab_message_ids = ""
|
||||
if ("tab_ids" in diction.keys()):
|
||||
if diction['tab_ids']:
|
||||
tab_message_ids = diction['tab_ids']
|
||||
|
||||
tab_message_Object_ids = []
|
||||
|
||||
tab_my_message_ids = str(tab_message_ids).split(",")
|
||||
for message_id in tab_my_message_ids:
|
||||
if (message_id):
|
||||
tab_message_Object_ids.append(ObjectId(str(message_id)))
|
||||
|
||||
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['_id'] = ObjectId(local_id)
|
||||
data_cle['_id'] = {'$in':tab_message_Object_ids}
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
result = MYSY_GV.dbname['ent_alert_message'].find_one_and_update(
|
||||
result = MYSY_GV.dbname['ent_alert_message'].update_many(
|
||||
data_cle,
|
||||
{"$set": {'publish_ent': '0'}},
|
||||
upsert=False,
|
||||
return_document=ReturnDocument.AFTER
|
||||
|
||||
)
|
||||
|
||||
if ("_id" not in result.keys()):
|
||||
mycommon.myprint(
|
||||
" Impossible de dépublier le message vers l'ENT (2) ")
|
||||
return False, " Impossible de dépublier le message vers l'ENT (2) "
|
||||
|
||||
return True, " Le message a été correctement dépublier de l'ENT"
|
||||
|
||||
|
|
|
|||
|
|
@ -771,6 +771,123 @@ def Get_Invoice_Liste_Payement_And_Total_Amount(diction):
|
|||
return False, " Impossible de récuperer les paiements de la facture "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Fonction interne qui retourne la liste des paiement
|
||||
avec le total payé et le reste à payer
|
||||
"""
|
||||
def Get_Invoice_Internal_Liste_Payement_And_Total_Amount(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'invoice_id', ]
|
||||
|
||||
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'est pas autorisé")
|
||||
return False, " Les informations fournies sont incorrectes"
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'invoice_id', ]
|
||||
|
||||
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 la liste des arguments ")
|
||||
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
|
||||
|
||||
|
||||
# Verifier que la facture existe et est valide
|
||||
is_existe_invoice = MYSY_GV.dbname['partner_invoice_header'].count_documents({'_id':ObjectId(str(diction['invoice_id'])),
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
|
||||
if( is_existe_invoice != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de la facture est invalide ")
|
||||
return False, " L'identifiant de la facture est invalide "
|
||||
|
||||
invoice_data = MYSY_GV.dbname['partner_invoice_header'].find_one(
|
||||
{'_id': ObjectId(str(diction['invoice_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id':1, 'total_header_toutes_taxes':1})
|
||||
|
||||
RetObject = {}
|
||||
tab_paiement = []
|
||||
val_tmp = 0
|
||||
payed_amount = 0
|
||||
|
||||
|
||||
|
||||
for retval in MYSY_GV.dbname['invoice_paiement'].find({'invoice_id':str(diction['invoice_id']),
|
||||
'partner_owner_recid':str(my_partner['recid']),
|
||||
'valide':'1',
|
||||
'locked':'0'}).sort([("_id", pymongo.DESCENDING), ]):
|
||||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
|
||||
|
||||
local_status, local_retval = mycommon.IsFloat(str(retval['paiement_amount']))
|
||||
if(local_status is False ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Impossible d'évaluer les paiements effectués ")
|
||||
return False, " Impossible d'évaluer les paiements effectués "
|
||||
|
||||
payed_amount = payed_amount + local_retval
|
||||
|
||||
val_tmp = val_tmp + 1
|
||||
tab_paiement.append(user)
|
||||
|
||||
payed_amount_float = round(payed_amount, 2)
|
||||
reste_a_payer_float = ""
|
||||
is_aquited = "0"
|
||||
if( "total_header_toutes_taxes" in invoice_data.keys() and invoice_data['total_header_toutes_taxes']):
|
||||
reste_a_payer_float = round(float(invoice_data['total_header_toutes_taxes']) - float(payed_amount), 2)
|
||||
if( reste_a_payer_float <= 0 ):
|
||||
is_aquited = "1"
|
||||
|
||||
|
||||
|
||||
total_node = {"total_payed":str(payed_amount_float), 'reste_a_payer':str(reste_a_payer_float)}
|
||||
|
||||
RetObject['total_payed'] = str(payed_amount_float)
|
||||
RetObject['reste_a_payer'] = str(reste_a_payer_float)
|
||||
RetObject['is_aquited'] = str(is_aquited)
|
||||
RetObject['tab_paiement'] = tab_paiement
|
||||
RetObject['nb_reglement'] = str(len(tab_paiement))
|
||||
|
||||
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écuperer les paiements de la facture "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction retourne le montant total payé dans une facture ainsi que
|
||||
le reste à payer
|
||||
|
|
|
|||
|
|
@ -4846,7 +4846,7 @@ def Create_Jury_Soutenance_Convocation_By_Inscrit_PDF(diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convocation_Soutenance_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convoc_Soutenance_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -5270,7 +5270,7 @@ def Create_Jury_Soutenance_Convocation_By_Inscrit_Email(tab_files, Folder, dicti
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convocation_Soutenance_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convoc_Soutenance_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
|
||||
|
|
@ -5718,7 +5718,7 @@ def Create_Jury_Convocation_By_Membre_PDF(diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convocation_Jury_Membre_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convoc_Jury_Membre_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
@ -6083,7 +6083,7 @@ def Create_Jury_Convocation_By_Membre_Email(tab_files, Folder, diction):
|
|||
ts = datetime.now().timestamp()
|
||||
ts = str(ts).replace(".", "").replace(",", "")[-5:]
|
||||
|
||||
orig_file_name = "Convocation_Jury_Membre_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
orig_file_name = "Convoc_Jury_Membre_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
|
||||
|
||||
# open output file for writing (truncated binary)
|
||||
|
|
|
|||
42
main.py
42
main.py
|
|
@ -7302,7 +7302,7 @@ def Get_Given_Line_Of_Partner_Invoice_Lines():
|
|||
|
||||
|
||||
"""
|
||||
API Impression PDF d'une facture
|
||||
API Impression PDF d'une facture ORIGINAL
|
||||
"""
|
||||
|
||||
@app.route('/myclass/api/GerneratePDF_Partner_Invoice/<token>/<invoice_id>', methods=['POST','GET'])
|
||||
|
|
@ -7323,6 +7323,35 @@ def GerneratePDF_Partner_Invoice(token, invoice_id):
|
|||
else:
|
||||
return False
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API Impression PDF d'une facture ACQUITEE avec le releve de paiement
|
||||
"""
|
||||
|
||||
@app.route('/myclass/api/GerneratePDF_Partner_Invoice_regeneration/<token>/<invoice_id>', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def GerneratePDF_Partner_Invoice_regeneration(token, invoice_id):
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
payload = {}
|
||||
payload['token'] = str(token)
|
||||
payload['invoice_id'] = str(invoice_id)
|
||||
payload['invoice_regeneration'] = "1"
|
||||
|
||||
|
||||
print(" ### GerneratePDF_Partner_Invoice : payload = ",str(payload))
|
||||
|
||||
localStatus, response= partner_invoice.GerneratePDF_Partner_Invoice(payload)
|
||||
if(localStatus ):
|
||||
return response
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API Envoie de la facture par email
|
||||
"""
|
||||
|
|
@ -14768,6 +14797,17 @@ def Get_List_Published_Ent_Alert_Message():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API pour desactiver les traitements automatique des session
|
||||
"""
|
||||
@app.route('/myclass/api/Disable_Session_Formation_Automation/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Disable_Session_Formation_Automation():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Disable_Session_Formation_Automation : payload = ",payload)
|
||||
localStatus, message= tools_cherif.Disable_Session_Formation_Automation(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ from email import encoders
|
|||
import partner_order as partner_order
|
||||
import base64
|
||||
|
||||
from prj_common import tryFloat
|
||||
|
||||
"""
|
||||
Creation de la facture d'un commande
|
||||
"""
|
||||
|
|
@ -674,6 +676,8 @@ def Get_Given_Partner_Invoice_Lines(diction):
|
|||
|
||||
for retval in MYSY_GV.dbname['partner_invoice_line'].aggregate(query):
|
||||
if ('myclass_collection' in retval.keys() and len(retval['myclass_collection']) > 0):
|
||||
|
||||
print(" ### retval = ", retval)
|
||||
user = {}
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
|
|
@ -790,24 +794,26 @@ def Get_Given_Partner_Invoice_Lines(diction):
|
|||
et partner_invoice_line_detail['order_line_inscription_id']
|
||||
"""
|
||||
tab_inscription = []
|
||||
for inscription_id in retval['tab_inscription_ids']:
|
||||
invoice_inscription_id_data = MYSY_GV.dbname['partner_invoice_line_detail'].find_one(
|
||||
{'order_line_inscription_id': str(inscription_id),
|
||||
'valide': '1', 'locked': '0',
|
||||
'partner_owner_recid': str(retval['partner_owner_recid']),
|
||||
'invoice_header_ref_interne': str(retval['invoice_header_ref_interne'])
|
||||
},
|
||||
{'order_line_inscription_type_apprenant': 1,
|
||||
'order_line_inscription_comment': 1,
|
||||
'order_line_inscription_memo': 1,
|
||||
'order_line_inscription_price': 1,
|
||||
'order_line_inscription_modefinancement': 1,
|
||||
'order_line_inscription_nom': 1,
|
||||
'order_line_inscription_prenom': 1,
|
||||
'order_line_inscription_email': 1,
|
||||
'order_line_inscription_civilite': 1,
|
||||
})
|
||||
tab_inscription.append(invoice_inscription_id_data)
|
||||
if( "tab_inscription_ids" in retval.keys()):
|
||||
for inscription_id in retval['tab_inscription_ids']:
|
||||
if (inscription_id):
|
||||
invoice_inscription_id_data = MYSY_GV.dbname['partner_invoice_line_detail'].find_one(
|
||||
{'order_line_inscription_id': str(inscription_id),
|
||||
'valide': '1', 'locked': '0',
|
||||
'partner_owner_recid': str(retval['partner_owner_recid']),
|
||||
'invoice_header_ref_interne': str(retval['invoice_header_ref_interne'])
|
||||
},
|
||||
{'order_line_inscription_type_apprenant': 1,
|
||||
'order_line_inscription_comment': 1,
|
||||
'order_line_inscription_memo': 1,
|
||||
'order_line_inscription_price': 1,
|
||||
'order_line_inscription_modefinancement': 1,
|
||||
'order_line_inscription_nom': 1,
|
||||
'order_line_inscription_prenom': 1,
|
||||
'order_line_inscription_email': 1,
|
||||
'order_line_inscription_civilite': 1,
|
||||
})
|
||||
tab_inscription.append(invoice_inscription_id_data)
|
||||
|
||||
user['inscription_data'] = tab_inscription
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
|
@ -1132,23 +1138,24 @@ def Get_Given_Partner_Invoice_Lines_From_Invoice_ref_interne(diction):
|
|||
"""
|
||||
tab_inscription = []
|
||||
for inscription_id in retval['tab_inscription_ids']:
|
||||
invoice_inscription_id_data = MYSY_GV.dbname['partner_invoice_line_detail'].find_one(
|
||||
{'order_line_inscription_id': str(inscription_id),
|
||||
'valide': '1', 'locked': '0',
|
||||
'partner_owner_recid': str(retval['partner_owner_recid']),
|
||||
'invoice_header_ref_interne': str(retval['invoice_header_ref_interne'])
|
||||
},
|
||||
{'order_line_inscription_type_apprenant': 1,
|
||||
'order_line_inscription_comment': 1,
|
||||
'order_line_inscription_memo': 1,
|
||||
'order_line_inscription_price': 1,
|
||||
'order_line_inscription_modefinancement': 1,
|
||||
'order_line_inscription_nom': 1,
|
||||
'order_line_inscription_prenom': 1,
|
||||
'order_line_inscription_email': 1,
|
||||
'order_line_inscription_civilite': 1,
|
||||
})
|
||||
tab_inscription.append(invoice_inscription_id_data)
|
||||
if (inscription_id):
|
||||
invoice_inscription_id_data = MYSY_GV.dbname['partner_invoice_line_detail'].find_one(
|
||||
{'order_line_inscription_id': str(inscription_id),
|
||||
'valide': '1', 'locked': '0',
|
||||
'partner_owner_recid': str(retval['partner_owner_recid']),
|
||||
'invoice_header_ref_interne': str(retval['invoice_header_ref_interne'])
|
||||
},
|
||||
{'order_line_inscription_type_apprenant': 1,
|
||||
'order_line_inscription_comment': 1,
|
||||
'order_line_inscription_memo': 1,
|
||||
'order_line_inscription_price': 1,
|
||||
'order_line_inscription_modefinancement': 1,
|
||||
'order_line_inscription_nom': 1,
|
||||
'order_line_inscription_prenom': 1,
|
||||
'order_line_inscription_email': 1,
|
||||
'order_line_inscription_civilite': 1,
|
||||
})
|
||||
tab_inscription.append(invoice_inscription_id_data)
|
||||
|
||||
user['inscription_data'] = tab_inscription
|
||||
|
||||
|
|
@ -1440,7 +1447,6 @@ def Get_List_Partner_Invoice_no_filter(diction):
|
|||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
|
||||
total_data = []
|
||||
node = {}
|
||||
node['somme_header_ca_ht'] = str(somme_header_ca_ht)
|
||||
|
|
@ -1468,6 +1474,8 @@ les filtres acceptés sont :
|
|||
- ref_externe
|
||||
- invoice_date entre date_debut et date_fin
|
||||
- nom_client
|
||||
- session_id (aller chercher à ligne de facture)
|
||||
- date échéance (invoice_date_echeance)
|
||||
"""
|
||||
def Get_List_Partner_Invoice_with_filter(diction):
|
||||
try:
|
||||
|
|
@ -1478,7 +1486,9 @@ 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', 'order_header_client_id']
|
||||
'ref_interne_invoice', 'ref_externe', 'formation', 'order_header_client_id',
|
||||
'session_code', 'solde', 'solde_operateur', 'date_echeance', 'echeance_operateur',
|
||||
'montant_ttc', 'montant_ttc_operateur']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -1513,8 +1523,8 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
filt_client_nom = {}
|
||||
sub_filt_client_nom = {}
|
||||
Lists_partner_client_id = []
|
||||
if ("client_nom" in diction.keys()):
|
||||
sub_filt_client_nom = {'nom': {'$regex': str(diction['client_nom']), "$options": "i"}, 'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}
|
||||
if ("client_nom" in diction.keys() and diction['client_nom']):
|
||||
sub_filt_client_nom = {'nom': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])), "$options": "i"}, 'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}
|
||||
# Recuperation des '_id' des clients dont le nom match en regexp
|
||||
#print(" ### sub_filt_client_nom = ", sub_filt_client_nom)
|
||||
for List_Client_Data in MYSY_GV.dbname['partner_client'].find(sub_filt_client_nom, {'_id':1}):
|
||||
|
|
@ -1527,7 +1537,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
filt_formation_external_code = {}
|
||||
sub_filt_formation_external_code = {}
|
||||
Lists_partner_formation_internal_url = []
|
||||
if ("formation" in diction.keys()):
|
||||
if ("formation" in diction.keys() and diction['formation']):
|
||||
sub_filt_formation_external_code = {'external_code': {'$regex': str(diction['formation']), "$options": "i"},
|
||||
'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}
|
||||
|
||||
|
|
@ -1539,38 +1549,127 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
filt_formation_external_code = {'order_line_formation': {'$in': Lists_partner_formation_internal_url }}
|
||||
|
||||
|
||||
filt_session_code = {}
|
||||
sub_filt_session_code = {}
|
||||
Lists_session_id = []
|
||||
if ("session_code" in diction.keys() and diction['session_code']):
|
||||
sub_filt_session_code = {'code_session': {'$regex': mycommon.regex_replace_cartere(str(diction['session_code'])), "$options": "i"},
|
||||
'partner_owner_recid': str(my_partner['recid']), 'valide': '1'}
|
||||
|
||||
# Recuperation des '_id' des formation dont le nom match en regexp
|
||||
# print(" ### sub_filt_formation_external_code = ", sub_filt_formation_external_code)
|
||||
for Lists_session_Data in MYSY_GV.dbname['session_formation'].find(sub_filt_session_code,
|
||||
{'_id': 1}):
|
||||
Lists_session_id.append(str(Lists_session_Data['_id']))
|
||||
|
||||
filt_session_code = {'order_line_session_id': {'$in': Lists_session_id}}
|
||||
|
||||
|
||||
filt_date_echeance_ISODATE = ""
|
||||
filt_date_echeance = ""
|
||||
if ("date_echeance" in diction.keys() and diction['date_echeance']):
|
||||
filt_date_echeance = str(diction['date_echeance'])[0:10]
|
||||
local_status = mycommon.CheckisDate(filt_date_echeance)
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le filtre : 'date d'échéance' n'est pas au format jj/mm/aaaa.")
|
||||
return False, " Le filtre : 'date d'échéance' n'est pas au format jj/mm/aaaa."
|
||||
|
||||
filt_date_echeance_ISODATE = datetime.strptime(str(filt_date_echeance), '%d/%m/%Y')
|
||||
|
||||
|
||||
filt_creation_date_from_ISODATE = ""
|
||||
filt_creation_date_from = ""
|
||||
if ("creation_date_from" in diction.keys() and diction['creation_date_from']):
|
||||
filt_creation_date_from = str(diction['creation_date_from'])[0:10]
|
||||
local_status = mycommon.CheckisDate(filt_creation_date_from)
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le filtre : 'date création du' n'est pas au format jj/mm/aaaa.")
|
||||
return False, " Le filtre : 'date création du' n'est pas au format jj/mm/aaaa."
|
||||
|
||||
filt_creation_date_from_ISODATE = datetime.strptime(str(filt_creation_date_from), '%d/%m/%Y')
|
||||
|
||||
|
||||
filt_creation_date_to_ISODATE = ""
|
||||
filt_creation_date_to = ""
|
||||
if ("creation_date_to" in diction.keys() and diction['creation_date_to']):
|
||||
filt_creation_date_to = str(diction['creation_date_to'])[0:10]
|
||||
local_status = mycommon.CheckisDate(filt_creation_date_to)
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le filtre : 'date création du' n'est pas au format jj/mm/aaaa.")
|
||||
return False, " Le filtre : 'date création du' n'est pas au format jj/mm/aaaa."
|
||||
|
||||
|
||||
filt_creation_date_to_ISODATE = datetime.strptime(str(filt_creation_date_to), '%d/%m/%Y')
|
||||
|
||||
mytoday = datetime.today().strftime("%d/%m/%Y")
|
||||
mytoday_datetime = datetime.strptime(str(mytoday).strip(), '%d/%m/%Y')
|
||||
|
||||
|
||||
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()):
|
||||
if ("ref_interne_cmd" in diction.keys() and diction['ref_interne_cmd'] ):
|
||||
filt_ref_interne_cmd = {
|
||||
'order_header_ref_interne': {'$regex': str(diction['ref_interne_cmd']), "$options": "i"}}
|
||||
'order_header_ref_interne': {'$regex': mycommon.regex_replace_cartere(str(diction['ref_interne_cmd'])), "$options": "i"}}
|
||||
|
||||
filt_ref_interne_invoice = {}
|
||||
if ("ref_interne_invoice" in diction.keys()):
|
||||
if ("ref_interne_invoice" in diction.keys() and diction['ref_interne_invoice']):
|
||||
filt_ref_interne_cmd = {
|
||||
'invoice_header_ref_interne': {'$regex': str(diction['ref_interne_invoice']), "$options": "i"}}
|
||||
'invoice_header_ref_interne': {'$regex': mycommon.regex_replace_cartere(str(diction['ref_interne_invoice'])), "$options": "i"}}
|
||||
|
||||
|
||||
filt_ref_externe = {}
|
||||
if ("ref_externe" in diction.keys()):
|
||||
if ("ref_externe" in diction.keys() and diction['ref_externe']):
|
||||
filt_ref_externe = {
|
||||
'order_header_ref_client': {'$regex': str(diction['ref_externe']), "$options": "i"}}
|
||||
'order_header_ref_client': {'$regex': mycommon.regex_replace_cartere(str(diction['ref_externe'])), "$options": "i"}}
|
||||
|
||||
filt_montant_ttc = {}
|
||||
if ("montant_ttc" in diction.keys() and diction['montant_ttc'] and "montant_ttc_operateur" in diction.keys() and diction['montant_ttc_operateur']):
|
||||
local_status, local_retval = mycommon.IsFloat(str(diction['montant_ttc']).strip())
|
||||
if( local_status is False):
|
||||
return False, " Le filtre montant TTC invalide ", False
|
||||
|
||||
filter_value_montant_ttc_float = local_retval
|
||||
|
||||
if (diction['montant_ttc_operateur'] == "egale"):
|
||||
filt_montant_ttc = {'mysy_total_header_toutes_taxes': filter_value_montant_ttc_float}
|
||||
|
||||
elif (diction['montant_ttc_operateur'] == "inf_egale"):
|
||||
filt_montant_ttc = {'mysy_total_header_toutes_taxes': {'$lte': filter_value_montant_ttc_float}}
|
||||
|
||||
elif (diction['montant_ttc_operateur'] == "sup_egale"):
|
||||
filt_montant_ttc = {'mysy_total_header_toutes_taxes': {'$gte': filter_value_montant_ttc_float}}
|
||||
|
||||
|
||||
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"}}},
|
||||
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, filt_montant_ttc]}
|
||||
|
||||
new_myquery_find_order = [{"$addFields":
|
||||
{
|
||||
"partner_invoice_header_Id": {"$toString": "$_id"},
|
||||
"mysy_total_header_toutes_taxes": {"$convert": {
|
||||
'input': "$total_header_toutes_taxes",
|
||||
'to': "double",
|
||||
'onError': {'error': 0},
|
||||
'onNull': {'isnull': 0}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{'$match': find_qry},
|
||||
{'$lookup':
|
||||
{
|
||||
'from': 'partner_invoice_line',
|
||||
'localField': "partner_invoice_header_Id",
|
||||
'foreignField': 'invoice_header_id',
|
||||
'pipeline': [{'$match': {'$and': [filt_formation_external_code, {
|
||||
'pipeline': [{'$match': {'$and': [filt_formation_external_code, filt_session_code, {
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'valide': '1'}]}}, ],
|
||||
'as': 'partner_invoice_line_collection'
|
||||
}
|
||||
|
|
@ -1581,7 +1680,65 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
]
|
||||
|
||||
|
||||
#print(" ### Get_List_Partner_Order_with_filter orders new_myquery_find_order = ", new_myquery_find_order)
|
||||
if(filt_date_echeance_ISODATE ):
|
||||
|
||||
sub_qry_echeance_operator = {}
|
||||
if( diction['echeance_operateur'] == "egale"):
|
||||
sub_qry_echeance_operator = { 'mysy_invoice_du_date': filt_date_echeance_ISODATE }
|
||||
|
||||
elif (diction['echeance_operateur'] == "inf_egale"):
|
||||
sub_qry_echeance_operator = {'mysy_invoice_du_date': { '$lte': filt_date_echeance_ISODATE}}
|
||||
|
||||
elif (diction['echeance_operateur'] == "sup_egale"):
|
||||
sub_qry_echeance_operator = {'mysy_invoice_du_date': {'$gte': filt_date_echeance_ISODATE}}
|
||||
|
||||
find_qry = {'$and': [{'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0', },
|
||||
sub_qry_echeance_operator,
|
||||
|
||||
filt_client_nom, filt_ref_interne_cmd, filt_ref_interne_invoice, filt_ref_externe,
|
||||
filt_client_id]}
|
||||
|
||||
|
||||
new_myquery_find_order = [
|
||||
{"$addFields":
|
||||
{
|
||||
"partner_invoice_header_Id": {"$toString": "$_id"},
|
||||
|
||||
"mysy_invoice_du_date": {
|
||||
'$dateFromString': {
|
||||
'dateString': '$invoice_date_echeance',
|
||||
'format': "%d/%m/%Y"
|
||||
}
|
||||
},
|
||||
"mysy_invoice_date": {
|
||||
'$dateFromString': {
|
||||
'dateString': {"$substr": ["$invoice_date", 0, 10]},
|
||||
'format': "%d/%m/%Y"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{'$match': find_qry},
|
||||
{'$lookup':
|
||||
{
|
||||
'from': 'partner_invoice_line',
|
||||
'localField': "partner_invoice_header_Id",
|
||||
'foreignField': 'invoice_header_id',
|
||||
'pipeline': [{'$match': {
|
||||
'$and': [filt_formation_external_code, filt_session_code, {
|
||||
'partner_owner_recid': str(my_partner['recid'])},
|
||||
{'valide': '1'}]}}, ],
|
||||
'as': 'partner_invoice_line_collection'
|
||||
}
|
||||
},
|
||||
{
|
||||
'$sort': {'_id': -1, }
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
||||
print(" ### Get_List_Partner_Order_with_filter orders new_myquery_find_order = ", new_myquery_find_order)
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
|
|
@ -1682,6 +1839,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
user['invoice_header_origin'] = ""
|
||||
|
||||
|
||||
|
||||
if( filter_date_debut and filter_date_fin ):
|
||||
if ( datetime.strptime(str(New_retVal['invoice_date'])[0:10], '%d/%m/%Y') >= datetime.strptime(str(filter_date_debut)[0:10], '%d/%m/%Y') and
|
||||
datetime.strptime(str(New_retVal['invoice_date'])[0:10], '%d/%m/%Y') <= datetime.strptime(str(filter_date_fin)[0:10], '%d/%m/%Y') ):
|
||||
|
|
@ -1703,9 +1861,32 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
else:
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
if ("solde" in diction.keys() and diction['solde'] and "solde_operateur" in diction.keys() and diction['solde_operateur']):
|
||||
|
||||
if( diction['solde_operateur'] == "egale"):
|
||||
if( tryFloat(diction['solde']) == tryFloat(reste_to_paye)):
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
elif( diction['solde_operateur'] == "inf_egale"):
|
||||
if ( tryFloat(reste_to_paye) <= tryFloat(diction['solde'])):
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
elif (diction['solde_operateur'] == "sup_egale"):
|
||||
if ( tryFloat(reste_to_paye) >= tryFloat(diction['solde']) ):
|
||||
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))
|
||||
|
||||
|
||||
total_data = []
|
||||
|
|
@ -2056,11 +2237,17 @@ Important : : update du 05/06/2024 :
|
|||
Si la facture a un document sécurisée (e_Invoice) associé dans la colonne :
|
||||
'e_document_signe_id', alors on va aller recuperer le document securisé associé
|
||||
|
||||
06/12/25 - Important :
|
||||
Si invoice_regeneration = "1", alors on imprime une facture à la volée, on ne va pas chercher la facture originale.
|
||||
|
||||
Dans le modele de facture, on va mettre une condiction dans le template:
|
||||
- si regelement existe alors on va afficher les reglement
|
||||
|
||||
"""
|
||||
|
||||
def GerneratePDF_Partner_Invoice(diction):
|
||||
try:
|
||||
field_list = ['invoice_id', 'token', ]
|
||||
field_list = ['invoice_id', 'token', 'invoice_regeneration' ]
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
|
|
@ -2110,9 +2297,16 @@ def GerneratePDF_Partner_Invoice(diction):
|
|||
my_partner['recid'])})
|
||||
|
||||
|
||||
invoice_regeneration = "0"
|
||||
if( "invoice_regeneration" in diction.keys() and diction['invoice_regeneration'] == "1"):
|
||||
invoice_regeneration = "1"
|
||||
|
||||
"""
|
||||
06/12/205 -
|
||||
Si invoice_regeneration == "1", on alors on va regenerer la facture sur le modele de document
|
||||
"""
|
||||
|
||||
if( "e_document_signe_id" in Order_header_data.keys() and Order_header_data['e_document_signe_id'] ):
|
||||
if( invoice_regeneration != "1" and "e_document_signe_id" in Order_header_data.keys() and Order_header_data['e_document_signe_id']):
|
||||
# On retourne la e_Invoice securisée
|
||||
|
||||
print(" #### RECUPERATION DU FICHIER SECURISE ")
|
||||
|
|
@ -2373,24 +2567,28 @@ def GerneratePDF_Partner_Invoice(diction):
|
|||
et partner_invoice_line_detail['order_line_inscription_id']
|
||||
"""
|
||||
tab_inscription = []
|
||||
for inscription_id in retval['tab_inscription_ids']:
|
||||
invoice_inscription_id_data = MYSY_GV.dbname['partner_invoice_line_detail'].find_one(
|
||||
{'order_line_inscription_id': str(inscription_id),
|
||||
'valide': '1', 'locked': '0',
|
||||
'partner_owner_recid': str(retval['partner_owner_recid']),
|
||||
'invoice_header_ref_interne': str(retval['invoice_header_ref_interne'])
|
||||
},
|
||||
{'order_line_inscription_type_apprenant': 1,
|
||||
'order_line_inscription_comment': 1,
|
||||
'order_line_inscription_memo': 1,
|
||||
'order_line_inscription_price': 1,
|
||||
'order_line_inscription_modefinancement': 1,
|
||||
'order_line_inscription_nom': 1,
|
||||
'order_line_inscription_prenom': 1,
|
||||
'order_line_inscription_email': 1,
|
||||
'order_line_inscription_civilite': 1,
|
||||
})
|
||||
tab_inscription.append(invoice_inscription_id_data)
|
||||
if ("tab_inscription_ids" in retval.keys()):
|
||||
for inscription_id in retval['tab_inscription_ids']:
|
||||
if( inscription_id ):
|
||||
invoice_inscription_id_data = MYSY_GV.dbname['partner_invoice_line_detail'].find_one(
|
||||
{'order_line_inscription_id': str(inscription_id),
|
||||
'valide': '1', 'locked': '0',
|
||||
'partner_owner_recid': str(retval['partner_owner_recid']),
|
||||
'invoice_header_ref_interne': str(retval['invoice_header_ref_interne'])
|
||||
},
|
||||
{'order_line_inscription_type_apprenant': 1,
|
||||
'order_line_inscription_comment': 1,
|
||||
'order_line_inscription_memo': 1,
|
||||
'order_line_inscription_price': 1,
|
||||
'order_line_inscription_modefinancement': 1,
|
||||
'order_line_inscription_nom': 1,
|
||||
'order_line_inscription_prenom': 1,
|
||||
'order_line_inscription_email': 1,
|
||||
'order_line_inscription_civilite': 1,
|
||||
})
|
||||
tab_inscription.append(invoice_inscription_id_data)
|
||||
|
||||
|
||||
|
||||
user['inscription_data'] = tab_inscription
|
||||
|
||||
|
|
@ -2525,6 +2723,16 @@ def GerneratePDF_Partner_Invoice(diction):
|
|||
|
||||
#print(" ### Order_header_lines_data = ", Order_header_lines_data)
|
||||
|
||||
"""
|
||||
Recuperation des reglements (paiements) effectués sur cette facture
|
||||
"""
|
||||
invoice_paiement_data = {}
|
||||
local_paiement_diction = {'token': str(diction['token']), 'invoice_id': str(diction['invoice_id'])}
|
||||
invoice_paiement_status, invoice_paiement_retval = invoice_paiement_mgt.Get_Invoice_Internal_Liste_Payement_And_Total_Amount( local_paiement_diction)
|
||||
|
||||
if( invoice_paiement_status is True):
|
||||
invoice_paiement_data = invoice_paiement_retval
|
||||
|
||||
|
||||
contenu_doc_Template = jinja2.Template(str(partner_document_INVOICE_data['contenu_doc']))
|
||||
|
||||
|
|
@ -2532,7 +2740,7 @@ def GerneratePDF_Partner_Invoice(diction):
|
|||
#sourceHtml = contenu_doc_Template.render(params=Order_header_data)
|
||||
|
||||
#print(" ### Order_header_data = ", Order_header_data)
|
||||
#print(" ### Order_header_lines_data = ", Order_header_lines_data)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
|
@ -2561,6 +2769,7 @@ def GerneratePDF_Partner_Invoice(diction):
|
|||
|
||||
convention_dictionnary_data['order_header'] = Order_header_data
|
||||
convention_dictionnary_data['order_lines'] = Order_header_lines_data
|
||||
convention_dictionnary_data['invoice_paiement_data'] = invoice_paiement_data
|
||||
|
||||
# read css file
|
||||
css_file = "./css_document/elyos_css.css"
|
||||
|
|
@ -2575,6 +2784,7 @@ def GerneratePDF_Partner_Invoice(diction):
|
|||
|
||||
sourceHtml = contenu_doc_Template.render(params=company_data['params'])
|
||||
|
||||
|
||||
orig_file_name = "Partner_Invoice_"+str(Order_header_data['invoice_header_ref_interne'])+".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) +"/"+ str(orig_file_name)
|
||||
|
||||
|
|
@ -2607,10 +2817,16 @@ def GerneratePDF_Partner_Invoice(diction):
|
|||
|
||||
"""
|
||||
Envoie de la facture par email
|
||||
06/12/25 - Important :
|
||||
Si invoice_regeneration = "1", alors on imprime une facture à la volée, on ne va pas chercher la facture originale.
|
||||
|
||||
Dans le modele de facture, on va mettre une condiction dans le template:
|
||||
- si regelement existe alors on va afficher les reglement
|
||||
|
||||
"""
|
||||
def Send_Partner_Invoice_By_Email(tab_files, Folder, diction):
|
||||
try:
|
||||
field_list = ['invoice_id', 'token', ]
|
||||
field_list = ['invoice_id', 'token', 'invoice_regeneration' ]
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
|
|
@ -2659,6 +2875,15 @@ def Send_Partner_Invoice_By_Email(tab_files, Folder, diction):
|
|||
'partner_owner_recid': str(
|
||||
my_partner['recid'])})
|
||||
|
||||
|
||||
|
||||
invoice_regeneration = "0"
|
||||
if( "invoice_regeneration" in diction.keys() and diction['invoice_regeneration'] == "1"):
|
||||
invoice_regeneration = "1"
|
||||
|
||||
|
||||
|
||||
|
||||
partner_document_INVOICE_data_qry = {'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0', 'ref_interne': 'PART_INVOICE', 'type_doc':'email'}
|
||||
|
||||
|
|
@ -2853,24 +3078,26 @@ def Send_Partner_Invoice_By_Email(tab_files, Folder, diction):
|
|||
et partner_invoice_line_detail['order_line_inscription_id']
|
||||
"""
|
||||
tab_inscription = []
|
||||
for inscription_id in retval['tab_inscription_ids']:
|
||||
invoice_inscription_id_data = MYSY_GV.dbname['partner_invoice_line_detail'].find_one(
|
||||
{'order_line_inscription_id': str(inscription_id),
|
||||
'valide': '1', 'locked': '0',
|
||||
'partner_owner_recid': str(retval['partner_owner_recid']),
|
||||
'invoice_header_ref_interne': str(retval['invoice_header_ref_interne'])
|
||||
},
|
||||
{'order_line_inscription_type_apprenant': 1,
|
||||
'order_line_inscription_comment': 1,
|
||||
'order_line_inscription_memo': 1,
|
||||
'order_line_inscription_price': 1,
|
||||
'order_line_inscription_modefinancement': 1,
|
||||
'order_line_inscription_nom': 1,
|
||||
'order_line_inscription_prenom': 1,
|
||||
'order_line_inscription_email': 1,
|
||||
'order_line_inscription_civilite': 1,
|
||||
})
|
||||
tab_inscription.append(invoice_inscription_id_data)
|
||||
if( "tab_inscription_ids" in retval.keys() ):
|
||||
for inscription_id in retval['tab_inscription_ids']:
|
||||
if( inscription_id):
|
||||
invoice_inscription_id_data = MYSY_GV.dbname['partner_invoice_line_detail'].find_one(
|
||||
{'order_line_inscription_id': str(inscription_id),
|
||||
'valide': '1', 'locked': '0',
|
||||
'partner_owner_recid': str(retval['partner_owner_recid']),
|
||||
'invoice_header_ref_interne': str(retval['invoice_header_ref_interne'])
|
||||
},
|
||||
{'order_line_inscription_type_apprenant': 1,
|
||||
'order_line_inscription_comment': 1,
|
||||
'order_line_inscription_memo': 1,
|
||||
'order_line_inscription_price': 1,
|
||||
'order_line_inscription_modefinancement': 1,
|
||||
'order_line_inscription_nom': 1,
|
||||
'order_line_inscription_prenom': 1,
|
||||
'order_line_inscription_email': 1,
|
||||
'order_line_inscription_civilite': 1,
|
||||
})
|
||||
tab_inscription.append(invoice_inscription_id_data)
|
||||
|
||||
user['inscription_data'] = tab_inscription
|
||||
|
||||
|
|
@ -3037,11 +3264,20 @@ def Send_Partner_Invoice_By_Email(tab_files, Folder, diction):
|
|||
|
||||
local_company_data = local_retval
|
||||
|
||||
"""
|
||||
Recuperation des reglements (paiements) effectués sur cette facture
|
||||
"""
|
||||
invoice_paiement_data = {}
|
||||
local_paiement_diction = {'token': str(diction['token']), 'invoice_id': str(diction['invoice_id'])}
|
||||
invoice_paiement_status, invoice_paiement_retval = invoice_paiement_mgt.Get_Invoice_Internal_Liste_Payement_And_Total_Amount(
|
||||
local_paiement_diction)
|
||||
|
||||
if (invoice_paiement_status is True):
|
||||
invoice_paiement_data = invoice_paiement_retval
|
||||
|
||||
"""
|
||||
Recuperation du dictionnaire des info
|
||||
"""
|
||||
Recuperation du dictionnaire des info
|
||||
"""
|
||||
tab_client = []
|
||||
tab_client.append(ObjectId(str(Order_header_client_data['_id'])))
|
||||
|
||||
|
|
@ -3073,6 +3309,7 @@ def Send_Partner_Invoice_By_Email(tab_files, Folder, diction):
|
|||
|
||||
convention_dictionnary_data['order_header'] = Order_header_data
|
||||
convention_dictionnary_data['order_lines'] = Order_header_lines_data
|
||||
convention_dictionnary_data['invoice_paiement_data'] = invoice_paiement_data
|
||||
|
||||
#print(" ############ convention_dictionnary_data = ", convention_dictionnary_data)
|
||||
|
||||
|
|
@ -3088,7 +3325,12 @@ def Send_Partner_Invoice_By_Email(tab_files, Folder, diction):
|
|||
partner_document_INVOICE_data['joint_pdf']) == "1"):
|
||||
|
||||
# Si on a un document sécurisé associé, alors on va le chercher, si non on le crée à la volée
|
||||
if ("e_document_signe_id" in Invoice_header_data.keys() and Invoice_header_data['e_document_signe_id']):
|
||||
"""
|
||||
06/12/205 -
|
||||
Si invoice_regeneration == "1", on alors on va regenerer la facture sur le modele de document
|
||||
"""
|
||||
|
||||
if ( invoice_regeneration != "1" and "e_document_signe_id" in Invoice_header_data.keys() and Invoice_header_data['e_document_signe_id']):
|
||||
# On retourne la e_Invoice securisée
|
||||
|
||||
print(" #### RECUPERATION DU FICHIER SECURISE ")
|
||||
|
|
@ -3143,8 +3385,6 @@ def Send_Partner_Invoice_By_Email(tab_files, Folder, diction):
|
|||
tab_files_to_attache_to_mail.append(new_node)
|
||||
|
||||
|
||||
|
||||
|
||||
else:
|
||||
# Il n'y pas de fichier joint sécurisé, il faut donc en créer un à la volée
|
||||
|
||||
|
|
|
|||
|
|
@ -3248,15 +3248,20 @@ def Get_List_Survey_with_filter(diction):
|
|||
if ("survey_internal_code" in diction.keys()):
|
||||
filt_survey_internal_code = {'survey_internal_code': str(diction['survey_internal_code'])}
|
||||
|
||||
filt_survey_type = {}
|
||||
if ("formulaire_type" in diction.keys() and diction['formulaire_type']):
|
||||
filt_survey_type = {'survey_type': str(diction['formulaire_type'])}
|
||||
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
qry = {"partner_owner_recid": str(my_partner['recid']), 'valide': '1', 'locked': '0', 'survey_type':str(diction['formulaire_type'])}
|
||||
qry = {"partner_owner_recid": str(my_partner['recid']), 'valide': '1', 'locked': '0'}
|
||||
query_with_filter = {'$and': [qry, filt_session_id, filt_related_collection, filt_related_collection_id,
|
||||
filt_survey_internal_code]}
|
||||
filt_survey_internal_code, filt_survey_type]}
|
||||
|
||||
pipe_qry = ([
|
||||
if ("formulaire_type" in diction.keys() and diction['formulaire_type']):
|
||||
pipe_qry = ([
|
||||
{'$match': query_with_filter },
|
||||
{'$project': { 'valide': 0, 'locked': 0, }},
|
||||
{'$lookup': {
|
||||
|
|
@ -3295,6 +3300,44 @@ def Get_List_Survey_with_filter(diction):
|
|||
}
|
||||
])
|
||||
|
||||
else:
|
||||
pipe_qry = ([
|
||||
{'$match': query_with_filter},
|
||||
{'$project': {'valide': 0, 'locked': 0, }},
|
||||
{'$lookup': {
|
||||
'from': 'formulaire',
|
||||
"let": {'formulaire_id': "$formulaire_id",
|
||||
'partner_owner_recid': '$partner_owner_recid'},
|
||||
'pipeline': [
|
||||
{'$match':
|
||||
{'$expr':
|
||||
{'$and':
|
||||
[
|
||||
|
||||
{'$eq': ["$_id", {'$convert': {
|
||||
'input': "$$formulaire_id",
|
||||
'to': "objectId",
|
||||
'onError': {'error': 'true'},
|
||||
'onNull': {'isnull': 'true'}
|
||||
}}]},
|
||||
|
||||
{'$eq': ["$valide", "1"]},
|
||||
{'$eq': ["$partner_owner_recid", '$$partner_owner_recid']}
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
],
|
||||
'as': 'formulaire'
|
||||
}
|
||||
},
|
||||
{
|
||||
'$unwind': '$formulaire'
|
||||
}
|
||||
])
|
||||
|
||||
print(" ### pipe_qry = ", pipe_qry)
|
||||
|
||||
for New_retVal in MYSY_GV.dbname['survey'].aggregate(pipe_qry):
|
||||
|
|
@ -3367,6 +3410,8 @@ def Get_List_Survey_with_filter(diction):
|
|||
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
#print(" ## USER = ", user)
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
|
|
|||
|
|
@ -2414,3 +2414,57 @@ def JMJ_Repise_Factures_Update_Inscription_Status(diction):
|
|||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de faire la reprise de factures JMJ"
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction permet de desactiver les traitements automatique sur
|
||||
les sessions de formation.
|
||||
Si un partner_owner_recid = "all", alors il fait pour tout le monde
|
||||
si non pour le partner_owner_recid concerné
|
||||
|
||||
"""
|
||||
def Disable_Session_Formation_Automation(diction):
|
||||
try:
|
||||
a = 2
|
||||
|
||||
qry_session = ""
|
||||
if( diction['partner_owner_recid'] == "all"):
|
||||
qry_session = {}
|
||||
else:
|
||||
qry_session = {'partner_owner_recid':str(diction['partner_owner_recid'])}
|
||||
|
||||
|
||||
for session_data in MYSY_GV.dbname['session_formation'].find(qry_session):
|
||||
print("### session_data kkk = ", session_data)
|
||||
if( "automatic_traitement" in session_data and session_data['automatic_traitement']):
|
||||
|
||||
for automatic_traitement_data in session_data['automatic_traitement']:
|
||||
|
||||
if( automatic_traitement_data and "actif" in automatic_traitement_data.keys()):
|
||||
print(" ### _id = ", str(session_data['_id']))
|
||||
print(" ### str(automatic_traitement_data['_id']) = ", str(automatic_traitement_data['_id']))
|
||||
|
||||
local_update = MYSY_GV.dbname['session_formation'].update_many(
|
||||
{'_id':ObjectId(str(session_data['_id']))},
|
||||
{'$set':
|
||||
{
|
||||
'automatic_traitement.$[xxx].actif': "-1",
|
||||
'automatic_traitement.$[xxx].statut': "2",
|
||||
'automatic_traitement.$[xxx].date_traitement_cron': str(datetime.now()),
|
||||
'automatic_traitement.$[xxx].date_update': str(datetime.now()),
|
||||
'automatic_traitement.$[xxx].update_by': "Automatic Cron",
|
||||
}
|
||||
},
|
||||
upsert=False,
|
||||
array_filters=[
|
||||
{"xxx._id": ObjectId(str(automatic_traitement_data['_id']))}
|
||||
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
return True, "Mise à jour OK "
|
||||
|
||||
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 faire la mise à jour"
|
||||
|
|
|
|||
Loading…
Reference in New Issue