24/04/26 - 19h

Signed-off-by: Cherif <cbalde@mysy-training.com>
master_Elyos_FI
Cherif 2026-04-24 19:18:13 +02:00
parent cb4daee06a
commit a34f87a5e5
6 changed files with 18587 additions and 12435 deletions

View File

@ -4,14 +4,13 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="21/04/2026 - 11h30">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="21/04/2026 - 21h30">
<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$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/apprenant_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/session_admission_fi.py" beforeDir="false" afterPath="$PROJECT_DIR$/session_admission_fi.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/note_evaluation_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/note_evaluation_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -455,7 +454,7 @@
<option name="project" value="LOCAL" />
<updated>1747251650255</updated>
</task>
<option name="localTasksCounter" value="565" />
<option name="localTasksCounter" value="566" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -497,7 +496,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="26/02/26 - 19h30" />
<MESSAGE value="27/02/26 - 19h30" />
<MESSAGE value="28/02/26 - 22h" />
<MESSAGE value="28/02/26 - 23h" />
@ -522,6 +520,7 @@
<MESSAGE value="19/04/2026 - 20h30" />
<MESSAGE value="20/04/2026 - 20h30" />
<MESSAGE value="21/04/2026 - 11h30" />
<option name="LAST_COMMIT_MESSAGE" value="21/04/2026 - 11h30" />
<MESSAGE value="21/04/2026 - 21h30" />
<option name="LAST_COMMIT_MESSAGE" value="21/04/2026 - 21h30" />
</component>
</project>

File diff suppressed because one or more lines are too long

View File

@ -9825,6 +9825,8 @@ def Sent_Convocation_Stagiaire_By_Email(tab_files, Folder, diction):
new_diction['list_apprenant_id'] = tab_apprenant
new_diction['list_sequence_session_id'] = tab_sequence_session
local_status, local_retval = mycommon.Get_Dictionnary_data_For_Template(new_diction)
if (local_status is False):
@ -9835,10 +9837,22 @@ def Sent_Convocation_Stagiaire_By_Email(tab_files, Folder, diction):
convention_dictionnary_data = local_retval
if ("inscription_direct" in class_data.keys()):
convention_dictionnary_data['class_inscription_directe'] = class_data['inscription_direct']
else:
convention_dictionnary_data['class_inscription_directe'] = ""
if( "mode_animation_detail_organisation" in session_data.keys() ):
convention_dictionnary_data['mode_animation_detail_organisation'] = session_data['mode_animation_detail_organisation']
else:
convention_dictionnary_data['mode_animation_detail_organisation'] = ""
body = {
"params": convention_dictionnary_data,
}
#print(" ### session_data = ", session_data)
#print(" ### body = ", body)
orig_file_name = None
outputFilename = None

View File

@ -4030,7 +4030,8 @@ def get_partner_class(diction):
filt_is_ftion_initiale = {}
if ("is_ftion_initiale" in diction.keys() and diction['is_ftion_initiale'] == "1"):
filt_is_ftion_initiale = {'is_ftion_initiale':"1"}
if ("is_ftion_initiale" in diction.keys() and diction['is_ftion_initiale'] == "2"):
elif ("is_ftion_initiale" in diction.keys() and diction['is_ftion_initiale'] == "2"):
# si la valeur = 2, on va recuperer toutes les formations
filt_is_ftion_initiale = {}

View File

@ -3345,6 +3345,9 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
if (local_status is not True):
return local_status, my_partner
print(" ### my_partner = ", my_partner)
### Les sessions de formation
my_session_ids = ""
if ("list_session_id" in diction.keys()):
@ -3407,7 +3410,7 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
for val in MYSY_GV.dbname['inscription'].find({'apprenant_id':{'$in': tab_my_apprenant_ids } ,
'valide':'1',
'locked':'0',
'partner_owner_recid':str(my_partner['recid'])}):
'partner_owner_recid':str(my_partner['partner_owner_recid'])}):
concerned_tab_inscription_id.append((str(val['_id'])))
if(len(concerned_tab_inscription_id) > 0 ):
@ -3427,7 +3430,7 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
for val in MYSY_GV.dbname['note_evaluation'].find({'class_eu_id': {'$in': tab_my_ue_ids},
'valide': '1',
'locked': '0',
'partner_owner_recid': str(my_partner['recid'])}):
'partner_owner_recid': str(my_partner['partner_owner_recid'])}):
concerned_tab_evaluation_id.append((str(val['_id'])))
@ -3444,14 +3447,14 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
for val in MYSY_GV.dbname['note_evaluation'].find({'class_eu_id': {'$in': tab_my_session_ids},
'valide': '1',
'locked': '0',
'partner_owner_recid': str(my_partner['recid'])}):
'partner_owner_recid': str(my_partner['partner_owner_recid'])}):
concerned_tab_session_id.append((str(val['_id'])))
if (len(concerned_tab_session_id) > 0):
filt_concerned_tab_session_id = {"evaluation_id": {"$in": concerned_tab_session_id}}
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])},
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['partner_owner_recid'])},
{"valide": '1'},
{"locked": '0'},
filt_concerned_tab_inscription_id,
@ -3539,7 +3542,7 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
'valide': '1',
'locked': '0',
'partner_owner_recid': str(
my_partner['recid'])})
my_partner['partner_owner_recid'])})
if ("code" in ue_data.keys()):
class_ue_code = str(ue_data['code'])
if ("titre" in ue_data.keys()):
@ -3553,7 +3556,7 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
'valide': '1',
'locked': '0',
'partner_owner_recid': str(
my_partner['recid'])})
my_partner['partner_owner_recid'])})
if (type_eval_data and 'code' in type_eval_data.keys()):
user['type_eval_code'] = type_eval_data['code']
else:

