gdfgdf
parent
4a1167c127
commit
850e22a927
|
@ -1,11 +1,16 @@
|
|||
<?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="sdsqq">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="ss">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron.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_Sequence.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation_Sequence.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_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$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -75,13 +80,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00263" summary="09/04/2024 - 23h50">
|
||||
<created>1712699498317</created>
|
||||
<option name="number" value="00263" />
|
||||
<option name="presentableId" value="LOCAL-00263" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1712699498318</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00264" summary="10/04/2024 - 11h50">
|
||||
<created>1712742562300</created>
|
||||
<option name="number" value="00264" />
|
||||
|
@ -418,7 +416,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1716483578233</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="312" />
|
||||
<task id="LOCAL-00312" summary="ss">
|
||||
<created>1716568731554</created>
|
||||
<option name="number" value="00312" />
|
||||
<option name="presentableId" value="LOCAL-00312" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716568731554</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="313" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -460,7 +465,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="05/05/2024 - 13h30" />
|
||||
<MESSAGE value="05/05/2024 - 17h30" />
|
||||
<MESSAGE value="06/05/2024 - 22h30" />
|
||||
<MESSAGE value="07/05/2024 - 17h30" />
|
||||
|
@ -485,6 +489,7 @@
|
|||
<MESSAGE value="20/05/2024 - 22h00" />
|
||||
<MESSAGE value="21/05/2024 - 21h" />
|
||||
<MESSAGE value="sdsqq" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="sdsqq" />
|
||||
<MESSAGE value="ss" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="ss" />
|
||||
</component>
|
||||
</project>
|
|
@ -5438,6 +5438,190 @@ def Refuse_List_AttendeeInscription_with_motif(diction):
|
|||
return False, " Impossible de refuser la liste des inscriptions"
|
||||
|
||||
|
||||
"""
|
||||
26/05/2025 : Gestion Formation initiale
|
||||
Si il s'agit d'une inscription à une formation initiale, alors
|
||||
on créer le contenu des collection :
|
||||
- inscription_liste_ue : Dans cette collection on les UE auxquelles l'apprenant est inscrit
|
||||
- inscription_liste_ue_type_eval : Dans cette collection on a types d'evaluation que doit passer un apprenant sur une UE
|
||||
==> Cela permet de gerer par exemple les personne qui s'inscrivent juste pour passer l'exemple final, ou juste les project
|
||||
etc.
|
||||
|
||||
/!\ Pour determiner si une inscription concerne la formation initiale, on regarde si le compte utilisateur qui
|
||||
valide l'inscription est un compte de 'formation initiale'
|
||||
|
||||
|
||||
cette fonction prend en entrée :
|
||||
- inscription_id
|
||||
- class_id
|
||||
- tab_type_evaluation : [ {'eu_id':'xxx', 'type_eval_id':'yyy'}, {'eu_id':'xxx', 'type_eval_id':'yyy'},....]
|
||||
|
||||
"""
|
||||
def Init_AcceptAttendeeInscription_For_Initial_Formation(diction):
|
||||
try:
|
||||
"""
|
||||
Verification de la liste des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'inscription_id', 'class_id', 'tab_type_evaluation']
|
||||
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 liste ")
|
||||
return False, " Les informations fournies ne sont pas correctes"
|
||||
|
||||
mytoken = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
mytoken = diction['token', 'inscription_id', 'class_id', 'tab_type_evaluation']
|
||||
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
formation_initiale = "0"
|
||||
if( "formation_initiale" in my_partner.keys() ):
|
||||
formation_initiale = my_partner['formation_initiale']
|
||||
|
||||
if( formation_initiale != "1"):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Il ne s'agit pas d'un formation initiale ")
|
||||
return True, " Il ne s'agit pas d'un formation initiale "
|
||||
|
||||
|
||||
"""
|
||||
Verifier que l'inscription est valide
|
||||
"""
|
||||
is_valide_inscription_count = MYSY_GV.dbname['inscription'].count_documents({'_id':ObjectId(diction['inscription_id']),
|
||||
'partner_owner_recid':str(my_partner['recid']),
|
||||
'valide':'1'})
|
||||
|
||||
if( is_valide_inscription_count != 1) :
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de l'inscrit est invalide ")
|
||||
return False, " L'identifiant de l'inscrit est invalide "
|
||||
|
||||
|
||||
"""
|
||||
Verifier la validité de la formation et créer le contenu de la collection
|
||||
"""
|
||||
is_valide_class_count = MYSY_GV.dbname['myclass'].count_documents(
|
||||
{'_id': ObjectId(diction['class_id']),
|
||||
'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1',
|
||||
'locked':'0'})
|
||||
|
||||
if (is_valide_class_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de la formation est invalide ")
|
||||
return False, " L'identifiant de la formation est invalide "
|
||||
|
||||
|
||||
"""
|
||||
Suppression des données existe dans les collections : inscription_liste_ue et inscription_liste_ue_type_eval
|
||||
pour l'inscrit et la formation conernée
|
||||
"""
|
||||
|
||||
clean_inscription_liste_ue = MYSY_GV.dbname['inscription_liste_ue'].delete_many({"partner_owner_recid": str(my_partner['recid']),
|
||||
'class_id': str(diction['class_id']), 'inscription_id': str(diction['inscription_id']), })
|
||||
|
||||
clean_inscription_liste_ue_type_eval = MYSY_GV.dbname['inscription_liste_ue_type_eval'].delete_many(
|
||||
{"partner_owner_recid": str(my_partner['recid']),
|
||||
'class_id': str(diction['class_id']), 'inscription_id': str(diction['inscription_id']), })
|
||||
|
||||
"""
|
||||
Recuperer les UE de la formation
|
||||
"""
|
||||
tab_class_ue_id = []
|
||||
|
||||
qry = {"partner_owner_recid": str(my_partner['recid']), 'valide': '1', 'locked': '0',
|
||||
'_id': ObjectId(str(diction['class_id']))}
|
||||
|
||||
|
||||
|
||||
for New_retVal in MYSY_GV.dbname['myclass'].find(qry).sort([("_id", pymongo.DESCENDING), ]):
|
||||
if( "list_unite_enseignement" in New_retVal.keys() ):
|
||||
for local_val in New_retVal['list_unite_enseignement'] :
|
||||
|
||||
tab_class_ue_id.append(str(local_val['_id']))
|
||||
|
||||
new_data = {}
|
||||
new_data['inscription_id'] = str(diction['inscription_id'])
|
||||
new_data['class_id'] = str(diction['class_id'])
|
||||
new_data['class_eu_id'] = str(local_val['_id'])
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
new_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
|
||||
|
||||
|
||||
key_data = {}
|
||||
key_data['inscription_id'] = str(diction['inscription_id'])
|
||||
key_data['class_id'] = str(diction['class_id'])
|
||||
key_data['class_eu_id'] = str(local_val['_id'])
|
||||
key_data['valide'] = "1"
|
||||
key_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
|
||||
result = MYSY_GV.dbname['inscription_liste_ue'].find_one_and_update(
|
||||
key_data,
|
||||
{"$set": new_data},
|
||||
upsert=True,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
if ("_id" not in result.keys()):
|
||||
mycommon.myprint(
|
||||
" Impossible de valider l'inscription pour la formation initiale (2) ")
|
||||
return False, "Impossible de valider l'inscription pour la formation initiale (2) "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Remplissage de la collection : inscription_liste_ue_type_eval
|
||||
"""
|
||||
|
||||
for val in MYSY_GV.dbname['class_unite_enseignement_type_evaluation'].find({'partner_owner_recid':str(my_partner['recid']),
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'class_id':str(diction['class_id'])}):
|
||||
new_data = {}
|
||||
new_data['inscription_id'] = str(diction['inscription_id'])
|
||||
new_data['class_id'] = str(diction['class_id'])
|
||||
new_data['class_eu_id'] = str(val['class_ue_id'])
|
||||
new_data['type_evaluation_id'] = str(val['type_evaluation_id'])
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
new_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
|
||||
key_data = {}
|
||||
key_data['inscription_id'] = str(diction['inscription_id'])
|
||||
key_data['class_id'] = str(diction['class_id'])
|
||||
key_data['class_eu_id'] = str(local_val['_id'])
|
||||
key_data['valide'] = "1"
|
||||
key_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
result = MYSY_GV.dbname['inscription_liste_ue'].find_one_and_update(
|
||||
key_data,
|
||||
{"$set": new_data},
|
||||
upsert=True,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
if ("_id" not in result.keys()):
|
||||
mycommon.myprint(
|
||||
" Impossible de valider l'inscription pour la formation initiale (2) ")
|
||||
return False, "Impossible de valider l'inscription pour la formation initiale (2) "
|
||||
|
||||
|
||||
return True, "L'inscription a été correctement validée"
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de valider l'inscription pour la formation initiale"
|
||||
|
||||
|
||||
|
||||
|
@ -5934,6 +6118,24 @@ def AcceptAttendeeInscription(diction):
|
|||
)
|
||||
|
||||
|
||||
"""
|
||||
26/05/2024 : S'il s'agit d'une formation initiale, alors on lance la fonction 'xxxx'
|
||||
qui permet de créer les contenus des collection 'inscription_liste_ue' et peut etre 'inscription_liste_ue_type_eval'
|
||||
|
||||
Il s'agit du remplissage par defaut ou tout est actif
|
||||
"""
|
||||
|
||||
if( "formation_initiale" in my_partner.keys() and my_partner['formation_initiale'] == "1"):
|
||||
local_diction = {}
|
||||
local_diction['token'] = diction['token']
|
||||
local_diction['inscription_id'] = diction['inscription_id']
|
||||
local_diction['class_id'] = str(local_class[0]['_id'])
|
||||
|
||||
local_inscription_liste_ue_status, local_inscription_liste_ue_retval = Init_AcceptAttendeeInscription_For_Initial_Formation(local_diction)
|
||||
|
||||
print(" local_inscription_liste_ue_status, local_inscription_liste_ue_retval = ", local_inscription_liste_ue_status, local_inscription_liste_ue_retval)
|
||||
|
||||
|
||||
"""
|
||||
update du 30/01/2024 :
|
||||
Apres la mise à jour de l'inscription avec l'apprenant_id,
|
||||
|
@ -5958,7 +6160,7 @@ def AcceptAttendeeInscription(diction):
|
|||
|
||||
|
||||
"""
|
||||
Cette fonction une liste d'inscrit à une session de formation
|
||||
Cette fonction acepte une liste d'inscrit à une session de formation
|
||||
"""
|
||||
def Accept_List_AttendeeInscription(diction):
|
||||
try:
|
||||
|
@ -6767,7 +6969,7 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
'foreignField': 'internal_url',
|
||||
'pipeline': [{'$match':{ '$and' : [ filt_class_title, filt_class_partner_recid] } }, {'$project': {'title': 1, 'domaine': 1,
|
||||
'duration': 1,
|
||||
'duration_unit': 1}}],
|
||||
'duration_unit': 1, '_id':1}}],
|
||||
'as': 'myclass_collection'
|
||||
}
|
||||
},
|
||||
|
@ -6864,6 +7066,7 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
|
||||
val['status'] = retVal['status']
|
||||
|
||||
val['class_id'] = str(retVal['myclass_collection'][0]['_id'])
|
||||
val['title'] = retVal['myclass_collection'][0]['title']
|
||||
if("domaine" in retVal['myclass_collection'][0].keys() ):
|
||||
val['domaine'] = retVal['myclass_collection'][0]['domaine']
|
||||
|
|
17
Job_Cron.py
17
Job_Cron.py
|
@ -104,11 +104,13 @@ def Global_MySy_Cron_Traitement():
|
|||
possibles.update(locals())
|
||||
cron_function = possibles.get(val['job_name'])
|
||||
if not cron_function:
|
||||
return False, "Fonction '"+str(val['job_name'])+"' est introuvable"
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Fonction '"+str(val['job_name'])+"' est introuvable")
|
||||
continue
|
||||
|
||||
local_con_status, local_con_retval = cron_function()
|
||||
|
||||
print(" local_con_status = ", local_con_status)
|
||||
print(" Traitement 01 du job = ", val['job_name'])
|
||||
|
||||
"""
|
||||
Mettre à jour le cron pour dire que tout s'est bien poassé
|
||||
|
@ -163,6 +165,8 @@ CRON fonction qui envoie les demandes d'enquete
|
|||
"""
|
||||
def Cron_Send_Survey():
|
||||
try:
|
||||
|
||||
print(" Cron : In function = Cron_Send_Survey")
|
||||
for val in MYSY_GV.dbname['survey'].find({"automatique_traitement":"1",
|
||||
'automatique_traitement_done':'0',
|
||||
'valide':'1',
|
||||
|
@ -241,6 +245,7 @@ Verifier que les devis repondent aux critères suivants (la collection : partner
|
|||
def Cron_Quotation_Relance():
|
||||
try:
|
||||
|
||||
print(" Cron : In function = Cron_Quotation_Relance")
|
||||
todays_date = str(date.today().strftime("%d/%m/%Y"))
|
||||
todays_date_ISODATE = datetime.strptime(str(todays_date), '%d/%m/%Y')
|
||||
|
||||
|
@ -283,7 +288,7 @@ def Cron_Quotation_Relance():
|
|||
{'$match': devis_qery_match},
|
||||
])
|
||||
|
||||
#print(" ## pipe_qry Cron_Quotation_Relance = ", pipe_qry)
|
||||
print(" ## pipe_qry Cron_Quotation_Relance = ", pipe_qry)
|
||||
for local_devis in MYSY_GV.dbname['partner_order_header'].aggregate(pipe_qry):
|
||||
|
||||
is_quotation_validated = 0
|
||||
|
@ -293,7 +298,7 @@ def Cron_Quotation_Relance():
|
|||
is_quotation_validated = 1
|
||||
|
||||
|
||||
#print( "### local_devis a traiter = ", local_devis)
|
||||
print( "### local_devis a traiter = ", local_devis)
|
||||
|
||||
relance_done = 0
|
||||
nb_limite_relance = 0
|
||||
|
@ -332,7 +337,6 @@ def Cron_Quotation_Relance():
|
|||
datetime.strptime(str(todays_date), '%d/%m/%Y')
|
||||
|
||||
|
||||
|
||||
if( is_quotation_validated == 0 and relance_done <= nb_limite_relance and datetime.strptime(str(todays_date), '%d/%m/%Y') >= datetime.strptime( str(new_relance_date_no_ISODATE).strip(), '%d/%m/%Y') ):
|
||||
|
||||
"""
|
||||
|
@ -429,6 +433,7 @@ A la prochaine facturation, comme on est sur une facturation mensuelle, le syst
|
|||
"""
|
||||
def Cron_Monthly_Invoice_Inscription():
|
||||
try:
|
||||
print(" Cron : In function = Cron_Monthly_Invoice_Inscription")
|
||||
|
||||
todays_date = str(date.today().strftime("%d/%m/%Y"))
|
||||
todays_date_ISODATE = datetime.strptime(str(todays_date), '%d/%m/%Y')
|
||||
|
@ -661,6 +666,8 @@ tables et met à jour les inscriptions
|
|||
"""
|
||||
def Invoice_Data_From_Tab(diction):
|
||||
try:
|
||||
|
||||
print(" Cron : In function = Invoice_Data_From_Tab")
|
||||
todays_date_mode_2 = str(date.today().strftime("%Y-%m-%d"))
|
||||
|
||||
print( " ### diction FACTURATION= ", diction)
|
||||
|
|
4479
Log/log_file.log
4479
Log/log_file.log
File diff suppressed because one or more lines are too long
|
@ -2093,6 +2093,114 @@ def Delete_Sequence_Affectation_Ressource_Poste(diction):
|
|||
return False, " Impossible de supprimer l'affectation de la ressource à la sequence "
|
||||
|
||||
|
||||
"""
|
||||
Supprimer les affectations et reservation de ressources pour les
|
||||
notes evaluation
|
||||
"""
|
||||
|
||||
def Delete_Note_Evaluation_Ressource_Poste(diction):
|
||||
try:
|
||||
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', "_id", "note_evaluation_id", "poste", "comment", 'related_target_collection', 'related_target_collection_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', '_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 liste ")
|
||||
return False, " Toutes le information obligatoires n'ont pas été fournies"
|
||||
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
|
||||
|
||||
# Recuperation du recid du partenaire
|
||||
partner_recid = mycommon.get_parnter_recid_from_token(str(token))
|
||||
if partner_recid is False:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de récupérer le partner_recid")
|
||||
return False, " Les informations d'identification sont invalides"
|
||||
|
||||
local_status, my_partner_data = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner_data
|
||||
|
||||
|
||||
# Verifier l'existence et la validité d'evalution à modifier
|
||||
note_evaluation_id = ""
|
||||
if ("note_evaluation_id" in diction.keys()):
|
||||
if diction['note_evaluation_id']:
|
||||
note_evaluation_id = diction['note_evaluation_id']
|
||||
|
||||
# Verifier que l'affetation existe bien
|
||||
affectation_evaluation_existe_count = MYSY_GV.dbname['note_evaluation_affectation_ressource'].count_documents({'_id':ObjectId(str(diction['_id'])),
|
||||
'partner_owner_recid':str(partner_recid),
|
||||
'valide':'1', 'locked':'0'})
|
||||
|
||||
if( affectation_evaluation_existe_count != 1 ) :
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " L'affectation est invalide ")
|
||||
return False, " L'affectation est invalide "
|
||||
|
||||
|
||||
affectation_evaluation_existe_data = MYSY_GV.dbname[
|
||||
'note_evaluation_affectation_ressource'].find_one(
|
||||
{'_id': ObjectId(str(diction['_id'])), 'partner_owner_recid': str(partner_recid),
|
||||
'valide': '1', 'locked': '0'})
|
||||
|
||||
|
||||
|
||||
deleted_data = MYSY_GV.dbname['note_evaluation_affectation_ressource'].delete_one(
|
||||
{'_id': ObjectId(str(diction['_id'])), 'valide': "1", "locked": "0",
|
||||
'partner_owner_recid': str(partner_recid)}, )
|
||||
|
||||
if (deleted_data is None):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de supprimer à jour cette affectation (3)")
|
||||
return False, " Impossible de supprimer cette affectation (3) "
|
||||
|
||||
"""
|
||||
A present que la ressource a été supprimée, il faut egalement supprimer la reservation de la ressource
|
||||
"""
|
||||
qry_for_delete = { 'partner_owner_recid': str(affectation_evaluation_existe_data['partner_owner_recid']),
|
||||
'related_collection_recid':str(affectation_evaluation_existe_data['related_target_collection_id']),
|
||||
'related_collection':str(affectation_evaluation_existe_data['related_target_collection']),
|
||||
'session_formation_sequence_affectation_id': str(affectation_evaluation_existe_data['_id'])}
|
||||
|
||||
print(" #### qry_for_delete = ", qry_for_delete)
|
||||
|
||||
MYSY_GV.dbname['agenda'].delete_many(qry_for_delete)
|
||||
|
||||
|
||||
return True, " L'affectation a bien été supprimée"
|
||||
|
||||
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 supprimer l'affectation de la ressource "
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperer la liste des affectations de ressource à une sequence
|
||||
|
|
24
main.py
24
main.py
|
@ -6877,6 +6877,23 @@ def Delete_Sequence_Affectation_Ressource_Poste():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API Supprimer une affectation de ressource affectée à une evaluation
|
||||
"""
|
||||
@app.route('/myclass/api/Delete_Note_Evaluation_Ressource_Poste/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Delete_Note_Evaluation_Ressource_Poste():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Delete_Note_Evaluation_Ressource_Poste payload = ",payload)
|
||||
status, retval = Session_Formation_Sequence.Delete_Note_Evaluation_Ressource_Poste(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API Recuperer la liste des affectations de ressource à une sequence
|
||||
"""
|
||||
|
@ -9629,11 +9646,10 @@ if __name__ == '__main__':
|
|||
/!\ Dasactivé en dev pour pas consommer de ressource pr rien.
|
||||
"""
|
||||
|
||||
|
||||
scheduler = BackgroundScheduler()
|
||||
""" scheduler = BackgroundScheduler()
|
||||
# Create the job
|
||||
scheduler.add_job(func=Flask_Cron_Strip_Get_Customer_Abonnement_Data, trigger="interval", minutes=3)
|
||||
scheduler.add_job(func=Internal_Global_MySy_Cron_Traitement, trigger="interval", minutes=2)
|
||||
scheduler.add_job(func=Internal_Global_MySy_Cron_Traitement, trigger="interval", minutes=1)
|
||||
|
||||
print(" ### scheduler.print_jobs() = ", scheduler.print_jobs())
|
||||
# Start the scheduler
|
||||
|
@ -9642,7 +9658,7 @@ if __name__ == '__main__':
|
|||
|
||||
# /!\ IMPORTANT /!\ : Shut down the scheduler when exiting the app
|
||||
atexit.register(lambda: scheduler.shutdown())
|
||||
|
||||
"""
|
||||
|
||||
app.run(host='localhost', port=MYSY_GV.MYSY_PORT_DEV, debug=True, threaded=True)
|
||||
# Create the background scheduler
|
||||
|
|
|
@ -1705,62 +1705,14 @@ def GerneratePDF_Partner_Invoice(diction):
|
|||
"params": convention_dictionnary_data,
|
||||
}
|
||||
|
||||
"""
|
||||
# Recuperation des données du partenaire associé à l'utilisateur connecté
|
||||
local_status, local_retval = mycommon.Get_Connected_User_Partner_Data_From_RecID(my_partner['recid'])
|
||||
if (local_status is False):
|
||||
return local_status, local_retval
|
||||
|
||||
|
||||
local_company_data = local_retval
|
||||
|
||||
|
||||
# Recuperation des données de la société
|
||||
company_data = {}
|
||||
|
||||
company_liste_champ = ['nom', 'email', 'telephone', 'num_nda', 'website', 'adr_street', 'adr_zip', 'adr_city',
|
||||
'adr_country']
|
||||
for champ in company_liste_champ:
|
||||
if (champ in local_company_data):
|
||||
new_champ_name = "societe_" + str(champ)
|
||||
new_field = {new_champ_name: str(local_company_data[champ])}
|
||||
company_data.update(new_field)
|
||||
else:
|
||||
new_champ_name = "societe_" + str(champ)
|
||||
new_field = {new_champ_name: ""}
|
||||
company_data.update(new_field)
|
||||
|
||||
# Recuperation du logo et du cachet de la société si il y en a
|
||||
local_part_status, local_part_imgs = partners.getRecodedParnterImage_from_front(
|
||||
{'token': str(diction['token'])})
|
||||
if (local_part_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " WARNING : Impossible de récuperer le logo et le cachet du partenaire ")
|
||||
new_field_logo = {'societe_logo': ''}
|
||||
new_field_cachet = {'societe_cachet': ''}
|
||||
company_data.update(new_field_logo)
|
||||
company_data.update(new_field_cachet)
|
||||
else:
|
||||
|
||||
local_JSON = ast.literal_eval(local_part_imgs[0])
|
||||
|
||||
new_field_logo = {'societe_logo': "data:image/png;base64," + local_JSON['logo_img']}
|
||||
new_field_cachet = {'societe_cachet': "data:image/png;base64," + local_JSON['cachet_img']}
|
||||
company_data.update(new_field_logo)
|
||||
company_data.update(new_field_cachet)
|
||||
|
||||
"""
|
||||
|
||||
"""
|
||||
print("Order_header_data = ", Order_header_data)
|
||||
print("Order_header_lines_data = ", Order_header_lines_data)
|
||||
print("company_data['params'] = ", company_data['params'])
|
||||
"""
|
||||
convention_dictionnary_data['order_header'] = Order_header_data
|
||||
convention_dictionnary_data['order_lines'] = Order_header_lines_data
|
||||
|
||||
#sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data, company_data=company_data)
|
||||
|
||||
sourceHtml = contenu_doc_Template.render(params_order_header=Order_header_data, params_order_lines=Order_header_lines_data,
|
||||
params=company_data['params'])
|
||||
#sourceHtml = contenu_doc_Template.render(params_order_header=Order_header_data, params_order_lines=Order_header_lines_data, params=company_data['params'])
|
||||
|
||||
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)
|
||||
|
@ -2099,18 +2051,22 @@ def Send_Partner_Invoice_By_Email(diction):
|
|||
}
|
||||
|
||||
|
||||
convention_dictionnary_data['order_header'] = Order_header_data
|
||||
convention_dictionnary_data['order_lines'] = Order_header_lines_data
|
||||
|
||||
print(" ############ convention_dictionnary_data = ", convention_dictionnary_data)
|
||||
|
||||
#print(" #### Order_header_data = ", Order_header_data)
|
||||
#sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data, company_data=company_data)
|
||||
|
||||
contenu_doc_Template = jinja2.Template(str(partner_document_INVOICE_data['contenu_doc']))
|
||||
contenuHtml = contenu_doc_Template.render(params_order_header=Order_header_data,
|
||||
params_order_lines=Order_header_lines_data,
|
||||
params=company_data['params'])
|
||||
#contenuHtml = contenu_doc_Template.render(params_order_header=Order_header_data,params_order_lines=Order_header_lines_data, params=company_data['params'])
|
||||
contenuHtml = contenu_doc_Template.render(params=company_data['params'])
|
||||
|
||||
|
||||
contenu_doc_Template_subject = jinja2.Template(str(partner_document_INVOICE_data['sujet']))
|
||||
sujetHtml = contenu_doc_Template_subject.render(params_order_header=Order_header_data)
|
||||
#sujetHtml = contenu_doc_Template_subject.render(params_order_header=Order_header_data)
|
||||
sujetHtml = contenu_doc_Template_subject.render(params=company_data['params'])
|
||||
|
||||
#print(" #### sourceHtml = ", sourceHtml)
|
||||
|
||||
|
|
297
partner_order.py
297
partner_order.py
|
@ -4477,6 +4477,25 @@ def GerneratePDF_Partner_Order(diction):
|
|||
if ("email" in Order_header_client_data.keys()):
|
||||
Order_header_data['client_email'] = Order_header_client_data['email']
|
||||
|
||||
"""
|
||||
Recup condition paiement id
|
||||
"""
|
||||
cdtion_paiement_code = ""
|
||||
cdtion_paiement_id = ""
|
||||
if( "order_header_condition_paiement_id" in Order_header_data.keys() and Order_header_data['order_header_condition_paiement_id']):
|
||||
cdtion_paiement_data = MYSY_GV.dbname['base_partner_paiement_condition'].find_one({'_id':ObjectId(str(Order_header_data['order_header_condition_paiement_id'])),
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
}
|
||||
)
|
||||
|
||||
if( cdtion_paiement_data and 'code' in cdtion_paiement_data.keys() ):
|
||||
cdtion_paiement_code = str(cdtion_paiement_data['code'])
|
||||
cdtion_paiement_id = str(cdtion_paiement_data['_id'])
|
||||
|
||||
Order_header_data['order_header_condition_paiement_code'] = cdtion_paiement_code
|
||||
Order_header_data['order_header_condition_paiement_id'] = cdtion_paiement_id
|
||||
|
||||
|
||||
# Recuperation des details de lignes de : partner_order_line
|
||||
filt_class_partner_recid = {'partner_owner_recid': str(my_partner['recid'])}
|
||||
|
@ -4515,6 +4534,31 @@ def GerneratePDF_Partner_Order(diction):
|
|||
user['valide'] = retval['valide']
|
||||
user['locked'] = retval['locked']
|
||||
|
||||
if ("order_line_session_id" in retval.keys()):
|
||||
local_session_data = MYSY_GV.dbname['session_formation'].find_one(
|
||||
{'_id': ObjectId(str(retval['order_line_session_id'])),
|
||||
'valide': '1',
|
||||
'partner_owner_recid': my_partner['recid']})
|
||||
|
||||
if (local_session_data):
|
||||
|
||||
if ("code_session" in local_session_data.keys()):
|
||||
user['code_session'] = local_session_data['code_session']
|
||||
else:
|
||||
user['code_session'] = ""
|
||||
|
||||
if ("date_debut" in local_session_data.keys() and "date_fin" in local_session_data.keys()):
|
||||
user['session_date_debut'] = local_session_data['date_debut']
|
||||
user['session_date_fin'] = local_session_data['date_fin']
|
||||
else:
|
||||
user['session_date_debut'] = ""
|
||||
user['session_date_fin'] = ""
|
||||
else:
|
||||
user['order_line_session_id'] = ""
|
||||
user['code_session'] = ""
|
||||
user['session_date_debut'] = ""
|
||||
user['session_date_fin'] = ""
|
||||
|
||||
if ("order_line_montant_reduction" in retval.keys()):
|
||||
user['order_line_montant_reduction'] = retval['order_line_montant_reduction']
|
||||
else:
|
||||
|
@ -4599,7 +4643,33 @@ def GerneratePDF_Partner_Order(diction):
|
|||
return False, " Aucune ligne de détail pour cette commande "
|
||||
|
||||
#print(" ### Order_header_lines_data = ", Order_header_lines_data)
|
||||
# Creation du dictionnaire d'information à utiliser pour la creation du doc
|
||||
|
||||
tab_client = []
|
||||
tab_client.append(ObjectId(str(Order_header_data['order_header_client_id'])))
|
||||
|
||||
convention_dictionnary_data = {}
|
||||
new_diction = {}
|
||||
new_diction['token'] = diction['token']
|
||||
new_diction['list_stagiaire_id'] = []
|
||||
new_diction['list_session_id'] = []
|
||||
new_diction['list_class_id'] = []
|
||||
new_diction['list_client_id'] = tab_client
|
||||
new_diction['list_apprenant_id'] = []
|
||||
|
||||
local_status, local_retval = mycommon.Get_Dictionnary_data_For_Template(new_diction)
|
||||
|
||||
if (local_status is False):
|
||||
return local_status, local_retval
|
||||
|
||||
convention_dictionnary_data = local_retval
|
||||
|
||||
convention_dictionnary_data['order_header'] = Order_header_data
|
||||
convention_dictionnary_data['order_lines'] = Order_header_lines_data
|
||||
|
||||
body = {
|
||||
"params": convention_dictionnary_data,
|
||||
}
|
||||
|
||||
contenu_doc_Template = jinja2.Template(str(partner_document_CONF_ORDER_data['contenu_doc']))
|
||||
|
||||
|
@ -4607,8 +4677,8 @@ def GerneratePDF_Partner_Order(diction):
|
|||
#sourceHtml = contenu_doc_Template.render(params=Order_header_data)
|
||||
Order_header_data['order_header_type'] = str(Order_header_data['order_header_type']).capitalize()
|
||||
|
||||
sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
||||
|
||||
#sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
||||
sourceHtml = contenu_doc_Template.render(params=body['params'], )
|
||||
|
||||
orig_file_name = "Partner_Order_"+str(Order_header_data['order_header_ref_interne'])+".pdf"
|
||||
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) +"/"+ str(orig_file_name)
|
||||
|
@ -4744,6 +4814,26 @@ def Gernerate_Stock_PDF_Partner_Order(diction):
|
|||
if ("email" in Order_header_client_data.keys()):
|
||||
Order_header_data['client_email'] = Order_header_client_data['email']
|
||||
|
||||
"""
|
||||
Recup condition paiement id
|
||||
"""
|
||||
cdtion_paiement_code = ""
|
||||
cdtion_paiement_id = ""
|
||||
if ("order_header_condition_paiement_id" in Order_header_data.keys() and Order_header_data[
|
||||
'order_header_condition_paiement_id']):
|
||||
cdtion_paiement_data = MYSY_GV.dbname['base_partner_paiement_condition'].find_one(
|
||||
{'_id': ObjectId(str(Order_header_data['order_header_condition_paiement_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
}
|
||||
)
|
||||
|
||||
if (cdtion_paiement_data and 'code' in cdtion_paiement_data.keys()):
|
||||
cdtion_paiement_code = str(cdtion_paiement_data['code'])
|
||||
cdtion_paiement_id = str(cdtion_paiement_data['_id'])
|
||||
|
||||
Order_header_data['order_header_condition_paiement_code'] = cdtion_paiement_code
|
||||
Order_header_data['order_header_condition_paiement_id'] = cdtion_paiement_id
|
||||
|
||||
# Recuperation des details de lignes de : partner_order_line
|
||||
filt_class_partner_recid = {'partner_owner_recid': str(my_partner['recid'])}
|
||||
|
@ -4782,6 +4872,31 @@ def Gernerate_Stock_PDF_Partner_Order(diction):
|
|||
user['valide'] = retval['valide']
|
||||
user['locked'] = retval['locked']
|
||||
|
||||
if ("order_line_session_id" in retval.keys()):
|
||||
local_session_data = MYSY_GV.dbname['session_formation'].find_one(
|
||||
{'_id': ObjectId(str(retval['order_line_session_id'])),
|
||||
'valide': '1',
|
||||
'partner_owner_recid': my_partner['recid']})
|
||||
|
||||
if (local_session_data):
|
||||
|
||||
if ("code_session" in local_session_data.keys()):
|
||||
user['code_session'] = local_session_data['code_session']
|
||||
else:
|
||||
user['code_session'] = ""
|
||||
|
||||
if ("date_debut" in local_session_data.keys() and "date_fin" in local_session_data.keys()):
|
||||
user['session_date_debut'] = local_session_data['date_debut']
|
||||
user['session_date_fin'] = local_session_data['date_fin']
|
||||
else:
|
||||
user['session_date_debut'] = ""
|
||||
user['session_date_fin'] = ""
|
||||
else:
|
||||
user['order_line_session_id'] = ""
|
||||
user['code_session'] = ""
|
||||
user['session_date_debut'] = ""
|
||||
user['session_date_fin'] = ""
|
||||
|
||||
if ("order_line_montant_reduction" in retval.keys()):
|
||||
user['order_line_montant_reduction'] = retval['order_line_montant_reduction']
|
||||
else:
|
||||
|
@ -4866,7 +4981,33 @@ def Gernerate_Stock_PDF_Partner_Order(diction):
|
|||
return False, " Aucune ligne de détail pour cette commande ", False
|
||||
|
||||
#print(" ### Order_header_lines_data = ", Order_header_lines_data)
|
||||
# Creation du dictionnaire d'information à utiliser pour la creation du doc
|
||||
|
||||
tab_client = []
|
||||
tab_client.append(ObjectId(str(Order_header_data['order_header_client_id'])))
|
||||
|
||||
convention_dictionnary_data = {}
|
||||
new_diction = {}
|
||||
new_diction['token'] = diction['token']
|
||||
new_diction['list_stagiaire_id'] = []
|
||||
new_diction['list_session_id'] = []
|
||||
new_diction['list_class_id'] = []
|
||||
new_diction['list_client_id'] = tab_client
|
||||
new_diction['list_apprenant_id'] = []
|
||||
|
||||
local_status, local_retval = mycommon.Get_Dictionnary_data_For_Template(new_diction)
|
||||
|
||||
if (local_status is False):
|
||||
return local_status, local_retval
|
||||
|
||||
convention_dictionnary_data = local_retval
|
||||
|
||||
convention_dictionnary_data['order_header'] = Order_header_data
|
||||
convention_dictionnary_data['order_lines'] = Order_header_lines_data
|
||||
|
||||
body = {
|
||||
"params": convention_dictionnary_data,
|
||||
}
|
||||
|
||||
contenu_doc_Template = jinja2.Template(str(partner_document_CONF_ORDER_data['contenu_doc']))
|
||||
|
||||
|
@ -4874,7 +5015,8 @@ def Gernerate_Stock_PDF_Partner_Order(diction):
|
|||
#sourceHtml = contenu_doc_Template.render(params=Order_header_data)
|
||||
Order_header_data['order_header_type'] = str(Order_header_data['order_header_type']).capitalize()
|
||||
|
||||
sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
||||
#sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
||||
sourceHtml = contenu_doc_Template.render(params=body['params'], )
|
||||
|
||||
|
||||
orig_file_name = "Partner_Order_"+str(Order_header_data['order_header_ref_interne'])+".pdf"
|
||||
|
@ -4973,8 +5115,6 @@ def Send_Partner_Order_By_Email(diction):
|
|||
'partner_owner_recid': str(
|
||||
my_partner['recid'])})
|
||||
|
||||
partner_document_CONF_ORDER_data_qry = {'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0', 'ref_interne': 'PART_ORDER', 'type_doc':'email'}
|
||||
|
||||
#print(" ### partner_document_CONF_ORDER_data_qry = ", partner_document_CONF_ORDER_data_qry)
|
||||
partner_document_CONF_ORDER_data = MYSY_GV.dbname['courrier_template'].find_one(
|
||||
|
@ -5010,6 +5150,26 @@ def Send_Partner_Order_By_Email(diction):
|
|||
3]) + " - Le client est invalide")
|
||||
return False, " Le client est invalide"
|
||||
|
||||
"""
|
||||
Recup condition paiement id
|
||||
"""
|
||||
cdtion_paiement_code = ""
|
||||
cdtion_paiement_id = ""
|
||||
if ("order_header_condition_paiement_id" in Order_header_data.keys() and Order_header_data[
|
||||
'order_header_condition_paiement_id']):
|
||||
cdtion_paiement_data = MYSY_GV.dbname['base_partner_paiement_condition'].find_one(
|
||||
{'_id': ObjectId(str(Order_header_data['order_header_condition_paiement_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
}
|
||||
)
|
||||
|
||||
if (cdtion_paiement_data and 'code' in cdtion_paiement_data.keys()):
|
||||
cdtion_paiement_code = str(cdtion_paiement_data['code'])
|
||||
cdtion_paiement_id = str(cdtion_paiement_data['_id'])
|
||||
|
||||
Order_header_data['order_header_condition_paiement_code'] = cdtion_paiement_code
|
||||
Order_header_data['order_header_condition_paiement_id'] = cdtion_paiement_id
|
||||
|
||||
|
||||
# Recuperation des details de lignes de : partner_order_line
|
||||
|
@ -5049,6 +5209,32 @@ def Send_Partner_Order_By_Email(diction):
|
|||
user['valide'] = retval['valide']
|
||||
user['locked'] = retval['locked']
|
||||
|
||||
if ("order_line_session_id" in retval.keys()):
|
||||
local_session_data = MYSY_GV.dbname['session_formation'].find_one({'_id':ObjectId(str(retval['order_line_session_id'])),
|
||||
'valide':'1',
|
||||
'partner_owner_recid':my_partner['recid']})
|
||||
|
||||
if( local_session_data ):
|
||||
|
||||
if( "code_session" in local_session_data.keys() ):
|
||||
user['code_session'] = local_session_data['code_session']
|
||||
else:
|
||||
user['code_session'] = ""
|
||||
|
||||
if ("date_debut" in local_session_data.keys() and "date_fin" in local_session_data.keys() ):
|
||||
user['session_date_debut'] = local_session_data['date_debut']
|
||||
user['session_date_fin'] = local_session_data['date_fin']
|
||||
else:
|
||||
user['session_date_debut'] = ""
|
||||
user['session_date_fin'] = ""
|
||||
else:
|
||||
user['order_line_session_id'] = ""
|
||||
user['code_session'] = ""
|
||||
user['session_date_debut'] = ""
|
||||
user['session_date_fin'] = ""
|
||||
|
||||
|
||||
|
||||
if ("order_line_montant_reduction" in retval.keys()):
|
||||
user['order_line_montant_reduction'] = retval['order_line_montant_reduction']
|
||||
else:
|
||||
|
@ -5133,6 +5319,35 @@ def Send_Partner_Order_By_Email(diction):
|
|||
3]) + " - Aucune ligne de détail pour cette commande ")
|
||||
return False, " Aucune ligne de détail pour cette commande "
|
||||
|
||||
# Creation du dictionnaire d'information à utiliser pour la creation du doc
|
||||
|
||||
tab_client = []
|
||||
tab_client.append(ObjectId(str(Order_header_data['order_header_client_id'])))
|
||||
|
||||
convention_dictionnary_data = {}
|
||||
new_diction = {}
|
||||
new_diction['token'] = diction['token']
|
||||
new_diction['list_stagiaire_id'] = []
|
||||
new_diction['list_session_id'] = []
|
||||
new_diction['list_class_id'] = []
|
||||
new_diction['list_client_id'] = tab_client
|
||||
new_diction['list_apprenant_id'] = []
|
||||
|
||||
local_status, local_retval = mycommon.Get_Dictionnary_data_For_Template(new_diction)
|
||||
|
||||
if (local_status is False):
|
||||
return local_status, local_retval
|
||||
|
||||
convention_dictionnary_data = local_retval
|
||||
|
||||
convention_dictionnary_data['order_header'] = Order_header_data
|
||||
convention_dictionnary_data['order_lines'] = Order_header_lines_data
|
||||
|
||||
body = {
|
||||
"params": convention_dictionnary_data,
|
||||
}
|
||||
|
||||
# print(" #### BODY = ", body) zzzz
|
||||
|
||||
#print(" ### Order_header_lines_data = ", Order_header_lines_data)
|
||||
|
||||
|
@ -5142,8 +5357,13 @@ def Send_Partner_Order_By_Email(diction):
|
|||
|
||||
#print(" #### Order_header_data = ", Order_header_data)
|
||||
Order_header_data['order_header_type'] = str(Order_header_data['order_header_type']).capitalize()
|
||||
sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
||||
sujetHtml = str(Order_header_data['order_header_type']) + " : "+ str(Order_header_data['order_header_ref_interne'])
|
||||
#sourceHtml = contenu_doc_Template.render(params=Order_header_data, param_order_lines=Order_header_lines_data)
|
||||
sourceHtml = contenu_doc_Template.render(params=body['params'], )
|
||||
|
||||
#sujetHtml = str(Order_header_data['order_header_type']) + " : "+ str(Order_header_data['order_header_ref_interne'])
|
||||
|
||||
sujetHtml = contenu_doc_Template_subject.render(params=body['params'], )
|
||||
|
||||
|
||||
new_model_courrier_with_code_tag = str(
|
||||
sourceHtml) + " <p style='width: 300px; text-align: right;'> Signature Client <br/> <img style='height:150px; width:150px' src='{{ params.mysy_manual_signature_img }}'> </p> <br/> " \
|
||||
|
@ -6493,10 +6713,6 @@ def Send_Quotation_Remind_Level1(diction):
|
|||
|
||||
convention_dictionnary_data = local_retval
|
||||
|
||||
body = {
|
||||
"params": convention_dictionnary_data,
|
||||
}
|
||||
|
||||
|
||||
"""
|
||||
# Recuperer le modele de courrier pour la relance niveau 1 des devis :
|
||||
|
@ -6563,6 +6779,26 @@ def Send_Quotation_Remind_Level1(diction):
|
|||
if( "email" in contact_communication.keys() and contact_communication['email']):
|
||||
tab_emails_destinataire.append(str(contact_communication['email']))
|
||||
|
||||
"""
|
||||
Recup condition paiement id
|
||||
"""
|
||||
cdtion_paiement_code = ""
|
||||
cdtion_paiement_id = ""
|
||||
if ("order_header_condition_paiement_id" in Order_header_data.keys() and Order_header_data[
|
||||
'order_header_condition_paiement_id']):
|
||||
cdtion_paiement_data = MYSY_GV.dbname['base_partner_paiement_condition'].find_one(
|
||||
{'_id': ObjectId(str(Order_header_data['order_header_condition_paiement_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
}
|
||||
)
|
||||
|
||||
if (cdtion_paiement_data and 'code' in cdtion_paiement_data.keys()):
|
||||
cdtion_paiement_code = str(cdtion_paiement_data['code'])
|
||||
cdtion_paiement_id = str(cdtion_paiement_data['_id'])
|
||||
|
||||
Order_header_data['order_header_condition_paiement_code'] = cdtion_paiement_code
|
||||
Order_header_data['order_header_condition_paiement_id'] = cdtion_paiement_id
|
||||
|
||||
# Recuperation des details de lignes de : partner_order_line
|
||||
filt_class_partner_recid = {'partner_owner_recid': str(my_partner['recid'])}
|
||||
|
@ -6601,6 +6837,31 @@ def Send_Quotation_Remind_Level1(diction):
|
|||
user['valide'] = retval['valide']
|
||||
user['locked'] = retval['locked']
|
||||
|
||||
if ("order_line_session_id" in retval.keys()):
|
||||
local_session_data = MYSY_GV.dbname['session_formation'].find_one(
|
||||
{'_id': ObjectId(str(retval['order_line_session_id'])),
|
||||
'valide': '1',
|
||||
'partner_owner_recid': my_partner['recid']})
|
||||
|
||||
if (local_session_data):
|
||||
|
||||
if ("code_session" in local_session_data.keys()):
|
||||
user['code_session'] = local_session_data['code_session']
|
||||
else:
|
||||
user['code_session'] = ""
|
||||
|
||||
if ("date_debut" in local_session_data.keys() and "date_fin" in local_session_data.keys()):
|
||||
user['session_date_debut'] = local_session_data['date_debut']
|
||||
user['session_date_fin'] = local_session_data['date_fin']
|
||||
else:
|
||||
user['session_date_debut'] = ""
|
||||
user['session_date_fin'] = ""
|
||||
else:
|
||||
user['order_line_session_id'] = ""
|
||||
user['code_session'] = ""
|
||||
user['session_date_debut'] = ""
|
||||
user['session_date_fin'] = ""
|
||||
|
||||
if ("order_line_montant_reduction" in retval.keys()):
|
||||
user['order_line_montant_reduction'] = retval['order_line_montant_reduction']
|
||||
else:
|
||||
|
@ -6685,6 +6946,15 @@ def Send_Quotation_Remind_Level1(diction):
|
|||
3]) + " - Aucune ligne de détail pour cette commande ")
|
||||
return False, " Aucune ligne de détail pour cette commande "
|
||||
|
||||
convention_dictionnary_data['order_header'] = Order_header_data
|
||||
convention_dictionnary_data['order_lines'] = Order_header_lines_data
|
||||
|
||||
body = {
|
||||
"params": convention_dictionnary_data,
|
||||
}
|
||||
|
||||
#print(" #### BODY = ", body) zzzz
|
||||
|
||||
# print(" ### Order_header_lines_data = ", Order_header_lines_data)
|
||||
|
||||
# Traitement de l'eventuel fichier joint
|
||||
|
@ -6707,11 +6977,10 @@ def Send_Quotation_Remind_Level1(diction):
|
|||
# print(" #### Order_header_data = ", Order_header_data)
|
||||
Order_header_data['order_header_type'] = str(Order_header_data['order_header_type']).capitalize()
|
||||
|
||||
sourceHtml = contenu_doc_Template.render(params=Order_header_data,
|
||||
param_order_lines=Order_header_lines_data)
|
||||
sourceHtml = contenu_doc_Template.render(params=body['params'],)
|
||||
|
||||
sujet_doc_Template = jinja2.Template(str(partner_document_QUOTATION_REMIND_data['sujet']))
|
||||
sujetHtml = sujet_doc_Template.render(params=Order_header_data)
|
||||
sujetHtml = sujet_doc_Template.render(params=body['params'],)
|
||||
|
||||
###
|
||||
|
||||
|
|
|
@ -4863,7 +4863,9 @@ def Get_Dictionnary_data_For_Template(diction):
|
|||
list_client_data = []
|
||||
tab_client_id = diction['list_client_id']
|
||||
|
||||
client_liste_champ = ['raison_sociale', 'nom', 'email', 'adr_adresse', 'adr_code_postal', 'adr_ville', 'adr_code_postal', 'adr_pays']
|
||||
client_liste_champ = ['raison_sociale', 'nom', 'email', 'adr_adresse', 'adr_code_postal', 'adr_ville', 'adr_code_postal', 'adr_pays',
|
||||
'invoice_email', 'invoice_nom', 'invoice_siret', 'invoice_adresse', 'invoice_ville', 'invoice_code_postal',
|
||||
'invoice_pays']
|
||||
|
||||
for client_data in MYSY_GV.dbname['partner_client'].find({'_id': {'$in': tab_client_id, },
|
||||
'valide': '1',
|
||||
|
@ -4917,6 +4919,7 @@ def Get_Dictionnary_data_For_Template(diction):
|
|||
new_client_data["list_contact_communication"] = list_contact_communication
|
||||
|
||||
|
||||
|
||||
list_client_data.append(new_client_data)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue