master
cherif 2024-03-10 10:57:02 +01:00
parent a41f34f607
commit 40cff9ddc9
7 changed files with 4068 additions and 21 deletions

View File

@ -1,10 +1,14 @@
<?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="ssdqs">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="07/03/2024 - 22h30">
<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$/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$/apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/apprenant_mgt.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" />
@ -74,13 +78,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00189" summary="05/01/24 - 20h30">
<created>1704482897223</created>
<option name="number" value="00189" />
<option name="presentableId" value="LOCAL-00189" />
<option name="project" value="LOCAL" />
<updated>1704482897223</updated>
</task>
<task id="LOCAL-00190" summary="06/01/24 - 20h30">
<created>1704570649680</created>
<option name="number" value="00190" />
@ -417,7 +414,14 @@
<option name="project" value="LOCAL" />
<updated>1709821854108</updated>
</task>
<option name="localTasksCounter" value="238" />
<task id="LOCAL-00238" summary="07/03/2024 - 22h30">
<created>1709847739473</created>
<option name="number" value="00238" />
<option name="presentableId" value="LOCAL-00238" />
<option name="project" value="LOCAL" />
<updated>1709847739474</updated>
</task>
<option name="localTasksCounter" value="239" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -432,7 +436,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="05/02/2024 -23h" />
<MESSAGE value="06/02/2024 -20h" />
<MESSAGE value="08/02/2024 -20h" />
<MESSAGE value="09/02/24 - 22h" />
@ -457,6 +460,7 @@
<MESSAGE value="04/03/2024 - 22h15" />
<MESSAGE value="06/03/2024 - 22h15" />
<MESSAGE value="ssdqs" />
<option name="LAST_COMMIT_MESSAGE" value="ssdqs" />
<MESSAGE value="07/03/2024 - 22h30" />
<option name="LAST_COMMIT_MESSAGE" value="07/03/2024 - 22h30" />
</component>
</project>

View File