View File

@ -2266,7 +2266,9 @@ def Get_List_Partner_Invoice_with_filter(diction):
field_list = ['token', 'date_facture_debut', 'date_facture_fin', 'client_nom', 'ref_interne_cmd',
'ref_interne_invoice', 'ref_externe', 'formation', 'order_header_client_id',
'session_code', 'solde', 'solde_operateur', 'date_echeance', 'echeance_operateur',
'montant_ttc', 'montant_ttc_operateur']
'montant_ttc', 'montant_ttc_operateur', 'montant_ttc_from_value', 'montant_ttc_to_from_value',
'solde_from_value', 'solde_to_value', 'date_echeance_from', 'date_echeance_to',
]
incom_keys = diction.keys()
for val in incom_keys:
@ -2298,6 +2300,24 @@ def Get_List_Partner_Invoice_with_filter(diction):
if (local_status is not True):
return local_status, my_partner, False
if( "solde" in diction.keys() and diction['solde']):
solde_status, solde_retval = mycommon.IsFloat(str(diction['solde']).strip())
if (solde_status is False ):
return False, " La valeur du solde est invalide ", False
if ("solde_from_value" in diction.keys() and diction['solde_from_value']):
solde_status, solde_retval = mycommon.IsFloat(str(diction['solde_from_value']).strip())
if (solde_status is False):
return False, " La valeur du solde est invalide (1) ", False
if ("solde_to_value" in diction.keys() and diction['solde_to_value']):
solde_status, solde_retval = mycommon.IsFloat(str(diction['solde_to_value']).strip())
if (solde_status is False):
return False, " La valeur du solde est invalide (2) ", False
filt_client_nom = {}
sub_filt_client_nom = {}
Lists_partner_client_id = []
@ -2344,7 +2364,6 @@ def Get_List_Partner_Invoice_with_filter(diction):
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)
@ -2355,6 +2374,30 @@ def Get_List_Partner_Invoice_with_filter(diction):
filt_date_echeance_ISODATE = datetime.strptime(str(filt_date_echeance), '%d/%m/%Y')
#-----------
filt_date_echeance_from_ISODATE = ""
if ("date_echeance_from" in diction.keys() and diction['date_echeance_from']):
filt_date_echeance_from = str(diction['date_echeance_from'])[0:10]
local_status = mycommon.CheckisDate(filt_date_echeance_from)
if (local_status is False):
mycommon.myprint(str(
inspect.stack()[0][3]) + " Le filtre : 'date d'échéance du' n'est pas au format jj/mm/aaaa.")
return False, " Le filtre : 'date d'échéance du' n'est pas au format jj/mm/aaaa."
filt_date_echeance_from_ISODATE = datetime.strptime(str(filt_date_echeance_from), '%d/%m/%Y')
filt_date_echeance_to_ISODATE = ""
if ("date_echeance_to" in diction.keys() and diction['date_echeance_to']):
filt_date_echeance_to = str(diction['date_echeance_to'])[0:10]
local_status = mycommon.CheckisDate(filt_date_echeance_to)
if (local_status is False):
mycommon.myprint(str(
inspect.stack()[0][3]) + " Le filtre : 'date d'échéance au' n'est pas au format jj/mm/aaaa.")
return False, " Le filtre : 'date d'échéance au' n'est pas au format jj/mm/aaaa."
filt_date_echeance_to_ISODATE = datetime.strptime(str(filt_date_echeance_to), '%d/%m/%Y')
#---------------
filt_creation_date_from_ISODATE = ""
filt_creation_date_from = ""
@ -2407,13 +2450,29 @@ def Get_List_Partner_Invoice_with_filter(diction):
filt_ref_externe = {
'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 = 0
filter_value_montant_ttc_from_float = 0
filter_value_montant_to_from_float = 0
filt_montant_ttc = {}
if ("montant_ttc_operateur" in diction.keys() and diction['montant_ttc_operateur'] ):
if( diction['montant_ttc_operateur'] == "entre" and "montant_ttc_from_value" in diction.keys() and "montant_ttc_to_from_value" in diction.keys()):
montant_ttc_from_value_status, montant_ttc_from_value_retval = mycommon.IsFloat(str(diction['montant_ttc_from_value']).strip())
montant_ttc_to_value_status, montant_ttc_to_value_retval = mycommon.IsFloat(str(diction['montant_ttc_to_from_value']).strip())
if (montant_ttc_from_value_status is False or montant_ttc_to_value_status is False):
return False, " Le filtre montant TTC invalide (1)", False
filter_value_montant_ttc_from_float = montant_ttc_from_value_retval
filter_value_montant_to_from_float = montant_ttc_to_value_retval
elif ( diction['montant_ttc_operateur'] != "entre" and "montant_ttc" in diction.keys() ):
local_status, local_retval = mycommon.IsFloat(str(diction['montant_ttc']).strip())
if( local_status is False):
return False, " Le filtre montant TTC invalide (2)", False
filter_value_montant_ttc_float = local_retval
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}
@ -2425,10 +2484,21 @@ def Get_List_Partner_Invoice_with_filter(diction):
filt_montant_ttc = {'mysy_total_header_toutes_taxes': {'$gte': filter_value_montant_ttc_float}}
elif (diction['montant_ttc_operateur'] == "inf"):
filt_montant_ttc = {'mysy_total_header_toutes_taxes': {'$lt': filter_value_montant_ttc_float}}
elif (diction['montant_ttc_operateur'] == "sup"):
filt_montant_ttc = {'mysy_total_header_toutes_taxes': {'$gt': filter_value_montant_ttc_float}}
elif (diction['montant_ttc_operateur'] == "entre"):
filt_montant_ttc = {'mysy_total_header_toutes_taxes': {'$gte': filter_value_montant_ttc_from_float, '$lte': filter_value_montant_to_from_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, filt_montant_ttc]}
new_myquery_find_order = [{"$addFields":
{
"partner_invoice_header_Id": {"$toString": "$_id"},
@ -2458,7 +2528,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
]
if(filt_date_echeance_ISODATE ):
if(filt_date_echeance_ISODATE or ( filt_date_echeance_from_ISODATE and filt_date_echeance_to_ISODATE) ):
sub_qry_echeance_operator = {}
if( diction['echeance_operateur'] == "egale"):
@ -2470,30 +2540,66 @@ def Get_List_Partner_Invoice_with_filter(diction):
elif (diction['echeance_operateur'] == "sup_egale"):
sub_qry_echeance_operator = {'mysy_invoice_du_date': {'$gte': filt_date_echeance_ISODATE}}
elif (diction['echeance_operateur'] == "inf"):
sub_qry_echeance_operator = {'mysy_invoice_du_date': { '$lt': filt_date_echeance_ISODATE}}
elif (diction['echeance_operateur'] == "sup"):
sub_qry_echeance_operator = {'mysy_invoice_du_date': {'$gt': filt_date_echeance_ISODATE}}
elif (diction['echeance_operateur'] == "entre"):
sub_qry_echeance_operator = {'mysy_invoice_du_date': {'$gte': filt_date_echeance_from_ISODATE, '$lte': filt_date_echeance_to_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]}
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}
}
},
"mysy_invoice_du_date": {
'$dateFromString': {
'dateString': '$invoice_date_echeance',
'format': "%d/%m/%Y"
}
},
"dateString": {
"$substr": [
{ "$ifNull": ["$invoice_date_echeance", ""]},
0,
10
]
},
"format": "%d/%m/%Y",
"onError": "null",
"onNull": "null"
}
},
"mysy_invoice_date": {
'$dateFromString': {
'dateString': {"$substr": ["$invoice_date", 0, 10]},
'format': "%d/%m/%Y"
}
}
"$dateFromString": {
"dateString": {
"$substr": [
{ "$ifNull": ["$invoice_date", ""] },
0,
10
]
},
"format": "%d/%m/%Y",
"onError": 'null',
"onNull": 'null'
}
}
},
},
{'$match': find_qry},
@ -2639,7 +2745,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
RetObject.append(mycommon.JSONEncoder().encode(user))
else:
if ("solde" in diction.keys() and diction['solde'] and "solde_operateur" in diction.keys() and diction['solde_operateur']):
if ("solde_operateur" in diction.keys() and diction['solde_operateur']):
if( diction['solde_operateur'] == "egale"):
if( tryFloat(diction['solde']) == tryFloat(reste_to_paye)):
@ -2661,6 +2767,27 @@ def Get_List_Partner_Invoice_with_filter(diction):
val_tmp = val_tmp + 1
RetObject.append(mycommon.JSONEncoder().encode(user))
elif (diction['solde_operateur'] == "inf"):
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"):
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'] == "entre"):
if ( tryFloat(reste_to_paye) <= tryFloat(diction['solde_to_value']) and tryFloat(reste_to_paye) >= tryFloat(diction['solde_from_value']) ):
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