master
cherif 2024-05-11 12:22:33 +02:00
parent 7d3e9e2270
commit fb7b0eabe1
5 changed files with 6187 additions and 31 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="0dfd"> <list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="10/05/2024 - 18h30">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Dashbord_queries/inscription_tdb_qries.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/inscription_tdb_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$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/invoice_paiement_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/invoice_paiement_mgt.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/partner_base_setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_base_setup.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_order.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_order.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -76,13 +76,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1680804787304</updated> <updated>1680804787304</updated>
</task> </task>
<task id="LOCAL-00243" summary="12/03/2024 - 20h30">
<created>1710272089417</created>
<option name="number" value="00243" />
<option name="presentableId" value="LOCAL-00243" />
<option name="project" value="LOCAL" />
<updated>1710272089418</updated>
</task>
<task id="LOCAL-00244" summary="19/03/2024 - 17h30"> <task id="LOCAL-00244" summary="19/03/2024 - 17h30">
<created>1710866627531</created> <created>1710866627531</created>
<option name="number" value="00244" /> <option name="number" value="00244" />
@ -419,7 +412,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1715267879324</updated> <updated>1715267879324</updated>
</task> </task>
<option name="localTasksCounter" value="292" /> <task id="LOCAL-00292" summary="10/05/2024 - 18h30">
<created>1715358191842</created>
<option name="number" value="00292" />
<option name="presentableId" value="LOCAL-00292" />
<option name="project" value="LOCAL" />
<updated>1715358191843</updated>
</task>
<option name="localTasksCounter" value="293" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -461,7 +461,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="10/04/2024 - 22h50" />
<MESSAGE value="11/04/2024 - 17h02" /> <MESSAGE value="11/04/2024 - 17h02" />
<MESSAGE value="12/04/2024 - 15h05" /> <MESSAGE value="12/04/2024 - 15h05" />
<MESSAGE value="14/04/2024 - 23h05" /> <MESSAGE value="14/04/2024 - 23h05" />
@ -486,6 +485,7 @@
<MESSAGE value="08/05/2024 - 17h30" /> <MESSAGE value="08/05/2024 - 17h30" />
<MESSAGE value="08/05/2024 - 21h30" /> <MESSAGE value="08/05/2024 - 21h30" />
<MESSAGE value="0dfd" /> <MESSAGE value="0dfd" />
<option name="LAST_COMMIT_MESSAGE" value="0dfd" /> <MESSAGE value="10/05/2024 - 18h30" />
<option name="LAST_COMMIT_MESSAGE" value="10/05/2024 - 18h30" />
</component> </component>
</project> </project>

View File

