diff --git a/src/components/Dashbord_Factures.js b/src/components/Dashbord_Factures.js index 8adb2c2..1c006d1 100644 --- a/src/components/Dashbord_Factures.js +++ b/src/components/Dashbord_Factures.js @@ -584,8 +584,8 @@ const Dashbord_Factures = (props) => { }} /> -
-
+
+
Filtre
{ {filter_value && String(filter_value) === "d" && -
-
- Date Debut - +
+
+ Date Debut + { - setp_filter_date_from(format(date, 'dd/MM/yyyy')); + selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))} + onChange={(date) => { + 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' + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style" + locale='fr-FR' - /> + /> +
-
- Date Fin - { - setp_filter_date_to(format(date, 'dd/MM/yyyy')); +
+
+ Date Fin + { + setp_filter_date_to(format(date, 'dd/MM/yyyy')); - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style enable_style" - /> + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style" + /> +

} -
-
+
+
Client
{New_Get_List_Partner_Clients_result && New_Get_List_Partner_Clients_result.length > 0 && @@ -695,14 +699,16 @@ const Dashbord_Factures = (props) => {

+
-
+ }}> Afficher +
+
@@ -941,7 +947,7 @@ const Dashbord_Factures = (props) => {
 
-
) +
) } diff --git a/src/components/Dashbord_Factures_Par_Client.js b/src/components/Dashbord_Factures_Par_Client.js index 3fc218e..67aaf73 100644 --- a/src/components/Dashbord_Factures_Par_Client.js +++ b/src/components/Dashbord_Factures_Par_Client.js @@ -407,8 +407,7 @@ const Dashbord_Factures_Par_Client = (props) => { var url = process.env.REACT_APP_API_URL + "myclass/api/TBD_FACTURE_01_Export_Dashbord_To_Excel/" + stored_cookie + "/" + local_dashbord_internal_id + "/" + date_from + "/" + date_to + "/" + local_client_id + "/"; //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url); - console.log(" ### url zzz = ", url); - + setLoading(true); axios.get(url, { responseType: 'blob', },) .then((res) => { @@ -432,6 +431,15 @@ const Dashbord_Factures_Par_Client = (props) => { 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 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" }, + + ] + + return (
{isLoading &&
@@ -441,126 +449,132 @@ const Dashbord_Factures_Par_Client = (props) => {
-
-
- Filtre
- { - setfilter_value(e.target.value); - } +
+
+ Filtre
+ + { + if (value && value.value) { + setfilter_value(value.value); + + } else { + setfilter_value(""); } + }} - > - Mois en cours    - Mois précédant   - Choisir des dates   - -
+ renderInput={(params) => -
- Date Debut - + } + /> - selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))} - onChange={(date) => { - 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' + {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')); +
+
+ Date Fin + { + setp_filter_date_to(format(date, 'dd/MM/yyyy')); - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style enable_style" - /> + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style" + /> +

-
- Client
- - {New_Get_List_Partner_Clients_result && New_Get_List_Partner_Clients_result.length > 0 && - - (data)._id === String(p_detail_partner_client_id))[0].label} - - onChange={(event, value) => { - if (value && value._id) { - - setp_detail_partner_client_id(value._id); - - setp_detail_partner_client_nom(value.label); - - - - } else { - setp_detail_partner_client_id(""); - setp_detail_partner_client_nom(""); - } - - Getall_Qry_Invoice_Data(); - - }} - - renderInput={(params) => - } - />} -
-
} -
+
+
+ Client
+ + {New_Get_List_Partner_Clients_result && New_Get_List_Partner_Clients_result.length > 0 && + + (data)._id === String(p_detail_partner_client_id))[0].label} + + onChange={(event, value) => { + if (value && value._id) { + + setp_detail_partner_client_id(value._id); + setp_detail_partner_client_nom(value.label); + + } else { + setp_detail_partner_client_id(""); + setp_detail_partner_client_nom(""); + } + + }} + + renderInput={(params) => + } + />} +
+ +
+
+

