From 1b586617909bf3c01a08a81fbc1f1fbda3aaa188 Mon Sep 17 00:00:00 2001 From: cherif Date: Thu, 7 Mar 2024 15:30:06 +0100 Subject: [PATCH] sds --- src/components/DisplayPartnerSession.js | 223 ++++++++++++++++++++---- src/components/TestUrl.js | 113 +++++++++++- src/styles/components/_test_page.scss | 2 +- 3 files changed, 300 insertions(+), 38 deletions(-) diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 624acfd..8cbb157 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -357,7 +357,7 @@ const DisplayPartnerSession = (props) => { const columns_preinscrit = [ { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, - { field: 'civilite', headerName: 'Civ.', minWidth: 100, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false, renderCell: (params) => , }, + { field: 'civilite', headerName: 'Civ.', minWidth: 100, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false, renderCell: (params) => , }, { field: 'nom', headerName: 'nom', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => , }, { field: 'prenom', headerName: 'prenom', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => , }, { field: 'email', headerName: 'email', minWidth: 150, flex: 1, flex: 1, renderCell: (params) => , }, @@ -618,8 +618,10 @@ const DisplayPartnerSession = (props) => { { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, { field: 'civilite', headerName: 'Civ.', minWidth: 70, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false }, - { field: 'nom', headerName: 'nom', minWidth: 150, flex: 1, hide: false, editable: false, - renderCell: (params) => , }, + { + field: 'nom', headerName: 'nom', minWidth: 150, flex: 1, hide: false, editable: false, + renderCell: (params) => , + }, { field: 'prenom', headerName: 'prenom', minWidth: 150, flex: 1, hide: false, editable: false, renderCell: (params) => , }, { field: 'email', headerName: 'email', minWidth: 150, flex: 1, flex: 1, renderCell: (params) => , }, { field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, maxWidth: 200, hide: false, editable: true, renderCell: (params) => , }, @@ -3103,7 +3105,8 @@ const DisplayPartnerSession = (props) => { const value = event.target.value; - if (String(value) === "confirmation" || String(value) === "impression" || String(value) === "annule inscription") { + if (String(value) === "confirmation" || String(value) === "impression" || String(value) === "annule inscription" || + String(value) === "facturer") { setactionmass_insc_val(value); } else { @@ -3240,41 +3243,121 @@ const DisplayPartnerSession = (props) => { async function actionmass_insc_Traitemet() { - var liste_formation = GetSelectedRows_Insc_Ids(); - for (var i = 0; i < liste_formation.length; i++) { + + if (String(actionmass_insc_val) === "facturer") { + + + + setDialog_FACTURATION_FORMATION_open(true); + GetListeInscrit(selected_session_id, selected_internal_url); - var line = JSON.parse(rowss_insc[liste_formation[i]]); - //console.log(" line = ", line); - var email = line.email; - //console.log(" Traitement de email = ", email); - if (String(actionmass_insc_val) === "confirmation") { + } else { + var liste_formation = GetSelectedRows_Insc_Ids(); + for (var i = 0; i < liste_formation.length; i++) { - SendInscriptionConfirmation(email); - } else if (String(actionmass_insc_val) === "impression") { - //console.log(" impress mail = ", email); - DownloadAttendeeDetail_one(email); + var line = JSON.parse(rowss_insc[liste_formation[i]]); + //console.log(" line = ", line); + var email = line.email; + //console.log(" Traitement de email = ", email); + if (String(actionmass_insc_val) === "confirmation") { - } else if (String(actionmass_insc_val) === "annule inscription") { + SendInscriptionConfirmation(email); + } else if (String(actionmass_insc_val) === "impression") { - //console.log(" impress mail = ", email); - SendInscriptionCancell(email); + //console.log(" impress mail = ", email); + DownloadAttendeeDetail_one(email); + + } else if (String(actionmass_insc_val) === "annule inscription") { + + //console.log(" impress mail = ", email); + SendInscriptionCancell(email); + + } + + + await sleep(5); } - await sleep(5); + setSelectionModel_insc([]); + setactionmass_insc_val(); + GetListePreinscrit(selected_session_id, selected_internal_url); + GetListeEmargement(selected_session_id, selected_internal_url); } - setSelectionModel_insc([]); - setactionmass_insc_val(); - GetListePreinscrit(selected_session_id, selected_internal_url); - GetListeInscrit(selected_session_id, selected_internal_url); - GetListeEmargement(selected_session_id, selected_internal_url); - } + + const [Invoice_Session_Formation_By_Selected_Inscrit_api, setInvoice_Session_Formation_By_Selected_Inscrit_api] = useState(); + const [Invoice_Session_Formation_By_Selected_Inscrit_message, setInvoice_Session_Formation_By_Selected_Inscrit_message] = useState(); + const [Invoice_Session_Formation_By_Selected_Inscrit_result, setInvoice_Session_Formation_By_Selected_Inscrit_result] = useState([]); + function Invoice_Session_Formation_By_Selected_Inscrit(event) { + var form = new FormData(); + + var tab_my_inscription_ids = [] + for (var i = 0; i < selectionModel_insc.length; i++) { + //console.log(" ### SelectionModel_insc[i] = ", selectionModel_insc[i]); + + var local_id = parseInt(selectionModel_insc[i]); + //console.log(" ### local_id = ",local_id); + + var myid = JSON.parse(String(rowss_insc[local_id])); + //var line = JSON.parse(rowss[myid]); + + //console.log(" ### myid = ",myid); + + tab_my_inscription_ids.push(myid['_id']); + } + + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("session_id", selected_session_id); + form.append("tab_inscription_ids", tab_my_inscription_ids); + form.append("courrier_template_id", "64fde469da3a50338b92fb83"); + + form.append("email_test", ""); + form.append("email_production", ""); + + console.log(" #### form = ", form); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Facture_From_Session_By_Inscription_Id/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + + setLoading(false); + + if (String(res.data.status) === String("true")) { + //console.log(" In Invoice_Session_Formation_By_Selected_Inscrit res.data.status = " + res.data.status); + //console.log(" In Invoice_Session_Formation_By_Selected_Inscrit res.data.message r_class = " + res.data.message); + setInvoice_Session_Formation_By_Selected_Inscrit_api("true"); + setInvoice_Session_Formation_By_Selected_Inscrit_result(res.data.message); + + alert(res.data.message); + + } + else { + setInvoice_Session_Formation_By_Selected_Inscrit_api("false"); + setInvoice_Session_Formation_By_Selected_Inscrit_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Invoice_Session_Formation_By_Selected_Inscrit = ', error); + setInvoice_Session_Formation_By_Selected_Inscrit_api("false"); + alert(" Impossible lancer la facturation de la session"); + }) + } + + const sleep = (milliseconds) => { return new Promise(resolve => setTimeout(resolve, milliseconds)) } @@ -4478,6 +4561,12 @@ const DisplayPartnerSession = (props) => { if (p_one_myclass_title) { one_myclass_title = p_one_myclass_title; } + + if (!p_one_code_session || p_one_code_session.trim() == "") { + alert(" Vous devez définir un code session "); + return; + } + if (one_myclass_title.trim() == "") { alert(" Vous devez choisir une formation "); return; @@ -9484,6 +9573,18 @@ const DisplayPartnerSession = (props) => { { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres. ] + + + const [Dialog_FACTURATION_FORMATION_open, setDialog_FACTURATION_FORMATION_open] = React.useState(false); + const Dialog_FACTURATION_FORMATION_handleClose = () => { + + }; + + const Dialog_FACTURATION_FORMATION_handleClose_buton = () => { + setDialog_FACTURATION_FORMATION_open(false); + }; + + return (
@@ -10382,6 +10483,65 @@ const DisplayPartnerSession = (props) => { + {/* Dialog pour gerer les FACTURATION_FORMATION */} + + + MySy Information + + +
+ En confirmation cette action, toute la session de formation sera facturée. + + Verifier les informations + +
    + +
  • Prix de session
  • +
  • Données client
  • +
  • etc
  • +
+ avant de lancer la facturation. +
+
+
+ + +
+
+ + +
+ +
+ +
+
+ +
+ +
+ + {/* FIN Dialog pour gerer les FACTURATION_FORMATION */} +

Vos sessions de formation

@@ -10389,7 +10549,7 @@ const DisplayPartnerSession = (props) => {
- {New_Option_Filter && New_Option_Filter.length > 0 && 0 && { />} - {/* {
{p_filtre1 && {
- {New_Option_Filter && New_Option_Filter.length > 0 && 0 && { +   @@ -16183,8 +16344,8 @@ const DisplayPartnerSession = (props) => { {String(submenu) === String("editique") &&
+ related_collection_recid={selected_session_id} GetListeInscrit={GetListeInscrit} + internal_url={selected_internal_url} />
} diff --git a/src/components/TestUrl.js b/src/components/TestUrl.js index 71e2252..47415f9 100644 --- a/src/components/TestUrl.js +++ b/src/components/TestUrl.js @@ -1180,16 +1180,16 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
-
+

- Mysy Training Logo + Mysy Training Logo
-
+
Cherif BALDE
-
+
Directeur
@@ -1199,7 +1199,7 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
-
+
 +337 69 20 39 45
 +331 77 00 38 57
 cbalde@mysy-training.com
@@ -1211,7 +1211,108 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
+
+
+
+
+
+ Mysy Training Logo +
+ +
+ Matthieu BOIFFARD
+
+
+ Responsable Commercial +
+
+
+
+ + +
+ +
+
 +336 67 45 99 64
+
 +331 77 00 38 57
+
 mboiffard@mysy-training.com
+
 https://www.mysy-training.com/
+ + +
+
+ +
+ +
+ +
+
+
+
+ Mysy Training Logo +
+ +
+ Aicha BARRY
+
+
+ Directrice Administration & Relation Client +
+
+
+
+ + +
+ +
+
 +336 16 08 80 48
+
 +331 77 00 38 57
+
 mboiffard@mysy-training.com
+
 https://www.mysy-training.com/
+ + +
+
+ +
+ +
+
+
+
+ Mysy Training Logo +
+ +
+ Matthieu BOIFFARD
+
+
+ Responsable Commercial +
+
+
+
+ + +
+ +
+
 +336 67 45 99 64
+
 +331 77 00 38 57
+
 mboiffard@mysy-training.com
+
 https://www.mysy-training.com/
+
 +337 69 20 39 45
+ +
+
+ +
{/* diff --git a/src/styles/components/_test_page.scss b/src/styles/components/_test_page.scss index 16df237..04f90e2 100644 --- a/src/styles/components/_test_page.scss +++ b/src/styles/components/_test_page.scss @@ -332,7 +332,7 @@ color: rgb(10, 42, 77); background-color: white; padding-top: 1rem !important; - line-height: 2.5rem !important; + line-height: 3rem; } .myhr {