diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index 69d8a6f..6b19b64 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -3637,7 +3637,7 @@ const AddClassManual = (props) => { const otherSetting = { height: 300, - yAxis: [{ label: 'rainfall (mm)' }], + yAxis: [{ label: '' }], grid: { horizontal: true }, sx: { [`& .${axisClasses.left} .${axisClasses.label}`]: { diff --git a/src/components/AddPartnerClient.js b/src/components/AddPartnerClient.js index 9ccff3e..728e099 100644 --- a/src/components/AddPartnerClient.js +++ b/src/components/AddPartnerClient.js @@ -32,7 +32,7 @@ import { IoCloseCircleOutline } from "react-icons/io5"; import AttachFileIcon from '@mui/icons-material/AttachFile'; import Radio from '@mui/material/Radio'; - +import WarningAmberIcon from '@mui/icons-material/WarningAmber'; const AddParnerClient = (props) => { const history = useHistory(); const [submenu, setsubmenu] = useState(""); @@ -182,7 +182,7 @@ const AddParnerClient = (props) => { document.getElementById("submenu_activite").style.background = "#d8edfc"; document.getElementById("submenu_activite").style.color = "#3b3e40"; - + document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc"; document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40"; @@ -653,6 +653,10 @@ const AddParnerClient = (props) => { }, [props.client_mail,]); + + const [has_client_invoice_email, sethas_client_invoice_email] = useState(); + + const [fillfield_api, setfillfield_api] = useState(""); const [fillfield_result, setfillfield_result] = useState(""); const [fillfield_message, setfillfield_message] = useState(""); @@ -673,7 +677,7 @@ const AddParnerClient = (props) => { //console.log(" In fillfield res.data.message = " + res.data.message); setfillfield_api("true"); setfillfield_result(res.data.message); - var mylocalclient = JSON.parse(res.data.message); + var mylocalclient = JSON.parse(res.data.message); if (mylocalclient) { @@ -772,8 +776,10 @@ const AddParnerClient = (props) => { // Remplissage des doonées de facturation if (mylocalclient.invoice_email) setclient_invoice_email(mylocalclient.invoice_email); - else + else{ setclient_invoice_email(""); + sethas_client_invoice_email("0"); + } if (mylocalclient.invoice_nom) setclient_invoice_nom(mylocalclient.invoice_nom); @@ -798,8 +804,10 @@ const AddParnerClient = (props) => { if (mylocalclient.invoice_condition_paiement_id) setp_client_invoice_paiement_condition_id(mylocalclient.invoice_condition_paiement_id); - else + else{ setp_client_invoice_paiement_condition_id(""); + sethas_client_invoice_email("0"); + } if (mylocalclient.invoice_condition_paiement_code) setp_client_invoice_paiement_condition_code(mylocalclient.invoice_condition_paiement_code); @@ -1059,6 +1067,8 @@ const AddParnerClient = (props) => { } + const [client_has_communication_contact, setclient_has_communication_contact] = useState(); + const [Get_List_Contact_Of_client_Part_api, setGet_List_Contact_Of_client_Part_api] = useState(); const [Get_List_Contact_Of_client_Part_message, setGet_List_Contact_Of_client_Part_message] = useState(); const [Get_List_Contact_Of_client_Part_result, setGet_List_Contact_Of_client_Part_result] = useState(); @@ -1084,6 +1094,18 @@ const AddParnerClient = (props) => { setGet_List_Contact_Of_client_Part_api("true"); setGet_List_Contact_Of_client_Part_result(res.data.message); + var contact_com = "0"; + + const new_data = res.data.message.map((x) => { + + //--- + var include_com = JSON.parse(x).include_com; + if (String(include_com) === "1") { + contact_com = "1" + } + }); + + setclient_has_communication_contact(contact_com); } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -1215,12 +1237,12 @@ const AddParnerClient = (props) => { document.getElementsByName("client_website")[0].style.backgroundColor = "#ECEFF1"; } - if (document.getElementsByName("client_code_postal") && document.getElementsByName("client_code_postal")[0] ) { + if (document.getElementsByName("client_code_postal") && document.getElementsByName("client_code_postal")[0]) { document.getElementsByName("client_code_postal")[0].disabled = true; document.getElementsByName("client_code_postal")[0].style.backgroundColor = "#ECEFF1"; } - if (document.getElementsByName("client_telephone")&& document.getElementsByName("client_telephone")[0]) { + if (document.getElementsByName("client_telephone") && document.getElementsByName("client_telephone")[0]) { document.getElementsByName("client_telephone")[0].disabled = true; document.getElementsByName("client_telephone")[0].style.backgroundColor = "#ECEFF1"; } @@ -1791,57 +1813,61 @@ const AddParnerClient = (props) => { form.append("email", p_client_email); form.append("nom", p_client_nom); - // Données de facturation - var client_invoice_email = "" - if (document.getElementsByName("client_invoice_email")) { - client_invoice_email = document.getElementsByName("client_invoice_email")[0].value; + // Données de facturation + var client_invoice_email = p_client_invoice_email + + var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; + + if (String(client_invoice_email) === "" || !client_invoice_email.match(validRegex) ) { + alert("L'adresse email de facturation est invalide."); + return; } + + + if( String(p_client_invoice_paiement_condition_id).trim() === ""){ + alert(" Vous devez choisir une condition de paiement"); + return; + } + + form.append("invoice_email", client_invoice_email); - var client_invoice_nom = "" - if (document.getElementsByName("client_invoice_nom")) { - client_invoice_nom = document.getElementsByName("client_invoice_nom")[0].value; - } + var client_invoice_nom = p_client_invoice_nom; + form.append("invoice_nom", client_invoice_nom); - var client_invoice_siret = "" - if (document.getElementsByName("client_invoice_siret")) { - client_invoice_siret = document.getElementsByName("client_invoice_siret")[0].value; - } + var client_invoice_siret = p_client_invoice_siret; + + form.append("invoice_siret", client_invoice_siret); - var client_invoice_tva = "" - if (document.getElementsByName("client_invoice_tva")) { - client_invoice_tva = document.getElementsByName("client_invoice_tva")[0].value; - } + var client_invoice_tva = p_client_invoice_tva; + + form.append("invoice_tva", client_invoice_tva); form.append("invoice_condition_paiement_id", p_client_invoice_paiement_condition_id); + - var client_invoice_adresse = "" - if (document.getElementsByName("client_invoice_adresse")) { - client_invoice_adresse = document.getElementsByName("client_invoice_adresse")[0].value; - } + var client_invoice_adresse = p_client_invoice_adresse; + + form.append("invoice_adresse", client_invoice_adresse); - var client_invoice_ville = "" - if (document.getElementsByName("client_invoice_ville")) { - client_invoice_ville = document.getElementsByName("client_invoice_ville")[0].value; - } + var client_invoice_ville = p_client_invoice_ville; + form.append("invoice_ville", client_invoice_ville); - var client_invoice_code_postal = "" - if (document.getElementsByName("client_invoice_email")) { - client_invoice_code_postal = document.getElementsByName("client_invoice_code_postal")[0].value; - } + var client_invoice_code_postal = p_client_invoice_code_postal; + + form.append("invoice_code_postal", client_invoice_code_postal); - var client_invoice_pays = "" - if (document.getElementsByName("client_invoice_pays")) { - client_invoice_pays = document.getElementsByName("client_invoice_pays")[0].value; - } + var client_invoice_pays = p_client_invoice_pays; + + form.append("invoice_pays", client_invoice_pays); @@ -1862,7 +1888,8 @@ const AddParnerClient = (props) => { setdatamodification_invoice("0"); alert(" Les données de facturation ont été mises à jour.") Disable_invoice_fields(); - alert(res.data.message); + sethas_client_invoice_email(""); + alert(res.data.message); } @@ -2234,6 +2261,7 @@ const AddParnerClient = (props) => { var include_com = "0" if (is_contact_include_com) { include_com = "1"; + setclient_has_communication_contact(""); } form.append("include_com", include_com); @@ -2510,14 +2538,9 @@ const AddParnerClient = (props) => { const [is_contact_include_com, setis_contact_include_com] = useState(false); const New_civilite = [ - { "id": "Mme", "label": "Mme", "value": "Mme" }, - { "id": "M", "label": "M", "value": "M" }, - { "id": "Neutre", "label": "Neutre", "value": "Neutre" }, - { "id": "mme", "label": "Mme", "value": "mme" }, { "id": "m", "label": "M", "value": "m" }, { "id": "neutre", "label": "Neutre", "value": "neutre" }, - { "id": "", "label": "", "value": "" }, ] @@ -3139,7 +3162,7 @@ const AddParnerClient = (props) => { DataEditMode(); if (p_client_is_financeur === true) setp_client_is_financeur(false) - else { + else { setp_client_is_financeur(true); } @@ -3266,18 +3289,36 @@ const AddParnerClient = (props) => { {String(props.new_customer) !== "1" &&
+ - - + + - {/* + {/* zzzzz */}
- + {String(submenu).trim() === "submenu_donnee_client" &&
@@ -3639,7 +3680,7 @@ const AddParnerClient = (props) => { {String(datamodification) === "1" &&
/!\ Pensez à enregistrer les modifications
} - + {String(formedit_mode) === "1" &&
@@ -3726,7 +3767,7 @@ const AddParnerClient = (props) => { />
-
Conditions Paiement
+
Conditions Paiement
{String(formedit_mode_invoice) !== "1" && { {Getall_Qry_Invoice_Data_result_JSON && Getall_Qry_Invoice_Data_result_JSON.length > 0 && Getall_Qry_Invoice_Data_result_JSON[0].data && { date_to = p_filter_date_to; } - + form.append("token", stored_cookie); form.append("session_start_date", date_from); diff --git a/src/components/Dashbord_Inscription_All_Inscription.js b/src/components/Dashbord_Inscription_All_Inscription.js index 29e5343..a27af15 100644 --- a/src/components/Dashbord_Inscription_All_Inscription.js +++ b/src/components/Dashbord_Inscription_All_Inscription.js @@ -81,7 +81,7 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { { field: 'session_distantiel', headerName: 'Distantiel', hide: true, Width: 20 }, { field: 'session_presentiel', headerName: 'Présentiel', hide: true, Width: 20 }, ] - + const [p_filter_date_from, setp_filter_date_from] = useState(date_today_90j.toLocaleDateString('fr-FR')); const [p_filter_date_to, setp_filter_date_to] = useState(new Date().toLocaleDateString('fr-FR')); @@ -294,7 +294,7 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { const chartSetting = { yAxis: [ { - label: " Nombre d'inscription ", + label: " Nombre d'inscriptions ", }, ], width: 1000, diff --git a/src/components/Dashbord_Session_Taux_Remplissage.js b/src/components/Dashbord_Session_Taux_Remplissage.js index 3025a59..aef6654 100644 --- a/src/components/Dashbord_Session_Taux_Remplissage.js +++ b/src/components/Dashbord_Session_Taux_Remplissage.js @@ -404,82 +404,7 @@ const Dashbord_Session_Taux_Remplissage = (props) => { {isLoading &&
} - {/*
-
- Filtre
- { - setfilter_value(e.target.value); - } - } - - > - Mois en cours    - Trimestre en cours   - Choisir des dates   - -
- - {filter_value && String(filter_value) === "d" &&
-
- Date Debut - { - setp_filter_date_from(format(date, 'dd/MM/yyyy')); - - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style session_caract_Dialog_DatePicker" - locale='fr-FR' - - /> - -
- -
- Date Fin - { - setp_filter_date_to(format(date, 'dd/MM/yyyy')); - - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style enable_style" - /> - -
- -
} -
- - -
*/} +
diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index da0557e..d8c992c 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -20349,7 +20349,7 @@ const DisplayPartnerSession = (props) => { {String(submenu) === String("evaluation_session") &&
- p_formateur_id = {p_formateur_id} + { const otherSetting = { height: 300, - yAxis: [{ label: 'rainfall (mm)' }], + yAxis: [{ label: '' }], grid: { horizontal: true }, sx: { [`& .${axisClasses.left} .${axisClasses.label}`]: { @@ -8532,6 +8532,8 @@ const Employes = (props) => { + +
@@ -9050,6 +9052,8 @@ const Employes = (props) => { + +
@@ -9615,6 +9619,8 @@ const Employes = (props) => { + +
@@ -9863,6 +9869,8 @@ const Employes = (props) => { + +
 
@@ -9973,6 +9981,8 @@ const Employes = (props) => { + +
@@ -10128,6 +10138,8 @@ const Employes = (props) => { + +
@@ -10206,6 +10218,8 @@ const Employes = (props) => { + +
diff --git a/src/components/Mon_Tableau_De_Bord.js b/src/components/Mon_Tableau_De_Bord.js index 632fa76..7a0e833 100644 --- a/src/components/Mon_Tableau_De_Bord.js +++ b/src/components/Mon_Tableau_De_Bord.js @@ -15,7 +15,7 @@ import 'reactjs-popup/dist/index.css'; import "react-datepicker/dist/react-datepicker.css"; - +import Button from '@mui/material/Button'; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; import Dashbord_Session_Par_Fteur from "./Dashbord_Session_Par_Fteur"; @@ -29,13 +29,31 @@ import Dashbord_Factures_Par_Client from "./Dashbord_Factures_Par_Client"; import Dashbord_Factures_Devis_Par_Periode from "./Dashbord_Factures_Devis_Par_Periode"; import Dashbord_Inscriptions_all_inscriptions from "./Dashbord_Inscription_All_Inscription"; import Dashbord_Factures_Previsionnel_Par_Periode from "./Dashbord_Factures_Previsionnel_Par_Periode"; - +import Box from '@mui/material/Box'; import { TbColumns2, TbColumns1 } from "react-icons/tb"; - +import { BarChart } from '@mui/x-charts'; +import { axisClasses } from '@mui/x-charts'; +import { pieArcLabelClasses } from '@mui/x-charts/PieChart'; +import Popup from 'reactjs-popup'; +import 'reactjs-popup/dist/index.css'; +import { MdDeleteForever } from "react-icons/md"; +import { RiFileExcel2Line } from "react-icons/ri"; +import Autocomplete from '@mui/material/Autocomplete'; +import TextField from '@mui/material/TextField'; +import { format } from 'date-fns' +import moment from "moment"; +import DatePicker from "react-datepicker"; +import "react-datepicker/dist/react-datepicker.css"; +import { ResponsiveBar } from "@nivo/bar"; +import { + useTheme, +} from "@mui/material"; +import { tokens } from "../theme"; const Mon_Tableau_De_Bord = (props) => { - + const theme = useTheme(); + const colors = tokens(theme.palette.mode); const history = useHistory(); const [isLoading, setLoading] = useState(); @@ -86,6 +104,9 @@ const Mon_Tableau_De_Bord = (props) => { useEffect(() => { + if (String(submenu) === "") { + submenu_rapport_activite(); + } Get_Connected_User_Dashbord(); window.scrollTo({ top: 0, @@ -94,218 +115,1089 @@ const Mon_Tableau_De_Bord = (props) => { }, []) + const New_option_periode = [ + { "id": "m0", "label": "Mois en cours", "value": "m0" }, + { "id": "m1", "label": "Mois précédant ", "value": "m1" }, + { "id": "d", "label": "Choisir des dates", "value": "d" }, + + ] + + const New_option_group_by = [ + { "id": "mois", "label": "Mois", "value": "mois" }, + { "id": "class", "label": "Formation", "value": "class" }, + { "id": "session", "label": "Session", "value": "session" }, + { "id": "", "label": "", "value": "" }, + ] const [display_nb_column, setdisplay_nb_column] = useState("1"); const [display_column_size, setdisplay_column_size] = useState("98%"); + const [submenu, setsubmenu] = useState(""); + function submenu_montbd() { + setsubmenu("montbd"); + + submenu_color_management("montbd"); + } + + function submenu_rapport_activite() { + setsubmenu("rapport_activite"); + submenu_color_management("rapport_activite"); + } + + function submenu_rapport_financier() { + setsubmenu("rapport_financier"); + submenu_color_management("rapport_financier"); + } + + + + function submenu_color_management(current_menu) { + const list_sous_menu = ["montbd", "rapport_activite", "rapport_financier"] + + for (let i = 0; i < list_sous_menu.length; i++) { + + var sous_menu = list_sous_menu[i]; + if (String(sous_menu) !== current_menu) { + if (document.getElementById(sous_menu)) { + document.getElementById(sous_menu).style.backgroundColor = "#d8edfc"; + document.getElementById(sous_menu).style.color = "black"; + document.getElementById(sous_menu).style.fontWeight = "normal"; + } + } + + if (String(sous_menu) === "editique") { + if (document.getElementById(sous_menu)) { + document.getElementById(sous_menu).style.backgroundColor = "#6C3483"; + document.getElementById(sous_menu).style.color = "#FFFFFF"; + document.getElementById(sous_menu).style.fontWeight = "bold"; + } + } + + } + + if (document.getElementById(current_menu)) { + document.getElementById(current_menu).style.backgroundColor = "#104277"; + document.getElementById(current_menu).style.color = "white"; + document.getElementById(current_menu).style.fontWeight = "bold"; + } + + } + + var date_today_90j = new Date(); + date_today_90j.setDate(date_today_90j.getDate() - 90); + const valueFormatter_count = (value) => `${value} Insc`; + + const [p_filter_date_from, setp_filter_date_from] = useState(date_today_90j.toLocaleDateString('fr-FR')); + const [p_filter_date_to, setp_filter_date_to] = useState(new Date().toLocaleDateString('fr-FR')); + const [filter_group_by, setfilter_group_by] = useState(""); + const [filter_value, setfilter_value] = useState("d"); + + const [Getall_Qry_Inscription_Data_result_JSON, setGetall_Qry_Inscription_Data_result_JSON] = useState([]); + + const [Getall_Qry_Inscription_Data_api, setGetall_Qry_Inscription_Data_api] = useState(); + const [Getall_Qry_Inscription_Data_message, setGetall_Qry_Inscription_Data_message] = useState(); + const [Getall_Qry_Inscription_Data_result, setGetall_Qry_Inscription_Data_result] = useState([]); + function Getall_Qry_Inscription_Data(groupe_by) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + var date_from = ""; + if (p_filter_date_from) { + date_from = p_filter_date_from; + + } + + var date_to = ""; + if (p_filter_date_to) { + date_to = p_filter_date_to; + + } + + + form.append("token", stored_cookie); + form.append("session_start_date", date_from); + form.append("session_end_date", date_to); + form.append("filter_value", filter_value); + + + + var myurl = ""; + if (String(groupe_by) === "class") + myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_Group_By_Class/"; + else if (String(groupe_by) === "session") + myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_Group_By_Session/"; + else if (String(groupe_by) === "periode_cumule") + myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_By_Session_By_Periode_cumule/"; + else + myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_By_Session_By_Periode/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Qry_Inscription_Data res.data.status = " + res.data.status); + //console.log(" In Getall_Qry_Inscription_Data res.data.message r_class = " + res.data.message); + + setGetall_Qry_Inscription_Data_result_JSON(JSON.parse('[' + res.data.message + ']')); + + var jsonObj = JSON.parse('[' + res.data.message + ']'); + + //console.log(" ### jsonObj = ", jsonObj) + + setGetall_Qry_Inscription_Data_api("true"); + setGetall_Qry_Inscription_Data_result(res.data.message); + + + } + else { + setGetall_Qry_Inscription_Data_api("false"); + setGetall_Qry_Inscription_Data_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Qry_Inscription_Data = ', error); + setGetall_Qry_Inscription_Data_api("false"); + alert("Impossible de récuperer les données demandées") + //setmyApimyApiMessage("") + }) + } + + const chartSetting = { + yAxis: [ + { + label: " ", + }, + ], + width: 1100, + height: 400, + + margin: 100, + }; + + const chartSetting_V2 = { + yAxis: [ + { + label: " ", + }, + ], + width: 1100, + height: 600, + + margin: 100, + }; + + + function display_inscrit_by_periode() { + setfilter_group_by(""); + Getall_Qry_Inscription_Data(""); + } + + function display_inscrit_by_formation() { + setfilter_group_by("class"); + Getall_Qry_Inscription_Data("class"); + } + + function display_inscrit_by_session() { + setfilter_group_by("session"); + Getall_Qry_Inscription_Data("session"); + } + + + function display_inscrit_by_periode_cumule() { + setfilter_group_by("periode_cumule"); + Getall_Qry_Inscription_Data("periode_cumule"); + } + + + const [Getall_Qry_Formation_Session_result_JSON, setGetall_Qry_Formation_Session_result_JSON] = useState([]); + const [Getall_Qry_Formation_Session_api, setGetall_Qry_Formation_Session_api] = useState(); + const [Getall_Qry_Formation_Session_message, setGetall_Qry_Formation_Session_message] = useState(); + const [Getall_Qry_Formation_Session_result, setGetall_Qry_Formation_Session_result] = useState([]); + function Getall_Qry_Formation_Session(session_groupe_by) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + var date_from = ""; + if (p_filter_date_from) { + date_from = p_filter_date_from; + + } + + var date_to = ""; + if (p_filter_date_to) { + date_to = p_filter_date_to; + + } + + + form.append("token", stored_cookie); + form.append("session_start_date", date_from); + form.append("session_end_date", date_to); + form.append("filter_value", filter_value); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Session_By_Periode_V2/"; + + if (String(session_groupe_by) === "periode_cumule") + myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Session_By_Periode_Cumule_V2/"; + + else if (String(session_groupe_by) === "class") + myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Session_By_Formation_V2/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + console.log(" In Getall_Qry_Formation_Session res.data.status = " + res.data.status); + console.log(" In Getall_Qry_Formation_Session res.data.message r_class = " + res.data.message); + + + setGetall_Qry_Formation_Session_result_JSON(JSON.parse('[' + res.data.message + ']')); + + var jsonObj = JSON.parse('[' + res.data.message + ']'); + + + setGetall_Qry_Formation_Session_api("true"); + setGetall_Qry_Formation_Session_result(res.data.message); + + console.log(" Getall_Qry_Formation_Session_result_JSON = ", Getall_Qry_Formation_Session_result_JSON); + + + } + else { + setGetall_Qry_Formation_Session_api("false"); + setGetall_Qry_Formation_Session_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Qry_Formation_Session = ', error); + setGetall_Qry_Formation_Session_api("false"); + alert("Impossible de récuperer les données demandées") + //setmyApimyApiMessage("") + }) + } + + const [filter_session_group_by, setfilter_session_group_by] = useState(""); + + function display_session_by_periode() { + setfilter_session_group_by(""); + Getall_Qry_Formation_Session(""); + } + + + function display_session_by_formation() { + setfilter_session_group_by("class"); + Getall_Qry_Formation_Session("class"); + } + + + function display_session_by_periode_cumule() { + setfilter_session_group_by("periode_cumule"); + Getall_Qry_Formation_Session("periode_cumule"); + } + + + const [Getall_Qry_Session_Data_result_JSON, setGetall_Qry_Session_Data_result_JSON] = useState([]); + const [Getall_Qry_Session_Data_api, setGetall_Qry_Session_Data_api] = useState(); + const [Getall_Qry_Session_Data_message, setGetall_Qry_Session_Data_message] = useState(); + const [Getall_Qry_Session_Data_result, setGetall_Qry_Session_Data_result] = useState([]); + function Getall_Qry_Session_Data(event) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + var date_from = ""; + if (p_filter_date_from) { + date_from = p_filter_date_from; + + } + + var date_to = ""; + if (p_filter_date_to) { + date_to = p_filter_date_to; + + } + + form.append("token", stored_cookie); + form.append("session_start_date", date_from); + form.append("session_end_date", date_to); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Session_Data/"; + + //console.log(" ### form = ", form); + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Qry_Session_Data res.data.status = " + res.data.status); + //console.log(" In Getall_Qry_Session_Data res.data.message r_class = " + res.data.message); + setGetall_Qry_Session_Data_result_JSON(JSON.parse('[' + res.data.message + ']')); + + var jsonObj = JSON.parse('[' + res.data.message + ']'); + + setGetall_Qry_Session_Data_api("true"); + setGetall_Qry_Session_Data_result(res.data.message); + + + } + else { + setGetall_Qry_Session_Data_api("false"); + setGetall_Qry_Session_Data_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Qry_Session_Data = ', error); + setGetall_Qry_Session_Data_api("false"); + alert("Impossible de récuperer les données demandées") + //setmyApimyApiMessage("") + }) + } + + const [Getall_Qry_Session_Taux_Remplissage_result_JSON, setGetall_Qry_Session_Taux_Remplissage_result_JSON] = useState([]); + const [Getall_Qry_Session_Taux_Remplissage_api, setGetall_Qry_Session_Taux_Remplissage_api] = useState(); + const [Getall_Qry_Session_Taux_Remplissage_message, setGetall_Qry_Session_Taux_Remplissage_message] = useState(); + const [Getall_Qry_Session_Taux_Remplissage_result, setGetall_Qry_Session_Taux_Remplissage_result] = useState([]); + function Getall_Qry_Session_Taux_Remplissage(session_groupe_by) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + var date_from = ""; + if (p_filter_date_from) { + date_from = p_filter_date_from; + + } + + var date_to = ""; + if (p_filter_date_to) { + date_to = p_filter_date_to; + + } + + + form.append("token", stored_cookie); + form.append("session_start_date", date_from); + form.append("session_end_date", date_to); + form.append("filter_value", filter_value); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Taux_Remplissage_Session_Data_V2/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Qry_Session_Taux_Remplissage res.data.status = " + res.data.status); + //console.log(" In Getall_Qry_Session_Taux_Remplissage res.data.message r_class = " + res.data.message); + + + setGetall_Qry_Session_Taux_Remplissage_result_JSON(JSON.parse('[' + res.data.message + ']')); + + var jsonObj = JSON.parse('[' + res.data.message + ']'); + + + + setGetall_Qry_Session_Taux_Remplissage_api("true"); + setGetall_Qry_Session_Taux_Remplissage_result(res.data.message); + + + } + else { + setGetall_Qry_Session_Taux_Remplissage_api("false"); + setGetall_Qry_Session_Taux_Remplissage_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Qry_Session_Taux_Remplissage = ', error); + setGetall_Qry_Session_Taux_Remplissage_api("false"); + alert("Impossible de récuperer les données demandées") + //setmyApimyApiMessage("") + }) + } + + + + const [p_detail_partner_client_id, setp_detail_partner_client_id] = useState(""); + const [p_detail_partner_client_nom, setp_detail_partner_client_nom] = useState(""); + + + const [Getall_Qry_Invoice_Data_result_JSON, setGetall_Qry_Invoice_Data_result_JSON] = useState([]); + const [Getall_Qry_Invoice_Data_api, setGetall_Qry_Invoice_Data_api] = useState(); + const [Getall_Qry_Invoice_Data_message, setGetall_Qry_Invoice_Data_message] = useState(); + const [Getall_Qry_Invoice_Data_result, setGetall_Qry_Invoice_Data_result] = useState([]); + function Getall_Qry_Invoice_Data(local_group_by) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + var date_from = ""; + if (p_filter_date_from) { + date_from = p_filter_date_from; + + } + + var date_to = ""; + if (p_filter_date_to) { + date_to = p_filter_date_to; + + } + + + form.append("token", stored_cookie); + form.append("periode_start_date", date_from); + form.append("periode_end_date", date_to); + form.append("filter_value", filter_value); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Factures_Data_By_Periode/"; + + if (local_group_by === "class") + myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Factures_Data_By_Class/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Qry_Invoice_Data res.data.status = " + res.data.status); + //console.log(" In Getall_Qry_Invoice_Data res.data.message r_class = " + res.data.message); + + setGetall_Qry_Invoice_Data_result_JSON(JSON.parse('[' + res.data.message + ']')); + + var jsonObj = JSON.parse('[' + res.data.message + ']'); + + //console.log("jsonObj = ", jsonObj) + + setGetall_Qry_Invoice_Data_api("true"); + setGetall_Qry_Invoice_Data_result(res.data.message); + + + } + else { + setGetall_Qry_Invoice_Data_api("false"); + setGetall_Qry_Invoice_Data_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Qry_Invoice_Data = ', error); + setGetall_Qry_Invoice_Data_api("false"); + alert("Impossible de récuperer les données demandées") + //setmyApimyApiMessage("") + }) + } + + const valueFormatter_CA = (value) => `${value}€`; + + + const [filter_invoice_group_by, setfilter_invoice_group_by] = useState("periode"); + + + function display_invoice_by_formation() { + setfilter_invoice_group_by("class"); + Getall_Qry_Invoice_Data("class"); + } + + function display_invoice_by_periode() { + setfilter_invoice_group_by("periode"); + Getall_Qry_Invoice_Data(""); + } + + + function display_invoice_by_session() { + setfilter_invoice_group_by("class"); + Getall_Qry_Invoice_Data("class"); + } + + + function display_invoice_by_periode_cumule() { + setfilter_invoice_group_by("class"); + Getall_Qry_Invoice_Data("class"); + } + + return (
{isLoading &&
} -

Mon tableau de bord

+ + +
+ +
+
+ Filtre
+ + { + if (value && value.value) { + setfilter_value(value.value); + + } else { + setfilter_value(""); + } - {/* Gestion des TBD des Inscriptions */} + }} - {display_nb_column &&
- {Get_Connected_User_Dashbord_result && - Get_Connected_User_Dashbord_result.map((step) => ( + renderInput={(params) => + } + /> + + +
+ + {filter_value && String(filter_value) === "d" && +
+
+
+ Date Debut + { + setp_filter_date_from(format(date, 'dd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style" + locale='fr-FR' + + /> + +
+
+ +
+
+ Date Fin + { + setp_filter_date_to(format(date, 'dd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style" + /> + +
+
+ +
} + +
+
+ +
+
+ + +
+ + {String(submenu) === String("rapport_financier") &&
+

Rapports Financiers

+ + +
+ {Getall_Qry_Invoice_Data_result_JSON && Getall_Qry_Invoice_Data_result_JSON.length > 0 && + Getall_Qry_Invoice_Data_result_JSON[0].data && +
+
Le Chiffre d'affaire
+
+ + + + + + +
+ + {filter_invoice_group_by && String(filter_invoice_group_by) === "periode" && } + + + {filter_invoice_group_by && String(filter_invoice_group_by) === "class" && + { + if (month) { + if (String(month).length < 4) { + return `${month.slice(0, 4)}` + } + + else if (String(month).length >= 4 && String(month).length <= 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, String(month).length)}` + } + else if (String(month).length > 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, 8)}` + " \n" + `${month.slice(8, 12)}` + } + } + + + }, + }]} + series={[ + { dataKey: 'TotalAmount_HT', label: 'CA HT', valueFormatter_CA }, + + + ]} + {...chartSetting} + margin={{ right: 15, left: 100 }} + + + />} +
+ } + +
+
+
} + + {String(submenu) === String("rapport_activite") &&
+

Rapport d'activité

+ +
+ + {Getall_Qry_Inscription_Data_result_JSON && Getall_Qry_Inscription_Data_result_JSON.length > 0 && + Getall_Qry_Inscription_Data_result_JSON[0].data && +
+
Les Inscriptions
+
+ + + + + + +
+ + + + { + + if (month) { + if (String(month).length < 4) { + return `${month.slice(0, 4)}` + } + + else if (String(month).length >= 4 && String(month).length <= 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, String(month).length)}` + } + + else if (String(month).length > 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, 8)}` + " \n" + `${month.slice(8, 12)}` + } + } + + }, + + }] + } + + series={[ + + { dataKey: 'count', label: 'Nb Inscrits', valueFormatter_count, color: '#1a75ff', }, + + ]} + {...chartSetting} + margin={{ right: 15, left: 100 }} -
- {String(JSON.parse(step).dashbord_internal_code) === "tbd_inscription_01" && -
-
} +
+
+ + + {Getall_Qry_Formation_Session_result_JSON && Getall_Qry_Formation_Session_result_JSON.length > 0 && + Getall_Qry_Formation_Session_result_JSON[0].data && +
+
Les Sessions de formation
+ +
+ + + + + +
+ + + + { + if (month) { + if (String(month).length < 4) { + return `${month.slice(0, 4)}` + } + + else if (String(month).length >= 4 && String(month).length <= 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, String(month).length)}` + } + + else if (String(month).length > 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, 8)}` + " \n" + `${month.slice(8, 12)}` + } + } + }, + } + ] + } + + series={[ + + { dataKey: 'count', label: 'Nb Sessions', valueFormatter_count, color: '#00802b', }, + + ]} + {...chartSetting} + margin={{ right: 15, left: 100 }} + + + /> +
+ } + +
+
+ + {Getall_Qry_Session_Taux_Remplissage_result_JSON[0] && Getall_Qry_Session_Taux_Remplissage_result_JSON[0].taux_replissage && + Getall_Qry_Session_Taux_Remplissage_result_JSON[0].taux_non_replissage && +
+
Taux de remplissage des sessions
+ +   + + + { + + if (month) { + if (String(month).length < 4) { + return `${month.slice(0, 4)}` + } + + else if (String(month).length >= 4 && String(month).length <= 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, String(month).length)}` + } + + else if (String(month).length > 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, 8)}` + " \n" + `${month.slice(8, 12)}` + } + } + + } + }]} + {...chartSetting_V2} + margin={{ right: 15, left: 100 }} + + + /> + + + +
}
- ))} -
} + + + +
} + + {String(submenu) === String("montbd") &&
+ +

Mon tableau de bord

+ +
 
+ + + + {/* Gestion des TBD des Inscriptions */} + + {display_nb_column &&
+ {Get_Connected_User_Dashbord_result && + Get_Connected_User_Dashbord_result.map((step) => ( + +
+ {String(JSON.parse(step).dashbord_internal_code) === "tbd_inscription_01" && +
+ +
+ } + + +
+ + ))} +
} + + {/* Gestion des TBD des sessions et formations */} + {display_nb_column &&
+ {Get_Connected_User_Dashbord_result && + Get_Connected_User_Dashbord_result.map((step) => ( + +
+ + {String(JSON.parse(step).dashbord_internal_code) === "tbd_code_session_01" && +
+ + +
+ } + + {String(JSON.parse(step).dashbord_internal_code) === "tbd_code_session_02" && + +
+ +
+ } + + + {String(JSON.parse(step).dashbord_internal_code) === "tbd_code_session_03" && +
+ + +
+ } + + {String(JSON.parse(step).dashbord_internal_code) === "tbd_code_formation_01" && +
+ + +
+ } + + +
+ + ))} +
} + + + + {/* Gestion des TBD des factures */} + {display_nb_column &&
+ {Get_Connected_User_Dashbord_result && + Get_Connected_User_Dashbord_result.map((step) => ( + +
+ + + {String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_01" && +
+ +
+ } + + {String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_02" && +
+ +
+ } + + {String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_03" && +
+ +
+ } + + + {String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_04" && +
+ +
+ } + + + +
+ + ))} +
} + + {/* Gestion des TBD des ressources humaines */} + {display_nb_column &&
+ {Get_Connected_User_Dashbord_result && + Get_Connected_User_Dashbord_result.map((step) => ( + +
+ + + + {String(JSON.parse(step).dashbord_internal_code) === "tbd_rh_01" && + + } + + {String(JSON.parse(step).dashbord_internal_code) === "tbd_rh_02" && + + } + + + + +
+ + ))} +
} + + + {String(Get_Connected_User_Dashbord_api) === "true" && (!Get_Connected_User_Dashbord_result || Get_Connected_User_Dashbord_result.length <= 0) &&
- {/* Gestion des TBD des sessions et formations */} - {display_nb_column &&
- {Get_Connected_User_Dashbord_result && - Get_Connected_User_Dashbord_result.map((step) => (
- - {String(JSON.parse(step).dashbord_internal_code) === "tbd_code_session_01" && -
- - -
- } - - {String(JSON.parse(step).dashbord_internal_code) === "tbd_code_session_02" && - -
- -
- } - - - {String(JSON.parse(step).dashbord_internal_code) === "tbd_code_session_03" && -
- - -
- } - - {String(JSON.parse(step).dashbord_internal_code) === "tbd_code_formation_01" && -
- - -
- } - +

Pour utiliser votre tableau de bord, Merci de le configurer à partir du menu : "Configuration" == > "Tableau de bord"

- ))} -
} - - - - {/* Gestion des TBD des factures */} - {display_nb_column &&
- {Get_Connected_User_Dashbord_result && - Get_Connected_User_Dashbord_result.map((step) => ( - -
- - - {String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_01" && -
- -
- } - - {String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_02" && -
- -
- } - - {String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_03" && -
- -
- } - - - {String(JSON.parse(step).dashbord_internal_code) === "tbd_facture_04" && -
- -
- } - - - -
- - ))} -
} - - {/* Gestion des TBD des ressources humaines */} - {display_nb_column &&
- {Get_Connected_User_Dashbord_result && - Get_Connected_User_Dashbord_result.map((step) => ( - -
- - - - {String(JSON.parse(step).dashbord_internal_code) === "tbd_rh_01" && - - } - - {String(JSON.parse(step).dashbord_internal_code) === "tbd_rh_02" && - - } - - - - -
- - ))} -
} - - - {String(Get_Connected_User_Dashbord_api) === "true" && (!Get_Connected_User_Dashbord_result || Get_Connected_User_Dashbord_result.length <= 0) &&
- - -
-

Pour utiliser votre tableau de bord, Merci de le configurer à partir du menu : "Configuration" == > "Tableau de bord"

- -
- -
} - +
} +
} +
) diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index 143c580..f8f0262 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -64,17 +64,17 @@ const Partner_Commande = (props) => { var date_today_90j = new Date(); date_today_90j.setDate(date_today_90j.getDate() + 90); - const [p_filtre1, setp_filtre1] = useState(); - const [p_filtre1_value, setp_filtre1_value] = useState(); + const [p_filtre1, setp_filtre1] = useState(""); + const [p_filtre1_value, setp_filtre1_value] = useState(""); - const [p_filtre2, setp_filtre2] = useState(); - const [p_filtre2_value, setp_filtre2_value] = useState(); + const [p_filtre2, setp_filtre2] = useState(""); + const [p_filtre2_value, setp_filtre2_value] = useState(""); - const [p_filtre3, setp_filtre3] = useState(); - const [p_filtre3_value, setp_filtre3_value] = useState(); + const [p_filtre3, setp_filtre3] = useState(""); + const [p_filtre3_value, setp_filtre3_value] = useState(""); - const [p_filtre4, setp_filtre4] = useState(); - const [p_filtre4_value, setp_filtre4_value] = useState(); + const [p_filtre4, setp_filtre4] = useState(""); + const [p_filtre4_value, setp_filtre4_value] = useState(""); function ExpandableCell_50({ value }) { const [expanded, setExpanded] = React.useState(false); @@ -460,16 +460,16 @@ const Partner_Commande = (props) => { function clean_all_filters() { - setp_filtre1(); + setp_filtre1(""); setp_filtre1_value(); - setp_filtre2(); + setp_filtre2(""); setp_filtre2_value(); - setp_filtre3(); + setp_filtre3(""); setp_filtre3_value(); - setp_filtre4(); + setp_filtre4(""); setp_filtre4_value(); clean_order_detail_fields(); @@ -482,6 +482,8 @@ const Partner_Commande = (props) => { setselectionModel_order_lines([]); Getall_Parter_Orders_No_Filter(); + + setgridline_id(""); } @@ -3820,6 +3822,16 @@ const Partner_Commande = (props) => { }; + const New_Option_Filter = [ + { "id": "ref_interne", "label": "Ref. Interne", "value": "ref_interne" }, + { "id": "ref_externe", "label": "Ref. Externe (chez le client)", "value": "ref_externe" }, + { "id": "client_nom", "label": "Nom Client", "value": "client_nom" }, + { "id": "formation", "label": "Lié à la Formation (code externe)", "value": "formation" }, + { "id": "code_session", "label": "Lié à la session (code session)", "value": "code_session" }, + { "id": "", "label": "", "value": "" }, + { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres. + ] + return ( @@ -4661,7 +4673,7 @@ const Partner_Commande = (props) => {
Utilisez les filtres !
- { -
+ +*/} + +{New_Option_Filter && New_Option_Filter.length > 0 && (data).value === String(p_filtre1))[0].label} + options={New_Option_Filter} + onChange={(event, value) => { + if (value && value.value) { + setp_filtre1(value.value); + }else{ + setp_filtre1(""); + } + + }} + + renderInput={(params) => + } + />} +
@@ -4728,7 +4765,7 @@ const Partner_Commande = (props) => {   { - setp_filtre1(); + setp_filtre1(""); setp_filtre1_value(); }} /> @@ -4741,25 +4778,27 @@ const Partner_Commande = (props) => { {p_filtre2 &&
- 0 && (data).value === String(p_filtre2))[0].label} + options={New_Option_Filter} + onChange={(event, value) => { + if (value && value.value) { + setp_filtre2(value.value); - value={p_filtre2} - onChange={(e) => { - setp_filtre2(e.target.value); + } }} - > - Ref. Interne   - Ref. Externe (chez le client)   - Nom Client   - Lié a la Formation (code externe)   - Lié à la session (code session)   - + renderInput={(params) => + } + />}
{String(p_filtre2).length > 2 && @@ -4808,7 +4847,7 @@ const Partner_Commande = (props) => {   { - setp_filtre2(); + setp_filtre2(""); setp_filtre2_value(); }} /> @@ -4822,24 +4861,27 @@ const Partner_Commande = (props) => { {p_filtre3 &&
- 0 && (data).value === String(p_filtre3))[0].label} + options={New_Option_Filter} + onChange={(event, value) => { + if (value && value.value) { + setp_filtre3(value.value); + + } - value={p_filtre3} - onChange={(e) => { - setp_filtre3(e.target.value) }} - > - Ref. Interne   - Ref. Externe (chez le client)   - Nom Client   - Lié a la Formation (code externe)   - Lié à la session (code session)   - + renderInput={(params) => + } + />}
{String(p_filtre3).length > 2 && @@ -4887,7 +4929,7 @@ const Partner_Commande = (props) => {   { - setp_filtre3(); + setp_filtre3(""); setp_filtre3_value(); }} /> diff --git a/src/components/Partner_Config_Formulaires.js b/src/components/Partner_Config_Formulaires.js index ef3030d..48ddf43 100644 --- a/src/components/Partner_Config_Formulaires.js +++ b/src/components/Partner_Config_Formulaires.js @@ -974,14 +974,14 @@ const Partner_Config_Formulaires = (props) => { const [selected_question_id, setselected_question_id] = useState(""); const [question_question, setquestion_question] = useState(""); const [question_type, setquestion_type] = useState(""); - const [question_max_note, setquestion_max_note] = useState(""); + const [question_max_note, setquestion_max_note] = useState("2"); function Ajouter_Question() { setselected_question_id(""); setquestion_question(""); setquestion_type(""); - setquestion_max_note(""); + setquestion_max_note("2"); setDialog_Question_open(true); settab_qcm_choix([]); @@ -1012,6 +1012,20 @@ const Partner_Config_Formulaires = (props) => { form.append("type", question_type); form.append("max_note", question_max_note); + if (String(question_type) === "note") { + + if( String(question_max_note) === ""){ + alert(" La note maximale doit être un entier supérieur à 1"); + return; + } + + if (isNaN(Number(question_max_note))) { + alert(" La note maximale doit être un entier supérieur à 1"); + return; + } + } + + if (statistic_checked === true) { form.append("is_statistic", "1"); } else { @@ -1062,7 +1076,7 @@ const Partner_Config_Formulaires = (props) => { setselected_question_id(""); setquestion_question(""); setquestion_type(""); - setquestion_max_note(""); + setquestion_max_note("2"); settab_qcm_choix([]); setadd_new_qcm_choix(""); setnew_qcm_choix_value(""); @@ -1144,7 +1158,7 @@ const Partner_Config_Formulaires = (props) => { setselected_question_id(""); setquestion_question(""); setquestion_type(""); - setquestion_max_note(""); + setquestion_max_note("2"); Get_Given_Formulaire_Data(selected_id); @@ -1322,10 +1336,14 @@ const Partner_Config_Formulaires = (props) => { name="field_question_question" fullWidth - type="intger" + type="number" + InputProps={{ inputProps: { min: 2, max: 21 } }} value={question_max_note} onChange={(e) => { - setquestion_max_note(e.target.value); + + if (!isNaN(Number((e.target.value)))) { + setquestion_max_note(e.target.value); + } } } @@ -1464,10 +1482,10 @@ const Partner_Config_Formulaires = (props) => { - +