@ -627,7 +627,7 @@ PURCHASE_PRICE_PERIODICITY = ['fixe', 'heure', 'jour', 'mois', 'annee', ]
"""
Les civilité
"""
CIVILITE = ['m', 'mme', 'neutre', ]
CIVILITE = ['m', 'mme', 'neutre', '']
"""

View File

@ -74,7 +74,7 @@ def AddStagiairetoClass(diction):
'tuteur1_cp', 'tuteur1_ville', 'tuteur1_pays', 'tuteur1_include_com',
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com','date_naissance',
'financeur_rattachement_id'
'financeur_rattachement_id', 'tuteur1_civilite', 'tuteur1_civilite'
]
incom_keys = diction.keys()
@ -270,6 +270,18 @@ def AddStagiairetoClass(diction):
else:
mydata['financeur_rattachement_id'] = ""
if ("tuteur1_civilite" not in diction.keys()):
mydata['tuteur1_civilite'] = ""
elif (val['tuteur1_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
mydata['tuteur1_civilite'] = ""
if ("tuteur2_civilite" not in diction.keys()):
mydata['tuteur2_civilite'] = ""
elif (val['tuteur2_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
mydata['tuteur2_civilite'] = ""
if ("ville" in diction.keys()):
if diction['ville']:
@ -5492,6 +5504,17 @@ def AcceptAttendeeInscription(diction):
else:
new_apprenant_diction['tuteur1_telephone'] = ""
if ("tuteur1_civilite" in inscription_data.keys()):
new_apprenant_diction['tuteur1_civilite'] = inscription_data['tuteur1_civilite']
else:
new_apprenant_diction['tuteur1_civilite'] = ""
if ("tuteur2_civilite" in inscription_data.keys()):
new_apprenant_diction['tuteur2_civilite'] = inscription_data['tuteur2_civilite']
else:
new_apprenant_diction['tuteur2_civilite'] = ""
if("tuteur2_nom" in inscription_data.keys()):
new_apprenant_diction['tuteur2_nom'] = inscription_data['tuteur2_nom']
else:
@ -6773,6 +6796,22 @@ def GetAttendeeDetail_perSession_from_line_id(diction):
else:
my_retrun_dict['apprenant_id'] = ""
if ("tuteur1_civilite" not in local_Insc_retval.keys()):
my_retrun_dict['tuteur1_civilite'] = ""
elif (local_Insc_retval['tuteur1_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
my_retrun_dict['tuteur1_civilite'] = ""
else:
my_retrun_dict['tuteur1_civilite'] = local_Insc_retval['tuteur1_civilite']
if ("tuteur2_civilite" not in local_Insc_retval.keys()):
my_retrun_dict['tuteur2_civilite'] = ""
elif (local_Insc_retval['tuteur2_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
my_retrun_dict['tuteur2_civilite'] = ""
else:
my_retrun_dict['tuteur2_civilite'] = local_Insc_retval['tuteur2_civilite']
if ("code_session" in local_Insc_retval['inscription_collection'][0].keys()):
my_retrun_dict['code_session'] = str(local_Insc_retval['inscription_collection'][0]['code_session'])
@ -6946,7 +6985,8 @@ def UpdateStagiairetoClass_Tuteurs(diction):
'tuteur1_nom', 'tuteur1_prenom', 'tuteur1_email', 'tuteur1_telephone', 'tuteur1_adresse',
'tuteur1_cp', 'tuteur1_ville', 'tuteur1_pays', 'tuteur1_include_com',
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'tuteur1_civilite',
'tuteur2_civilite'
]
incom_keys = diction.keys()
@ -7001,6 +7041,19 @@ def UpdateStagiairetoClass_Tuteurs(diction):
data_update['update_by'] = str(my_partner['_id'])
if ("tuteur1_civilite" in data_update.keys() ):
if (data_update['tuteur1_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
data_update['tuteur1_civilite'] = ""
if ("tuteur2_civilite" in data_update.keys() ):
if (data_update['tuteur2_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
data_update['tuteur2_civilite'] = ""
result = MYSY_GV.dbname['inscription'].find_one_and_update(
{'_id':ObjectId(str(my_id)),
'partner_owner_recid':str(my_partner['recid'])},

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ import ast
import smtplib
from email import encoders
from email.mime.base import MIMEBase
from calendar import monthrange
import jinja2
import pymongo
from flask import send_file
@ -7445,6 +7445,52 @@ def Invoice_Partner_From_Session( diction):
partner_invoice_header_data['order_header_client_id'] = str(partner_client_id_data['_id'])
"""
Recuperation des conditions de paiement depuis le client
"""
ction_paiement_code = ""
ction_paiement_desc = ""
ction_paiement_depart = "facture"
ction_paiement_nb_jour = "0"
if ("invoice_condition_paiement_id" in partner_client_id_data.keys() and partner_client_id_data[
'invoice_condition_paiement_id']):
ction_paiement_data = MYSY_GV.dbname['base_partner_paiement_condition'].find_one(
{'partner_owner_recid': my_partner['recid'],
'valide': '1',
'locked': '0',
'_id': ObjectId(str(partner_client_id_data['invoice_condition_paiement_id']))})
if (ction_paiement_data and "code" in ction_paiement_data.keys() and ction_paiement_data['code']):
ction_paiement_code = ction_paiement_data['code']
if (ction_paiement_data and "description" in ction_paiement_data.keys() and ction_paiement_data[
'description']):
ction_paiement_desc = ction_paiement_data['description']
if (ction_paiement_data and "nb_jour" in ction_paiement_data.keys() and ction_paiement_data['nb_jour'] and
"depart" in ction_paiement_data.keys() and ction_paiement_data['depart']):
ction_paiement_nb_jour = ction_paiement_data['nb_jour']
ction_paiement_depart = ction_paiement_data['depart']
nb_jour_int = mycommon.tryInt(str(ction_paiement_nb_jour))
today = datetime.today()
date_echance = datetime.today()
if (str(ction_paiement_depart) == "mois"):
days_in_month = lambda dt: monthrange(dt.year, dt.month)[1]
first_day_next_month = today.replace(day=1) + timedelta(days_in_month(today))
date_echance = first_day_next_month + timedelta(days=nb_jour_int)
else:
date_echance = today + timedelta(days=nb_jour_int)
date_echance = date_echance.strftime("%d/%m/%Y")
partner_invoice_header_data['invoice_date_echeance'] = str(date_echance)
partner_invoice_header_data['order_header_condition_paiement_code'] = str(ction_paiement_code)
partner_invoice_header_data['order_header_condition_paiement_description'] = str(ction_paiement_desc)
code_session = ""
if( "code_session" in session_data.keys() ):
code_session = session_data['code_session']
@ -8675,6 +8721,49 @@ def Invoice_Partner_From_Session_By_Inscription_Id( diction):
partner_invoice_header_data['order_header_client_id'] = str(partner_client_id_data['_id'])
"""
Recuperation des conditions de paiement depuis le client
"""
ction_paiement_code = ""
ction_paiement_desc = ""
ction_paiement_depart = "facture"
ction_paiement_nb_jour = "0"
if( "invoice_condition_paiement_id" in partner_client_id_data.keys() and partner_client_id_data['invoice_condition_paiement_id']):
ction_paiement_data = MYSY_GV.dbname['base_partner_paiement_condition'].find_one({'partner_owner_recid':my_partner['recid'],
'valide':'1',
'locked':'0',
'_id':ObjectId(str(partner_client_id_data['invoice_condition_paiement_id']))})
if( ction_paiement_data and "code" in ction_paiement_data.keys() and ction_paiement_data['code']):
ction_paiement_code = ction_paiement_data['code']
if (ction_paiement_data and "description" in ction_paiement_data.keys() and ction_paiement_data['description']):
ction_paiement_desc = ction_paiement_data['description']
if (ction_paiement_data and "nb_jour" in ction_paiement_data.keys() and ction_paiement_data['nb_jour'] and
"depart" in ction_paiement_data.keys() and ction_paiement_data['depart'] ):
ction_paiement_nb_jour = ction_paiement_data['nb_jour']
ction_paiement_depart = ction_paiement_data['depart']
nb_jour_int = mycommon.tryInt(str(ction_paiement_nb_jour))
today = datetime.today()
date_echance = datetime.today()
if (str(ction_paiement_depart) == "mois"):
days_in_month = lambda dt: monthrange(dt.year, dt.month)[1]
first_day_next_month = today.replace(day=1) + timedelta(days_in_month(today))
date_echance = first_day_next_month + timedelta(days=nb_jour_int)
else:
date_echance = today + timedelta(days=nb_jour_int)
date_echance = date_echance.strftime("%d/%m/%Y")
partner_invoice_header_data['invoice_date_echeance'] = str(date_echance)
partner_invoice_header_data['order_header_condition_paiement_code'] = str(ction_paiement_code)
partner_invoice_header_data['order_header_condition_paiement_description'] = str(ction_paiement_desc)
code_session = ""
if( "code_session" in session_data.keys() ):
code_session = session_data['code_session']

View File

@ -51,7 +51,8 @@ def Add_Apprenant(diction):
'tuteur1_nom', 'tuteur1_prenom', 'tuteur1_email', 'tuteur1_telephone', 'tuteur1_adresse',
'tuteur1_cp', 'tuteur1_ville', 'tuteur1_pays', 'tuteur1_include_com',
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'civilite', 'date_naissance'
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'civilite', 'date_naissance',
'tuteur1_civilite', 'tuteur2_civilite'
]
incom_keys = diction.keys()
@ -430,6 +431,20 @@ def Get_Given_Apprenant_Data(diction):
user['id'] = str(val_tmp)
val_tmp = val_tmp + 1
if( "tuteur1_civilite" not in val.keys() ):
user['tuteur1_civilite'] = ""
elif(val['tuteur1_civilite'] not in MYSY_GV.CIVILITE ):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
user['tuteur1_civilite'] = ""
if ("tuteur2_civilite" not in val.keys()):
user['tuteur2_civilite'] = ""
elif(val['tuteur2_civilite'] not in MYSY_GV.CIVILITE ):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
user['tuteur2_civilite'] = ""
# Recuperer les données du client
if( "client_rattachement_id" in val.keys() and val['client_rattachement_id'] ):
client_data = MYSY_GV.dbname['partner_client'].find_one({'_id':ObjectId(str(val['client_rattachement_id'])),
@ -1945,7 +1960,8 @@ def Update_Apprenant_Tuteurs(diction):
'tuteur1_nom', 'tuteur1_prenom', 'tuteur1_email', 'tuteur1_telephone', 'tuteur1_adresse',
'tuteur1_cp', 'tuteur1_ville', 'tuteur1_pays', 'tuteur1_include_com',
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'tuteur1_civilite',
'tuteur2_civilite'
]
incom_keys = diction.keys()
@ -2000,6 +2016,18 @@ def Update_Apprenant_Tuteurs(diction):
data_update['update_by'] = str(my_partner['_id'])
if ("tuteur1_civilite" in data_update.keys() ):
if (data_update['tuteur1_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
data_update['tuteur1_civilite'] = ""
if ("tuteur2_civilite" in data_update.keys() ):
if (data_update['tuteur2_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
data_update['tuteur2_civilite'] = ""
result = MYSY_GV.dbname['apprenant'].find_one_and_update(
{'_id':ObjectId(str(my_id)),
'partner_owner_recid':str(my_partner['recid'])},

View File

@ -3123,6 +3123,24 @@ def GetAttendeeDetail_perSession(diction):
if ("date_fin" in local_Insc_retval['inscription_collectoin'][0].keys()):
my_retrun_dict['date_au'] = str(local_Insc_retval['inscription_collectoin'][0]['date_fin'])[0:10]
if ("tuteur1_civilite" not in local_Insc_retval.keys()):
my_retrun_dict['tuteur1_civilite'] = ""
elif (local_Insc_retval['tuteur1_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
my_retrun_dict['tuteur1_civilite'] = ""
else:
my_retrun_dict['tuteur1_civilite'] = local_Insc_retval['tuteur1_civilite']
if ("tuteur2_civilite" not in local_Insc_retval.keys()):
my_retrun_dict['tuteur2_civilite'] = ""
elif (local_Insc_retval['tuteur2_civilite'] not in MYSY_GV.CIVILITE):
# la civilité n'est pas une de celle autorisée, alors je renvoie vide
my_retrun_dict['tuteur2_civilite'] = ""
else:
my_retrun_dict['tuteur2_civilite'] = local_Insc_retval['tuteur2_civilite']
if ("ville" in local_Insc_retval.keys()):
my_retrun_dict['ville'] = local_Insc_retval['ville']
else:
@ -4743,12 +4761,27 @@ def Get_Dictionnary_data_For_Template(diction):
if( "list_sequence_session_id" in diction.keys() ):
tab_sequence_session = diction['list_sequence_session_id']
qery_match = {'_id': {'$in': tab_sequence_session, },'valide': '1', 'partner_owner_recid': str(my_partner['recid']) }
pipe_qry = ([
{"$addFields": {
"mysy_sequence_start": {
'$dateFromString': {
'dateString': '$sequence_start',
'format': '%d/%m/%Y %H:%M'
}
}
}
},
{'$match': qery_match},
{
'$sort': {'mysy_sequence_start': 1}
},
for sequence_session_data in MYSY_GV.dbname['session_formation_sequence'].find({'_id': {'$in': tab_sequence_session, },
'valide': '1',
'partner_owner_recid': str(my_partner['recid'])
}):
])
print( " ### pipe_qry select sequence = ", pipe_qry)
for sequence_session_data in MYSY_GV.dbname['session_formation_sequence'].aggregate(pipe_qry):
new_session_data = {}