parent
9aa74df58b
commit
6f81ec23e5
|
|
@ -4,17 +4,17 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="05/05/2026 - 19h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="07/05/2026 - 17h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Dashbord_queries/BPF.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/BPF.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$/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$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Session_Formation_Sequence.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation_Sequence.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/apprenant_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/stage_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/stage_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/wrapper.py" beforeDir="false" afterPath="$PROJECT_DIR$/wrapper.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -458,7 +458,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1747251650255</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="574" />
|
||||
<option name="localTasksCounter" value="575" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
|
@ -500,7 +500,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="17/03/2026 - 22h" />
|
||||
<MESSAGE value="18/03/2026 - 22h" />
|
||||
<MESSAGE value="20/03/2026 - 9h" />
|
||||
<MESSAGE value="20/03/2026 - 20h" />
|
||||
|
|
@ -525,6 +524,7 @@
|
|||
<MESSAGE value="04/05/2026 - 13h" />
|
||||
<MESSAGE value="04/05/2026 - 19h" />
|
||||
<MESSAGE value="05/05/2026 - 19h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="05/05/2026 - 19h" />
|
||||
<MESSAGE value="07/05/2026 - 17h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="07/05/2026 - 17h" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -2667,125 +2667,6 @@ def Get_Qery_List_Factures_For_List_Class(diction):
|
|||
|
||||
"""
|
||||
Cette fonction permet de recuperer les factures par inscrit
|
||||
db.partner_invoice_header.aggregate([
|
||||
{
|
||||
"$addFields":{
|
||||
"mysy_invoice_date":{
|
||||
"$dateFromString":{
|
||||
"dateString":"$invoice_date",
|
||||
"format":"%d/%m/%Y"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"$match":{
|
||||
"$and":[
|
||||
{
|
||||
"valide":"1",
|
||||
"invoice_header_type":"facture",
|
||||
"credit_note_ref":{
|
||||
"$exists":false
|
||||
},
|
||||
"partner_owner_recid":"43598820dd270936c3d2fd822717d0f18f194b1a1b894aaf89"
|
||||
},
|
||||
{invoice_header_ref_interne: 'NEW_Invoice_56'},
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"$lookup":{
|
||||
"from":"partner_invoice_line_detail",
|
||||
"let":{
|
||||
"invoice_header_id":{
|
||||
"$toString":"$_id"
|
||||
},
|
||||
"partner_invoice_line_partner_owner_recid":"$partner_owner_recid",
|
||||
"partner_invoice_line_invoice_header_ref_interne":"$invoice_header_ref_interne"
|
||||
},
|
||||
"pipeline":[
|
||||
{
|
||||
"$match":{
|
||||
"$expr":{
|
||||
"$and":[
|
||||
{
|
||||
"$eq":[
|
||||
"$valide",
|
||||
"1"
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"$eq":[
|
||||
"$invoice_header_ref_interne",
|
||||
"$$partner_invoice_line_invoice_header_ref_interne"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq":[
|
||||
"$partner_owner_recid",
|
||||
"$$partner_invoice_line_partner_owner_recid"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"as":"collection_partner_invoice_line"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$unwind":"$collection_partner_invoice_line"
|
||||
},
|
||||
{
|
||||
"$lookup":{
|
||||
"from":"inscription",
|
||||
"let":{
|
||||
"inscription_id":"$collection_partner_invoice_line.order_line_inscription_id"
|
||||
},
|
||||
"pipeline":[
|
||||
{
|
||||
"$match":{
|
||||
"$expr":{
|
||||
"$and":[
|
||||
{
|
||||
"$eq":[
|
||||
"$_id",
|
||||
{
|
||||
"$convert":{
|
||||
"input":"$$inscription_id",
|
||||
"to":"objectId",
|
||||
"onError":{
|
||||
"error":"true"
|
||||
},
|
||||
"onNull":{
|
||||
"isnull":"true"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq":[
|
||||
"$valide",
|
||||
"1"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"as":"inscription_collection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$unwind":"$inscription_collection"
|
||||
},
|
||||
|
||||
])
|
||||
|
||||
"""
|
||||
def Get_Qery_List_Factures_For_List_Inscrit(diction):
|
||||
|
|
@ -2796,7 +2677,8 @@ def Get_Qery_List_Factures_For_List_Inscrit(diction):
|
|||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'periode_start_date', 'periode_end_date', 'filter_value',
|
||||
'tab_formation_ids', 'from_beginning']
|
||||
'tab_formation_ids', 'from_beginning', 'invoice_ref', 'client_nom',
|
||||
'inscrit_nom', 'session_id', ]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -2909,11 +2791,100 @@ def Get_Qery_List_Factures_For_List_Inscrit(diction):
|
|||
filt_list_class_id = {'$in': ["$class_id", tab_formation_ids]}
|
||||
filt_list_class_internal_url = {'$in': ["$order_line_formation", tab_formation_internal_url]}
|
||||
|
||||
"""
|
||||
Filtre général sur le client (raison_sociale, nom, email, telephone
|
||||
"""
|
||||
filt_gle_client_facture = {}
|
||||
if ("client_nom" in diction.keys() and diction['client_nom']):
|
||||
|
||||
local_myquery_gle = {
|
||||
"partner_owner_recid": str(my_partner['recid']),
|
||||
"valide": "1",
|
||||
"locked": "0",
|
||||
"$or": [
|
||||
{'raison_sociale': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])),
|
||||
"$options": "i"}},
|
||||
{'nom': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])),
|
||||
"$options": "i"}},
|
||||
{'email': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])),
|
||||
"$options": "i"}},
|
||||
{'telephone': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])),
|
||||
"$options": "i"}},
|
||||
]
|
||||
}
|
||||
|
||||
tab_client_facture_id = []
|
||||
for tmp in MYSY_GV.dbname['partner_client'].find(local_myquery_gle):
|
||||
tab_client_facture_id.append(str(tmp['_id']))
|
||||
|
||||
filt_gle_client_facture = {'order_header_client_id': {'$in': tab_client_facture_id}}
|
||||
|
||||
"""
|
||||
Filtre général sur l'inscrit (raison_sociale, nom, email, telephone
|
||||
"""
|
||||
filt_gle_inscrit_nom = {}
|
||||
tab_inscrit_id = []
|
||||
if ("inscrit_nom" in diction.keys() and diction['inscrit_nom']):
|
||||
|
||||
filt_gle_inscrit_nom = {
|
||||
"partner_owner_recid": str(my_partner['recid']),
|
||||
"valide": "1",
|
||||
"locked": "0",
|
||||
"$or": [
|
||||
{'prenom': {'$regex': mycommon.regex_replace_cartere(str(diction['inscrit_nom'])),
|
||||
"$options": "i"}},
|
||||
{'nom': {'$regex': mycommon.regex_replace_cartere(str(diction['inscrit_nom'])),
|
||||
"$options": "i"}},
|
||||
{'email': {'$regex': mycommon.regex_replace_cartere(str(diction['inscrit_nom'])),
|
||||
"$options": "i"}},
|
||||
{'telephone': {'$regex': mycommon.regex_replace_cartere(str(diction['inscrit_nom'])),
|
||||
"$options": "i"}},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
for tmp in MYSY_GV.dbname['inscription'].find(filt_gle_inscrit_nom):
|
||||
tab_inscrit_id.append(str(tmp['_id']))
|
||||
|
||||
filter_inscrit = {}
|
||||
if( len(tab_inscrit_id) > 0 ):
|
||||
filter_inscrit = {
|
||||
"$in": [
|
||||
"$order_line_inscription_id",
|
||||
"$$tab_inscrit_id"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
filter_invoice_ref = {}
|
||||
if( "invoice_ref" in diction.keys() and diction['invoice_ref']):
|
||||
filter_invoice_ref = {'invoice_header_ref_interne':str(diction['invoice_ref'])
|
||||
}
|
||||
|
||||
|
||||
filter_session_id = {}
|
||||
tab_session_id = []
|
||||
if( 'session_id' in diction.keys() and diction['session_id']):
|
||||
is_valide_session = MYSY_GV.dbname['session_formation'].count_documents({'_id':ObjectId(str(diction['session_id'])),
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
if( is_valide_session != 1 ):
|
||||
return True, []
|
||||
|
||||
tab_session_id.append(str(diction['session_id']))
|
||||
|
||||
if (len(tab_session_id) > 0):
|
||||
filter_session_id = {
|
||||
"$in": [
|
||||
"$session_id",
|
||||
"$$tab_session_id"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])},
|
||||
{"valide": '1'},
|
||||
filt_mysy_invoice_date, ]}
|
||||
filt_mysy_invoice_date, filt_gle_client_facture, filter_invoice_ref]}
|
||||
|
||||
pipe_qry = ([
|
||||
{"$addFields": {
|
||||
|
|
@ -2927,103 +2898,206 @@ def Get_Qery_List_Factures_For_List_Inscrit(diction):
|
|||
},
|
||||
|
||||
{'$match': qery_match},
|
||||
{'$lookup': {
|
||||
'from': 'partner_invoice_line',
|
||||
"let": {"invoice_header_id": {'$toString': "$_id"},
|
||||
'partner_invoice_line_partner_owner_recid': '$partner_owner_recid',
|
||||
'partner_invoice_line_invoice_header_ref_interne': '$invoice_header_ref_interne'},
|
||||
'pipeline': [
|
||||
{'$match':
|
||||
{'$expr':
|
||||
{'$and':
|
||||
[
|
||||
{'$eq': ["$valide", "1"]},
|
||||
filt_list_class_internal_url,
|
||||
{'$eq': ["$invoice_header_ref_interne",'$$partner_invoice_line_invoice_header_ref_interne']},
|
||||
{'$eq': ["$partner_owner_recid", '$$partner_invoice_line_partner_owner_recid']},
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
{'$project':{'_id':1, 'order_header_client_id':1,'order_header_ref_interne':1,'order_header_email_client':1,'order_header_origin':1,'invoice_header_ref_interne':1,
|
||||
'invoice_header_type':1, 'invoice_date':1, 'invoice_date_echeance':1, 'order_header_condition_paiement_code':1,
|
||||
'partner_owner_recid':1, 'reste_to_paye':1, 'total_header_toutes_taxes':1, 'total_header_hors_taxe_after_header_reduction':1}},
|
||||
{
|
||||
"$lookup": {
|
||||
"from": "partner_invoice_line_detail",
|
||||
"let": {
|
||||
"invoice_header_id": {
|
||||
"$toString": "$_id"
|
||||
},
|
||||
"partner_invoice_line_partner_owner_recid": "$partner_owner_recid",
|
||||
"partner_invoice_line_invoice_header_ref_interne": "$invoice_header_ref_interne",
|
||||
"tab_inscrit_id": tab_inscrit_id
|
||||
},
|
||||
"pipeline": [
|
||||
{
|
||||
"$match": {
|
||||
"$expr": {
|
||||
"$and": [
|
||||
{
|
||||
"$eq": [
|
||||
"$valide",
|
||||
"1"
|
||||
]
|
||||
},
|
||||
|
||||
],
|
||||
'as': 'collection_partner_invoice_line'
|
||||
}
|
||||
{
|
||||
"$eq": [
|
||||
"$invoice_header_ref_interne",
|
||||
"$$partner_invoice_line_invoice_header_ref_interne"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq": [
|
||||
"$partner_owner_recid",
|
||||
"$$partner_invoice_line_partner_owner_recid"
|
||||
]
|
||||
},
|
||||
filter_inscrit
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
'$project': {"order_line_inscription_id": 1, "order_line_class_id": 1,
|
||||
"invoice_header_ref_interne": 1,
|
||||
"invoice_header_id": 1, "partner_owner_recid": 1, }
|
||||
}
|
||||
],
|
||||
"as": "collection_partner_invoice_line"
|
||||
}
|
||||
},
|
||||
{
|
||||
'$unwind': '$collection_partner_invoice_line'
|
||||
},
|
||||
{'$group': {
|
||||
'_id': {
|
||||
"class_internal_url": "$collection_partner_invoice_line.order_line_formation",
|
||||
},
|
||||
"TotalAmount_HT": {
|
||||
"$sum": {'$toDouble': '$collection_partner_invoice_line.order_line_montant_hors_taxes'}},
|
||||
"count": {"$sum": 1}
|
||||
}
|
||||
"$unwind": "$collection_partner_invoice_line"
|
||||
},
|
||||
{
|
||||
'$sort': {'count': -1}
|
||||
},
|
||||
"$lookup": {
|
||||
"from": "inscription",
|
||||
"let": {
|
||||
"inscription_id": "$collection_partner_invoice_line.order_line_inscription_id",
|
||||
"inscription_collection_partner_owner_recid": "$partner_owner_recid",
|
||||
"tab_session_id": tab_session_id
|
||||
|
||||
},
|
||||
"pipeline": [
|
||||
{
|
||||
"$match": {
|
||||
"$expr": {
|
||||
"$and": [
|
||||
{
|
||||
"$eq": [
|
||||
"$_id",
|
||||
{
|
||||
"$convert": {
|
||||
"input": "$$inscription_id",
|
||||
"to": "objectId",
|
||||
"onError": {
|
||||
"error": "true"
|
||||
},
|
||||
"onNull": {
|
||||
"isnull": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq": [
|
||||
"$valide",
|
||||
"1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq": [
|
||||
"$partner_owner_recid",
|
||||
"$$inscription_collection_partner_owner_recid"
|
||||
]
|
||||
},
|
||||
filter_session_id
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
'$project': {"session_id": 1, "email": 1, "apprenant_id": 1,
|
||||
"nom": 1, "prenom": 1, "client_rattachement_id": 1,
|
||||
"facture_client_rattachement_id": 1, "partner_owner_recid": 1, }
|
||||
}
|
||||
],
|
||||
"as": "inscription_collection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$unwind": "$inscription_collection"
|
||||
},
|
||||
{
|
||||
"$lookup": {
|
||||
"from": "session_formation",
|
||||
"let": {
|
||||
"session_id": "$inscription_collection.session_id",
|
||||
"session_formation_collection_partner_owner_recid": "$partner_owner_recid",
|
||||
},
|
||||
"pipeline": [
|
||||
{
|
||||
"$match": {
|
||||
"$expr": {
|
||||
"$and": [
|
||||
{
|
||||
"$eq": [
|
||||
"$_id",
|
||||
{
|
||||
"$convert": {
|
||||
"input": "$$session_id",
|
||||
"to": "objectId",
|
||||
"onError": {
|
||||
"error": "true"
|
||||
},
|
||||
"onNull": {
|
||||
"isnull": "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq": [
|
||||
"$valide",
|
||||
"1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq": [
|
||||
"$partner_owner_recid",
|
||||
"$$session_formation_collection_partner_owner_recid"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
'$project': {"_id": 1, "code_session": 1, "date_debut": 1,
|
||||
"date_fin": 1, }
|
||||
}
|
||||
],
|
||||
"as": "session_formation_collection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$unwind": "$session_formation_collection"
|
||||
},
|
||||
])
|
||||
|
||||
print(" ### Get_Qery_List_Factures_Data_By_Class ici pipe_qry = ", pipe_qry)
|
||||
print(" ### Get_Qery_List_Factures_For_List_Inscrit ici pipe_qry = ", pipe_qry)
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
axis_data = []
|
||||
series_TotalAmount_data = []
|
||||
|
||||
tab_data = []
|
||||
tab_axis_data_class_code = []
|
||||
tab_axis_data_class_title = []
|
||||
"""
|
||||
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):
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
node = {}
|
||||
node['class_internal_url'] = retval['_id']['class_internal_url']
|
||||
node['TotalAmount_HT'] = retval['TotalAmount_HT']
|
||||
node['label'] = retval['TotalAmount_HT']
|
||||
node['nb_line'] = retval['count']
|
||||
if( "order_header_client_id" in retval.keys() and retval['order_header_client_id']):
|
||||
client_data = MYSY_GV.dbname['partner_client'].find_one({'_id':ObjectId(str(retval['order_header_client_id'])),
|
||||
'partner_owner_recid':str(my_partner['recid'])}, {'raison_sociale':1, 'nom':1,
|
||||
})
|
||||
|
||||
# Recuperation des données de la formation
|
||||
if( client_data and "raison_sociale" in client_data.keys()):
|
||||
retval['client_raison_sociale'] = client_data['raison_sociale']
|
||||
|
||||
class_data = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(retval['_id']['class_internal_url']),
|
||||
'partner_owner_recid':str(my_partner['recid']),
|
||||
'valide':'1'})
|
||||
if (client_data and "nom" in client_data.keys()):
|
||||
retval['client_nom'] = client_data['nom']
|
||||
|
||||
if( "reste_to_paye" not in retval.keys() or retval['reste_to_paye'] == ""):
|
||||
retval['reste_to_paye'] = retval['total_header_toutes_taxes']
|
||||
|
||||
if( class_data and "title" in class_data.keys() ):
|
||||
node['class_title'] = class_data['title']
|
||||
tab_axis_data_class_title.append(class_data['title'])
|
||||
else:
|
||||
node['class_title'] = ""
|
||||
tab_axis_data_class_title.append("")
|
||||
RetObject.append(mycommon.JSONEncoder().encode(retval))
|
||||
|
||||
if (class_data and "external_code" in class_data.keys()):
|
||||
node['class_external_code'] = class_data['external_code']
|
||||
tab_axis_data_class_code.append(class_data['external_code'])
|
||||
else:
|
||||
node['class_external_code'] = ""
|
||||
tab_axis_data_class_code.append("")
|
||||
|
||||
tab_data.append(node)
|
||||
|
||||
|
||||
|
||||
|
||||
json_retval = {}
|
||||
json_retval['data'] = tab_data
|
||||
json_retval['axis_class_code'] = tab_axis_data_class_code
|
||||
json_retval['axis_class_title'] = tab_axis_data_class_title
|
||||
|
||||
print(" ### Get_Qery_List_Factures_Data_By_Class json_retval = ", json_retval)
|
||||
RetObject.append(mycommon.JSONEncoder().encode(json_retval))
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
|
|
|||
|
|
@ -10359,10 +10359,10 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
"""
|
||||
if ("nom" in diction.keys()):
|
||||
qry_gle = {"$or": [
|
||||
{'prenom': {'$regex': mycommon.regex_replace_cartere(str(diction['nom']))}},
|
||||
{'nom': {'$regex': mycommon.regex_replace_cartere(str(diction['nom']))}},
|
||||
{'email': {'$regex': mycommon.regex_replace_cartere(str(diction['nom']))}},
|
||||
{'telephone': {'$regex': mycommon.regex_replace_cartere(str(diction['nom']))}},
|
||||
{'prenom': {'$regex': mycommon.regex_replace_cartere(str(diction['nom'])), "$options": "i"}},
|
||||
{'nom': {'$regex': mycommon.regex_replace_cartere(str(diction['nom'])), "$options": "i"}},
|
||||
{'email': {'$regex': mycommon.regex_replace_cartere(str(diction['nom'])), "$options": "i"}},
|
||||
{'telephone': {'$regex': mycommon.regex_replace_cartere(str(diction['nom'])), "$options": "i"}},
|
||||
]}
|
||||
else:
|
||||
qry_gle = {}
|
||||
|
|
@ -10430,6 +10430,9 @@ def Get_Statgaire_List_Partner_with_filter(diction):
|
|||
}
|
||||
}
|
||||
},
|
||||
{'$project': {"_id": 1, "order_header_ref_interne": 1, "external_code": 1,
|
||||
"title": 1, "partner_owner_recid": 1, "valide": 1}
|
||||
},
|
||||
],
|
||||
'as': 'myclass_collection'
|
||||
|
||||
|
|
@ -10944,6 +10947,9 @@ def Get_Statgaire_List_Partner_with_filter_light(diction):
|
|||
}
|
||||
}
|
||||
},
|
||||
{'$project': {"_id": 1, "order_header_ref_interne": 1, "external_code": 1,
|
||||
"title": 1, "partner_owner_recid": 1, "valide":1}
|
||||
},
|
||||
],
|
||||
'as': 'myclass_collection'
|
||||
|
||||
|
|
|
|||
3919
Log/log_file.log
3919
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
|
@ -1983,6 +1983,9 @@ def GetAllValideSessionPartner_List_Without_Scope_Action(diction):
|
|||
}
|
||||
}
|
||||
},
|
||||
{'$project': {"_id": 1, "order_header_ref_interne": 1, "external_code": 1,
|
||||
"title": 1, "partner_owner_recid": 1, "valide": 1}
|
||||
},
|
||||
],
|
||||
'as': 'myclass_collection'
|
||||
|
||||
|
|
@ -2162,6 +2165,8 @@ def GetAllValideSessionPartner_List(diction):
|
|||
query = [{'$match': {
|
||||
"$and": [{'partner_owner_recid': str(my_partner['recid'])}, filt_scope_class_id, filt_scope_session_id, filt_archive, filt_type_session]}},
|
||||
{'$sort': {'_id': -1}},
|
||||
{'$project': {"automatic_traitement": 0, }
|
||||
},
|
||||
{'$lookup':
|
||||
{
|
||||
'from': 'myclass',
|
||||
|
|
@ -2184,6 +2189,8 @@ def GetAllValideSessionPartner_List(diction):
|
|||
query2 = [{'$match': {
|
||||
"$and": [{'partner_owner_recid': str(my_partner['recid'])}, filt_scope_class_id, filt_scope_session_id, filt_archive, filt_type_session]}},
|
||||
{'$sort': {'_id': -1}},
|
||||
{'$project': {"automatic_traitement": 0, }
|
||||
},
|
||||
{'$lookup':
|
||||
{
|
||||
'from': 'myclass',
|
||||
|
|
@ -2207,6 +2214,9 @@ def GetAllValideSessionPartner_List(diction):
|
|||
}
|
||||
}
|
||||
},
|
||||
{'$project': {"_id": 1, "order_header_ref_interne": 1, "external_code": 1,
|
||||
"title": 1, "partner_owner_recid": 1, "valide": 1}
|
||||
},
|
||||
],
|
||||
'as': 'myclass_collection'
|
||||
|
||||
|
|
@ -2687,6 +2697,9 @@ def GetAllValideSessionPartner_List_filter_like(diction):
|
|||
}
|
||||
}
|
||||
},
|
||||
{'$project': {"_id": 1, "order_header_ref_interne": 1, "external_code": 1,
|
||||
"title": 1, "partner_owner_recid": 1, "valide": 1}
|
||||
},
|
||||
],
|
||||
'as': 'myclass_collection'
|
||||
|
||||
|
|
@ -3116,6 +3129,9 @@ def GetAllValideSessionPartner_List_no_filter(diction):
|
|||
}
|
||||
}
|
||||
},
|
||||
{'$project': {"_id": 1, "order_header_ref_interne": 1, "external_code": 1,
|
||||
"title": 1, "partner_owner_recid": 1, "valide": 1}
|
||||
},
|
||||
],
|
||||
'as': 'myclass_collection'
|
||||
|
||||
|
|
@ -11852,6 +11868,30 @@ def Invoice_Partner_From_Session( diction):
|
|||
order_header_email_client = partner_client_id_data['email']
|
||||
partner_invoice_header_data['order_header_email_client'] = order_header_email_client
|
||||
|
||||
#############
|
||||
order_header_client_raison_sociale = ""
|
||||
if ("raison_sociale" in partner_client_id_data.keys()):
|
||||
order_header_client_raison_sociale = partner_client_id_data['raison_sociale']
|
||||
partner_invoice_header_data['order_header_client_raison_sociale'] = order_header_client_raison_sociale
|
||||
|
||||
order_header_client_nom = ""
|
||||
if ("nom" in partner_client_id_data.keys()):
|
||||
order_header_client_nom = partner_client_id_data['nom']
|
||||
partner_invoice_header_data['order_header_client_nom'] = order_header_client_nom
|
||||
|
||||
order_header_client_siret = ""
|
||||
if ("siret" in partner_client_id_data.keys()):
|
||||
order_header_client_siret = partner_client_id_data['siret']
|
||||
partner_invoice_header_data['order_header_client_siret'] = order_header_client_siret
|
||||
|
||||
order_header_client_telephone = ""
|
||||
if ("telephone" in partner_client_id_data.keys()):
|
||||
order_header_client_telephone = partner_client_id_data['telephone']
|
||||
partner_invoice_header_data['order_header_client_telephone'] = order_header_client_telephone
|
||||
|
||||
|
||||
############
|
||||
|
||||
order_header_origin = "session_id_"+str(session_data['_id'])
|
||||
partner_invoice_header_data['order_header_origin'] = order_header_origin
|
||||
|
||||
|
|
@ -14289,6 +14329,29 @@ def Invoice_Partner_From_Session_By_Inscription_Id( diction):
|
|||
order_header_email_client = partner_client_id_data['email']
|
||||
partner_invoice_header_data['order_header_email_client'] = order_header_email_client
|
||||
|
||||
#############
|
||||
order_header_client_raison_sociale = ""
|
||||
if ("raison_sociale" in partner_client_id_data.keys()):
|
||||
order_header_client_raison_sociale = partner_client_id_data['raison_sociale']
|
||||
partner_invoice_header_data['order_header_client_raison_sociale'] = order_header_client_raison_sociale
|
||||
|
||||
order_header_client_nom = ""
|
||||
if ("nom" in partner_client_id_data.keys()):
|
||||
order_header_client_nom = partner_client_id_data['nom']
|
||||
partner_invoice_header_data['order_header_client_nom'] = order_header_client_nom
|
||||
|
||||
order_header_client_siret = ""
|
||||
if ("siret" in partner_client_id_data.keys()):
|
||||
order_header_client_siret = partner_client_id_data['siret']
|
||||
partner_invoice_header_data['order_header_client_siret'] = order_header_client_siret
|
||||
|
||||
order_header_client_telephone = ""
|
||||
if ("telephone" in partner_client_id_data.keys()):
|
||||
order_header_client_telephone = partner_client_id_data['telephone']
|
||||
partner_invoice_header_data['order_header_client_telephone'] = order_header_client_telephone
|
||||
|
||||
############
|
||||
|
||||
order_header_origin = "session_id_"+str(session_data['_id'])
|
||||
partner_invoice_header_data['order_header_origin'] = order_header_origin
|
||||
|
||||
|
|
@ -14915,6 +14978,29 @@ def Invoice_Splited_Partner_From_Session_By_Inscription_Id( diction):
|
|||
order_header_email_client = partner_client_id_data['email']
|
||||
partner_invoice_header_data['order_header_email_client'] = order_header_email_client
|
||||
|
||||
#############
|
||||
order_header_client_raison_sociale = ""
|
||||
if ("raison_sociale" in partner_client_id_data.keys()):
|
||||
order_header_client_raison_sociale = partner_client_id_data['raison_sociale']
|
||||
partner_invoice_header_data['order_header_client_raison_sociale'] = order_header_client_raison_sociale
|
||||
|
||||
order_header_client_nom = ""
|
||||
if ("nom" in partner_client_id_data.keys()):
|
||||
order_header_client_nom = partner_client_id_data['nom']
|
||||
partner_invoice_header_data['order_header_client_nom'] = order_header_client_nom
|
||||
|
||||
order_header_client_siret = ""
|
||||
if ("siret" in partner_client_id_data.keys()):
|
||||
order_header_client_siret = partner_client_id_data['siret']
|
||||
partner_invoice_header_data['order_header_client_siret'] = order_header_client_siret
|
||||
|
||||
order_header_client_telephone = ""
|
||||
if ("telephone" in partner_client_id_data.keys()):
|
||||
order_header_client_telephone = partner_client_id_data['telephone']
|
||||
partner_invoice_header_data['order_header_client_telephone'] = order_header_client_telephone
|
||||
|
||||
############
|
||||
|
||||
order_header_origin = "session_id_"+str(session_data['_id'])
|
||||
partner_invoice_header_data['order_header_origin'] = order_header_origin
|
||||
|
||||
|
|
|
|||
|
|
@ -2012,8 +2012,17 @@ def Get_Session_Sequence_List(diction):
|
|||
'valide': '1', 'locked': "0"})
|
||||
|
||||
if (affectation_target_data is not None):
|
||||
related_target_collection_id_nom = affectation_target_data["nom"] + " " + \
|
||||
affectation_target_data["prenom"]
|
||||
nom = ""
|
||||
if( "nom" in affectation_target_data.keys()):
|
||||
nom = affectation_target_data['nom']
|
||||
|
||||
prenom = ""
|
||||
if ("prenom" in affectation_target_data.keys()):
|
||||
prenom = affectation_target_data['prenom']
|
||||
|
||||
|
||||
related_target_collection_id_nom = nom + " " + \
|
||||
prenom
|
||||
related_target_collection_object = "Ressource Humaine"
|
||||
|
||||
tab_ressource_humaine.append(related_target_collection_id_nom)
|
||||
|
|
|
|||
|
|
@ -1021,11 +1021,11 @@ def Get_Apprenant_List_Partner_with_filter(diction):
|
|||
"""
|
||||
if ("nom" in diction.keys()):
|
||||
qry_gle = {"$or": [
|
||||
{'prenom': {'$regex': mycommon.regex_replace_cartere(str(diction['nom']))}},
|
||||
{'nom': {'$regex': mycommon.regex_replace_cartere(str(diction['nom']))}},
|
||||
{'email': {'$regex': mycommon.regex_replace_cartere(str(diction['nom']))}},
|
||||
{'telephone': {'$regex': mycommon.regex_replace_cartere(str(diction['nom']))}},
|
||||
{'matricule': {'$regex': mycommon.regex_replace_cartere(str(diction['nom']))}},
|
||||
{'prenom': {'$regex': mycommon.regex_replace_cartere(str(diction['nom'])), "$options": "i"}},
|
||||
{'nom': {'$regex': mycommon.regex_replace_cartere(str(diction['nom'])), "$options": "i"}},
|
||||
{'email': {'$regex': mycommon.regex_replace_cartere(str(diction['nom'])), "$options": "i"}},
|
||||
{'telephone': {'$regex': mycommon.regex_replace_cartere(str(diction['nom'])), "$options": "i"}},
|
||||
{'matricule': {'$regex': mycommon.regex_replace_cartere(str(diction['nom'])), "$options": "i"}},
|
||||
]}
|
||||
else:
|
||||
qry_gle = {}
|
||||
|
|
|
|||
17
main.py
17
main.py
|
|
@ -10777,6 +10777,23 @@ def Get_Qery_List_Factures_For_List_Class():
|
|||
|
||||
|
||||
|
||||
"""
|
||||
API / TBD / QRY : Recuperation du suivi de paiement d'un inscrit sur une periode
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Qery_List_Factures_For_List_Inscrit/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Qery_List_Factures_For_List_Inscrit():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Qery_List_Factures_For_List_Inscrit payload = ",payload)
|
||||
status, retval = factures_tbd_qries.Get_Qery_List_Factures_For_List_Inscrit(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API / TBD / QRY : Recuperation des factures sur une periode PAR CLIENT
|
||||
|
|
|
|||
|
|
@ -1738,20 +1738,6 @@ def Get_Partner_List_Partner_Client_with_filter_Like(diction):
|
|||
filt_not_id = {'_id':{'$ne':ObjectId(diction['not_id'])}}
|
||||
|
||||
|
||||
|
||||
|
||||
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 = {'email': {'$regex': str(diction['email']), "$options": "i"}}
|
||||
|
||||
"""
|
||||
Filtre général
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -2378,18 +2378,37 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
|
||||
|
||||
|
||||
filt_client_nom = {}
|
||||
sub_filt_client_nom = {}
|
||||
Lists_partner_client_id = []
|
||||
if ("client_nom" in diction.keys() and diction['client_nom']):
|
||||
sub_filt_client_nom = {'nom': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])), "$options": "i"}, 'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}
|
||||
# Recuperation des '_id' des clients dont le nom match en regexp
|
||||
#print(" ### sub_filt_client_nom = ", sub_filt_client_nom)
|
||||
for List_Client_Data in MYSY_GV.dbname['partner_client'].find(sub_filt_client_nom, {'_id':1}):
|
||||
Lists_partner_client_id.append(str(List_Client_Data['_id']))
|
||||
|
||||
filt_client_nom = {'order_header_client_id': {'$in': Lists_partner_client_id, }}
|
||||
#print(' ### filt_client_nom = ', filt_client_nom)
|
||||
|
||||
"""
|
||||
Filtre général sur le client (raison_sociale, nom, email, telephone
|
||||
"""
|
||||
filt_gle_client_facture = {}
|
||||
if ("client_nom" in diction.keys() and diction['client_nom']):
|
||||
|
||||
local_myquery_gle = {
|
||||
"partner_owner_recid": str(my_partner['recid']),
|
||||
"valide": "1",
|
||||
"locked": "0",
|
||||
"$or": [
|
||||
{'raison_sociale': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])),
|
||||
"$options": "i"}},
|
||||
{'nom': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])),
|
||||
"$options": "i"}},
|
||||
{'email': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])),
|
||||
"$options": "i"}},
|
||||
{'telephone': {'$regex': mycommon.regex_replace_cartere(str(diction['client_nom'])),
|
||||
"$options": "i"}},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
tab_client_facture_id = []
|
||||
for tmp in MYSY_GV.dbname['partner_client'].find(local_myquery_gle):
|
||||
tab_client_facture_id.append(str(tmp['_id']))
|
||||
|
||||
filt_gle_client_facture = {'order_header_client_id': {'$in': tab_client_facture_id}}
|
||||
|
||||
|
||||
filt_formation_external_code = {}
|
||||
|
|
@ -2554,7 +2573,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
filt_montant_ttc = {'mysy_total_header_toutes_taxes': {'$gte': filter_value_montant_ttc_from_float, '$lte': filter_value_montant_to_from_float}}
|
||||
|
||||
|
||||
find_qry = {'$and': [{'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}, filt_client_nom, filt_ref_interne_cmd,
|
||||
find_qry = {'$and': [{'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}, filt_gle_client_facture, filt_ref_interne_cmd,
|
||||
filt_ref_interne_invoice, filt_ref_externe, filt_client_id, filt_montant_ttc]}
|
||||
|
||||
|
||||
|
|
@ -2613,8 +2632,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
|
||||
find_qry = {'$and': [{'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0', },
|
||||
sub_qry_echeance_operator,
|
||||
|
||||
filt_client_nom, filt_ref_interne_cmd, filt_ref_interne_invoice, filt_ref_externe,
|
||||
filt_gle_client_facture, filt_ref_interne_cmd, filt_ref_interne_invoice, filt_ref_externe,
|
||||
filt_client_id, filt_montant_ttc]}
|
||||
|
||||
|
||||
|
|
@ -5658,6 +5676,11 @@ def Add_Partner_Draft_Invoice(diction):
|
|||
{'_id': ObjectId(str(order_header_client_id)), 'valide': '1',
|
||||
'locked': '0', 'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
data['order_header_client_raison_sociale'] = is_client_data['raison_sociale']
|
||||
data['order_header_client_nom'] = is_client_data['nom']
|
||||
data['order_header_client_siret'] = is_client_data['siret']
|
||||
data['order_header_client_telephone'] = is_client_data['telephone']
|
||||
|
||||
data['order_header_email_client'] = is_client_data['email']
|
||||
data['order_header_adr_fact_adresse'] = is_client_data['invoice_adresse']
|
||||
data['order_header_adr_fact_code_postal'] = is_client_data['invoice_code_postal']
|
||||
|
|
@ -6271,6 +6294,11 @@ def Update_Partner_Draft_Invoice(diction):
|
|||
{'_id': ObjectId(str(order_header_client_id)), 'valide': '1',
|
||||
'locked': '0', 'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
data['order_header_client_raison_sociale'] = is_client_data['raison_sociale']
|
||||
data['order_header_client_nom'] = is_client_data['nom']
|
||||
data['order_header_client_siret'] = is_client_data['siret']
|
||||
data['order_header_client_telephone'] = is_client_data['telephone']
|
||||
|
||||
data['order_header_email_client'] = is_client_data['email']
|
||||
data['order_header_adr_fact_adresse'] = is_client_data['invoice_adresse']
|
||||
data['order_header_adr_fact_code_postal'] = is_client_data['invoice_code_postal']
|
||||
|
|
@ -8703,9 +8731,6 @@ def Create_Inscrit_Invoice(diction):
|
|||
local_diction_entete['order_header_ref_client'] = ""
|
||||
local_diction_entete['order_header_vendeur_id'] = ""
|
||||
|
||||
|
||||
|
||||
|
||||
local_statut_entete, local_retval, local_entete_ref_interne = Add_Partner_Draft_Invoice(local_diction_entete)
|
||||
|
||||
if( local_statut_entete is False):
|
||||
|
|
|
|||
Loading…
Reference in New Issue