- +
@@ -629,7 +643,7 @@ const Dashbord_Factures_Par_Client = (props) => {
-
+
  diff --git a/src/components/Dashbord_Factures_Par_Periode.js b/src/components/Dashbord_Factures_Par_Periode.js index 134ac75..80d5cfa 100644 --- a/src/components/Dashbord_Factures_Par_Periode.js +++ b/src/components/Dashbord_Factures_Par_Periode.js @@ -94,7 +94,7 @@ const Dashbord_Factures_Par_Periode = (props) => { setRemove_From_User_TBD_api("true"); setRemove_From_User_TBD_result(res.data.message); - // Getall_Qry_Formation_Session(); + // Getall_Qry_Formation_Session(); alert(res.data.message); window.location.reload(); @@ -288,22 +288,22 @@ const Dashbord_Factures_Par_Periode = (props) => { var local_client_id = ""; - if( !p_detail_partner_client_id || String(p_detail_partner_client_id) === ""){ + if (!p_detail_partner_client_id || String(p_detail_partner_client_id) === "") { local_client_id = "-" - }else{ + } else { local_client_id = p_detail_partner_client_id; - } + } console.log(" #### p_detail_partner_client_id = ", p_detail_partner_client_id, " ### local_client_id = ", local_client_id) var nom_fichier_cmd_excel = "export_excel.xlsx"; //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- local_dashbord_internal_id = ", local_dashbord_internal_id); - var url = process.env.REACT_APP_API_URL + "myclass/api/TBD_FACTURE_01_Export_Dashbord_To_Excel/" + stored_cookie + "/" + local_dashbord_internal_id+"/"+date_from+"/"+date_to+"/"+local_client_id+"/"; + var url = process.env.REACT_APP_API_URL + "myclass/api/TBD_FACTURE_01_Export_Dashbord_To_Excel/" + stored_cookie + "/" + local_dashbord_internal_id + "/" + date_from + "/" + date_to + "/" + local_client_id + "/"; //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url); - + console.log(" #### url = ", url) - + setLoading(true); axios.get(url, { responseType: 'blob', },) .then((res) => { @@ -328,7 +328,7 @@ const Dashbord_Factures_Par_Periode = (props) => { useEffect(() => { Getall_Qry_Invoice_Data(); Get_List_Partner_Clients(); - + window.scrollTo({ top: 0, behavior: "smooth", @@ -415,11 +415,18 @@ const Dashbord_Factures_Par_Periode = (props) => { }) } - + 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 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" }, + + ] + return (
{isLoading &&
@@ -429,75 +436,84 @@ const Dashbord_Factures_Par_Periode = (props) => {
-
-
+
+
Filtre
- { - setfilter_value(e.target.value); - } - } + options={New_option_periode} + onChange={(event, value) => { + if (value && value.value) { + setfilter_value(value.value); + + } else { + setfilter_value(""); + } + }} + + renderInput={(params) => + } + /> - > - Mois en cours    - Mois précédant   - Choisir des dates   -
- {filter_value && String(filter_value) === "d" &&
-
- Date Debut - { - setp_filter_date_from(format(date, 'dd/MM/yyyy')); +
+
+
+ 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 enable_style" - /> +
+
+ Date Fin + { + setp_filter_date_to(format(date, 'dd/MM/yyyy')); -
+ } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style" + /> -
-
+
+
+ +
+
} +
+
Client
{New_Get_List_Partner_Clients_result && New_Get_List_Partner_Clients_result.length > 0 && @@ -517,17 +533,12 @@ const Dashbord_Factures_Par_Periode = (props) => { setp_detail_partner_client_id(value._id); setp_detail_partner_client_nom(value.label); - - // console.log(" ### setp_detail_partner_client_id = ", p_detail_partner_client_id ); - } else { setp_detail_partner_client_id(""); setp_detail_partner_client_nom(""); } - Getall_Qry_Invoice_Data(); - }} renderInput={(params) => { />}
-
} +

+
-
+
+
-
@@ -621,7 +631,7 @@ const Dashbord_Factures_Par_Periode = (props) => {
- {p_detail_partner_client_nom && String(p_detail_partner_client_nom) !== "" && " Client : " + p_detail_partner_client_nom } + {p_detail_partner_client_nom && String(p_detail_partner_client_nom) !== "" && " Client : " + p_detail_partner_client_nom} {Getall_Qry_Invoice_Data_result_JSON && Getall_Qry_Invoice_Data_result_JSON.length > 0 && Getall_Qry_Invoice_Data_result_JSON[0].data && @@ -636,7 +646,7 @@ const Dashbord_Factures_Par_Periode = (props) => { ]} {...chartSetting} - margin={{right: 15, left: 100}} + margin={{ right: 15, left: 100 }} />}
diff --git a/src/components/Dashbord_Inscription.js b/src/components/Dashbord_Inscription.js index 587e5db..49f54e7 100644 --- a/src/components/Dashbord_Inscription.js +++ b/src/components/Dashbord_Inscription.js @@ -181,7 +181,7 @@ const Dashbord_Inscriptions = (props) => { var tdb_title = "default"; var filter_val = ""; - var filter_type_event = ""; + var local_filter_group_by = ""; if (document.getElementsByName("tdb_title")[0]) { @@ -196,8 +196,8 @@ const Dashbord_Inscriptions = (props) => { filter_val = filter_value } - if (document.getElementsByName("filtre12")[0]) { - filter_type_event = document.getElementsByName("filtre12")[0].value; + if (filter_group_by) { + local_filter_group_by = filter_group_by; } // Si filter_val = "d", alors on va recuperer l'interval de date @@ -215,7 +215,7 @@ const Dashbord_Inscriptions = (props) => { form.append("dashbord_internal_code", local_dashbord_internal_code); form.append("default_filter", filter_val); form.append("title", tdb_title); - form.append("type_event", filter_type_event); + form.append("group_by", local_filter_group_by); @@ -274,6 +274,7 @@ const Dashbord_Inscriptions = (props) => { { "id": "mois", "label": "Mois", "value": "mois" }, { "id": "class", "label": "Formation", "value": "class" }, { "id": "session", "label": "Session", "value": "session" }, + { "id": "", "label": "", "value": "" }, ] @@ -325,8 +326,8 @@ const Dashbord_Inscriptions = (props) => { }} />
-
-
+
+
Filtre
{ setfilter_value(""); } - + }} renderInput={(params) => {
- {filter_value && String(filter_value) === "d" &&
-
- Date Debut - +
+
+ Date Debut + { - setp_filter_date_from(format(date, 'dd/MM/yyyy')); + selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))} + onChange={(date) => { + 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' + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style" + locale='fr-FR' - /> + /> -
+
+
-
- Date Fin - { - setp_filter_date_to(format(date, 'dd/MM/yyyy')); +
+
+ Date Fin + { + setp_filter_date_to(format(date, 'dd/MM/yyyy')); - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style enable_style" - /> + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style" + /> -
+
+
-
} +
}
-
- Grouper par
- { - if (value && value.value) { - setfilter_group_by(value.value); +
+
+ Grouper par
+ (data).value === String(filter_group_by))[0].label} + onChange={(event, value) => { + if (value && value.value) { + setfilter_group_by(value.value); - } else { - setfilter_group_by(""); + } else { + setfilter_group_by(""); + } + + }} + + renderInput={(params) => } - - }} - - renderInput={(params) => - } - /> - +
+
+
- + }}> Afficher +
+
diff --git a/src/components/Dashbord_Inscription_All_Inscription.js b/src/components/Dashbord_Inscription_All_Inscription.js index a2533d5..29e5343 100644 --- a/src/components/Dashbord_Inscription_All_Inscription.js +++ b/src/components/Dashbord_Inscription_All_Inscription.js @@ -1,26 +1,38 @@ import React, { useRef, useState, useEffect } from "react"; +import TextField from '@mui/material/TextField'; +import MenuItem from '@mui/material/MenuItem'; 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 "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; import 'react-tooltip/dist/react-tooltip.css' import { Tooltip } from 'react-tooltip' -import fileDownload from 'js-file-download' -import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; +import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; +import { format } from 'date-fns' +import moment from "moment"; import Box from '@mui/material/Box'; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; -import { tokens } from "../theme"; -import { MdDeleteForever } from "react-icons/md"; import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; +import { tokens } from "./../theme"; +import { MdOutlineAddchart, } from "react-icons/md"; import { useTheme, } from "@mui/material"; - +import Autocomplete from '@mui/material/Autocomplete'; +import { ResponsivePie } from '@nivo/pie' import { ResponsiveBar } from "@nivo/bar"; +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"; const Dashbord_Inscriptions_all_inscriptions = (props) => { @@ -35,7 +47,6 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { var date_today_90j = new Date(); date_today_90j.setDate(date_today_90j.getDate() - 90); const [selectionModel, setSelectionModel] = React.useState([]); - const [user_dashbord_id, setuser_dashbord_id] = useState(props.user_dashbord_id); const columns = [ @@ -80,6 +91,8 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { const [filter_type_tache, setfilter_type_tache] = useState(""); + const [filter_group_by, setfilter_group_by] = useState(""); + const [tdb_title, settdb_title] = useState(); const [display_nb_column, setdisplay_nb_column] = useState("1"); @@ -89,6 +102,7 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { const [gridline_id, setgridline_id] = useState(""); 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([]); @@ -116,9 +130,15 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { form.append("filter_value", filter_value); - console.log(' #### Get_Qery_Inscription_By_Session_By_Periode form = ', form); + console.log(" LAAA filter_group_by = ", filter_group_by) - var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_By_Session_By_Periode/"; + var myurl = ""; + if (String(filter_group_by) === "class") + myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_Group_By_Class/"; + else if (String(filter_group_by) === "session") + myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_Group_By_Session/"; + 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 => { @@ -131,6 +151,8 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { 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); @@ -151,54 +173,6 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { }) } - - const [Remove_From_User_TBD_api, setRemove_From_User_TBD_api] = useState(); - const [Remove_From_User_TBD_message, setRemove_From_User_TBD_message] = useState(); - const [Remove_From_User_TBD_result, setRemove_From_User_TBD_result] = useState(); - function Remove_From_User_TBD() { - - var form = new FormData(); - const stored_cookie = getCookie('tokenmysypart'); - - - - form.append("token", stored_cookie); - form.append("user_dashbord_id", user_dashbord_id); - - var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_To_User_Dashbord/"; - - //console.log(" ## myurl = ", myurl); - - setLoading(true); - axios.post(myurl, form).then(res => { - setLoading(false); - if (String(res.data.status) === String("true")) { - //console.log(" In Remove_From_User_TBD res.data.status = " + res.data.status); - //console.log(" In Remove_From_User_TBD res.data.message r_class = " + res.data.message); - - setRemove_From_User_TBD_api("true"); - setRemove_From_User_TBD_result(res.data.message); - Getall_Qry_Inscription_Data(); - alert(res.data.message); - window.location.reload(); - - - } - else { - setRemove_From_User_TBD_api("false"); - setRemove_From_User_TBD_message(res.data.message); - alert(res.data.message) - } - - }).catch((error) => { - setLoading(false); - console.warn('Not good man :( Remove_From_User_TBD = ', error); - setRemove_From_User_TBD_api("false"); - alert("Impossible de supprimer le tableau de bord de votre liste"); - //setmyApimyApiMessage("") - }) - } - const [Add_To_User_TBD_api, setAdd_To_User_TBD_api] = useState(); const [Add_To_User_TBD_message, setAdd_To_User_TBD_message] = useState(); @@ -212,19 +186,23 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { var tdb_title = "default"; var filter_val = ""; - var filter_type_event = ""; + var local_filter_group_by = ""; if (document.getElementsByName("tdb_title")[0]) { tdb_title = document.getElementsByName("tdb_title")[0].value; } + /* if (document.getElementsByName("filtre11")[0]) { filter_val = document.getElementsByName("filtre11")[0].value; + }*/ + if (filter_value) { + filter_val = filter_value } - if (document.getElementsByName("filtre12")[0]) { - filter_type_event = document.getElementsByName("filtre12")[0].value; + if (filter_group_by) { + local_filter_group_by = filter_group_by; } // Si filter_val = "d", alors on va recuperer l'interval de date @@ -242,7 +220,7 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { form.append("dashbord_internal_code", local_dashbord_internal_code); form.append("default_filter", filter_val); form.append("title", tdb_title); - form.append("type_event", filter_type_event); + form.append("group_by", local_filter_group_by); @@ -279,15 +257,12 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { }) } - const [event_type_filter, setevent_type_filter] = useState(props.user_dashbord_filter_type_envent); - useEffect(() => { - console.log(" &&&& props.user_dashbord_filter_end = ", props.user_dashbord_filter_end); - setp_filter_date_from(props.user_dashbord_filter_start); setp_filter_date_to(props.user_dashbord_filter_end); - setevent_type_filter(props.user_dashbord_filter_type_envent); + setfilter_group_by(props.user_dashbord_filter_group_by); + Getall_Qry_Inscription_Data(); @@ -299,17 +274,128 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { }, [p_filter_date_from, p_filter_date_to]) + 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 valueFormatter_count = (value) => `${value} Insc`; + + const chartSetting = { + yAxis: [ + { + label: " Nombre d'inscription ", + }, + ], + width: 1000, + height: 400, + sx: { + [`.${axisClasses.left} .${axisClasses.label}`]: { + transform: 'translate(-20px, 0)', + }, + }, + margin: 100, + }; + + const [user_dashbord_id, setuser_dashbord_id] = useState(props.user_dashbord_id); + + const [Remove_From_User_TBD_api, setRemove_From_User_TBD_api] = useState(); + const [Remove_From_User_TBD_message, setRemove_From_User_TBD_message] = useState(); + const [Remove_From_User_TBD_result, setRemove_From_User_TBD_result] = useState(); + function Remove_From_User_TBD() { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + + + form.append("token", stored_cookie); + form.append("user_dashbord_id", user_dashbord_id); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_To_User_Dashbord/"; + + //console.log(" ## myurl = ", myurl); + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Remove_From_User_TBD res.data.status = " + res.data.status); + //console.log(" In Remove_From_User_TBD res.data.message r_class = " + res.data.message); + + setRemove_From_User_TBD_api("true"); + setRemove_From_User_TBD_result(res.data.message); + // Getall_Qry_Formation_Session(); + alert(res.data.message); + window.location.reload(); + + + } + else { + setRemove_From_User_TBD_api("false"); + setRemove_From_User_TBD_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Remove_From_User_TBD = ', error); + setRemove_From_User_TBD_api("false"); + alert("Impossible de supprimer le tableau de bord de votre liste"); + //setmyApimyApiMessage("") + }) + } + function Export_Dashbord_to_CSV(local_dashbord_internal_id) { + + alert(" Cette fontion sera bientot disponible "); + return; +/* const stored_cookie = getCookie('tokenmysypart'); - var nom_fichier_cmd = "export_csv.csv"; + var date_from = ""; + if (p_filter_date_from) { + date_from = p_filter_date_from; + date_from = date_from.replaceAll('/', "-") + + } + + var date_to = ""; + if (p_filter_date_to) { + date_to = p_filter_date_to; + date_to = date_to.replaceAll('/', "-") + } + + + var local_client_id = ""; + if (!p_detail_partner_client_id || String(p_detail_partner_client_id) === "") { + local_client_id = "-" + } else { + local_client_id = p_detail_partner_client_id; + } + + console.log(" #### p_detail_partner_client_id = ", p_detail_partner_client_id, " ### local_client_id = ", local_client_id) + var nom_fichier_cmd_excel = "export_excel.xlsx"; //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- local_dashbord_internal_id = ", local_dashbord_internal_id); - var url = process.env.REACT_APP_API_URL + "myclass/api/TBD_Inscription_Export_Dashbord_To_Csv/" + stored_cookie + "/" + local_dashbord_internal_id; + var url = process.env.REACT_APP_API_URL + "myclass/api/TBD_FACTURE_01_Export_Dashbord_To_Excel/" + stored_cookie + "/" + local_dashbord_internal_id + "/" + date_from + "/" + date_to + "/" + local_client_id + "/"; //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url); + + console.log(" #### url = ", url) + setLoading(true); axios.get(url, { responseType: 'blob', },) .then((res) => { @@ -318,7 +404,7 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { if (String(res.data) === String("false")) { alert("Impossible d'exporter les données (2) "); } else { - fileDownload(res.data, nom_fichier_cmd) + fileDownload(res.data, nom_fichier_cmd_excel) } }).catch((error) => { @@ -327,18 +413,142 @@ const Dashbord_Inscriptions_all_inscriptions = (props) => { alert(" Impossible d'exporter les données ") }); - +*/ } + + return (
{isLoading &&
} -
-
+
+
+ Filtre
+ + { + if (value && value.value) { + setfilter_value(value.value); + + } else { + setfilter_value(""); + } + + + }} + + 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" + /> + +
+
+ +
} +
+
+
+ Grouper par
+ (data).value === String(filter_group_by))[0].label} + onChange={(event, value) => { + if (value && value.value) { + setfilter_group_by(value.value); + + + } else { + setfilter_group_by(""); + } + + }} + + renderInput={(params) => + } + /> +
+ +
+
+
+ +
+
+ + +
+ + +
+ {
+ + {tdb_title && String(tdb_title) === "3" && }  
-
-
-   - 0 && + Getall_Qry_Inscription_Data_result_JSON[0].data && + - { - setSelectionModel(newSelectionModel); - /*if (newSelectionModel.length === 1) - handleClick_edit_session_From_Line(newSelectionModel);*/ - if (newSelectionModel.length !== 1) { - /* setaddOneParticipant(); - setdisplay_detail_insc(); - setselected_code_session(); - setsubmenu();*/ - } - }} - selectionModel={selectionModel} - - localeText={frFR.components.MuiDataGrid.defaultProps.localeText} - rows={Getall_Qry_Inscription_Data_result.map((item, index) => ( - { - id: index, - _id: JSON.parse(item)._id, - civilite: JSON.parse(item).civilite, - nom: JSON.parse(item).nom, - prenom: JSON.parse(item).prenom, - email: JSON.parse(item).email, - telephone: JSON.parse(item).telephone, - session_class_title: JSON.parse(item).session_class_title, - session_code_session: JSON.parse(item).session_code_session, - session_date_debut: JSON.parse(item).session_date_debut, - session_date_fin: JSON.parse(item).session_date_fin, - session_distantiel: JSON.parse(item).session_distantiel, - session_presentiel: JSON.parse(item).session_presentiel, - inscription_status: JSON.parse(item).inscription_status, - apprenant_id: JSON.parse(item).apprenant_id, - - } - ))} - - columns={columns} - pageSize={20} - className="datagridclass" - - onRowDoubleClick={(newSelectionModel) => { - - }} - - - - rowsPerPageOptions={[20]} - disableSelectionOnClick - components={{ - Toolbar: GridToolbar, - }} - //sx={datagridSx} - getCellClassName={(params) => { - - if (params.field === 'inscription_status' && String(params.value) === "-1") { - return 'cell--annule'; - } - if (params.field === "inscription_status" && String(params.value) == "0") { - return 'cell--preinscrit'; - } - - if (params.field === "inscription_status" && String(params.value) == "1") { - return 'cell--inscrit'; - } - - if (params.field === "inscription_status" && String(params.value) == "2") { - return '.cell--encours'; - } - - }} - - getRowClassName={(params) => { - - // Pour la gestion de la couleur de zone double cliquée - if (String(params.row.id) === String(gridline_id)) { - - return 'line--statut--selected'; - } - else if (parseInt(String(params.row.id)) % 2 === 0) { - return 'line--statut--pair'; - } - else if (parseInt(String(params.row.id)) % 2 !== 0) { - return 'line--statut--impair'; - } - - }} - - - /> - -
- -
- -
- + />}
- -
+
+ +
diff --git a/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js b/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js index 00fac97..39ea389 100644 --- a/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js +++ b/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js @@ -298,8 +298,6 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => { useEffect(() => { setp_filter_date_from(props.user_dashbord_filter_start); - - setp_filter_date_to(props.user_dashbord_filter_end); setevent_type_filter(props.user_dashbord_filter_type_envent); diff --git a/src/components/Mon_Tableau_De_Bord.js b/src/components/Mon_Tableau_De_Bord.js index 8a1c1c8..f0e9195 100644 --- a/src/components/Mon_Tableau_De_Bord.js +++ b/src/components/Mon_Tableau_De_Bord.js @@ -24,10 +24,10 @@ import Dashbord_Session_Repartition_Fteur from "./Dashbord_Session_Repartition_F import Dashbord_Formation_Evol_Session from "./Dashbord_Formation_Evol_Session"; import Dashbord_Ressources_Humaines_Tache_by_rhid from "./Dashbord_Ressources_Humaines_Tache_by_rhid"; import Dashbord_Ressources_Humaines_Tache_Couts from "./Dashbord_Ressources_Humaines_Tache_Couts"; -import Dashbord_Inscriptions_all_inscriptions from "./Dashbord_Inscription_All_Inscription"; import Dashbord_Factures_Par_Periode from "./Dashbord_Factures_Par_Periode"; 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 { TbColumns2, TbColumns1 } from "react-icons/tb"; @@ -94,8 +94,8 @@ const Mon_Tableau_De_Bord = (props) => { }, []) - const [display_nb_column, setdisplay_nb_column] = useState("2"); - const [display_column_size, setdisplay_column_size] = useState("49%"); + const [display_nb_column, setdisplay_nb_column] = useState("1"); + const [display_column_size, setdisplay_column_size] = useState("98%"); return ( + + {/* 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" && +
- + +
} @@ -176,30 +209,34 @@ const Mon_Tableau_De_Bord = (props) => { {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" && - - +
+ +
} @@ -210,8 +247,8 @@ const Mon_Tableau_De_Bord = (props) => { ))}
} - {/* Gestion des TBD des ressources humaines */} - {display_nb_column &&
+ {/* Gestion des TBD des ressources humaines */} + {display_nb_column &&
{Get_Connected_User_Dashbord_result && Get_Connected_User_Dashbord_result.map((step) => ( @@ -239,18 +276,8 @@ const Mon_Tableau_De_Bord = (props) => { /> } - {String(JSON.parse(step).dashbord_internal_code) === "tbd_inscription_01" && - - } -
diff --git a/src/styles/components/_mon_tableau_de_bord.scss b/src/styles/components/_mon_tableau_de_bord.scss index b9cae7e..e4d292b 100644 --- a/src/styles/components/_mon_tableau_de_bord.scss +++ b/src/styles/components/_mon_tableau_de_bord.scss @@ -2,8 +2,8 @@ .tooltip_css { background: #81BC3A; z-index: 9999; - } - + } + .loader-container { width: 100%; height: 100vh; @@ -17,7 +17,7 @@ top: 0px; opacity: 80%; left: 0px; - } + } .spinner { width: 20rem; @@ -902,7 +902,7 @@ width: 50%; } - + .bton_import_excel { background: #c8cfd5; @@ -1552,10 +1552,11 @@ color: black; width: 40%; } + .bton_add_session_create_automatic { background: #c8cfd5; color: black; - width:60% !important; + width: 60% !important; } .bton_import_excel { @@ -2503,7 +2504,7 @@ // end media - .css-md26zr-MuiInputBase-root-MuiOutlinedInput-root{ + .css-md26zr-MuiInputBase-root-MuiOutlinedInput-root { height: 3rem !important; } @@ -2571,15 +2572,15 @@ .text_tbd_vide { - + color: #34495E; padding: 1.5rem; font-size: 2rem; display: inline-block; margin-top: 5rem !important; text-align: center; - } - + } + } @@ -2615,4 +2616,16 @@ .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input { padding-left: 5px !important; +} + +.css-k69abp-MuiResponsiveChart-container { + width: auto !important; +} + +.css-1jkcq86-MuiResponsiveChart-container { + width: auto !important; +} + +.css-s0svql-MuiResponsiveChart-container { + width: auto !important; } \ No newline at end of file