diff --git a/src/components/DisplayClassV2.js b/src/components/DisplayClassV2.js index c93d757..2e1b2c2 100644 --- a/src/components/DisplayClassV2.js +++ b/src/components/DisplayClassV2.js @@ -31,7 +31,7 @@ const DisplayClassV2 = (props) => { return (
-

on y arrive Affichage detaillé d'une formation

+

on y arrive Affichage détaillé d'une formation

  • diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index d8c992c..9d44a27 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -3538,7 +3538,7 @@ const DisplayPartnerSession = (props) => { GetListeEmargement(selected_session_id, selected_internal_url); setretval_ch("1"); - alert(" La mise à jour été correctement faite.") + alert(" La mise à jour a été correctement faite.") } else { setDeleteStagiaireData_api("false"); @@ -3747,7 +3747,7 @@ const DisplayPartnerSession = (props) => { setparticipant_data_changed(); setparticipant_data_edit_mode(); GetAttendee_Data(p_detail_mail, selected_session_id); - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); //myRef_head.current.scrollIntoView({ behavior: "smooth" }); @@ -4967,6 +4967,10 @@ const DisplayPartnerSession = (props) => { const [p_session_etape_label, setp_session_etape_label] = useState(); + const [nb_valide_inscription_entreprise, setnb_valide_inscription_entreprise] = useState(""); + const [nb_valide_inscription_individuelle, setnb_valide_inscription_individuelle] = useState(""); + + const [GetCurrentSession_id, setGetCurrentSession_id] = useState(); const [GetCurrentSession_api, setGetCurrentSession_api] = useState(); @@ -4991,7 +4995,7 @@ const DisplayPartnerSession = (props) => { if (String(res.data.status) === "true") { //console.log(" In GetCurrentSession res.data.status = " + res.data.status); - //console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message); + console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message); //console.log(" In GetCurrentSession res.data.message len = " + String(res.data.message).length); setLoading(false); @@ -5027,6 +5031,17 @@ const DisplayPartnerSession = (props) => { } + if( mylocaltraining.nb_valide_inscription_entreprise){ + setnb_valide_inscription_entreprise(mylocaltraining.nb_valide_inscription_entreprise); + }else{ + setnb_valide_inscription_entreprise(""); + } + + if( mylocaltraining.nb_valide_inscription_individuelle){ + setnb_valide_inscription_individuelle(mylocaltraining.nb_valide_inscription_individuelle); + }else{ + setnb_valide_inscription_individuelle(""); + } if (mylocaltraining.date_debut) { var date_du = new Date(moment(mylocaltraining.date_debut, "DD/MM/YYYY HH:mm:ss")); @@ -5693,7 +5708,7 @@ const DisplayPartnerSession = (props) => { GetListeEmargement(selected_session_id, selected_internal_url); setretval_ch("1"); - alert(" La mise à jour été correctement faite.") + alert(" La mise à jour a été correctement faite.") } else { setUpdateStagiaireData_api("false"); @@ -19878,7 +19893,10 @@ const DisplayPartnerSession = (props) => { submenu_emargement={submenu_emargement} submenu_evaluation={submenu_evaluation_session} submenu_attestation={submenu_attestation} - submenu_q_positionnement={submenu_q_positionnement} + submenu_q_positionnement={submenu_q_positionnement} + nb_valide_inscription_entreprise = {nb_valide_inscription_entreprise} + nb_valide_inscription_individuelle = {nb_valide_inscription_individuelle} + selected_session_invoiced_statut = {selected_session_invoiced_statut} /> diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js index 6fc83fe..50c9c24 100644 --- a/src/components/DisplayPartnerStagiaires.js +++ b/src/components/DisplayPartnerStagiaires.js @@ -775,7 +775,7 @@ const DisplayPartnerStagiaires = (props) => { setselected_code_session(''); setsubmenu(''); - alert(" La mise à jour été correctement faite.") + alert(" La mise à jour a été correctement faite.") } else { setDeleteStagiaireData_api("false"); @@ -4072,7 +4072,7 @@ const DisplayPartnerStagiaires = (props) => { setparticipant_data_changed(); setparticipant_data_edit_mode(); GetAttendee_Data(p_detail_mail, p_detail_session_class_id, selected_internal_url); - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); //myRef_head.current.scrollIntoView({ behavior: "smooth" }); @@ -4143,7 +4143,7 @@ const DisplayPartnerStagiaires = (props) => { setparticipant_data_changed(); setparticipant_data_edit_mode(); GetAttendee_Data(p_detail_mail, p_detail_session_class_id, selected_internal_url); - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); //myRef_head.current.scrollIntoView({ behavior: "smooth" }); diff --git a/src/components/DisplayPartnerUnite_Enseignement.js b/src/components/DisplayPartnerUnite_Enseignement.js index a24804c..e7e2db7 100644 --- a/src/components/DisplayPartnerUnite_Enseignement.js +++ b/src/components/DisplayPartnerUnite_Enseignement.js @@ -202,7 +202,7 @@ const DisplayPartnerUnite_Enseignement = (props) => { setDelete_Given_UE_api("true"); setDelete_Given_UE_result(res.data.message); Getall_Parter_Unite_Enseignement(); - alert(" La mise à jour été correctement faite.") + alert(" La mise à jour a été correctement faite.") } else { setDelete_Given_UE_api("false"); diff --git a/src/components/ESign.js b/src/components/ESign.js index b389483..fdb918c 100644 --- a/src/components/ESign.js +++ b/src/components/ESign.js @@ -46,6 +46,8 @@ import Header from "./Header"; import Footer from "./Fotter"; import { FcInfo } from "react-icons/fc"; import { Document, Page } from 'react-pdf' +import SignatureCanvas from 'react-signature-canvas'; + function ESign() { @@ -140,14 +142,18 @@ function ESign() { form.append("secret_key_signature", selected_e_doc_secret); form.append("email_destinataire", selected_e_doc_email); - - if (isimgclassSelectedfile ) + form.append("signature_img_selected", userimgclassprofil); + + + if (isimgclassSelectedfile) form.append('signature_img', isimgclassSelected); else form.append('signature_img', ""); console.log(" isimgclassSelected #### = ", isimgclassSelected); + + setLoading(true); axios.post(myurl, form).then(res => { @@ -263,6 +269,13 @@ function ESign() { const [userimgclassprofil, setuserimgclassprofil] = useState(); const [userimgclassprofilchanged, setuserimgclassprofilchanged] = useState(""); + function reader(file, callback) { + const fr = new FileReader(); + fr.onload = () => callback(null, fr.result); + fr.onerror = (err) => callback(err); + fr.readAsDataURL(file); + } + const imglogoclasschangeHandler = (event) => { @@ -284,17 +297,112 @@ function ESign() { setisimgclassSelected(event.target.files[0]); setisimgclassSelectedfile(true); - setuserimgclassprofil(URL.createObjectURL(event.target.files[0])); + //setuserimgclassprofil(URL.createObjectURL(event.target.files[0])); setuserimgclassprofilchanged("1"); + + + reader(event.target.files[0], (err, res) => { + //console.log(res); // Base64 `data:image/...` String result. + setuserimgclassprofil(res); + }); + + + + }; + const [isimgclassSaved, setisimgclassSaved] = useState(""); const [isimgclassSaved_message, setisimgclassSaved_message] = useState(""); + const [Dialog_SIGN_MANUSCRITE_open, setDialog_SIGN_MANUSCRITE_open] = React.useState(false); + + + const Dialog_SIGN_MANUSCRITE_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_SIGN_MANUSCRITE_handleClose_buton = () => { + setDialog_SIGN_MANUSCRITE_open(false); + + }; + + const signatureCanvasRef = useRef(null); + // API method examples + const checkIfEmpty = () => { + const isEmpty = signatureCanvasRef.current.isEmpty(); + + if (signatureCanvasRef) { + setuserimgclassprofil(signatureCanvasRef.current.toDataURL()); + setisimgclassSelected(signatureCanvasRef.current.toDataURL()) + } + + setuserimgclassprofilchanged("1"); + + Dialog_SIGN_MANUSCRITE_handleClose_buton(); + }; + + const clearCanvas = () => { + signatureCanvasRef.current.clear(); + }; + + return (
    + + {/* POUR SIGNATURE MANUSCRITE */} + + + Signature Manuscrite + + +
    + +
    + +
    + + + +
    + + + +
    + + +
    +
    + +
    +
    + +
    + +
    + +
    +
    + + {/* FIN POUR SIGNATURE MANUSCRITE */} + + + {/* POUR SIGNATURE E-DOCUMENT */} } - + {isimgclassSelected && String(isimgclassSaved) === "0" && }
    diff --git a/src/components/Emarge_QR_Code.js b/src/components/Emarge_QR_Code.js index 06efc01..6231307 100644 --- a/src/components/Emarge_QR_Code.js +++ b/src/components/Emarge_QR_Code.js @@ -418,7 +418,7 @@ function Emarge_QR_Code() { reader(event.target.files[0], (err, res) => { - console.log(res); // Base64 `data:image/...` String result. + //console.log(res); // Base64 `data:image/...` String result. setuserimgclassprofil(res); }); @@ -717,7 +717,7 @@ function Emarge_QR_Code() {
    - + diff --git a/src/components/Employes.js b/src/components/Employes.js index 197dc2f..1539ad1 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -2240,7 +2240,7 @@ const Employes = (props) => { setemployee_data_edit_mode(""); Get_Employee_Data(selected_id); //setgridline_id(''); - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); if (document.getElementById('myRef_head')) { @@ -4002,7 +4002,7 @@ const Employes = (props) => { Getall_Employee_Affectation(selected_id); setSelectionModel_affectations([]); - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); if (document.getElementById('myRef_affectation')) { // myRef.current.scrollIntoView({ behavior: "smooth" }); @@ -4217,7 +4217,7 @@ const Employes = (props) => { setUpdate_user_access_right_Data_api("true"); setUpdate_user_access_right_Data_result(res.data.message); setacces_right_data_edit_mode(); - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); } else { diff --git a/src/components/GestionAdministrative.js b/src/components/GestionAdministrative.js index 8f3654c..2822305 100644 --- a/src/components/GestionAdministrative.js +++ b/src/components/GestionAdministrative.js @@ -572,7 +572,7 @@ function GestionAdministrative(props) { GetListePreinscrit(mysession); setretval_ch("1"); - alert(" La mise à jour été correctement faite.") + alert(" La mise à jour a été correctement faite.") } else { setDeleteStagiaireData_api("false"); @@ -993,7 +993,7 @@ function GestionAdministrative(props) { GetListeEmargement(mysession); GetListeEvaluation(mysession); setretval_ch("1"); - alert(" La mise à jour été correctement faite.") + alert(" La mise à jour a été correctement faite.") } else { setUpdateStagiaireData_api("false"); @@ -5562,7 +5562,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair GetAttendee_Data_from_line_id(selected_id); GetCurrentClass_trainingsession() - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); } else { diff --git a/src/components/Materiel_Salle.js b/src/components/Materiel_Salle.js index c0ef217..a7da5f3 100644 --- a/src/components/Materiel_Salle.js +++ b/src/components/Materiel_Salle.js @@ -2006,7 +2006,7 @@ const Materiel_Salle = (props) => { }); } - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); } else { @@ -2248,7 +2248,7 @@ const Materiel_Salle = (props) => { setSelectionModel_affectations([]); setgridline_affectation_id(''); - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); if (document.getElementById('myRef_new_affectation')) { var divh = document.getElementById('myRef_new_affectation').offsetTop; diff --git a/src/components/Materiels.js b/src/components/Materiels.js index 03d6c31..4337e17 100644 --- a/src/components/Materiels.js +++ b/src/components/Materiels.js @@ -1724,7 +1724,7 @@ const Materiels = (props) => { }); } - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); } else { @@ -1944,7 +1944,7 @@ const Materiels = (props) => { setSelectionModel_affectations([]); setgridline_affectation_id(''); - alert(" La mise à jour été correctement faite."); + alert(" La mise à jour a été correctement faite."); if (document.getElementById('myRef_new_affectation')) { var divh = document.getElementById('myRef_new_affectation').offsetTop; diff --git a/src/components/Module_Editique.js b/src/components/Module_Editique.js index 1c2cacc..37e7796 100644 --- a/src/components/Module_Editique.js +++ b/src/components/Module_Editique.js @@ -149,14 +149,14 @@ const Module_Editique = (props) => { form.append("token", stored_cookie); form.append("session_id", selected_session_id); form.append("tab_inscription_ids", "all"); - + //var myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Facture_From_Session_By_Email/"; var myurl = process.env.REACT_APP_API_URL + "myclass/api/Invoice_Inscrption_With_Split_Session_By_Inscription_Id/"; - + setLoading(true); axios.post(myurl, form).then(res => { @@ -1802,7 +1802,7 @@ const Module_Editique = (props) => { {/* FIN Dialog pour gerer les CONVOCATION_STAGIAIRE */} - {/* Dialog pour gerer les conventions */} + {/* Dialog pour gerer les CONVENTIONS */} {
  • - {String(partner_digital_signature_status) === "1" && String(selected_convention_type) === "email" &&
    -
    - - - + -
    +
    - } + } - {String(partner_digital_signature_status) !== "1" && String(selected_convention_type) === "email" &&
    Signature Digiale
    -
    - - - - +
    + + + + -
    +
    -
    } + } {(String(selected_convention_type) === "email" || String(selected_convention_type) === "pdf") &&
    Choisir une convention { - {/* FIN Dialog pour gerer les conventions */} + {/* FIN Dialog pour gerer les CONVENTIONS */} {/* Dialog pour gerer les Q_POSITIONNEMENT */} @@ -2205,121 +2208,366 @@ const Module_Editique = (props) => { {Getall_Editable_Document_By_Partner_By_Collection_result && Getall_Editable_Document_By_Partner_By_Collection_result.map((document) => ( -
    - -
    { +
    + {String(props.selected_session_invoiced_statut) !== "1" && String(props.selected_session_invoiced_statut) !== "2" && + String(JSON.parse(document).courrier_template_ref_interne) !== "CONVENTION_STAGIAIRE_INDIVIDUELLE" + && String(props.nb_valide_inscription_individuelle) === "0" && String(props.nb_valide_inscription_entreprise) !== "0" &&
    - setaction_server_to_run(String(JSON.parse(document).server_action_name)) - //setaction_server_type_doc(String(JSON.parse(document).courrier_template_type_doc)) - setaction_server_nom_doc(String(JSON.parse(document).courrier_template_nom)) - setaction_server_ref_interne_doc(String(JSON.parse(document).courrier_template_ref_interne)) - Action_Server(String(JSON.parse(document).server_action_name)); - setaction_server_type_doc_ref_interne(JSON.parse(document).courrier_template_ref_interne); - setDialog_1_message(String(JSON.parse(document).courrier_template_ref_interne)) +
    { + + setaction_server_to_run(String(JSON.parse(document).server_action_name)) + //setaction_server_type_doc(String(JSON.parse(document).courrier_template_type_doc)) + setaction_server_nom_doc(String(JSON.parse(document).courrier_template_nom)) + setaction_server_ref_interne_doc(String(JSON.parse(document).courrier_template_ref_interne)) + Action_Server(String(JSON.parse(document).server_action_name)); + setaction_server_type_doc_ref_interne(JSON.parse(document).courrier_template_ref_interne); + setDialog_1_message(String(JSON.parse(document).courrier_template_ref_interne)) - if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVENTION_STAGIAIRE_ENTREPRISE" || - String(JSON.parse(document).courrier_template_ref_interne) === "CONVENTION_STAGIAIRE_INDIVIDUELLE") { + if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVENTION_STAGIAIRE_ENTREPRISE") { - // Verifier que la date de la session n'est pas passée - var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); - var diff = date_eval.getTime() - Date.now(); + // Verifier que la date de la session n'est pas passée + var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); + var diff = date_eval.getTime() - Date.now(); - if (diff <= 0) { - setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convention") - setDialog_MSG_INFO_open(true); - return; - } + if (diff <= 0) { + setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + return; + } + + if (String(is_session_invoiced) === "1") { + setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + + } + else if (String(is_session_invoiced) === "2") { + setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + + } else { + Get_List_Stagiaire_Conventions(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) + ); + setDialog_convention_open(true); + + } + } + else if (String(JSON.parse(document).courrier_template_ref_interne) === "EMARGEMENT_FORMATION") { + // setDialog_EMARGEMENT_FORMATION_open(true); + props.submenu_emargement(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "ATTESTATION_FORMATION") { + //setDialog_ATTESTATION_FORMATION_open(true); + props.submenu_attestation(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVOCATION_STAGIAIRE") { + + // Verifier que la date de la session n'est pas passée + var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); + var diff = date_eval.getTime() - Date.now(); + + if (diff <= 0) { + setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + return; + } + + + if (String(is_session_invoiced) === "1") { + setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + + + } + else if (String(is_session_invoiced) === "2") { + setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + + } else { + + Get_List_Stagiaire_Convocations(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) + ); + + setDialog_CONVOCATION_STAGIAIRE_open(true); + } + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONF_INSCRIPTION") { + setDialog_CONF_INSCRIPTION_open(true); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "EVAL_FORMATION") { + //setDialog_EVALUATION_FORMATION_open(true); + props.submenu_evaluation(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "QUESTION_POSITIONNEMENT") { + //setDialog_Q_POSITIONNEMENT_open(true); + props.submenu_q_positionnement(); + } + + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "FACTURATION_SESSION") { + + setDialog_FACTURATION_FORMATION_open(true); + } + + + + }}> + {(JSON.parse(document).courrier_template_nom)} +
    + + + +
    + + +
    + +
    } + + {String(props.selected_session_invoiced_statut) !== "1" && String(props.selected_session_invoiced_statut) !== "2" && + String(JSON.parse(document).courrier_template_ref_interne) !== "CONVENTION_STAGIAIRE_ENTREPRISE" + && String(props.nb_valide_inscription_entreprise) === "0" && String(props.nb_valide_inscription_individuelle) !== "0" &&
    + + +
    { + + setaction_server_to_run(String(JSON.parse(document).server_action_name)) + //setaction_server_type_doc(String(JSON.parse(document).courrier_template_type_doc)) + setaction_server_nom_doc(String(JSON.parse(document).courrier_template_nom)) + setaction_server_ref_interne_doc(String(JSON.parse(document).courrier_template_ref_interne)) + Action_Server(String(JSON.parse(document).server_action_name)); + setaction_server_type_doc_ref_interne(JSON.parse(document).courrier_template_ref_interne); + setDialog_1_message(String(JSON.parse(document).courrier_template_ref_interne)) + + + if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVENTION_STAGIAIRE_INDIVIDUELLE") { + + // Verifier que la date de la session n'est pas passée + var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); + var diff = date_eval.getTime() - Date.now(); + + if (diff <= 0) { + setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + return; + } + + if (String(is_session_invoiced) === "1") { + setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + + } + else if (String(is_session_invoiced) === "2") { + setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + + } else { + Get_List_Stagiaire_Conventions(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) + ); + setDialog_convention_open(true); + + } + } + else if (String(JSON.parse(document).courrier_template_ref_interne) === "EMARGEMENT_FORMATION") { + // setDialog_EMARGEMENT_FORMATION_open(true); + props.submenu_emargement(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "ATTESTATION_FORMATION") { + //setDialog_ATTESTATION_FORMATION_open(true); + props.submenu_attestation(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVOCATION_STAGIAIRE") { + + // Verifier que la date de la session n'est pas passée + var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); + var diff = date_eval.getTime() - Date.now(); + + if (diff <= 0) { + setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + return; + } + + + if (String(is_session_invoiced) === "1") { + setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + + + } + else if (String(is_session_invoiced) === "2") { + setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + + } else { + + Get_List_Stagiaire_Convocations(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) + ); + + setDialog_CONVOCATION_STAGIAIRE_open(true); + } + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONF_INSCRIPTION") { + setDialog_CONF_INSCRIPTION_open(true); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "EVAL_FORMATION") { + //setDialog_EVALUATION_FORMATION_open(true); + props.submenu_evaluation(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "QUESTION_POSITIONNEMENT") { + //setDialog_Q_POSITIONNEMENT_open(true); + props.submenu_q_positionnement(); + } + + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "FACTURATION_SESSION") { + + setDialog_FACTURATION_FORMATION_open(true); + } + + + + }}> + {(JSON.parse(document).courrier_template_nom)} +
    - if (String(is_session_invoiced) === "1") { - setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convention") - setDialog_MSG_INFO_open(true); +
    + - } - else if (String(is_session_invoiced) === "2") { - setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convention") - setDialog_MSG_INFO_open(true); +
    - } else { - Get_List_Stagiaire_Conventions(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) - ); - setDialog_convention_open(true); +
    } - } - } - else if (String(JSON.parse(document).courrier_template_ref_interne) === "EMARGEMENT_FORMATION") { - // setDialog_EMARGEMENT_FORMATION_open(true); - props.submenu_emargement(); - } - - else if (String(JSON.parse(document).courrier_template_ref_interne) === "ATTESTATION_FORMATION") { - //setDialog_ATTESTATION_FORMATION_open(true); - props.submenu_attestation(); - } - - else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVOCATION_STAGIAIRE") { - - // Verifier que la date de la session n'est pas passée - var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); - var diff = date_eval.getTime() - Date.now(); - - if (diff <= 0) { - setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convocation") - setDialog_MSG_INFO_open(true); - return; - } + {String(props.selected_session_invoiced_statut) !== "1" && String(props.selected_session_invoiced_statut) !== "2" && + String(props.nb_valide_inscription_entreprise) !== "0" && String(props.nb_valide_inscription_individuelle) !== "0" &&
    - if (String(is_session_invoiced) === "1") { - setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convocation") - setDialog_MSG_INFO_open(true); +
    { + + setaction_server_to_run(String(JSON.parse(document).server_action_name)) + //setaction_server_type_doc(String(JSON.parse(document).courrier_template_type_doc)) + setaction_server_nom_doc(String(JSON.parse(document).courrier_template_nom)) + setaction_server_ref_interne_doc(String(JSON.parse(document).courrier_template_ref_interne)) + Action_Server(String(JSON.parse(document).server_action_name)); + setaction_server_type_doc_ref_interne(JSON.parse(document).courrier_template_ref_interne); + setDialog_1_message(String(JSON.parse(document).courrier_template_ref_interne)) - } - else if (String(is_session_invoiced) === "2") { - setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convocation") - setDialog_MSG_INFO_open(true); + if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVENTION_STAGIAIRE_ENTREPRISE" || + String(JSON.parse(document).courrier_template_ref_interne) === "CONVENTION_STAGIAIRE_INDIVIDUELLE") { - } else { + // Verifier que la date de la session n'est pas passée + var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); + var diff = date_eval.getTime() - Date.now(); - Get_List_Stagiaire_Convocations(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) - ); + if (diff <= 0) { + setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + return; + } - setDialog_CONVOCATION_STAGIAIRE_open(true); - } - } + if (String(is_session_invoiced) === "1") { + setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); - else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONF_INSCRIPTION") { - setDialog_CONF_INSCRIPTION_open(true); - } + } + else if (String(is_session_invoiced) === "2") { + setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); - else if (String(JSON.parse(document).courrier_template_ref_interne) === "EVAL_FORMATION") { - //setDialog_EVALUATION_FORMATION_open(true); - props.submenu_evaluation(); - } + } else { + Get_List_Stagiaire_Conventions(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) + ); + setDialog_convention_open(true); - else if (String(JSON.parse(document).courrier_template_ref_interne) === "QUESTION_POSITIONNEMENT") { - //setDialog_Q_POSITIONNEMENT_open(true); - props.submenu_q_positionnement(); - } + } + } + else if (String(JSON.parse(document).courrier_template_ref_interne) === "EMARGEMENT_FORMATION") { + // setDialog_EMARGEMENT_FORMATION_open(true); + props.submenu_emargement(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "ATTESTATION_FORMATION") { + //setDialog_ATTESTATION_FORMATION_open(true); + props.submenu_attestation(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVOCATION_STAGIAIRE") { + + // Verifier que la date de la session n'est pas passée + var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); + var diff = date_eval.getTime() - Date.now(); + + if (diff <= 0) { + setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + return; + } - else if (String(JSON.parse(document).courrier_template_ref_interne) === "FACTURATION_SESSION") { + if (String(is_session_invoiced) === "1") { + setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); - setDialog_FACTURATION_FORMATION_open(true); - } + + } + else if (String(is_session_invoiced) === "2") { + setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + + } else { + + Get_List_Stagiaire_Convocations(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) + ); + + setDialog_CONVOCATION_STAGIAIRE_open(true); + } + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONF_INSCRIPTION") { + setDialog_CONF_INSCRIPTION_open(true); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "EVAL_FORMATION") { + //setDialog_EVALUATION_FORMATION_open(true); + props.submenu_evaluation(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "QUESTION_POSITIONNEMENT") { + //setDialog_Q_POSITIONNEMENT_open(true); + props.submenu_q_positionnement(); + } + + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "FACTURATION_SESSION") { + + setDialog_FACTURATION_FORMATION_open(true); + } - }}> - {(JSON.parse(document).courrier_template_nom)} -
    + }}> + {(JSON.parse(document).courrier_template_nom)} +
    - {/*String(JSON.parse(document).has_history_event) === "1" && + {/*String(JSON.parse(document).has_history_event) === "1" &&
    @@ -2332,10 +2580,161 @@ const Module_Editique = (props) => {
    */} -
    - +
    + -
    +
    + +
    } + + {String(props.selected_session_invoiced_statut) !== "1" && String(props.selected_session_invoiced_statut) !== "2" && + String(props.nb_valide_inscription_entreprise) === "0" && String(props.nb_valide_inscription_individuelle) === "0" &&
    + + +
    { + + setMSG_INFO_TEXT("Aucune inscription validée.") + setDialog_MSG_INFO_open(true); + return; + + }}> + {(JSON.parse(document).courrier_template_nom)} +
    + + + + +
    + + +
    + +
    } + + {/*** Cas d'une sesson facturée */} + {(String(props.selected_session_invoiced_statut) === "1" || String(props.selected_session_invoiced_statut) === "2") && +
    + + +
    { + + setaction_server_to_run(String(JSON.parse(document).server_action_name)) + //setaction_server_type_doc(String(JSON.parse(document).courrier_template_type_doc)) + setaction_server_nom_doc(String(JSON.parse(document).courrier_template_nom)) + setaction_server_ref_interne_doc(String(JSON.parse(document).courrier_template_ref_interne)) + Action_Server(String(JSON.parse(document).server_action_name)); + setaction_server_type_doc_ref_interne(JSON.parse(document).courrier_template_ref_interne); + setDialog_1_message(String(JSON.parse(document).courrier_template_ref_interne)) + + + if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVENTION_STAGIAIRE_ENTREPRISE" || + String(JSON.parse(document).courrier_template_ref_interne) === "CONVENTION_STAGIAIRE_INDIVIDUELLE") { + + // Verifier que la date de la session n'est pas passée + var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); + var diff = date_eval.getTime() - Date.now(); + + if (diff <= 0) { + setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + return; + } + + if (String(is_session_invoiced) === "1") { + setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + + } + else if (String(is_session_invoiced) === "2") { + setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convention") + setDialog_MSG_INFO_open(true); + + } else { + Get_List_Stagiaire_Conventions(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) + ); + setDialog_convention_open(true); + + } + } + else if (String(JSON.parse(document).courrier_template_ref_interne) === "EMARGEMENT_FORMATION") { + // setDialog_EMARGEMENT_FORMATION_open(true); + props.submenu_emargement(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "ATTESTATION_FORMATION") { + //setDialog_ATTESTATION_FORMATION_open(true); + props.submenu_attestation(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVOCATION_STAGIAIRE") { + + // Verifier que la date de la session n'est pas passée + var date_eval = new Date(moment(session_date_debut, "DD/MM/YYYY")); + var diff = date_eval.getTime() - Date.now(); + + if (diff <= 0) { + setMSG_INFO_TEXT("Cette session a déjà commencé. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + return; + } + + + if (String(is_session_invoiced) === "1") { + setMSG_INFO_TEXT("Cette session est en cours de facturation. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + + + } + else if (String(is_session_invoiced) === "2") { + setMSG_INFO_TEXT("Cette session a déjà été facturée. Il n'est plus possible d'éditer une convocation") + setDialog_MSG_INFO_open(true); + + } else { + + Get_List_Stagiaire_Convocations(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) + ); + + setDialog_CONVOCATION_STAGIAIRE_open(true); + } + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONF_INSCRIPTION") { + setDialog_CONF_INSCRIPTION_open(true); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "EVAL_FORMATION") { + //setDialog_EVALUATION_FORMATION_open(true); + props.submenu_evaluation(); + } + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "QUESTION_POSITIONNEMENT") { + //setDialog_Q_POSITIONNEMENT_open(true); + props.submenu_q_positionnement(); + } + + + else if (String(JSON.parse(document).courrier_template_ref_interne) === "FACTURATION_SESSION") { + + setDialog_FACTURATION_FORMATION_open(true); + } + + + + }}> + {(JSON.parse(document).courrier_template_nom)} +
    + + + + +
    + + +
    + +
    }
    diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index e16508d..e9818ad 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -157,24 +157,7 @@ const Partner_Commande = (props) => { { field: 'order_header_date_expiration', headerName: 'Date Expiration', minWidth: 150, hide: false, editable: false }, - /* { - field: "Detail", headerName: 'Voir detail', - renderCell: (cellValues) => { - return ( - - - - ); - } - },*/ + { field: "delete", headerName: 'Supprimer', renderCell: (cellValues) => { @@ -250,6 +233,7 @@ const Partner_Commande = (props) => { { field: 'order_line_formation_duration', headerName: 'Durée', width: 80, hide: false, editable: false }, { field: 'order_line_qty', headerName: 'Qte', width: 100, hide: false, editable: false }, { field: 'order_line_prix_unitaire', headerName: 'Prix Unit.', width: 100, hide: false, editable: false }, + { field: 'order_line_montant_hors_taxes', headerName: 'Total HT', width: 100, hide: false, editable: false }, { field: 'order_header_id', headerName: 'Id_Entete', hide: true, editable: false }, { field: 'order_header_ref_interne', headerName: 'Ref_Interne', hide: true, editable: false }, { field: 'order_line_type', headerName: 'Type', width: 100, hide: false, editable: false }, @@ -273,7 +257,7 @@ const Partner_Commande = (props) => { }, }, { - field: "Detail", headerName: 'Voir detail', + field: "Detail", headerName: 'Voir détail', renderCell: (cellValues) => { return ( @@ -450,6 +434,9 @@ const Partner_Commande = (props) => { setp_add_line_session_code(String(cellValues.row.order_line_session_code)); setp_add_line_order_line_type_article(String(cellValues.row.order_line_type_article)); + setarticle_formation_ou_produit(String(cellValues.row.order_line_type_article)); + + console.log(" String(cellValues.row.order_line_type_article = ", String(cellValues.row.order_line_type_article)); Get_Given_Line_Of_Partner_Order_Line_Data(order_line_id, order_internal_ref); @@ -3966,7 +3953,7 @@ const Partner_Commande = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); form.append("order_header_id", selected_id); - form.append("order_header_status", setp_new_raison_cloture); + form.append("order_header_status", p_new_raison_cloture); form.append("closure_reason", setp_new_comment_raison_cloture); @@ -4141,7 +4128,7 @@ const Partner_Commande = (props) => { MySy Information - {Dialog_1_message} + Envoi devis par email @@ -4256,9 +4243,7 @@ const Partner_Commande = (props) => { {/*p_add_line_item = {p_add_line_item}
    */} - {selected_order_line_id && String(selected_order_line_id).length > 3 &&
    - deja choisi -
    } + {(!selected_order_line_id || String(selected_order_line_id).length < 3) && @@ -5611,27 +5596,14 @@ const Partner_Commande = (props) => { -
    - {session_file_name && } - {String(liste_sessions_file_change_api) === String("true") && } - {String(liste_sessions_file_change_api) === String("false") && } - - - - Télécharger un fichier modèle +
     
    {String(submenu) === "detail_order" && String(add_One_Order) !== "1" &&
    - +
    @@ -6732,7 +6704,7 @@ const Partner_Commande = (props) => { } {String(p_detail_header_statut_label).toLowerCase() === "en cours" && - String(p_detail_header_type).toLowerCase() === "commande" && + String(p_detail_header_type).toLowerCase() === "commande" && } @@ -6915,15 +6887,11 @@ const Partner_Commande = (props) => {
    - +
      { order_line_comment: JSON.parse(item).order_line_comment, order_line_formation_external_code: JSON.parse(item).order_line_formation_external_code, order_line_type_article: JSON.parse(item).order_line_type_article, + order_line_montant_hors_taxes: JSON.parse(item).order_line_montant_hors_taxes, } ))} diff --git a/src/components/Partner_Facture.js b/src/components/Partner_Facture.js index efc5725..09e3056 100644 --- a/src/components/Partner_Facture.js +++ b/src/components/Partner_Facture.js @@ -277,6 +277,9 @@ const Partner_Facture = (props) => { { field: 'order_line_qty', headerName: 'Qte', width: 100, hide: false, editable: false }, { field: 'order_line_prix_unitaire', headerName: 'Prix Unit.', width: 100, hide: false, editable: false }, + + { field: 'order_line_montant_hors_taxes', headerName: 'Total HT', width: 100, hide: false, editable: false }, + { field: 'order_header_id', headerName: 'Id_Entete', hide: true, editable: false }, { field: 'order_header_ref_interne', headerName: 'Ref_Interne', hide: true, editable: false }, { field: 'order_line_type', headerName: 'Type', width: 100, hide: false, editable: false }, @@ -697,8 +700,8 @@ const Partner_Facture = (props) => { var mylocal_order = JSON.parse(res.data.message); - if (mylocal_order.order_line_formation) { - setp_add_line_item(mylocal_order.order_line_formation); + if (mylocal_order.title) { + setp_add_line_item(mylocal_order.title); } @@ -742,41 +745,57 @@ const Partner_Facture = (props) => { if (mylocal_order.order_line_tax_amount) { setp_add_line_item_taxe_amount(mylocal_order.order_line_tax_amount); + } else { + setp_add_line_item_taxe_amount(""); } if (mylocal_order.order_line_type_reduction) { setp_add_line_item_type_reduction(mylocal_order.order_line_type_reduction); + } else { + setp_add_line_item_type_reduction(""); } if (mylocal_order.order_line_type_valeur) { setp_add_line_item_reduction_value(mylocal_order.order_line_type_valeur); + } else { + setp_add_line_item_reduction_value(""); } if (mylocal_order.order_line_type) { setp_add_line_item_type(mylocal_order.order_line_type); + } else { + setp_add_line_item_type(""); } if (mylocal_order.order_line_status) { setp_add_line_item_status(mylocal_order.order_line_status); + } else { + setp_add_line_item_status(""); } if (mylocal_order.order_line_comment) { setp_add_line_item_comment(mylocal_order.order_line_comment); + } else { + setp_add_line_item_comment(""); } if (mylocal_order.title) { setp_add_line_item_title(mylocal_order.title); + } else { + setp_add_line_item_title(""); } if (mylocal_order.order_line_montant_hors_taxes) { setp_add_line_item_total_amount_ht(mylocal_order.order_line_montant_hors_taxes); + } else { + setp_add_line_item_total_amount_ht(""); } @@ -787,6 +806,8 @@ const Partner_Facture = (props) => { if (mylocal_order.duration_concat) { setp_add_line_item_duration_concat(mylocal_order.duration_concat); + } else { + setp_add_line_item_duration_concat(""); } @@ -1071,7 +1092,7 @@ const Partner_Facture = (props) => { if (res.data.message.length > 0) { var mylocal_order = JSON.parse(res.data.message); - // zzzzz + if (mylocal_order.invoice_header_ref_interne) setp_detail_header_invoice_header_ref_interne(mylocal_order.invoice_header_ref_interne); @@ -2431,7 +2452,6 @@ const Partner_Facture = (props) => {
    Prix Unitaire { />
    -
    Taux TVA +
    Taxe
    @@ -2793,7 +2814,7 @@ const Partner_Facture = (props) => {
    Utilisez les filtres !
    - + {New_Option_Filter && New_Option_Filter.length > 0 && { onChange={(event, value) => { if (value && value.value) { setp_filtre1(value.value); - }else{ + } else { setp_filtre1(""); } @@ -3223,7 +3244,7 @@ const Partner_Facture = (props) => {
     
    {String(display_detail_invoice) === "1" &&
    - +
    @@ -4176,6 +4197,7 @@ const Partner_Facture = (props) => { order_line_formation_duration: JSON.parse(item).duration_concat, order_line_comment: JSON.parse(item).order_line_comment, order_line_formation_external_code: JSON.parse(item).order_line_formation_external_code, + order_line_montant_hors_taxes: JSON.parse(item).order_line_montant_hors_taxes, } ))}