@ -566,7 +566,8 @@ PARTNER_QUOTATION_STATUS = ['-1', '0', '1', '2']
Pour mettre en place un système de configuration global, on va definir les valeur acceptée Pour mettre en place un système de configuration global, on va definir les valeur acceptée
""" """
PARTNER_BASE_CONFIG_NAME = ['tva', 'smtp_server', 'smtp_user', 'smtp_user_pwd', 'smtp_count_from_name', PARTNER_BASE_CONFIG_NAME = ['tva', 'smtp_server', 'smtp_user', 'smtp_user_pwd', 'smtp_count_from_name',
'smtp_count_port', 'partner_smtp', 'partner_jour_heure' ] 'smtp_count_port', 'partner_smtp', 'partner_jour_heure', 'nb_relance_auto',
'relance_auto', 'frequence_relance_auto']
""" """

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,23 @@ ex :
- Region - Region
- etc - etc
Ce fichier travaille principalemet sur la collection : "base_partner_setup" Ce fichier travaille principalement sur la collection : "base_partner_setup"
/!\ 10/05/2024 :
On ajoute le module concerné à la collection pour pouvoir gerer les parametrage liée à des modules specifique.
on aura le champ : "related_collection" pour cela.
par exemple :
- devis (point de parametrage :
=> relance auto
=> frequence,
etc).
les parametrage generaux auront, le "related_collection" = "" vide ou inexistant
""" """
import bson import bson
@ -55,7 +71,7 @@ def Add_Update_Partner_Basic_Setup(diction):
""" """
Verification des input acceptés Verification des input acceptés
""" """
field_list = ['token', 'config_name', 'config_value'] field_list = ['token', 'config_name', 'config_value', 'related_collection']
incom_keys = diction.keys() incom_keys = diction.keys()
for val in incom_keys: for val in incom_keys:
@ -67,7 +83,7 @@ def Add_Update_Partner_Basic_Setup(diction):
""" """
Verification des champs obligatoires Verification des champs obligatoires
""" """
field_list_obligatoire = ['token', 'config_name', 'config_value'] field_list_obligatoire = ['token', 'config_name', 'config_value', 'related_collection']
for val in field_list_obligatoire: for val in field_list_obligatoire:
if val not in diction: if val not in diction:
@ -98,6 +114,7 @@ def Add_Update_Partner_Basic_Setup(diction):
my_data['partner_owner_recid'] = str(my_partner['recid']) my_data['partner_owner_recid'] = str(my_partner['recid'])
my_data['config_name'] = str(diction['config_name']) my_data['config_name'] = str(diction['config_name'])
my_data['config_value'] = str(diction['config_value']) my_data['config_value'] = str(diction['config_value'])
my_data['related_collection'] = str(diction['related_collection'])
my_data['valide'] = "1" my_data['valide'] = "1"
my_data['locked'] = "0" my_data['locked'] = "0"
my_data['date_update'] = str(datetime.now()) my_data['date_update'] = str(datetime.now())
@ -108,7 +125,8 @@ def Add_Update_Partner_Basic_Setup(diction):
result = MYSY_GV.dbname['base_partner_setup'].find_one_and_update( result = MYSY_GV.dbname['base_partner_setup'].find_one_and_update(
{'partner_owner_recid': str(my_partner['recid']), {'partner_owner_recid': str(my_partner['recid']),
'config_name' : str(diction['config_name'])}, 'config_name' : str(diction['config_name']),
'related_collection':str(diction['related_collection'])},
{"$set": my_data}, {"$set": my_data},
return_document=ReturnDocument.AFTER, return_document=ReturnDocument.AFTER,
upsert=True, upsert=True,
@ -122,7 +140,7 @@ def Add_Update_Partner_Basic_Setup(diction):
except Exception as e: except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info() exc_type, exc_obj, exc_tb = sys.exc_info()
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno)) mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
return False, " Impossible d'ajouter la configuration " return False, " Impossible d'ajouter / mettre à jour la configuration "
""" """
Suppression d'un point de configuraton à partir de l'_id Suppression d'un point de configuraton à partir de l'_id
@ -135,7 +153,7 @@ def Delete_Partner_Basic_Setup(diction):
""" """
Verification des input acceptés Verification des input acceptés
""" """
field_list = ['token', '_id', 'config_name'] field_list = ['token', '_id', 'config_name', 'related_collection']
incom_keys = diction.keys() incom_keys = diction.keys()
for val in incom_keys: for val in incom_keys:
@ -214,7 +232,7 @@ def Get_List_Partner_Basic_Setup(diction):
""" """
Verification des input acceptés Verification des input acceptés
""" """
field_list = ['token', ] field_list = ['token', 'related_collection']
incom_keys = diction.keys() incom_keys = diction.keys()
for val in incom_keys: for val in incom_keys:
@ -226,7 +244,7 @@ def Get_List_Partner_Basic_Setup(diction):
""" """
Verification des champs obligatoires Verification des champs obligatoires
""" """
field_list_obligatoire = ['token', ] field_list_obligatoire = ['token', 'related_collection']
for val in field_list_obligatoire: for val in field_list_obligatoire:
if val not in diction: if val not in diction:
mycommon.myprint( mycommon.myprint(
@ -248,7 +266,15 @@ def Get_List_Partner_Basic_Setup(diction):
RetObject = [] RetObject = []
val_tmp = 1 val_tmp = 1
for New_retVal in MYSY_GV.dbname['base_partner_setup'].find({'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}):
qry = {'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0',
'related_collection':str(diction['related_collection'])}
print(" ### qry = ", qry)
for New_retVal in MYSY_GV.dbname['base_partner_setup'].find({'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0',
'related_collection':str(diction['related_collection'])}):
if( str(New_retVal['config_name']) == "smtp_user_pwd"): if( str(New_retVal['config_name']) == "smtp_user_pwd"):
New_retVal['config_value'] = New_retVal['config_value'][:2]+"...."+str(New_retVal['config_value'])[-2:] New_retVal['config_value'] = New_retVal['config_value'][:2]+"...."+str(New_retVal['config_value'])[-2:]
@ -275,7 +301,7 @@ def Get_Given_Partner_Basic_Setup(diction):
""" """
Verification des input acceptés Verification des input acceptés
""" """
field_list = ['token', 'config_name'] field_list = ['token', 'config_name', 'related_collection']
incom_keys = diction.keys() incom_keys = diction.keys()
for val in incom_keys: for val in incom_keys:
@ -287,7 +313,7 @@ def Get_Given_Partner_Basic_Setup(diction):
""" """
Verification des champs obligatoires Verification des champs obligatoires
""" """
field_list_obligatoire = ['token','config_name' ] field_list_obligatoire = ['token','config_name', 'related_collection' ]
for val in field_list_obligatoire: for val in field_list_obligatoire:
if val not in diction: if val not in diction:
mycommon.myprint( mycommon.myprint(
@ -322,7 +348,8 @@ def Get_Given_Partner_Basic_Setup(diction):
#print(" ### qry_tva = ", qry_tva) #print(" ### qry_tva = ", qry_tva)
for New_retVal in MYSY_GV.dbname['base_partner_setup'].find({'partner_owner_recid':str(my_partner['recid']), 'valide':'1', for New_retVal in MYSY_GV.dbname['base_partner_setup'].find({'partner_owner_recid':str(my_partner['recid']), 'valide':'1',
'locked':'0', 'config_name':str(diction['config_name'])}): 'locked':'0', 'config_name':str(diction['config_name']),
'related_collection':str(diction['related_collection'])}):
user = New_retVal user = New_retVal
param_retval_value = str(New_retVal['config_value']) param_retval_value = str(New_retVal['config_value'])
@ -333,7 +360,8 @@ def Get_Given_Partner_Basic_Setup(diction):
if( str(param_retval_value).strip() == ""): if( str(param_retval_value).strip() == ""):
for New_retVal in MYSY_GV.dbname['base_partner_setup'].find( for New_retVal in MYSY_GV.dbname['base_partner_setup'].find(
{'partner_owner_recid': "default", 'valide': '1', {'partner_owner_recid': "default", 'valide': '1',
'locked': '0', 'config_name': str(diction['config_name'])}): 'locked': '0', 'config_name': str(diction['config_name']),
'related_collection':str(diction['related_collection'])}):
user = New_retVal user = New_retVal
param_retval_value = str(New_retVal['config_value']) param_retval_value = str(New_retVal['config_value'])

View File

@ -593,7 +593,7 @@ def Add_Partner_Quotation(diction):
incom_keys = diction.keys() incom_keys = diction.keys()
for val in incom_keys: for val in incom_keys:
if val not in field_list and val.startswith('my_') is False: 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( mycommon.myprint(str(
inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé") inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé")
return False, " Les informations fournies sont incorrectes", False return False, " Les informations fournies sont incorrectes", False
@ -683,6 +683,11 @@ def Add_Partner_Quotation(diction):
data['order_header_location_type'] = diction['order_header_location_type'] data['order_header_location_type'] = diction['order_header_location_type']
# Ajout des point de setup des relances
for val in MYSY_GV.PARTNER_BASE_CONFIG_NAME:
if (val in diction.keys()):
data[val] = diction[val]
order_header_comment = "" order_header_comment = ""
if ("order_header_comment" in diction.keys()): if ("order_header_comment" in diction.keys()):
if diction['order_header_comment']: if diction['order_header_comment']:
@ -1014,6 +1019,8 @@ def Add_Partner_Quotation(diction):
data['is_validated'] = '0' data['is_validated'] = '0'
data['update_by'] = str(my_partner['recid']) data['update_by'] = str(my_partner['recid'])
#print(" ### add_partner_order data = ", data) #print(" ### add_partner_order data = ", data)
inserted_id = "" inserted_id = ""
inserted_id = MYSY_GV.dbname['partner_order_header'].insert_one(data).inserted_id inserted_id = MYSY_GV.dbname['partner_order_header'].insert_one(data).inserted_id
@ -1559,7 +1566,7 @@ def Update_Partner_Quotation_Header(diction):
incom_keys = diction.keys() incom_keys = diction.keys()
for val in incom_keys: for val in incom_keys:
if val not in field_list and val.startswith('my_') is False: 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( mycommon.myprint(str(
inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé") inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé")
return False, " Les informations fournies sont incorrectes", return False, " Les informations fournies sont incorrectes",
@ -1640,6 +1647,13 @@ def Update_Partner_Quotation_Header(diction):
return False, " - Le client est invalide " return False, " - Le client est invalide "
data['order_header_client_id'] = diction['order_header_client_id'] data['order_header_client_id'] = diction['order_header_client_id']
# Ajout des point de setup des relances
for val in MYSY_GV.PARTNER_BASE_CONFIG_NAME:
if (val in diction.keys()):
data[val] = diction[val]
order_header_description = "" order_header_description = ""
if ("order_header_description" in diction.keys()): if ("order_header_description" in diction.keys()):
order_header_description = diction['order_header_description'] order_header_description = diction['order_header_description']
@ -2990,7 +3004,7 @@ def Get_Given_Partner_Order(diction):
RetObject.append(mycommon.JSONEncoder().encode(user)) RetObject.append(mycommon.JSONEncoder().encode(user))
#print(" ### RetObject = ", RetObject) print(" ### RetObject Get_Given_Partner_Order = ", RetObject)
return True, RetObject return True, RetObject