14/07/2024 - 22h
parent
065a9ac763
commit
35d0e81527
|
@ -1,15 +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="11/07/2024 - 13h14">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="13/07/2024 - 22h">
|
||||
<change afterPath="$PROJECT_DIR$/partner_produit_service_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Contact.py" beforeDir="false" afterPath="$PROJECT_DIR$/Contact.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Dashbord_queries/factures_tbd_qries.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/factures_tbd_qries.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Dashbord_queries/session_tbd_qries.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/session_tbd_qries.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$/formulaire_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/formulaire_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_order.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_order.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -80,13 +79,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00301" summary="ddd">
|
||||
<created>1715857414078</created>
|
||||
<option name="number" value="00301" />
|
||||
<option name="presentableId" value="LOCAL-00301" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1715857414079</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00302" summary="ddd">
|
||||
<created>1715884005756</created>
|
||||
<option name="number" value="00302" />
|
||||
|
@ -423,7 +415,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1720853546538</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="350" />
|
||||
<task id="LOCAL-00350" summary="13/07/2024 - 22h">
|
||||
<created>1720900252716</created>
|
||||
<option name="number" value="00350" />
|
||||
<option name="presentableId" value="LOCAL-00350" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1720900252717</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="351" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -465,7 +464,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="qsdsq" />
|
||||
<MESSAGE value="qsdsqsqdsq" />
|
||||
<MESSAGE value="05/06/2024 - 23h" />
|
||||
<MESSAGE value="06/06/2024 - 12h" />
|
||||
|
@ -490,6 +488,7 @@
|
|||
<MESSAGE value="wwssdssd" />
|
||||
<MESSAGE value="wwssdssddd" />
|
||||
<MESSAGE value="11/07/2024 - 13h14" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="11/07/2024 - 13h14" />
|
||||
<MESSAGE value="13/07/2024 - 22h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="13/07/2024 - 22h" />
|
||||
</component>
|
||||
</project>
|
|
@ -206,7 +206,7 @@ def Get_Qery_List_Factures_Data_By_Periode(diction):
|
|||
}
|
||||
},
|
||||
{
|
||||
'$sort': {'count': -1}
|
||||
'$sort': {'_id.mois_annee_facture': 1}
|
||||
},
|
||||
|
||||
])
|
||||
|
@ -218,7 +218,7 @@ def Get_Qery_List_Factures_Data_By_Periode(diction):
|
|||
|
||||
axis_data = []
|
||||
series_TotalAmount_data = []
|
||||
|
||||
count_cumule = 0
|
||||
"""
|
||||
On recupere les données, on les format dans le 'range_date_month' et on retourne"""
|
||||
for retval in MYSY_GV.dbname['partner_invoice_header'].aggregate(pipe_qry):
|
||||
|
@ -229,6 +229,9 @@ def Get_Qery_List_Factures_Data_By_Periode(diction):
|
|||
if( str(retval['_id']['mois_annee_facture']) == str(tmp['month_year']) ):
|
||||
tmp['TotalAmount'] = mycommon.tryFloat(str(retval['TotalAmount']))
|
||||
tmp['count'] = mycommon.tryFloat(str(retval['count']))
|
||||
count_cumule = mycommon.tryFloat(str(retval['TotalAmount'])) + count_cumule
|
||||
tmp['TotalAmount_cumule'] = count_cumule
|
||||
|
||||
|
||||
series_TotalAmount_data.append( str(retval['TotalAmount']))
|
||||
else:
|
||||
|
@ -241,6 +244,7 @@ def Get_Qery_List_Factures_Data_By_Periode(diction):
|
|||
json_retval['axis_data'] = axis_data
|
||||
json_retval['series_TotalAmount_data'] = series_TotalAmount_data
|
||||
|
||||
print(" ### Get_Qery_List_Factures_Data_By_Periode : json_retval = ", json_retval)
|
||||
RetObject.append(mycommon.JSONEncoder().encode(json_retval))
|
||||
|
||||
return True, RetObject
|
||||
|
@ -663,9 +667,11 @@ def Get_Qery_List_Factures_Data_By_Client_Periode(diction):
|
|||
user['Client_nom'] = retval['_id']['Client_nom'][0]
|
||||
user['Client_raison_sociale'] = retval['_id']['Client_raison_sociale'][0]
|
||||
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
print(" ### Get_Qery_List_Factures_Data_By_Client_Periode RetObject = ", RetObject)
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
||||
|
@ -675,8 +681,214 @@ def Get_Qery_List_Factures_Data_By_Client_Periode(diction):
|
|||
return False, " Impossible de récupérer les données "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonctionne donne le CA des devis (validé / non validé par mois) sur une periode
|
||||
V2 Affichage du chiffre d'affaire par client
|
||||
"""
|
||||
def Get_Qery_List_Factures_Data_By_Client_V2(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'periode_start_date', 'periode_end_date', 'filter_value', 'filter_client_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'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_client_id = {}
|
||||
if ("filter_client_id" in diction.keys() and diction['filter_client_id']):
|
||||
filt_client_id = {'order_header_client_id': str(diction['filter_client_id'])}
|
||||
|
||||
|
||||
filt_periode_start_date = ""
|
||||
if ("periode_start_date" in diction.keys() and diction['periode_start_date']):
|
||||
filt_periode_start_date = str(diction['periode_start_date'])[0:10]
|
||||
local_status = mycommon.CheckisDate(filt_periode_start_date)
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le filtre : 'date de debut' n'est pas au format jj/mm/aaaa.")
|
||||
return False, " Le filtre : 'date de debut' n'est pas au format jj/mm/aaaa."
|
||||
|
||||
filt_periode_end_date = ""
|
||||
if ("periode_end_date" in diction.keys() and diction['periode_end_date']):
|
||||
filt_periode_end_date = str(diction['periode_end_date'])[0:10]
|
||||
local_status = mycommon.CheckisDate(filt_periode_end_date)
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le filtre : 'date de fin' n'est pas au format jj/mm/aaaa.")
|
||||
return False, " Le filtre : 'date de fin' n'est pas au format jj/mm/aaaa."
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Si la valeur de 'filter_value' est m0 ou m1, on va aller recuperer les date du mois correspondant.
|
||||
On ecrase les valeur de filt_session_start_date et filt_session_end_date
|
||||
"""
|
||||
if ('filter_value' in diction.keys()):
|
||||
# print(" filter_value = ", diction['filter_value'])
|
||||
if (str(diction['filter_value']) == "m0"):
|
||||
# On recupere les date du mois en cours
|
||||
local_status, start_current_month_date, end_current_month_date = mycommon.Get_Current_Month_Start_End_Date()
|
||||
if (local_status is False):
|
||||
return local_status, start_current_month_date
|
||||
|
||||
filt_periode_start_date = start_current_month_date
|
||||
filt_periode_end_date = end_current_month_date
|
||||
|
||||
# print(" ### filt_session_start_date = ", filt_session_start_date, " ### filt_session_end_date = ", filt_session_end_date)
|
||||
|
||||
elif (str(diction['filter_value']) == "m1"):
|
||||
# On recupere les date du mois en cours
|
||||
local_status, start_current_month_date, end_current_month_date = mycommon.Get_Previous_Month_Start_End_Date()
|
||||
if (local_status is False):
|
||||
return local_status, start_current_month_date
|
||||
|
||||
filt_periode_start_date = start_current_month_date
|
||||
filt_periode_end_date = end_current_month_date
|
||||
|
||||
|
||||
|
||||
filt_periode_start_date_ISODATE = datetime.strptime(str(filt_periode_start_date), '%d/%m/%Y')
|
||||
filt_periode_end_date_ISODATE = datetime.strptime(str(filt_periode_end_date), '%d/%m/%Y')
|
||||
|
||||
|
||||
|
||||
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])},
|
||||
{"valide": '1'},filt_client_id,
|
||||
|
||||
{
|
||||
'mysy_invoice_date': {'$gte': filt_periode_start_date_ISODATE,
|
||||
'$lte': filt_periode_end_date_ISODATE}}, ]}
|
||||
|
||||
pipe_qry = ([
|
||||
{"$addFields": {
|
||||
"mysy_invoice_date": {
|
||||
'$dateFromString': {
|
||||
'dateString': '$invoice_date',
|
||||
'format': "%d/%m/%Y"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{'$match': qery_match},
|
||||
{'$lookup': {
|
||||
'from': 'partner_client',
|
||||
"let": {'order_header_client_id': "$order_header_client_id", 'partner_owner_recid': '$partner_owner_recid'},
|
||||
'pipeline': [
|
||||
{'$match':
|
||||
{'$expr':
|
||||
{'$and':
|
||||
[
|
||||
|
||||
{'$eq': ["$_id", {'$convert': {
|
||||
'input': "$$order_header_client_id",
|
||||
'to': "objectId",
|
||||
'onError': {'error': 'true'},
|
||||
'onNull': {'isnull': 'true'}
|
||||
}}]},
|
||||
|
||||
{'$eq': ["$valide", "1"]},
|
||||
{'$eq': ["$partner_recid", '$$partner_owner_recid']}
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
],
|
||||
'as': 'partner_client_collection'
|
||||
}
|
||||
},
|
||||
{'$group': {
|
||||
'_id': {
|
||||
"Client_id": "$order_header_client_id",
|
||||
"Client_nom": "$partner_client_collection.nom",
|
||||
"Client_raison_sociale": "$partner_client_collection.raison_sociale",
|
||||
},
|
||||
"TotalAmount": {"$sum": {'$toDouble': '$total_header_toutes_taxes'}},
|
||||
"count": { "$sum": 1}
|
||||
}
|
||||
},
|
||||
{
|
||||
'$sort': {'count': -1}
|
||||
},
|
||||
|
||||
])
|
||||
|
||||
#print(" ### Get_Qery_List_Factures_Data ici pipe_qry = ", pipe_qry)
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
axis_data = []
|
||||
series_TotalAmount_data = []
|
||||
|
||||
"""
|
||||
On recupere les données, on les format dans le 'range_date_month' et on retourne
|
||||
"""
|
||||
tab_data = []
|
||||
for retval in MYSY_GV.dbname['partner_invoice_header'].aggregate(pipe_qry):
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
user = {}
|
||||
user['label'] = retval['_id']['Client_nom'][0]
|
||||
user['value'] = retval['TotalAmount']
|
||||
user['count'] = retval['count']
|
||||
user['Client_id'] = retval['_id']['Client_id']
|
||||
user['Client_nom'] = retval['_id']['Client_nom'][0]
|
||||
user['Client_raison_sociale'] = retval['_id']['Client_raison_sociale'][0]
|
||||
|
||||
tab_data.append(user)
|
||||
|
||||
retval = {}
|
||||
retval['data'] = tab_data
|
||||
RetObject.append(mycommon.JSONEncoder().encode(retval))
|
||||
|
||||
#print(" ### Get_Qery_List_Factures_Data_By_Client_Periode RetObject = ", RetObject)
|
||||
|
||||
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 les données "
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonctionne donne le CA des devis (gagné ou perdu ) sur une periode
|
||||
"""
|
||||
def Get_Qery_List_Quotation_Data_By_Periode(diction):
|
||||
try:
|
||||
|
@ -854,7 +1066,7 @@ def Get_Qery_List_Quotation_Data_By_Periode(diction):
|
|||
},
|
||||
{'$group': {
|
||||
'_id': {
|
||||
"is_validated": "$is_validated",
|
||||
"order_header_status": "$order_header_status",
|
||||
"mois_annee_facture": { "$concat": [{'$substr': ["$order_header_date_cmd", 3, 2]},"_", {'$substr': ["$order_header_date_cmd", 6, 4]}]},
|
||||
"annee_facture": {'$substr': ["$order_header_date_cmd", 6, 4]},
|
||||
"mois_facture": {'$substr': ["$order_header_date_cmd", 3, 2]},
|
||||
|
@ -863,6 +1075,256 @@ def Get_Qery_List_Quotation_Data_By_Periode(diction):
|
|||
"count": { "$sum": 1}
|
||||
}
|
||||
},
|
||||
{
|
||||
'$sort': {'_id.mois_annee_facture': 1}
|
||||
},
|
||||
|
||||
])
|
||||
|
||||
print(" ### Get_Qery_List_Factures_Data ici pipe_qry = ", pipe_qry)
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
axis_data = []
|
||||
series_TotalAmount_data = []
|
||||
nb_cumule_gagne = 0
|
||||
nb_cumule_perdu = 0
|
||||
"""
|
||||
On recupere les données, on les format dans le 'range_date_month' et on retourne"""
|
||||
for retval in MYSY_GV.dbname['partner_order_header'].aggregate(pipe_qry):
|
||||
val_tmp = val_tmp + 1
|
||||
for tmp in range_date_month:
|
||||
axis_data.append(str(tmp['month_year']))
|
||||
|
||||
if( str(retval['_id']['mois_annee_facture']) == str(tmp['month_year']) and str(retval['_id']['order_header_status']) == "3" ):
|
||||
tmp['TotalAmount'] = mycommon.tryFloat(str(retval['TotalAmount']))
|
||||
tmp['count'] = mycommon.tryFloat(str(retval['count']))
|
||||
tmp['nb_devis_gagne'] = mycommon.tryFloat(str(retval['count']))
|
||||
nb_cumule_gagne = mycommon.tryFloat(str(retval['count'])) + nb_cumule_gagne
|
||||
|
||||
tmp['nb_cumule_perdu'] = mycommon.tryFloat(str(nb_cumule_perdu))
|
||||
tmp['nb_cumule_gagne'] = mycommon.tryFloat(str(nb_cumule_gagne))
|
||||
|
||||
series_TotalAmount_data.append( str(retval['TotalAmount']))
|
||||
|
||||
elif (str(retval['_id']['mois_annee_facture']) == str(tmp['month_year']) and str(retval['_id']['order_header_status']) == "4"):
|
||||
tmp['TotalAmount'] = mycommon.tryFloat(str(retval['TotalAmount']))
|
||||
tmp['count'] = mycommon.tryFloat(str(retval['count']))
|
||||
tmp['nb_devis_perdu'] = mycommon.tryFloat(str(retval['count']))
|
||||
nb_cumule_perdu = mycommon.tryFloat(str(retval['count'])) + nb_cumule_perdu
|
||||
|
||||
tmp['nb_cumule_perdu'] = mycommon.tryFloat(str(nb_cumule_perdu))
|
||||
tmp['nb_cumule_gagne'] = mycommon.tryFloat(str(nb_cumule_gagne))
|
||||
|
||||
series_TotalAmount_data.append(str(retval['TotalAmount']))
|
||||
|
||||
|
||||
|
||||
|
||||
json_retval = {}
|
||||
json_retval['data'] = range_date_month
|
||||
|
||||
print(" ### Get_Qery_List_Quotation_Data_By_Periode json_retval = ", json_retval)
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(json_retval))
|
||||
|
||||
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 les données "
|
||||
|
||||
|
||||
"""
|
||||
Cette fonctionne donne le CA des devis (gagné ou perdu ) par client
|
||||
"""
|
||||
def Get_Qery_List_Quotation_Data_By_Client(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'periode_start_date', 'periode_end_date', 'filter_value', 'filter_client_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'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_client_id = {}
|
||||
if ("filter_client_id" in diction.keys() and diction['filter_client_id']):
|
||||
filt_client_id = {'order_header_client_id': str(diction['filter_client_id'])}
|
||||
|
||||
|
||||
filt_periode_start_date = ""
|
||||
if ("periode_start_date" in diction.keys() and diction['periode_start_date']):
|
||||
filt_periode_start_date = str(diction['periode_start_date'])[0:10]
|
||||
local_status = mycommon.CheckisDate(filt_periode_start_date)
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le filtre : 'date de debut' n'est pas au format jj/mm/aaaa.")
|
||||
return False, " Le filtre : 'date de debut' n'est pas au format jj/mm/aaaa."
|
||||
|
||||
filt_periode_end_date = ""
|
||||
if ("periode_end_date" in diction.keys() and diction['periode_end_date']):
|
||||
filt_periode_end_date = str(diction['periode_end_date'])[0:10]
|
||||
local_status = mycommon.CheckisDate(filt_periode_end_date)
|
||||
if (local_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le filtre : 'date de fin' n'est pas au format jj/mm/aaaa.")
|
||||
return False, " Le filtre : 'date de fin' n'est pas au format jj/mm/aaaa."
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Si la valeur de 'filter_value' est m0 ou m1, on va aller recuperer les date du mois correspondant.
|
||||
On ecrase les valeur de filt_session_start_date et filt_session_end_date
|
||||
"""
|
||||
if ('filter_value' in diction.keys()):
|
||||
# print(" filter_value = ", diction['filter_value'])
|
||||
if (str(diction['filter_value']) == "m0"):
|
||||
# On recupere les date du mois en cours
|
||||
local_status, start_current_month_date, end_current_month_date = mycommon.Get_Current_Month_Start_End_Date()
|
||||
if (local_status is False):
|
||||
return local_status, start_current_month_date
|
||||
|
||||
filt_periode_start_date = start_current_month_date
|
||||
filt_periode_end_date = end_current_month_date
|
||||
|
||||
# print(" ### filt_session_start_date = ", filt_session_start_date, " ### filt_session_end_date = ", filt_session_end_date)
|
||||
|
||||
elif (str(diction['filter_value']) == "m1"):
|
||||
# On recupere les date du mois en cours
|
||||
local_status, start_current_month_date, end_current_month_date = mycommon.Get_Previous_Month_Start_End_Date()
|
||||
if (local_status is False):
|
||||
return local_status, start_current_month_date
|
||||
|
||||
filt_periode_start_date = start_current_month_date
|
||||
filt_periode_end_date = end_current_month_date
|
||||
|
||||
|
||||
|
||||
filt_periode_start_date_ISODATE = datetime.strptime(str(filt_periode_start_date), '%d/%m/%Y')
|
||||
filt_periode_end_date_ISODATE = datetime.strptime(str(filt_periode_end_date), '%d/%m/%Y')
|
||||
|
||||
|
||||
"""
|
||||
Creation de la range des mois entre filt_periode_start_date_ISODATE et
|
||||
filt_periode_end_date_ISODATE
|
||||
"""
|
||||
range_date_month = []
|
||||
start = filt_periode_start_date_ISODATE
|
||||
end = filt_periode_end_date_ISODATE
|
||||
while start <= end:
|
||||
node = {}
|
||||
node['month_year'] = '{:02d}'.format(start.month) +"_"+str(start.year)
|
||||
node['mois_annee_facture'] = '{:02d}'.format(start.month) + "_" + str(start.year)
|
||||
node['label'] = '{:02d}'.format(start.month) + "_" + str(start.year)
|
||||
node['TotalAmount'] = 0
|
||||
node['value'] = 0
|
||||
node['count'] = 0
|
||||
|
||||
node['nb_devis_gagne'] = 0
|
||||
node['nb_devis_perdu'] = 0
|
||||
|
||||
range_date_month.append(node)
|
||||
start += relativedelta(months=1)
|
||||
|
||||
|
||||
|
||||
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])},
|
||||
{"valide": '1'},filt_client_id, { 'is_validated': {'$exists': True}},
|
||||
{
|
||||
"order_header_type": "devis"
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
'mysy_quotation_date': {'$gte': filt_periode_start_date_ISODATE,
|
||||
'$lte': filt_periode_end_date_ISODATE}
|
||||
},
|
||||
|
||||
]}
|
||||
|
||||
pipe_qry = ([
|
||||
{"$addFields": {
|
||||
"mysy_quotation_date": {
|
||||
'$dateFromString': {
|
||||
'dateString': '$order_header_date_cmd',
|
||||
'format': "%d/%m/%Y"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{'$match': qery_match},
|
||||
{'$lookup': {
|
||||
'from': 'partner_client',
|
||||
"let": {'order_header_client_id': "$order_header_client_id", 'partner_owner_recid': '$partner_owner_recid'},
|
||||
'pipeline': [
|
||||
{'$match':
|
||||
{'$expr':
|
||||
{'$and':
|
||||
[
|
||||
|
||||
{'$eq': ["$_id", {'$convert': {
|
||||
'input': "$$order_header_client_id",
|
||||
'to': "objectId",
|
||||
'onError': {'error': 'true'},
|
||||
'onNull': {'isnull': 'true'}
|
||||
}}]},
|
||||
|
||||
{'$eq': ["$valide", "1"]},
|
||||
{'$eq': ["$partner_recid", '$$partner_owner_recid']}
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
],
|
||||
'as': 'partner_client_collection'
|
||||
}
|
||||
},
|
||||
{'$group': {
|
||||
'_id': {
|
||||
"Client_id": "$order_header_client_id",
|
||||
"Client_nom": "$partner_client_collection.nom",
|
||||
"Client_raison_sociale": "$partner_client_collection.raison_sociale",
|
||||
},
|
||||
"TotalAmount": {"$sum": {'$toDouble': '$total_header_toutes_taxes'}},
|
||||
"count": {"$sum": 1}
|
||||
}
|
||||
},
|
||||
{
|
||||
'$sort': {'count': -1}
|
||||
},
|
||||
|
@ -876,32 +1338,38 @@ def Get_Qery_List_Quotation_Data_By_Periode(diction):
|
|||
|
||||
axis_data = []
|
||||
series_TotalAmount_data = []
|
||||
|
||||
nb_cumule_gagne = 0
|
||||
nb_cumule_perdu = 0
|
||||
"""
|
||||
On recupere les données, on les format dans le 'range_date_month' et on retourne"""
|
||||
for retval in MYSY_GV.dbname['partner_order_header'].aggregate(pipe_qry):
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
for tmp in range_date_month:
|
||||
axis_data.append(str(tmp['month_year']))
|
||||
tmp['label'] = retval['_id']['Client_nom'][0]
|
||||
tmp['Client_id'] = retval['_id']['Client_id']
|
||||
tmp['Client_nom'] = retval['_id']['Client_nom'][0]
|
||||
tmp['Client_raison_sociale'] = retval['_id']['Client_raison_sociale'][0]
|
||||
|
||||
if( str(retval['_id']['mois_annee_facture']) == str(tmp['month_year']) and str(retval['_id']['is_validated']) == "1" ):
|
||||
if( str(retval['_id']['mois_annee_facture']) == str(tmp['month_year']) and str(retval['_id']['order_header_status']) == "3" ):
|
||||
tmp['TotalAmount'] = mycommon.tryFloat(str(retval['TotalAmount']))
|
||||
tmp['count'] = mycommon.tryFloat(str(retval['count']))
|
||||
tmp['nb_devis_gagne'] = mycommon.tryFloat(str(retval['count']))
|
||||
|
||||
series_TotalAmount_data.append( str(retval['TotalAmount']))
|
||||
|
||||
elif (str(retval['_id']['mois_annee_facture']) == str(tmp['month_year']) and str(retval['_id']['is_validated']) == "0"):
|
||||
elif (str(retval['_id']['mois_annee_facture']) == str(tmp['month_year']) and str(retval['_id']['order_header_status']) == "4"):
|
||||
tmp['TotalAmount'] = mycommon.tryFloat(str(retval['TotalAmount']))
|
||||
tmp['count'] = mycommon.tryFloat(str(retval['count']))
|
||||
tmp['nb_devis_perdu'] = mycommon.tryFloat(str(retval['count']))
|
||||
|
||||
series_TotalAmount_data.append(str(retval['TotalAmount']))
|
||||
|
||||
|
||||
json_retval = {}
|
||||
json_retval['data'] = range_date_month
|
||||
|
||||
print(" ### Get_Qery_List_Quotation_Data_By_Periode json_retval = ", json_retval)
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(json_retval))
|
||||
|
||||
|
@ -1855,6 +2323,26 @@ def Get_Qery_List_Facture_Previsionnelle_Data_By_Periode(diction):
|
|||
|
||||
|
||||
for val in MYSY_GV.dbname['session_formation'].aggregate(pipe_qry):
|
||||
"""
|
||||
30/05/2024 - update :
|
||||
/!\ : Ici on parle du prix TOTAL de la session
|
||||
Pour recalculer le prix mensuelle, il faut prendre
|
||||
on fait un ratio :
|
||||
- calculer le nombre de mois
|
||||
- diviser le prix par le nombre de mois
|
||||
"""
|
||||
local_diction = {}
|
||||
local_diction['date_from'] = str(val['date_debut'])
|
||||
local_diction['date_to'] = str(val['date_fin'])
|
||||
local_diction['total_price'] = str(val['prix_session'])
|
||||
local_price_status, local_price_retval = mycommon.Compute_Monthly_Price_From_Dates(local_diction)
|
||||
if (local_price_status is False):
|
||||
return local_price_status, local_price_retval
|
||||
|
||||
new_price_data = local_price_retval['monthly_price']
|
||||
|
||||
#print(" ### pour la session : "+str(val['code_session'])+" le prix mensuel est de new_price_data = ", local_price_retval)
|
||||
|
||||
|
||||
|
||||
for tmp in range_date_month:
|
||||
|
@ -1870,14 +2358,16 @@ def Get_Qery_List_Facture_Previsionnelle_Data_By_Periode(diction):
|
|||
local_node['price_by'] = val['price_by']
|
||||
if( "inscription_collection" in val.keys() ):
|
||||
local_node['nb_participant'] = len(val['inscription_collection'])
|
||||
|
||||
else:
|
||||
local_node['nb_participant'] = '0'
|
||||
|
||||
if( val['price_by'] == "perstagiaire"):
|
||||
ca_prev = (mycommon.tryFloat( val['prix_session']) * mycommon.tryFloat( local_node['nb_participant'])) + ca_prev
|
||||
|
||||
ca_prev = (mycommon.tryFloat( new_price_data) * mycommon.tryFloat( local_node['nb_participant'])) + ca_prev
|
||||
|
||||
elif( val['price_by'] == "persession"):
|
||||
ca_prev = (mycommon.tryFloat( val['prix_session']) ) + ca_prev
|
||||
ca_prev = (mycommon.tryFloat( new_price_data) ) + ca_prev
|
||||
|
||||
local_node['ca_previsionnel'] = str(ca_prev)
|
||||
|
||||
|
@ -1887,8 +2377,6 @@ def Get_Qery_List_Facture_Previsionnelle_Data_By_Periode(diction):
|
|||
data['ca_month_previsionnel'] = mycommon.tryFloat(str(ca_month_previsionnel))
|
||||
|
||||
|
||||
|
||||
|
||||
final_data = {}
|
||||
final_data['data'] = range_date_month
|
||||
final_data['axis_data'] = []
|
||||
|
|
2711
Log/log_file.log
2711
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -137,7 +137,10 @@ def Add_Formulaire(diction):
|
|||
|
||||
|
||||
"""
|
||||
Fonction ajoute ou modifie une question à un formulaire
|
||||
Fonction ajoute ou modifie une question à un formulaire.
|
||||
|
||||
La mise à jour n'est possible que s'il n'y pas des reponses à des enquetes avec cette question
|
||||
|
||||
"""
|
||||
|
||||
def Add_Update_Question_Formulaire(diction):
|
||||
|
@ -202,7 +205,16 @@ def Add_Update_Question_Formulaire(diction):
|
|||
mycommon.myprint(" Le type des question est invalide. Les valeurs autorisées "+ MYSY_GV.FORM_QUESTION_TYPE)
|
||||
return False, " Le type des question est invalide. Les valeurs autorisées "+ MYSY_GV.FORM_QUESTION_TYPE
|
||||
|
||||
|
||||
"""
|
||||
Si la question est utilisée dans le collection 'survey', on revuse
|
||||
"""
|
||||
if( "question_id" in diction.keys() ):
|
||||
is_question_used_in_survey = MYSY_GV.dbname['survey'].count_documents(
|
||||
{'user_response.question_id': str(diction['question_id']),
|
||||
'valide': '1'})
|
||||
if (is_question_used_in_survey > 0):
|
||||
mycommon.myprint(" Il a déjà des réponses d'enquete avec cette question. Impossible de faire la mise à jour ")
|
||||
return False, " Il a déjà des réponses d'enquete avec cette question. Impossible de faire la mise à jour "
|
||||
|
||||
"""
|
||||
Verifier que la note maximale est un entier
|
||||
|
@ -430,7 +442,11 @@ def Add_Update_Question_Formulaire(diction):
|
|||
|
||||
|
||||
"""
|
||||
Fonction pour supprimer une question d'un formulaire
|
||||
Fonction pour supprimer une question d'un formulaire.
|
||||
|
||||
Si une question est deja utilisée dans la collection "survey", la suppression est impossible
|
||||
car la question est deja utilisée
|
||||
|
||||
"""
|
||||
|
||||
def Delete_Question_Formulaire(diction):
|
||||
|
@ -498,6 +514,16 @@ def Delete_Question_Formulaire(diction):
|
|||
return False, " L'identifiant de la question est invalide "
|
||||
|
||||
|
||||
"""
|
||||
Si la question est utilisée dans le collection 'survey', on revuse
|
||||
"""
|
||||
is_question_used_in_survey = MYSY_GV.dbname['survey'].count_documents({'user_response.question_id':str(diction['question_id']),
|
||||
'valide':'1'})
|
||||
if( is_question_used_in_survey > 0 ):
|
||||
mycommon.myprint(" Il a déjà des réponses d'enquete avec cette question. Impossible de la supprimer ")
|
||||
return False, " Il a déjà des réponses d'enquete avec cette question. Impossible de la supprimer "
|
||||
|
||||
|
||||
update = MYSY_GV.dbname['formulaire'].update_one({'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0',
|
||||
'_id': ObjectId(str(diction['form_id']))},
|
||||
|
|
113
main.py
113
main.py
|
@ -91,6 +91,7 @@ import notes_apprenant_mgt as notes_apprenant_mgt
|
|||
import note_evaluation_mgt as note_evaluation_mgt
|
||||
import groupe_inscrit_mgt as groupe_inscrit_mgt
|
||||
import suivi_pedagogique_mgt as suivi_pedagogique_mgt
|
||||
import partner_produit_service_mgt as partner_produit_service_mgt
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
|
@ -5775,6 +5776,22 @@ def Update_Partner_Quotation_Header():
|
|||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API d cloture d'un devis
|
||||
"""
|
||||
@app.route('/myclass/api/Closure_Partner_Quotation_Header/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Closure_Partner_Quotation_Header():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Closure_Partner_Quotation_Header payload = ",payload)
|
||||
status, retval = partner_order.Closure_Partner_Quotation_Header(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de Ajout et mise à jour d'une ligne commande client d'un partenaire
|
||||
"""
|
||||
|
@ -8968,8 +8985,24 @@ def Get_Qery_List_Factures_Data_By_Client_Periode():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API / TBD / QRY : Recuperation des DEVIS
|
||||
V2 API / TBD / QRY : Recuperation des factures sur une PAR CLIENT
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Qery_List_Factures_Data_By_Client_V2/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Qery_List_Factures_Data_By_Client_V2():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Qery_List_Factures_Data_By_Client_V2 payload = ",payload)
|
||||
status, retval = factures_tbd_qries.Get_Qery_List_Factures_Data_By_Client_V2(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API / TBD / QRY : Recuperation des DEVIS par periode
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Qery_List_Quotation_Data_By_Periode/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
|
@ -8981,6 +9014,18 @@ def Get_Qery_List_Quotation_Data_By_Periode():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API / TBD / QRY : Recuperation des DEVIS par client
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Qery_List_Quotation_Data_By_Client/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Qery_List_Quotation_Data_By_Client():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Qery_List_Quotation_Data_By_Client payload = ",payload)
|
||||
status, retval = factures_tbd_qries.Get_Qery_List_Quotation_Data_By_Client(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API / TBD / EXPORT EXCEL : Export excel des resultats des tbd
|
||||
|
@ -10316,6 +10361,72 @@ def Export_Excel_Survey_Stat_Data_For_Given_related_collection_id(token, related
|
|||
else:
|
||||
return False
|
||||
|
||||
"""
|
||||
API pour ajouter un produit et service du partner (article)
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Partner_Produit_Service/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Partner_Produit_Service():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Partner_Produit_Service payload = ",payload)
|
||||
status, retval = partner_produit_service_mgt.Add_Partner_Produit_Service(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API pour mettre à jour un produit et service du partner (article)
|
||||
"""
|
||||
@app.route('/myclass/api/Update_Partner_Produit_Service/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Update_Partner_Produit_Service():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Update_Partner_Produit_Service payload = ",payload)
|
||||
status, retval = partner_produit_service_mgt.Update_Partner_Produit_Service(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API pour supprimer un produit et service du partner (article)
|
||||
"""
|
||||
@app.route('/myclass/api/Delete_Partner_Produit_Service/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Delete_Partner_Produit_Service():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Delete_Partner_Produit_Service payload = ",payload)
|
||||
status, retval = partner_produit_service_mgt.Delete_Partner_Produit_Service(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API pour recuperer la liste des un produit et service d'un partner (article)
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Partner_Produit_Service/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Partner_Produit_Service():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Partner_Produit_Service payload = ",payload)
|
||||
status, retval = partner_produit_service_mgt.Get_List_Partner_Produit_Service(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour recuperer les données d'un produit et service d'un partner (article)
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Given_Partner_Produit_Service/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Given_Partner_Produit_Service():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Given_Partner_Produit_Service payload = ",payload)
|
||||
status, retval = partner_produit_service_mgt.Get_Given_Partner_Produit_Service(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(" debut api")
|
||||
|
|
170
partner_order.py
170
partner_order.py
|
@ -12,7 +12,6 @@ order_header et order_lines comme suit :
|
|||
order {order_header_ref:'xxx', order_header_amount:'yyyy', order_line[ {order_line1}, {order_line2}, ....,{}] }
|
||||
"""
|
||||
import ast
|
||||
|
||||
import bson
|
||||
import pymongo
|
||||
from pymongo import MongoClient
|
||||
|
@ -2021,6 +2020,175 @@ def Update_Partner_Quotation_Header(diction):
|
|||
return False, " Impossible de mettre à jour le devis "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction permet de cloturer un devis en ajoutant une raison
|
||||
"""
|
||||
def Closure_Partner_Quotation_Header(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'order_header_id', 'order_header_status', 'closure_reason']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False and val not in MYSY_GV.PARTNER_BASE_CONFIG_NAME :
|
||||
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', 'order_header_id', 'order_header_status', 'closure_reason']
|
||||
|
||||
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
|
||||
|
||||
order_header_id = ""
|
||||
if ("order_header_id" in diction.keys()):
|
||||
if diction['order_header_id']:
|
||||
order_header_id = diction['order_header_id']
|
||||
|
||||
"""
|
||||
# Verifier que la commande existe et qu'elle est modifiable.
|
||||
Pour les ligne, on fait pareil, on ne peut modifier que celles qui sont modifiable.
|
||||
|
||||
Conditions pour modifier entete :
|
||||
1 - statut est : devis, cmd, MAIS PAS ANNULE ou FACTURE
|
||||
Pour un debut pas de facturation partielle. c'est tout ou rien.
|
||||
"""
|
||||
my_order_data_count = MYSY_GV.dbname['partner_order_header'].count_documents(
|
||||
{'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0', 'order_header_type':'devis',
|
||||
'_id': ObjectId(str(order_header_id))})
|
||||
|
||||
if (my_order_data_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - L'identifiant du devis est invalide ")
|
||||
return False, " L'identifiant du devis est invalide ",
|
||||
|
||||
|
||||
"""
|
||||
Verifier que le statut envoyé est valide
|
||||
"""
|
||||
if( diction["order_header_status"] not in MYSY_GV.PARTNER_QUOTATION_STATUS):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le nouveau statut est invalide ")
|
||||
return False, " Le nouveau statut est invalide ",
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperation et stockage des données de l'entete avant mise à jour
|
||||
"""
|
||||
my_order_data_previous_information = MYSY_GV.dbname['partner_order_header'].find_one(
|
||||
{'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0', 'order_header_type': 'devis',
|
||||
'_id': ObjectId(str(order_header_id))})
|
||||
|
||||
|
||||
|
||||
|
||||
data = {}
|
||||
|
||||
### 1 - Mise à jour de l'entete
|
||||
data['order_header_status'] = str(diction['order_header_status'])
|
||||
data['closure_reason'] = str(diction['closure_reason'])
|
||||
data['date_update'] = str(datetime.now())
|
||||
data['update_by'] = str(my_partner['_id'])
|
||||
|
||||
print(" ### Update_partner_order data = ", data)
|
||||
|
||||
inserted_data = MYSY_GV.dbname['partner_order_header'].find_one_and_update(
|
||||
{'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0','order_header_type':'devis',
|
||||
'_id': ObjectId(str(order_header_id))},
|
||||
{"$set": data},
|
||||
return_document=ReturnDocument.AFTER,
|
||||
upsert=False,
|
||||
)
|
||||
|
||||
if (inserted_data is None):
|
||||
mycommon.myprint(
|
||||
" Impossible de mettre à jour l'entete du devis ")
|
||||
return False, "Impossible de mettre à jour l'entete du devis "
|
||||
|
||||
"""
|
||||
Si le statut de l'entete de commande a bougé, alors on met à le statut de toutes les ligne
|
||||
Verification my_order_data_previous_information['order_header_status'] != order_header_status
|
||||
"""
|
||||
|
||||
local_qry = {'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0',
|
||||
'order_header_id': str(order_header_id)
|
||||
},
|
||||
|
||||
#print(" #### DEVIS local_qry = ",local_qry )
|
||||
|
||||
order_header_status = diction['order_header_status']
|
||||
|
||||
if( "order_header_status" in my_order_data_previous_information.keys()):
|
||||
if (str(my_order_data_previous_information['order_header_status']) != str(order_header_status)):
|
||||
# Il y a eu une mise à jour du statut de l'entete, on va donc mettre à jour les statuts des lignes de commande
|
||||
inserted_data_line = MYSY_GV.dbname['partner_order_line'].update_many(
|
||||
{'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0',
|
||||
'order_header_id': str(order_header_id)
|
||||
},
|
||||
{
|
||||
"$set": {"order_line_status": str(order_header_status), "order_line_type": str(my_order_data_previous_information['order_header_type']),
|
||||
'date_update': str(data['date_update'])}
|
||||
})
|
||||
"""print("raw:", inserted_data_line.raw_result)
|
||||
print("acknowledged:", inserted_data_line.acknowledged)
|
||||
print("matched_count:", inserted_data_line.matched_count)"""
|
||||
|
||||
else:
|
||||
inserted_data_line = MYSY_GV.dbname['partner_order_line'].update_many(
|
||||
{'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0',
|
||||
'order_header_id': str(order_header_id)
|
||||
},
|
||||
{
|
||||
"$set": {"order_line_status": str(order_header_status), "order_line_type": str(my_order_data_previous_information['order_header_type']),
|
||||
'date_update': str(data['date_update'])}
|
||||
})
|
||||
"""print("raw:", inserted_data_line.raw_result)
|
||||
print("acknowledged:", inserted_data_line.acknowledged)
|
||||
print("matched_count:", inserted_data_line.matched_count)"""
|
||||
|
||||
return True, " Le devis a été correctement mis à jour"
|
||||
|
||||
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 mettre à jour le devis "
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Fonction ajoute des lignes à une commande qui existe.
|
||||
Clé :
|
||||
|
|
|
@ -0,0 +1,472 @@
|
|||
"""
|
||||
Ce fichier permet de gerer les produits et service qui peuvent etre ajouter à des devis et facture
|
||||
Par exemple si dans la cadre d'une formation, on souhaite refacturer le deplacement de l'enseignant
|
||||
ou si on facture des objets pédagogique.
|
||||
/!\ : Un produit et service se differencient par le type de produit (produit ou service)
|
||||
|
||||
Un article (produit & service) est defini par :
|
||||
code produit
|
||||
Nom du produit
|
||||
Type de produit?
|
||||
Prix de vente?
|
||||
Taxes à la vente?
|
||||
famille
|
||||
|
||||
"""
|
||||
import bson
|
||||
import pymongo
|
||||
from pymongo import MongoClient
|
||||
import json
|
||||
from bson import ObjectId
|
||||
import re
|
||||
from datetime import datetime
|
||||
import prj_common as mycommon
|
||||
import secrets
|
||||
import inspect
|
||||
import sys, os
|
||||
import csv
|
||||
import pandas as pd
|
||||
from pymongo import ReturnDocument
|
||||
import GlobalVariable as MYSY_GV
|
||||
from math import isnan
|
||||
import GlobalVariable as MYSY_GV
|
||||
import ela_index_bdd_classes as eibdd
|
||||
import email_mgt as email
|
||||
import jinja2
|
||||
from flask import send_file
|
||||
from xhtml2pdf import pisa
|
||||
from email.message import EmailMessage
|
||||
from email.mime.text import MIMEText
|
||||
from email import encoders
|
||||
import smtplib
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from email.mime.base import MIMEBase
|
||||
from email import encoders
|
||||
|
||||
"""
|
||||
Ajout d'un produit
|
||||
"""
|
||||
def Add_Partner_Produit_Service(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'code', 'nom', 'description', 'type', 'code_taxe', 'famille']
|
||||
|
||||
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', 'code', 'nom', ]
|
||||
|
||||
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
|
||||
|
||||
|
||||
# Verifier que ce code n'existe pas déjà
|
||||
is_existe_class_categorie = MYSY_GV.dbname['partner_produit_service'].count_documents({'code':str(diction['code']),
|
||||
'valide':'1',
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
|
||||
if( is_existe_class_categorie > 0 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Un produit avec le code '" + str(diction['code']) + "' existe déjà ")
|
||||
return False, " Un produit avec le code '" + str(diction['code']) + "' existe déjà "
|
||||
|
||||
|
||||
|
||||
new_data = diction
|
||||
del diction['token']
|
||||
|
||||
# Initialisation des champs non envoyés à vide
|
||||
for val in field_list:
|
||||
if val not in diction.keys():
|
||||
new_data[str(val)] = ""
|
||||
|
||||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
new_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
inserted_id = MYSY_GV.dbname['partner_produit_service'].insert_one(new_data).inserted_id
|
||||
if (not inserted_id):
|
||||
mycommon.myprint(
|
||||
" Impossible de créer le produit (2) ")
|
||||
return False, " Impossible de créer le produit (2) "
|
||||
|
||||
|
||||
return True, " La produit a été correctement ajouté"
|
||||
|
||||
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 créer le produit "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Mise à jour d'un produit & service
|
||||
"""
|
||||
def Update_Partner_Produit_Service(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', '_id', 'code', 'nom', 'description', 'type', 'code_taxe', 'famille']
|
||||
|
||||
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, " 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
|
||||
|
||||
new_data = diction
|
||||
|
||||
# Verifier que le produit est valide
|
||||
is_existe_produit = MYSY_GV.dbname['partner_produit_service'].count_documents(
|
||||
{'_id': ObjectId(str(diction['_id'])),
|
||||
'valide': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (is_existe_produit < 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant du produit est invalide ")
|
||||
return False, " L'identifiant du produit est invalide "
|
||||
|
||||
|
||||
|
||||
local_id = str(diction['_id'])
|
||||
|
||||
del diction['token']
|
||||
del diction['_id']
|
||||
|
||||
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['_id'] = ObjectId(local_id)
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
result = MYSY_GV.dbname['partner_produit_service'].find_one_and_update(
|
||||
data_cle,
|
||||
{"$set": new_data},
|
||||
upsert=False,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
|
||||
if ("_id" not in result.keys()):
|
||||
mycommon.myprint(
|
||||
" Impossible de mettre à jour le produit (2) ")
|
||||
return False, " Impossible de mettre à jour le produit (2) "
|
||||
|
||||
return True, " Le produit de formation a été correctement mis à jour"
|
||||
|
||||
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 mettre à jour le produit "
|
||||
|
||||
|
||||
"""
|
||||
Suppression d'un produit
|
||||
regles (a definir plus tard, mais à minima:
|
||||
Si la condition (_id) n'est pas utiliser dans les collection
|
||||
- partner_order_line
|
||||
- partner_invoice_line
|
||||
"""
|
||||
|
||||
def Delete_Partner_Produit_Service(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', '_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, " Les informations fournies sont incorrectes"
|
||||
|
||||
"""
|
||||
Verification de l'identité et autorisation de l'entité qui
|
||||
appelle cette API
|
||||
"""
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
|
||||
# Verifier le produit existe
|
||||
is_existe_produit = MYSY_GV.dbname['partner_produit_service'].count_documents(
|
||||
{'_id': ObjectId(str(diction['_id'])),
|
||||
'valide': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (is_existe_produit < 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant du produit est invalide ")
|
||||
return False, " L'identifiant du produit est invalide "
|
||||
|
||||
|
||||
"""
|
||||
Verifier que le produit n'est pas utilisé dans les collection
|
||||
- partner_order_line
|
||||
- partner_invoice_line
|
||||
"""
|
||||
is_product_in_order = MYSY_GV.dbname['partner_order_line'].count_documents({'partner_owner_recid':my_partner['recid'],
|
||||
'valide':'1',
|
||||
'partner_invoice_line_id':str(diction['_id'])})
|
||||
|
||||
|
||||
if( is_product_in_order > 0 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Ce produit est utilisée dans "+str(is_product_in_order)+" commande(s)/devis ")
|
||||
return False, " Cette catégorie de formation est utilisée dans "+str(is_product_in_order)+" commande(s)/devis "
|
||||
|
||||
is_product_in_invoice = MYSY_GV.dbname['partner_invoice_line'].count_documents(
|
||||
{'partner_owner_recid': my_partner['recid'],
|
||||
'valide': '1',
|
||||
'partner_invoice_line_id': str(diction['_id'])})
|
||||
|
||||
if (is_product_in_invoice > 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Ce produit est utilisée dans " + str(
|
||||
is_product_in_order) + " facture(s) ")
|
||||
return False, " Cette catégorie de formation est utilisée dans " + str(
|
||||
is_product_in_order) + " facture(s) "
|
||||
|
||||
|
||||
|
||||
|
||||
delete = MYSY_GV.dbname['partner_produit_service'].delete_one({'_id': ObjectId(str(diction['_id'])),
|
||||
'partner_owner_recid': str(my_partner['recid']),
|
||||
}, )
|
||||
|
||||
|
||||
|
||||
return True, " Le produit a été correctement supprimé"
|
||||
|
||||
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 le produit "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperer la liste des produits et services d'un partenaire
|
||||
"""
|
||||
def Get_List_Partner_Produit_Service(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', ]
|
||||
|
||||
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
|
||||
|
||||
"""
|
||||
Clés de mise à jour
|
||||
"""
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
for retval in MYSY_GV.dbname['partner_produit_service'].find(data_cle).sort([("_id", pymongo.DESCENDING), ]):
|
||||
user = 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 categories de formation "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperer les données d'un produit
|
||||
"""
|
||||
def Get_Given_Partner_Produit_Service(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', '_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'existe pas")
|
||||
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, " 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
|
||||
|
||||
"""
|
||||
Clés de mise à jour
|
||||
"""
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
data_cle['_id'] = ObjectId(str(diction['_id']))
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
for retval in MYSY_GV.dbname['partner_produit_service'].find(data_cle):
|
||||
user = 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 les données du produit "
|
||||
|
|
@ -2370,6 +2370,10 @@ def Get_Survey_Stat_Data_For_Given_related_collection_id(diction):
|
|||
'valide': '1', 'locked': '0',
|
||||
'list_questions._id': str(diction['question_id'])})
|
||||
|
||||
print(" qry = ",{'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1', 'locked': '0',
|
||||
'list_questions._id': str(diction['question_id'])})
|
||||
|
||||
if (is_question_formulaire_exist != 1):
|
||||
mycommon.myprint(" L'identifiant de la question est invalide ")
|
||||
return False, " L'identifiant de la question est invalide "
|
||||
|
|
Loading…
Reference in New Issue