sdsdqs
parent
62696c7302
commit
48818b1769
|
@ -1,11 +1,15 @@
|
|||
<?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="09/02/24 - 22hqsdsq">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="11/02/2024 - 22h">
|
||||
<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$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ressources_materiels.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_materiels.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.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 +79,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00170" summary="14/12/2023 - 08h30">
|
||||
<created>1702540046306</created>
|
||||
<option name="number" value="00170" />
|
||||
<option name="presentableId" value="LOCAL-00170" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1702540046307</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00171" summary="14/12/2023 - 16h16">
|
||||
<created>1702566989856</created>
|
||||
<option name="number" value="00171" />
|
||||
|
@ -418,7 +415,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1707599836405</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="219" />
|
||||
<task id="LOCAL-00219" summary="11/02/2024 - 22h">
|
||||
<created>1707685370013</created>
|
||||
<option name="number" value="00219" />
|
||||
<option name="presentableId" value="LOCAL-00219" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1707685370016</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="220" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -433,7 +437,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="11/01/24 - 21h30" />
|
||||
<MESSAGE value="12/01/24 - 16h30" />
|
||||
<MESSAGE value="15/01/2024 - 17h00" />
|
||||
<MESSAGE value="15/01/2024 - 22h" />
|
||||
|
@ -458,6 +461,7 @@
|
|||
<MESSAGE value="08/02/2024 -20h" />
|
||||
<MESSAGE value="09/02/24 - 22h" />
|
||||
<MESSAGE value="09/02/24 - 22hqsdsq" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="09/02/24 - 22hqsdsq" />
|
||||
<MESSAGE value="11/02/2024 - 22h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="11/02/2024 - 22h" />
|
||||
</component>
|
||||
</project>
|
|
@ -627,4 +627,10 @@ PURCHASE_PRICE_PERIODICITY = ['fixe', 'heure', 'jour', 'mois', 'annee', ]
|
|||
"""
|
||||
Les civilité
|
||||
"""
|
||||
CIVILITE = ['m', 'mme', 'neutre', ]
|
||||
CIVILITE = ['m', 'mme', 'neutre', ]
|
||||
|
||||
|
||||
"""
|
||||
Les prix de vente des formations
|
||||
"""
|
||||
TRAINING_PRICE = ['persession', 'perstagiaire', '']
|
|
@ -73,7 +73,8 @@ def AddStagiairetoClass(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','date_naissance'
|
||||
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com','date_naissance',
|
||||
'financeur_rattachement_id'
|
||||
]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
@ -250,6 +251,25 @@ def AddStagiairetoClass(diction):
|
|||
else:
|
||||
mydata['client_rattachement_id'] = ""
|
||||
|
||||
if ("financeur_rattachement_id" in diction.keys()):
|
||||
if diction['financeur_rattachement_id']:
|
||||
mydata['financeur_rattachement_id'] = diction['financeur_rattachement_id']
|
||||
|
||||
## Verifier l'existance du client de rattachement
|
||||
local_client_retval_count = MYSY_GV.dbname['partner_client'].count_documents(
|
||||
{'_id': ObjectId(diction['financeur_rattachement_id']),
|
||||
'valide': '1', 'locked': '0', 'partner_recid': str(my_session_data['partner_owner_recid'])})
|
||||
|
||||
if (local_client_retval_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " - Le client de rattachement est invalide : local_client_retval_count = " + str(
|
||||
local_client_retval_count))
|
||||
return False, " Le client de rattachement est invalide "
|
||||
|
||||
else:
|
||||
mydata['financeur_rattachement_id'] = ""
|
||||
|
||||
|
||||
if ("ville" in diction.keys()):
|
||||
if diction['ville']:
|
||||
|
@ -583,7 +603,7 @@ def UpdateStagiairetoClass(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', 'type_apprenant', 'civilite',
|
||||
'date_naissance'
|
||||
'date_naissance', 'financeur_rattachement_id'
|
||||
]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
@ -822,6 +842,21 @@ def UpdateStagiairetoClass(diction):
|
|||
3]) + " - Le client de rattachement est invalide : local_client_retval_count = "+str(local_client_retval_count))
|
||||
return False, " Le client de rattachement est invalide "
|
||||
|
||||
if ("financeur_rattachement_id" in diction.keys()):
|
||||
mydata['financeur_rattachement_id'] = str(diction['financeur_rattachement_id']).strip()
|
||||
if (len(str(diction['financeur_rattachement_id']).strip()) > 0):
|
||||
## Verifier l'existance du client de rattachement
|
||||
local_client_retval_count = MYSY_GV.dbname['partner_client'].count_documents(
|
||||
{'_id': ObjectId(diction['financeur_rattachement_id']),
|
||||
'valide': '1', 'locked': '0', 'partner_recid': str(partner_recid)})
|
||||
|
||||
if (local_client_retval_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " - Le financeur de rattachement est invalide : local_client_retval_count = " + str(
|
||||
local_client_retval_count))
|
||||
return False, " Le financeur de rattachement est invalide "
|
||||
|
||||
|
||||
# ici recup des infos de la session
|
||||
local_query = {'_id': ObjectId(str(mysession_id)), 'valide': '1'}
|
||||
|
@ -1264,6 +1299,25 @@ def GetAllClassStagiaire(diction):
|
|||
user['client_rattachement_id'] = client_rattachement_id
|
||||
user['client_rattachement_nom'] = client_rattachement_nom
|
||||
|
||||
#-----
|
||||
financeur_rattachement_id = ""
|
||||
financeur_rattachement_nom = ""
|
||||
|
||||
# Si il a un client rattacher, recuperation des information du client
|
||||
# print(" ### retVal = ", retVal )
|
||||
if ("financeur_rattachement_id" in retval.keys()):
|
||||
if (retval['financeur_rattachement_id'] and str(retval['financeur_rattachement_id']) != 'undefined'):
|
||||
client_retval = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(retval['financeur_rattachement_id']),
|
||||
'valide': '1', 'locked': '0'})
|
||||
|
||||
if (client_retval is not None):
|
||||
financeur_rattachement_id = client_retval['_id']
|
||||
financeur_rattachement_nom = client_retval['nom']
|
||||
|
||||
user['financeur_rattachement_id'] = financeur_rattachement_id
|
||||
user['financeur_rattachement_nom'] = financeur_rattachement_nom
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
@ -6411,6 +6465,25 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
val['client_rattachement_id'] = client_rattachement_id
|
||||
val['client_rattachement_nom'] = client_rattachement_nom
|
||||
|
||||
# ----
|
||||
financeur_rattachement_id = ""
|
||||
financeur_rattachement_nom = ""
|
||||
|
||||
# Si il a un client rattacher, recuperation des information du client
|
||||
# print(" ### retVal = ", retVal )
|
||||
if ("financeur_rattachement_id" in retVal.keys()):
|
||||
if (retVal['financeur_rattachement_id'] and str(retVal['financeur_rattachement_id']) != 'undefined'):
|
||||
client_retval = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(retVal['financeur_rattachement_id']),
|
||||
'valide': '1', 'locked': '0'})
|
||||
|
||||
if (client_retval is not None):
|
||||
financeur_rattachement_id = client_retval['_id']
|
||||
financeur_rattachement_nom = client_retval['nom']
|
||||
|
||||
val['financeur_rattachement_id'] = financeur_rattachement_id
|
||||
val['financeur_rattachement_nom'] = financeur_rattachement_nom
|
||||
|
||||
if(count_session != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
|
@ -6781,6 +6854,24 @@ def GetAttendeeDetail_perSession_from_line_id(diction):
|
|||
my_retrun_dict['client_rattachement_id'] = client_rattachement_id
|
||||
my_retrun_dict['client_rattachement_nom'] = client_rattachement_nom
|
||||
|
||||
# ----
|
||||
financeur_rattachement_id = ""
|
||||
financeur_rattachement_nom = ""
|
||||
if ("financeur_rattachement_id" in local_Insc_retval.keys()):
|
||||
if (local_Insc_retval['financeur_rattachement_id'] and str(
|
||||
local_Insc_retval['financeur_rattachement_id']) != 'undefined'):
|
||||
local_client_retval_data = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(str(local_Insc_retval['financeur_rattachement_id'])),
|
||||
'valide': '1', 'locked': '0'}, {'_id': 1, 'nom': 1})
|
||||
|
||||
if (local_client_retval_data is not None):
|
||||
financeur_rattachement_id = local_client_retval_data['_id']
|
||||
financeur_rattachement_nom = local_client_retval_data['nom']
|
||||
|
||||
my_retrun_dict['financeur_rattachement_id'] = financeur_rattachement_id
|
||||
my_retrun_dict['financeur_rattachement_nom'] = financeur_rattachement_nom
|
||||
|
||||
|
||||
|
||||
v = local_Insc_retval['_id'].generation_time
|
||||
my_retrun_dict['created_date'] = str(v.strftime("%d/%m/%Y"))
|
||||
|
|
2533
Log/log_file.log
2533
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -62,7 +62,7 @@ def Add_Update_SessionFormation(diction):
|
|||
'class_internal_url', 'session_status', 'date_debut_inscription', 'date_fin_inscription',
|
||||
'attestation_certif', "distantiel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code',
|
||||
'session_ondemande', 'source', 'session_id', 'session_etape', 'pays', 'formateur_id',
|
||||
'titre', 'location_type', 'is_bpf', 'site_formation_id']
|
||||
'titre', 'location_type', 'is_bpf', 'site_formation_id', 'price_by']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -184,6 +184,15 @@ def Add_Update_SessionFormation(diction):
|
|||
if ("prix_session" in diction.keys()):
|
||||
mydata['prix_session'] = diction['prix_session']
|
||||
|
||||
if ("price_by" in diction.keys()):
|
||||
if( str(diction['price_by']) not in MYSY_GV.TRAINING_PRICE):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le prix par "+str(diction['price_by'])+" n'est valide. Les valeurs autorisées sont "+str(MYSY_GV.TRAINING_PRICE) )
|
||||
return False, " Le prix par "+str(diction['price_by'])+" n'est valide. Les valeurs autorisées sont "+str(MYSY_GV.TRAINING_PRICE)+" "
|
||||
|
||||
mydata['price_by'] = diction['price_by']
|
||||
else:
|
||||
mydata['price_by'] = "perstagiaire"
|
||||
|
||||
|
||||
if ("titre" in diction.keys()):
|
||||
mydata['titre'] = diction['titre']
|
||||
|
|
16
main.py
16
main.py
|
@ -4042,6 +4042,22 @@ def Get_Partner_List_Partner_Client():
|
|||
localStatus, message = partner_client.Get_Partner_List_Partner_Client(payload)
|
||||
return jsonify(status=localStatus, message=message)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de recuperation de la liste des clients d'un partner avec des filter like
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Partner_List_Partner_Client_with_filter_Like/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Partner_List_Partner_Client_with_filter_Like():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Partner_List_Partner_Client_with_filter_Like : payload = ",payload)
|
||||
localStatus, message = partner_client.Get_Partner_List_Partner_Client_with_filter_Like(payload)
|
||||
return jsonify(status=localStatus, message=message)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de recuperation d'un client donné d'un partner en partant de l'email
|
||||
"""
|
||||
|
|
|
@ -40,8 +40,8 @@ def Add_Partner_Client(diction):
|
|||
'adr_adresse', 'adr_code_postal', 'adr_ville', 'adr_pays',
|
||||
'invoice_email', 'invoice_nom', 'invoice_siret',
|
||||
'invoice_tva', 'invoice_adresse', 'invoice_ville',
|
||||
'invoice_code_postal', 'invoice_pays', "client_type_id"
|
||||
]
|
||||
'invoice_code_postal', 'invoice_pays', "client_type_id",
|
||||
'is_fournisseur', 'is_client', 'is_financeur']
|
||||
|
||||
print(" diction = ", diction)
|
||||
|
||||
|
@ -145,6 +145,41 @@ def Add_Partner_Client(diction):
|
|||
client_type_id = diction['client_type_id']
|
||||
data['client_type_id'] = client_type_id
|
||||
|
||||
is_fournisseur = ""
|
||||
if ("is_fournisseur" in diction.keys() and diction['is_fournisseur']):
|
||||
if (str(diction['is_fournisseur']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Fournisseur : La valeur " + str(
|
||||
diction['is_fournisseur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Fournisseur : La valeur " + str(
|
||||
diction['is_fournisseur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
is_fournisseur = str(diction['is_fournisseur'])
|
||||
data['is_fournisseur'] = is_fournisseur
|
||||
|
||||
is_client = ""
|
||||
if ("is_client" in diction.keys() and diction['is_client']):
|
||||
if (str(diction['is_client']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Client : La valeur " + str(
|
||||
diction['is_client']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Client : La valeur " + str(
|
||||
diction['is_client']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
is_client = str(diction['is_client'])
|
||||
data['is_client'] = is_client
|
||||
|
||||
is_financeur = ""
|
||||
if ("is_financeur" in diction.keys() and diction['is_financeur']):
|
||||
if (str(diction['is_financeur']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Financeur : La valeur " + str(
|
||||
diction['is_financeur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Financeur : La valeur " + str(
|
||||
diction['is_financeur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
|
||||
is_financeur = str(diction['is_financeur'])
|
||||
data['is_financeur'] = is_financeur
|
||||
|
||||
|
||||
adr_adresse = ""
|
||||
if ("adr_adresse" in diction.keys()):
|
||||
if diction['adr_adresse']:
|
||||
|
@ -468,7 +503,8 @@ def Update_Partner_Client(diction):
|
|||
'adr_adresse', 'adr_code_postal', 'adr_ville', 'adr_pays',
|
||||
'invoice_email', 'invoice_nom', 'invoice_siret',
|
||||
'invoice_tva', 'invoice_adresse', 'invoice_ville',
|
||||
'invoice_code_postal', 'invoice_pays', 'client_type_id']
|
||||
'invoice_code_postal', 'invoice_pays', 'client_type_id',
|
||||
'is_fournisseur', 'is_client', 'is_financeur']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -557,6 +593,42 @@ def Update_Partner_Client(diction):
|
|||
client_type_id = diction['client_type_id']
|
||||
data_update['client_type_id'] = diction['client_type_id']
|
||||
|
||||
is_fournisseur = ""
|
||||
if ("is_fournisseur" in diction.keys() and diction['is_fournisseur']):
|
||||
if (str(diction['is_fournisseur']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Fournisseur : La valeur " + str(
|
||||
diction['is_fournisseur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Fournisseur : La valeur " + str(
|
||||
diction['is_fournisseur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
is_fournisseur = str(diction['is_fournisseur'])
|
||||
data_update['is_fournisseur'] = is_fournisseur
|
||||
|
||||
is_client = ""
|
||||
if ("is_client" in diction.keys() and diction['is_client']):
|
||||
if (str(diction['is_client']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Client : La valeur " + str(
|
||||
diction['is_client']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Client : La valeur " + str(
|
||||
diction['is_client']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
is_client = str(diction['is_client'])
|
||||
data_update['is_client'] = is_client
|
||||
|
||||
is_financeur = ""
|
||||
if ("is_financeur" in diction.keys() and diction['is_financeur']):
|
||||
if (str(diction['is_financeur']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Financeur : La valeur " + str(
|
||||
diction['is_financeur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Financeur : La valeur " + str(
|
||||
diction['is_financeur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
|
||||
is_financeur = str(diction['is_financeur'])
|
||||
data_update['is_financeur'] = is_financeur
|
||||
|
||||
|
||||
|
||||
adr_adresse = ""
|
||||
if ("adr_adresse" in diction.keys()):
|
||||
adr_adresse = diction['adr_adresse']
|
||||
|
@ -817,6 +889,117 @@ def Get_Partner_List_Partner_Client(diction):
|
|||
return False, " Impossible de récupérer la liste des clients "
|
||||
|
||||
|
||||
"""
|
||||
Recuperation de la liste des clients d'un partner avec des filtre
|
||||
- is_fournisseur,
|
||||
- is_financeur,
|
||||
- nom
|
||||
- email
|
||||
- etc
|
||||
"""
|
||||
"""
|
||||
Recuperation d'une liste de client d'un partenaire
|
||||
|
||||
|
||||
"""
|
||||
|
||||
def Get_Partner_List_Partner_Client_with_filter_Like(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'raison_sociale', 'nom', 'email',
|
||||
'is_client', 'is_financeur', 'is_fournisseur']
|
||||
|
||||
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'existe pas")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token',]
|
||||
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 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
|
||||
|
||||
|
||||
filt_raison_sociale = {}
|
||||
if ("raison_sociale" in diction.keys()):
|
||||
filt_raison_sociale = {'raison_sociale': {'$regex': str(diction['raison_sociale']), "$options": "i"}}
|
||||
|
||||
filt_nom = {}
|
||||
if ("nom" in diction.keys()):
|
||||
filt_nom = {'nom': {'$regex': str(diction['nom']), "$options": "i"}}
|
||||
|
||||
filt_email = {}
|
||||
if ("email" in diction.keys()):
|
||||
filt_email = {'prenom': {'$regex': str(diction['email']), "$options": "i"}}
|
||||
|
||||
filt_client_is_client = {}
|
||||
if ("is_client" in diction.keys()):
|
||||
filt_client_is_client = {'is_client': str(diction['is_client'])}
|
||||
|
||||
filt_client_is_financeur = {}
|
||||
if ("is_financeur" in diction.keys()):
|
||||
filt_client_is_financeur = {'is_financeur': str(diction['is_financeur'])}
|
||||
|
||||
filt_client_is_fournisseur = {}
|
||||
if ("is_fournisseur" in diction.keys()):
|
||||
filt_client_is_fournisseur = {'is_fournisseur': str(diction['is_fournisseur'])}
|
||||
|
||||
|
||||
filt_class_partner_recid = {'partner_owner_recid': str(my_partner['recid'])}
|
||||
|
||||
qry = {'$and': [filt_raison_sociale, filt_email, filt_nom, filt_client_is_client,
|
||||
filt_client_is_financeur,filt_client_is_fournisseur, {'partner_recid': str(my_partner['recid'])}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
print("#### Get_Partner_List_Partner_Client_with_filter_Like laa 01 : query = ", qry)
|
||||
RetObject = []
|
||||
val_tmp = 1
|
||||
|
||||
for New_retVal in MYSY_GV.dbname['partner_client'].find(qry):
|
||||
print(" ### New_retVal = ", New_retVal)
|
||||
|
||||
user = New_retVal
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
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écupérer la liste des clients "
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperation d'un client donnée a partir de l'adresse email
|
||||
"""
|
||||
|
@ -1340,6 +1523,16 @@ def Get_Client_Type_List(diction):
|
|||
for retval in MYSY_GV.dbname['partner_client_type'].find(data_cle):
|
||||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
if( "is_financeur" not in retval.keys() ):
|
||||
user['is_financeur'] = 0
|
||||
|
||||
if ("is_client" not in retval.keys()):
|
||||
user['is_client'] = 0
|
||||
|
||||
if ("is_fournisseur" not in retval.keys()):
|
||||
user['is_fournisseur'] = 0
|
||||
|
||||
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
@ -1360,7 +1553,7 @@ def Add_Client_Type(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token','code', 'description']
|
||||
field_list = ['token','code', 'description', 'is_fournisseur', 'is_client', 'is_financeur']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -1402,6 +1595,32 @@ def Add_Client_Type(diction):
|
|||
str(inspect.stack()[0][3]) + " - Ce code existe déjà pour un type de client ")
|
||||
return False, " Ce code existe déjà pour un type de client",
|
||||
|
||||
if( "is_fournisseur" in diction.keys() and diction['is_fournisseur']) :
|
||||
if ( str(diction['is_fournisseur']) not in ['0', '1'] ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Fournisseur : La valeur " + str(diction['is_fournisseur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Fournisseur : La valeur " + str(diction['is_fournisseur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
|
||||
|
||||
if ("is_client" in diction.keys() and diction['is_client']):
|
||||
if (str(diction['is_client']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Client : La valeur " + str(
|
||||
diction['is_client']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Client : La valeur " + str(
|
||||
diction['is_client']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
|
||||
|
||||
if ("is_financeur" in diction.keys() and diction['is_financeur']):
|
||||
if (str(diction['is_financeur']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Financeur : La valeur " + str(
|
||||
diction['is_financeur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Financeur : La valeur " + str(
|
||||
diction['is_financeur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
|
||||
|
||||
|
||||
|
||||
new_data = diction
|
||||
del new_data['token']
|
||||
|
@ -1436,7 +1655,7 @@ def Update_Client_Type(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', '_id', 'code', 'description']
|
||||
field_list = ['token', '_id', 'code', 'description', 'is_fournisseur', 'is_client', 'is_financeur']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -1480,6 +1699,31 @@ def Update_Client_Type(diction):
|
|||
str(inspect.stack()[0][3]) + " - L'identifiant du type de client est invalide ")
|
||||
return False, " L'identifiant du type de client est invalide ",
|
||||
|
||||
if ("is_fournisseur" in diction.keys() and diction['is_fournisseur']):
|
||||
if (str(diction['is_fournisseur']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Fournisseur : La valeur " + str(
|
||||
diction['is_fournisseur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Fournisseur : La valeur " + str(
|
||||
diction['is_fournisseur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
|
||||
if ("is_client" in diction.keys() and diction['is_client']):
|
||||
if (str(diction['is_client']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Client : La valeur " + str(
|
||||
diction['is_client']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Client : La valeur " + str(
|
||||
diction['is_client']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
|
||||
if ("is_financeur" in diction.keys() and diction['is_financeur']):
|
||||
if (str(diction['is_financeur']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Est Financeur : La valeur " + str(
|
||||
diction['is_financeur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 ")
|
||||
return False, " Est Financeur : La valeur " + str(
|
||||
diction['is_financeur']) + " n'est pas autorisée. Les valeurs admises sont : 0, 1 "
|
||||
|
||||
|
||||
|
||||
local_id = str(diction['_id'])
|
||||
new_data = diction
|
||||
|
|
|
@ -3360,6 +3360,23 @@ def GetAttendeeDetail_perSession(diction):
|
|||
my_retrun_dict['client_rattachement_id'] = client_rattachement_id
|
||||
my_retrun_dict['client_rattachement_nom'] = client_rattachement_nom
|
||||
|
||||
#----
|
||||
financeur_rattachement_id = ""
|
||||
financeur_rattachement_nom = ""
|
||||
if ("financeur_rattachement_id" in local_Insc_retval.keys()):
|
||||
if (local_Insc_retval['financeur_rattachement_id'] and str(
|
||||
local_Insc_retval['financeur_rattachement_id']) != 'undefined'):
|
||||
local_client_retval_data = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(str(local_Insc_retval['financeur_rattachement_id'])),
|
||||
'valide': '1', 'locked': '0'}, {'_id': 1, 'nom': 1})
|
||||
|
||||
if (local_client_retval_data is not None):
|
||||
financeur_rattachement_id = local_client_retval_data['_id']
|
||||
financeur_rattachement_nom = local_client_retval_data['nom']
|
||||
|
||||
my_retrun_dict['financeur_rattachement_id'] = financeur_rattachement_id
|
||||
my_retrun_dict['financeur_rattachement_nom'] = financeur_rattachement_nom
|
||||
|
||||
|
||||
v = local_Insc_retval['_id'].generation_time
|
||||
my_retrun_dict['created_date'] = str(v.strftime("%d/%m/%Y"))
|
||||
|
@ -4544,11 +4561,35 @@ def Get_Dictionnary_data_For_Template(diction):
|
|||
new_field = {new_champ_name: str(client_rattachement_nom)}
|
||||
new_apprenant_data.update(new_field)
|
||||
|
||||
|
||||
else :
|
||||
new_champ_name = "apprenant_" + str(champ)
|
||||
new_field = {new_champ_name: str(apprenant_data[champ])}
|
||||
new_apprenant_data.update(new_field)
|
||||
|
||||
# ----
|
||||
if (champ == "financeur_rattachement_id"):
|
||||
financeur_rattachement_nom = "";
|
||||
if ("financeur_rattachement_id" in apprenant_data.keys() and apprenant_data[
|
||||
'financeur_rattachement_id']):
|
||||
client_rattachement_id_data = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(str(apprenant_data['financeur_rattachement_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_recid': str(my_partner['recid'])},
|
||||
{'nom': 1})
|
||||
|
||||
if (client_rattachement_id_data and "nom" in client_rattachement_id_data.keys()):
|
||||
financeur_rattachement_nom = str(client_rattachement_id_data["nom"])
|
||||
|
||||
new_champ_name = "apprenant_financeur_rattachement_nom"
|
||||
new_field = {new_champ_name: str(financeur_rattachement_nom)}
|
||||
new_apprenant_data.update(new_field)
|
||||
|
||||
else:
|
||||
new_champ_name = "apprenant_" + str(champ)
|
||||
new_field = {new_champ_name: str(apprenant_data[champ])}
|
||||
new_apprenant_data.update(new_field)
|
||||
|
||||
else:
|
||||
new_champ_name = "apprenant_" + str(champ)
|
||||
new_field = {new_champ_name: ""}
|
||||
|
|
Loading…
Reference in New Issue