diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index 5e00a03..0783c5e 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -3850,7 +3850,7 @@ const AddClassManual = (props) => { //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url); - console.log(" #### url = ", url) + // console.log(" #### url = ", url) setLoading(true); axios.get(url, { responseType: 'blob', },) @@ -4223,7 +4223,7 @@ const AddClassManual = (props) => { aria-labelledby="draggable-dialog-title" > - MySy Information + MySy Information {Dialog_1_message} diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 00dd1d2..c4c5485 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -760,7 +760,7 @@ const DisplayPartnerSession = (props) => {
@@ -769,7 +769,7 @@ const DisplayPartnerSession = (props) => {
} diff --git a/src/components/Module_Editique.js b/src/components/Module_Editique.js index c375c95..eae9e61 100644 --- a/src/components/Module_Editique.js +++ b/src/components/Module_Editique.js @@ -1,22 +1,18 @@ import React, { useRef, useState, useEffect } from "react"; import TextField from '@mui/material/TextField'; -import MenuItem from '@mui/material/MenuItem'; +import Checkbox from '@mui/material/Checkbox'; import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css import Button from '@mui/material/Button'; import axios from "axios"; import { getCookie, setCookie } from 'react-use-cookie'; import { useHistory } from "react-router-dom"; -import CheckOut from "./CheckOut"; -import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; + import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; -import { Editor } from '@tinymce/tinymce-react'; -import parse from 'html-react-parser'; + import 'react-tooltip/dist/react-tooltip.css' import { Tooltip } from 'react-tooltip' -import add_plus from "../mysy_img/plus.png"; -import excel_icone from "../mysy_img/excel_icone.png"; -import participants from "../mysy_img/participants.png"; + import fileDownload from 'js-file-download' import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; @@ -25,13 +21,9 @@ import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import { format } from 'date-fns' import moment from "moment"; -import InputAdornment from '@mui/material/InputAdornment'; -import { AiFillCloseCircle } from "react-icons/ai"; + import Box from '@mui/material/Box'; -import { Typography, LinearProgress, sliderClasses } from '@mui/material'; -import styled from 'styled-components'; -import { CiTrash } from "react-icons/ci"; -import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md"; + import Dialog from '@mui/material/Dialog'; import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; @@ -44,16 +36,10 @@ import daygridPlugin from "@fullcalendar/daygrid"; //import interactionPlugin from "@fullcalendar/interaction"; //import timeGridPlugin from "@fullcalendar/timegrid"; -import allLocales from '@fullcalendar/core/locales-all' -import { RepeatOnRounded } from "@mui/icons-material"; -import { alignPropType } from "react-bootstrap/esm/types"; - - import ToggleSwitch from "./ToggleSwitch"; import ToggleSwitch_v2_mysy from "./ToggleSwitch_v2_mysy"; import ToggleSwitch_v3_mysy from "./ToggleSwitch_v3_mysy"; - import Autocomplete from '@mui/material/Autocomplete'; import FullCalendar, { formatDate } from "@fullcalendar/react"; import dayGridPlugin from "@fullcalendar/daygrid"; @@ -67,6 +53,8 @@ import { useTheme, } from "@mui/material"; +import SettingsSuggestIcon from '@mui/icons-material/SettingsSuggest'; + import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ChevronRightIcon from '@mui/icons-material/ChevronRight'; import { TreeView } from '@mui/x-tree-view/TreeView'; @@ -239,8 +227,6 @@ const Module_Editique = (props) => { - - const [Getall_Editable_Document_By_Partner_By_Collection_api, setGetall_Editable_Document_By_Partner_By_Collection_api] = useState(); const [Getall_Editable_Document_By_Partner_By_Collection_message, setGetall_Editable_Document_By_Partner_By_Collection_message] = useState(); const [Getall_Editable_Document_By_Partner_By_Collection_result, setGetall_Editable_Document_By_Partner_By_Collection_result] = useState([]); @@ -263,11 +249,9 @@ const Module_Editique = (props) => { if (String(res.data.status) === String("true")) { //console.log(" In Getall_Editable_Document_By_Partner_By_Collection res.data.status = " + res.data.status); - //console.log(" In Getall_Editable_Document_By_Partner_By_Collection res.data.message r_class = " + res.data.message); + // console.log(" In Getall_Editable_Document_By_Partner_By_Collection res.data.message r_class = " + res.data.message); setGetall_Editable_Document_By_Partner_By_Collection_api("true"); setGetall_Editable_Document_By_Partner_By_Collection_result(res.data.message); - - } else { setGetall_Editable_Document_By_Partner_By_Collection_api("false"); @@ -341,6 +325,45 @@ const Module_Editique = (props) => { } + const [Get_Given_Session_List_Automatic_Traitement_api, setGet_Given_Session_List_Automatic_Traitement_api] = useState(); + const [Get_Given_Session_List_Automatic_Traitement_message, setGet_Given_Session_List_Automatic_Traitement_message] = useState(); + const [Get_Given_Session_List_Automatic_Traitement_result, setGet_Given_Session_List_Automatic_Traitement_result] = useState([]); + function Get_Given_Session_List_Automatic_Traitement(local_selected_session_id) { + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("session_id", local_selected_session_id); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_SessionFormation_List_Automatic_Traitement_From/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + + setLoading(false); + + if (String(res.data.status) === String("true")) { + //console.log(" In Get_Given_Session_List_Automatic_Traitement res.data.status = " + res.data.status); + //console.log(" In Get_Given_Session_List_Automatic_Traitement res.data.message r_class = " + res.data.message); + setGet_Given_Session_List_Automatic_Traitement_api("true"); + setGet_Given_Session_List_Automatic_Traitement_result(JSON.parse(res.data.message)); + + + } + else { + setGet_Given_Session_List_Automatic_Traitement_api("false"); + setGet_Given_Session_List_Automatic_Traitement_message(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Get_Given_Session_List_Automatic_Traitement = ', error); + setGet_Given_Session_List_Automatic_Traitement_api("false"); + //setmyApimyApiMessage("") + }) + } + const [Getall_Session_Document_Status_api, setGetall_Session_Document_Status_api] = useState(); const [Getall_Session_Document_Status_message, setGetall_Session_Document_Status_message] = useState(); const [Getall_Session_Document_Status_result, setGetall_Session_Document_Status_result] = useState([]); @@ -482,6 +505,7 @@ const Module_Editique = (props) => { Getall_Editable_Document_By_Partner_By_Collection(); Getall_Audit_Document_By_Partner_By_Collection(); Get_related_collection_Data(); + Get_Given_Session_List_Automatic_Traitement(props.related_collection_recid); }, []) @@ -1220,6 +1244,64 @@ const Module_Editique = (props) => { }) } + + + const [Update_Session_Automatic_Doc_Setup_api, setUpdate_Session_Automatic_Doc_Setup_api] = useState(); + const [Update_Session_Automatic_Doc_Setup_message, setUpdate_Session_Automatic_Doc_Setup_message] = useState(); + const [Update_Session_Automatic_Doc_Setup_result, setUpdate_Session_Automatic_Doc_Setup_result] = useState([]); + function Update_Session_Automatic_Doc_Setup(event) { + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("_id", selected_session_id); + form.append("nb_jour_action", p_doc_automatic_setup_nb_jour); + form.append("actif", p_doc_automatic_setup_actif); + form.append("courrier_template_type_document_id", p_doc_automatic_setup_courrier_template_type_document_id); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_SessionFormation_Doc_Automatic_Setup/"; + + + setLoading(true); + axios.post(myurl, form).then(res => { + + setLoading(false); + + if (String(res.data.status) === String("true")) { + //console.log(" In Update_Session_Automatic_Doc_Setup res.data.status = " + res.data.status); + //console.log(" In Update_Session_Automatic_Doc_Setup res.data.message r_class = " + res.data.message); + setUpdate_Session_Automatic_Doc_Setup_api("true"); + setUpdate_Session_Automatic_Doc_Setup_result(res.data.message); + + Dialog_Config_Doc_Automation_handleClose_buton(); + + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); + + Get_Given_Session_List_Automatic_Traitement(props.related_collection_recid); + + } + else { + setUpdate_Session_Automatic_Doc_Setup_api("false"); + setUpdate_Session_Automatic_Doc_Setup_message(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Update_Session_Automatic_Doc_Setup = ', error); + setUpdate_Session_Automatic_Doc_Setup_api("false"); + alert(" Impossible de modifier le parametrage du document"); + }) + } + + const [action_server_to_run, setaction_server_to_run] = useState(""); const [action_server_type_doc, setaction_server_type_doc] = useState(""); const [action_server_nom_doc, setaction_server_nom_doc] = useState(""); @@ -1343,6 +1425,39 @@ const Module_Editique = (props) => { setdisplay_alert_mysy(""); } + + + const [Dialog_Config_Doc_Automation_open, setDialog_Config_Doc_Automation_open] = React.useState(false); + const Dialog_Config_Doc_Automation_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_Config_Doc_Automation_handleClose_buton = () => { + setDialog_Config_Doc_Automation_open(false); + setedit_doc_automatic_setup(""); + setis_modified_doc_automatic_setup(""); + setp_doc_automatic_setup_selected_id(""); + setp_doc_automatic_setup_actif(""); + + setp_doc_automatic_setup_nb_jour(""); + setp_doc_automatic_setup_nom_document(""); + setp_doc_automatic_setup_courrier_template_type_document_ref_interne(""); + setp_doc_automatic_setup_courrier_template_type_document_id(""); + }; + + + const [edit_doc_automatic_setup, setedit_doc_automatic_setup] = useState(""); + const [is_modified_doc_automatic_setup, setis_modified_doc_automatic_setup] = useState(""); + + const [p_doc_automatic_setup_selected_id, setp_doc_automatic_setup_selected_id] = useState(""); + const [p_doc_automatic_setup_actif, setp_doc_automatic_setup_actif] = useState(""); + const [p_doc_automatic_setup_nb_jour, setp_doc_automatic_setup_nb_jour] = useState(""); + const [p_doc_automatic_setup_nom_document, setp_doc_automatic_setup_nom_document] = useState(""); + const [p_doc_automatic_setup_courrier_template_type_document_ref_interne, setp_doc_automatic_setup_courrier_template_type_document_ref_interne] = useState(""); + const [p_doc_automatic_setup_courrier_template_type_document_id, setp_doc_automatic_setup_courrier_template_type_document_id] = useState(""); + + return (
@@ -1417,14 +1532,223 @@ const Module_Editique = (props) => { + + + {/* Dialog pour gerer les Config_Doc_Automation */} + null} + + PaperProps={{ + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '5rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" + > + + MySy Information + + + +
+ + {String(p_doc_automatic_setup_courrier_template_type_document_ref_interne) !== action_server_ref_interne_doc && + } + + {String(p_doc_automatic_setup_courrier_template_type_document_ref_interne) === action_server_ref_interne_doc && +
+ Traitement Automatique : {p_doc_automatic_setup_nom_document}
+ +
} +
+ +
+ + +
+ + + + + + + +
+
+   + +
+ + + {String(is_modified_doc_automatic_setup) === "1" &&
+ +
} +
+ +
+ +
+ {/* FIN Dialog pour gerer les Config_Doc_Automation */} + + + {/* Dialog pour gerer les MSG_INFO */} null} + + PaperProps={{ + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '5rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" > - MySy Information + MySy Information @@ -1440,6 +1764,16 @@ const Module_Editique = (props) => { + + + + +
  @@ -1460,11 +1794,32 @@ const Module_Editique = (props) => { {/* Dialog pour gerer les CONF_INSCRIPTION */} null} + + PaperProps={{ + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '5rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" > - MySy Information + MySy Information @@ -1480,6 +1835,15 @@ const Module_Editique = (props) => { + + + +
  @@ -1500,11 +1864,32 @@ const Module_Editique = (props) => { {/* Dialog pour gerer les EMARGEMENT_FORMATION */} null} + + PaperProps={{ + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '5rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" > - MySy Information + MySy Information
@@ -1520,6 +1905,15 @@ const Module_Editique = (props) => { + + + +
  @@ -1541,11 +1935,32 @@ const Module_Editique = (props) => { {/* Dialog pour gerer les ATTESTATION_FORMATION */} null} + + PaperProps={{ + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '5rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" > - MySy Information + MySy Information
@@ -1560,6 +1975,15 @@ const Module_Editique = (props) => { + + + +
  @@ -1581,11 +2005,32 @@ const Module_Editique = (props) => { {/* Dialog pour gerer les EVALUATION_FORMATION */} null} + + PaperProps={{ + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '5rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" > - MySy Information + MySy Information
@@ -1601,6 +2046,15 @@ const Module_Editique = (props) => { + + + +
  @@ -2229,7 +2683,6 @@ 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" &&
@@ -2501,14 +2956,20 @@ const Module_Editique = (props) => { }}> - {(JSON.parse(document).courrier_template_nom)} + {(JSON.parse(document).courrier_template_nom)} ttt
- + + + + +
+
+ 11
} @@ -2627,11 +3088,16 @@ const Module_Editique = (props) => {
- -
- + + + + +
+ +
+ 22
} @@ -2743,28 +3209,50 @@ const Module_Editique = (props) => { setDialog_FACTURATION_FORMATION_open(true); } - - }}> {(JSON.parse(document).courrier_template_nom)}
- {/*String(JSON.parse(document).has_history_event) === "1" && -
- - -
} - - {String(JSON.parse(document).has_history_event) !== "1" && -
- - -
*/}
- + + + + +
+ +
{ + + console.log(" OnClick"); + console.log(" JSON.parse(document) = ", JSON.parse(document)); + const new_data = Get_Given_Session_List_Automatic_Traitement_result.map((x) => { + // console.log(" CMP 1 x = ", x); + // console.log(" CMP 1 x.courrier_template_type_document_ref_interne = ", x.courrier_template_type_document_ref_interne); + // console.log(" CMP 2 String(JSON.parse(document).courrier_template_ref_interne = ", String(JSON.parse(document).courrier_template_ref_interne)); + if (x.courrier_template_type_document_ref_interne === String(JSON.parse(document).courrier_template_ref_interne)) { + + setp_doc_automatic_setup_actif(String((x).actif)); + setp_doc_automatic_setup_nb_jour(String((x).nb_jour_action)); + setp_doc_automatic_setup_selected_id(String((x).courrier_template_type_document_id)); + setp_doc_automatic_setup_nom_document(String((x).nom_document)); + setp_doc_automatic_setup_courrier_template_type_document_ref_interne(String((x).courrier_template_type_document_ref_interne)); + setp_doc_automatic_setup_courrier_template_type_document_id(String((x).courrier_template_type_document_id)); + } + }); + + setaction_server_nom_doc(String(JSON.parse(document).courrier_template_nom)) + setaction_server_ref_interne_doc(String(JSON.parse(document).courrier_template_ref_interne)) + + setDialog_Config_Doc_Automation_open(true); + }} + > + 33
} @@ -2793,6 +3281,15 @@ const Module_Editique = (props) => {
+
+ 44 +
+
} {/*** Cas d'une sesson facturée */} @@ -2911,7 +3408,6 @@ const Module_Editique = (props) => { -
diff --git a/src/components/Partner_Config_Technique.js b/src/components/Partner_Config_Technique.js index b2422e9..4501336 100644 --- a/src/components/Partner_Config_Technique.js +++ b/src/components/Partner_Config_Technique.js @@ -549,6 +549,8 @@ const Partner_Configuration_Technique = (props) => { const myRef = useRef(null) + const myRef_doc_auto = useRef(null) + useEffect(() => { Getall_Parter_config_Points(); @@ -1215,9 +1217,10 @@ const Partner_Configuration_Technique = (props) => { const [p_detail_doc_automatic_courrier_template_type_document_id, setp_detail_doc_automatic_courrier_template_type_document_id] = useState(""); const [p_detail_doc_automatic_nb_jour_action, setp_detail_doc_automatic_nb_jour_action] = useState(""); - const [p_detail_doc_automatic_action_target_date, set] = useState(""); + const [p_detail_doc_automatic_action_target_date, setp_detail_doc_automatic_action_target_date] = useState(""); const [p_detail_doc_automatic_collection_target, setp_detail_doc_automatic_collection_target] = useState(""); const [p_detail_doc_automatic_actif, setp_detail_doc_automatic_actif] = useState(""); + const [p_detail_doc_automatic_selected_id, setp_detail_doc_automatic_selected_id] = useState(""); const [p_detail_doc_automatic_nom, setp_detail_doc_automatic_nom] = useState(""); const [p_detail_doc_automatic_ref_interne, setp_detail_doc_automatic_ref_interne] = useState(""); @@ -1380,6 +1383,10 @@ const Partner_Configuration_Technique = (props) => { }); } + + + + } function Disable_Config_doc_auto_DetailFields() { @@ -1556,6 +1563,90 @@ const Partner_Configuration_Technique = (props) => { } + const [Update_One_base_document_automatic_Config_Data_api, setUpdate_One_base_document_automatic_Config_Data_api] = useState(); + const [Update_One_base_document_automatic_Config_Data_message, setUpdate_One_base_document_automatic_Config_Data_message] = useState(); + const [Update_One_base_document_automatic_Config_Data_result, setUpdate_One_base_document_automatic_Config_Data_result] = useState(); + function Update_One_base_document_automatic_Config_Data() { + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("_id", p_detail_doc_automatic_selected_id); + form.append("courrier_template_type_document_id", p_detail_doc_automatic_courrier_template_type_document_id); + form.append("nb_jour_action", p_detail_doc_automatic_nb_jour_action); + form.append("action_target_date", p_detail_doc_automatic_action_target_date); + form.append("collection_target", p_detail_doc_automatic_collection_target); + form.append("actif", p_detail_doc_automatic_actif); + + + //console.log(" form == ", form); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_base_document_automatic_setup/"; + setLoading(true); + + axios.post(myurl, form).then(res => { + setLoading(false); + //console.log(" In Update_One_base_document_automatic_Config_Data res.data.status = " + res.data.status); + //console.log(" In Update_One_base_document_automatic_Config_Data res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + + + setUpdate_One_base_document_automatic_Config_Data_api("true"); + setUpdate_One_base_document_automatic_Config_Data_result(res.data.message); + + Getall_Parter_Doc_Automatic_Config_Points(); + + setConfig_doc_automatic_data_changed(""); + setconfig_doc_automatic_data_edit_mode(""); + + setp_detail_doc_automatic_nb_jour_action(""); + setp_detail_doc_automatic_type(""); + setp_detail_doc_automatic_nom(""); + setp_detail_doc_automatic_ref_interne(""); + setp_detail_doc_automatic_actif(""); + setp_detail_doc_automatic_selected_id(""); + setp_detail_doc_automatic_action_target_date(""); + setp_detail_doc_automatic_collection_target(""); + setp_detail_doc_automatic_courrier_template_type_document_id(""); + + + + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); + + if (document.getElementById('myRef_head')) { + var divh = document.getElementById('myRef_head').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + + } + else { + setUpdate_One_base_document_automatic_Config_Data_api("false"); + setUpdate_One_base_document_automatic_Config_Data_message(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } + + }).catch((error) => { + setLoading(false); + console.warn('UpdateStagiaireData : Not good man :( Update_One_base_document_automatic_Config_Data = ' + error); + setUpdate_One_base_document_automatic_Config_Data_api("false"); + alert(" Impossible de mettre à jour le paramétrage "); + + }) + } + + const [gridline_id, setgridline_id] = useState(""); const [gridline_site_ftion_id, setgridline_site_ftion_id] = useState(""); @@ -2217,7 +2308,8 @@ const Partner_Configuration_Technique = (props) => { { "id": "nb_heure_par_semaine", "label": "nb_heure_par_semaine", "value": "nb_heure_par_semaine" }, { "id": "nb_heure_par_annee", "label": "nb_heure_par_annee", "value": "nb_heure_par_annee" }, - + { "id": "preinscription_notification_email", "label": "preinscription_notification_email", "value": "preinscription_notification_email" }, + { "id": "inscription_notification_email", "label": "inscription_notification_email", "value": "inscription_notification_email" }, { "id": "", "label": "", "value": "" }, ] @@ -3254,7 +3346,7 @@ const Partner_Configuration_Technique = (props) => { fullWidth type="number" - inputProps={{ min: "0", max: "100", step: "1" }} + inputProps={{ min: "0", max: "200", step: "1" }} value={p_detail_paiement_nb_jour} onChange={(e) => { setp_detail_paiement_nb_jour(e.target.value); @@ -5146,8 +5238,10 @@ const Partner_Configuration_Technique = (props) => { document_type_nom: JSON.parse(item).document_type_nom, actif: JSON.parse(item).actif, nb_jour_action: JSON.parse(item).nb_jour_action, + collection_target: JSON.parse(item).collection_target, action_target_date: JSON.parse(item).action_target_date, document_type_doc: JSON.parse(item).document_type_doc, + courrier_template_type_document_id: JSON.parse(item).courrier_template_type_document_id, } ))} @@ -5157,6 +5251,8 @@ const Partner_Configuration_Technique = (props) => { onRowDoubleClick={(newSelectionModel) => { setgridline_doc_automatic_id(newSelectionModel.row.id); + setConfig_doc_automatic_data_changed(""); + setconfig_doc_automatic_data_edit_mode(""); // handleClick_edit_config_quotation_From_Line(newSelectionModel.row.id); @@ -5166,6 +5262,20 @@ const Partner_Configuration_Technique = (props) => { setp_detail_doc_automatic_nom(newSelectionModel.row.document_type_nom); setp_detail_doc_automatic_ref_interne(newSelectionModel.row.document_ref_interne); setp_detail_doc_automatic_actif(newSelectionModel.row.actif); + + setp_detail_doc_automatic_selected_id(newSelectionModel.row._id); + setp_detail_doc_automatic_courrier_template_type_document_id(newSelectionModel.row.courrier_template_type_document_id); + setp_detail_doc_automatic_collection_target(newSelectionModel.row.collection_target); + setp_detail_doc_automatic_action_target_date(newSelectionModel.row.action_target_date); + + if (document.getElementById('myRef_doc_auto')) { + var divh = document.getElementById('myRef_doc_auto').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + }} @@ -5241,18 +5351,15 @@ const Partner_Configuration_Technique = (props) => {
*/}
-
 
+
 
- config_doc_automatic_data_edit_mode === {config_doc_automatic_data_edit_mode}
{display_detail_doc_automatic_config && String(display_detail_doc_automatic_config) === "1" &&
{config_doc_automatic_data_edit_mode && String(config_doc_automatic_data_edit_mode) === "1" && New_Config_Quotation_Point &&
- - en mode edit
Actif
{p_detail_doc_automatic_actif && String(p_detail_doc_automatic_actif) === "1" && { checked={true} onChange={(e) => { if (e.target.checked) { - p_detail_doc_automatic_actif("1"); + setp_detail_doc_automatic_actif("1"); } else { - p_detail_doc_automatic_actif("0"); + setp_detail_doc_automatic_actif("0"); } setConfig_doc_automatic_data_changed("1"); }} + style={{ background: '#FFFFFF' }} />} {String(p_detail_doc_automatic_actif) !== "1" && @@ -5277,13 +5385,14 @@ const Partner_Configuration_Technique = (props) => { checked={false} onChange={(e) => { if (e.target.checked) { - p_detail_doc_automatic_actif("1"); + setp_detail_doc_automatic_actif("1"); } else { - p_detail_doc_automatic_actif("0"); + setp_detail_doc_automatic_actif("0"); } setConfig_doc_automatic_data_changed("1"); }} + style={{ background: '#FFFFFF' }} />}
@@ -5300,7 +5409,7 @@ const Partner_Configuration_Technique = (props) => { disabled={false} className="disabled_style" value={p_detail_doc_automatic_nom} - + style={{ background: '#ECEFF1' }} />
@@ -5317,7 +5426,7 @@ const Partner_Configuration_Technique = (props) => { disabled={false} className="disabled_style" value={p_detail_doc_automatic_ref_interne} - + style={{ background: '#ECEFF1' }} />
@@ -5334,6 +5443,7 @@ const Partner_Configuration_Technique = (props) => { disabled={false} className="disabled_style" value={p_detail_doc_automatic_type} + style={{ background: '#ECEFF1' }} />
@@ -5345,6 +5455,7 @@ const Partner_Configuration_Technique = (props) => { required name="nb_jour_document" id="nb_jour_document" + type="number" InputLabelProps={{ shrink: true, @@ -5357,6 +5468,8 @@ const Partner_Configuration_Technique = (props) => { setConfig_doc_automatic_data_changed("1"); }} + style={{ background: '#FFFFFF' }} + />
@@ -5365,13 +5478,14 @@ const Partner_Configuration_Technique = (props) => { {String(config_doc_automatic_data_edit_mode) !== "1" && -
Point de configuration (No edit mode)
+
Point de configuration
Actif
{p_detail_doc_automatic_actif && String(p_detail_doc_automatic_actif) === "1" && } {String(p_detail_doc_automatic_actif) !== "1" && @@ -5379,12 +5493,13 @@ const Partner_Configuration_Technique = (props) => { name="active_config_document" className="disabled_style" checked={false} + style={{ background: '#ECEFF1' }} />}
Nom
{ disabled={false} className="disabled_style" value={p_detail_doc_automatic_nom} + style={{ background: '#ECEFF1' }} />
@@ -5412,6 +5528,7 @@ const Partner_Configuration_Technique = (props) => { disabled={false} className="disabled_style" value={p_detail_doc_automatic_ref_interne} + style={{ background: '#ECEFF1' }} />
@@ -5429,6 +5546,7 @@ const Partner_Configuration_Technique = (props) => { disabled={false} className="disabled_style" value={p_detail_doc_automatic_type} + style={{ background: '#ECEFF1' }} />
@@ -5447,6 +5565,7 @@ const Partner_Configuration_Technique = (props) => { disabled={false} className="disabled_style" value={p_detail_doc_automatic_nb_jour_action} + style={{ background: '#ECEFF1' }} />
@@ -5464,10 +5583,54 @@ const Partner_Configuration_Technique = (props) => {
- {String(config_doc_automatic_data_edit_mode) === "1" && String("Config_doc_automatic_data_changed") === "1" &&
+ {String(Config_doc_automatic_data_changed) === "1" && String(config_doc_automatic_data_edit_mode) === "1" &&
+ + + Enregistrer les modifications + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, la configuration sera modifiée
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
+ -
} diff --git a/src/components/Partner_Facture.js b/src/components/Partner_Facture.js index 6447642..5ba0472 100644 --- a/src/components/Partner_Facture.js +++ b/src/components/Partner_Facture.js @@ -17,8 +17,7 @@ import { Fab } from "@material-ui/core"; import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io"; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; -import { Editor } from '@tinymce/tinymce-react'; -import parse from 'html-react-parser'; + import { FcViewDetails, FcDisapprove, FcInfo } from "react-icons/fc"; import 'react-tooltip/dist/react-tooltip.css' import { Tooltip } from 'react-tooltip' @@ -60,7 +59,7 @@ import { GridPreferencePanelsValue, } from '@mui/x-data-grid'; - + //import { utils, writeFileXLSX } from "xlsx"; import { ContextMenu, ContextMenuTrigger } from "react-contextmenu"; import zIndex from "@material-ui/core/styles/zIndex"; @@ -68,9 +67,47 @@ import { FcOpenedFolder } from "react-icons/fc"; import Module_Historique_Action from "./Module_Historique_Action"; import { GridExportCsvOptions } from '@mui/x-data-grid'; +import { makeStyles } from "@material-ui/core/styles"; +import Paper from '@material-ui/core/Paper'; +import Draggable from 'react-draggable'; +import { IconButton } from '@material-ui/core'; +import CancelPresentationIcon from '@mui/icons-material/CancelPresentation'; +import Module_Alert_Confirmation from "./Module_Alert_Confirmation"; + +function PaperComponent(props) { + return ( + + + + ); +} + + +const useStyles = makeStyles((theme) => ({ + + dialog: { + position: 'absolute', + // left: 10, + top: 400 + }, + + paper: { + overflowY: 'unset', + }, + customizedButton: { + position: 'absolute', + left: '98%', + top: '-3%', + backgroundColor: 'lightgray', + color: 'gray', + }, +})); const Partner_Facture = (props) => { - + const classes = useStyles(); const { action, orderid } = useParams(); @@ -464,13 +501,19 @@ const Partner_Facture = (props) => { Getall_Invoice_Paiement_Payed_Remain_Amounts(); clear_Paiement_DetailFields() - alert(res.data.message); + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); } else { sethandleClick_delete_Paiement_api("false"); sethandleClick_delete_Paiement_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -570,7 +613,10 @@ const Partner_Facture = (props) => { else { setGetall_Invoice_Paiement_api("false"); setGetall_Invoice_Paiement_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -637,7 +683,10 @@ const Partner_Facture = (props) => { else { setGetall_Invoice_Paiement_Payed_Remain_Amounts_api("false"); setGetall_Invoice_Paiement_Payed_Remain_Amounts_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -841,7 +890,10 @@ const Partner_Facture = (props) => { else { setGet_Given_Line_Of_Partner_Invoice_Line_Data_api("false"); setGet_Given_Line_Of_Partner_Invoice_Line_Data_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -993,7 +1045,10 @@ const Partner_Facture = (props) => { else { setGetall_Parter_Invoice_No_Filter_api("false"); setGetall_Parter_Invoice_No_Filter_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -1033,7 +1088,10 @@ const Partner_Facture = (props) => { else { setGetall_Parter_Invoice_With_Filter_On_Client_Id_api("false"); setGetall_Parter_Invoice_With_Filter_On_Client_Id_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -1411,7 +1469,10 @@ const Partner_Facture = (props) => { setLoading(false); setGetAttendee_api("false"); setGetAttendee_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -1643,7 +1704,10 @@ const Partner_Facture = (props) => { else { setGetall_Parter_Invoice_With_Filter_api("false"); setGetall_Parter_Invoice_With_Filter_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -1683,12 +1747,18 @@ const Partner_Facture = (props) => { if (String(res.data.status) === String("true")) { setSend_Invoice_By_Email_api("true"); setSend_Invoice_By_Email_message(res.data.message); - alert(res.data.message); + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); } else { setSend_Invoice_By_Email_api("false"); setSend_Invoice_By_Email_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -1734,7 +1804,10 @@ const Partner_Facture = (props) => { setLoading(false); setGet_Partner_Invoice_Lines_from_header_id_api("false"); setGet_Partner_Invoice_Lines_from_header_id_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -2182,7 +2255,10 @@ const Partner_Facture = (props) => { else { setGet_Given_Paiement_Data_api("false"); setGet_Given_Paiement_Data_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -2290,7 +2366,10 @@ const Partner_Facture = (props) => { Dialog_Paiement_1_handleClose_buton(); - alert(res.data.message); + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); if (document.getElementById('myRef')) { var divh = document.getElementById('myRef').offsetTop; window.scrollTo({ @@ -2304,7 +2383,10 @@ const Partner_Facture = (props) => { else { setAdd_Update_Paiement_Data_api("false"); setAdd_Update_Paiement_Data_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -2352,7 +2434,10 @@ const Partner_Facture = (props) => { Display_Detail_Invoice_data(selected_id); - alert(res.data.message); + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); if (document.getElementById('myRef_head')) { var divh = document.getElementById('myRef_head').offsetTop; @@ -2367,7 +2452,10 @@ const Partner_Facture = (props) => { else { setCreate_Invoice_Credit_Note_api("false"); setCreate_Invoice_Credit_Note_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -2439,7 +2527,10 @@ const Partner_Facture = (props) => { Dialog_annotation_1_handleClose_buton(); - alert(res.data.message); + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); if (document.getElementById('myRef')) { var divh = document.getElementById('myRef').offsetTop; window.scrollTo({ @@ -2453,7 +2544,10 @@ const Partner_Facture = (props) => { else { setAdd_Update_annotation_Data_api("false"); setAdd_Update_annotation_Data_message(res.data.message); - alert(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); } }).catch((error) => { @@ -2709,6 +2803,21 @@ const Partner_Facture = (props) => { } }; + const [display_alert_mysy, setdisplay_alert_mysy] = useState(""); + const [alert_message, setalert_message] = useState(""); + const [alert_type, setalert_type] = useState(""); + + function clear_alert_message() { + setalert_message(""); + } + function clear_alert_type() { + setalert_type(""); + } + + function clear_display_alert_mysy() { + setdisplay_alert_mysy(""); + } + return (
@@ -2716,13 +2825,25 @@ const Partner_Facture = (props) => {
} + {/*** Affichage des messages d'alerte*/} + {display_alert_mysy && String(display_alert_mysy) === "1" && + + } + {/*** FIN Affichage des messages d'alerte*/} + + - Détail ligne Facture {String(invoice_internal_ref)} + Détail ligne Facture {String(invoice_internal_ref)} @@ -2934,9 +3055,29 @@ const Partner_Facture = (props) => { // onClose={Dialog_invoice_history_handleClose} className="displaypartnersession" static - onClose={() => null} > + onClose={() => null} - MySy Information + PaperProps={{ + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '5rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" + > + + MySy Information
@@ -2960,6 +3101,16 @@ const Partner_Facture = (props) => { + + + + +
  @@ -2983,9 +3134,29 @@ const Partner_Facture = (props) => { // onClose={Dialog_send_invoice_with_PJ_handleClose} className="displaypartnersession" static - onClose={() => null} > + onClose={() => null} - MySy Information + PaperProps={{ + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '5rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" + > + + MySy Information Envoi Facture par email @@ -3064,6 +3235,16 @@ const Partner_Facture = (props) => { + + + + +