import React, { useRef, useState, useEffect } from "react";
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
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 Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'
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";
import Dashbord_Session_Taux_Remplissage from "./Dashbord_Session_Taux_Remplissage";
import Dashbord_Session_Repartition_Fteur from "./Dashbord_Session_Repartition_Fteur";
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_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 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";
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
const Mon_Tableau_De_Bord = (props) => {
const theme = useTheme();
const colors = tokens(theme.palette.mode);
const history = useHistory();
const [isLoading, setLoading] = useState();
const [Get_Connected_User_Dashbord_api, setGet_Connected_User_Dashbord_api] = useState();
const [Get_Connected_User_Dashbord_message, setGet_Connected_User_Dashbord_message] = useState();
const [Get_Connected_User_Dashbord_result, setGet_Connected_User_Dashbord_result] = useState([]);
const columns = [
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'civilite', headerName: 'Civ.', hide: true, minWidth: 100, flex: 1, maxWidth: 60, renderCell: (params) => , },
{ field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => },
{ field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => },
{ field: 'email', headerName: 'Email', hide: true, flex: 1, minWidth: 250, renderCell: (params) => },
{ field: 'ismanager', headerName: 'Manager', hide: true, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => },
{ field: 'fonction', headerName: 'Fonction', hide: true, minWidth: 200, flex: 1, maxWidth: 150, renderCell: (params) => },
{ field: 'agenda_event_title', headerName: 'Titre Event', hide: false, minWidth: 250, flex: 1, renderCell: (params) => },
{ field: 'agenda_event_code_session', headerName: 'Code session', hide: false, minWidth: 250, flex: 1, renderCell: (params) => },
{ field: 'agenda_event_type', headerName: 'Type Event', hide: false, minWidth: 150, flex: 1, maxWidth: 100, renderCell: (params) => },
{ field: 'event_duration_hour', headerName: 'Durée (h)', hide: false, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => },
{ field: 'agenda_date_jour', headerName: 'Date', hide: false, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => },
{ field: 'agenda_event_start', headerName: 'Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => },
{ field: 'agenda_event_end', headerName: 'Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => },
{ field: 'agenda_event_sequence_session_id', headerName: 'agenda_id', hide: true, maxWidth: 1, renderCell: (params) => },
]
const columns_task_cost = [
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'rh_civilite', headerName: 'Civ.', hide: true, minWidth: 100, flex: 1, maxWidth: 60, renderCell: (params) => , },
{ field: 'rh_nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => , },
{ field: 'rh_prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => , },
{ field: 'rh_email', headerName: 'Email', hide: true, flex: 1, minWidth: 250, renderCell: (params) => , },
{ field: 'rh_ismanager', headerName: 'Manager', hide: true, minWidth: 50, flex: 1, maxWidth: 100, renderCell: (params) => , },
{ field: 'rh_fonction', headerName: 'Fonction', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_telephone_mobile', headerName: 'Mobile', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_adr_adresse', headerName: 'Adesse', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_adr_code_postal', headerName: 'CP', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_adr_ville', headerName: 'Ville', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_adr_pays', headerName: 'Pays', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_date_debut', headerName: 'Ctrat Du', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_date_fin', headerName: 'Ctrat Au', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_type_contrat', headerName: 'Ctrat Type', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_type_employe', headerName: 'Ctrat Empl.', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_cout', headerName: 'Ctrat Cout', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_periodicite', headerName: 'Ctrat Périodicité', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_quantite', headerName: 'Ctrat Qte', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_groupe_prix_achat_id', headerName: 'Grp Prix ID', hide: true, Width: 0, renderCell: (params) => , },
{ field: 'rh_contrat_groupe_prix_achat_code', headerName: 'Grp Prix Code', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_groupe_prix_achat_cout', headerName: 'Grp Prix Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_contrat_groupe_prix_achat_periodicite', headerName: 'Grp Prix Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_event_planning_event_title', headerName: 'Planning Titre', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , },
{ field: 'rh_event_planning_even_comment', headerName: 'Planning Comment', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_event_planning_event_type', headerName: 'Planning Type', hide: false, minWidth: 150, flex: 1, maxWidth: 100, renderCell: (params) => , },
{ field: 'rh_event_planning_event_duration_hour', headerName: 'Planning Durée (h)', hide: false, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => , },
{ field: 'rh_event_planning_agenda_date_jour', headerName: 'Planning Date', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => , },
{ field: 'rh_event_planning_event_start', headerName: 'Planning Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => , },
{ field: 'rh_event_planning_event_end', headerName: 'Planning Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => , },
{ field: 'rh_event_planning_event_cost', headerName: 'Planning Cout Total (HT)', hide: false, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => , },
]
const [selectionModel_task_cost, setSelectionModel_task_cost] = React.useState([]);
function ExpandableCell_50({ value }) {
const [expanded, setExpanded] = React.useState(false);
return (
{value &&
{expanded ? value : value.slice(0, 50)}
{value.length > 50 && (
// eslint-disable-next-line jsx-a11y/anchor-is-valid
setExpanded(!expanded)}
>
{expanded ?
Réduire :
Voir }
)}
}
{value &&
}
);
}
const [selectionModel, setSelectionModel] = React.useState([]);
function Get_Connected_User_Dashbord() {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Connected_User_List_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 Get_Connected_User_Dashbord res.data.status = " + res.data.status);
//console.log(" In Get_Connected_User_Dashbord res.data.message r_class = " + res.data.message);
setGet_Connected_User_Dashbord_api("true");
setGet_Connected_User_Dashbord_result(res.data.message);
}
else {
setGet_Connected_User_Dashbord_api("false");
setGet_Connected_User_Dashbord_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Get_Connected_User_Dashbord = ', error);
setGet_Connected_User_Dashbord_api("false");
alert("Impossible de récupérer la liste des tableaux de bord");
//setmyApimyApiMessage("")
})
}
useEffect(() => {
if (String(submenu) === "") {
submenu_rapport_activite();
}
Get_Connected_User_Dashbord();
window.scrollTo({
top: 0,
behavior: "smooth",
});
}, [])
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_rapport_rh() {
setsubmenu("rapport_rh");
submenu_color_management("rapport_rh");
}
function submenu_bpf() {
setsubmenu("bpf");
submenu_color_management("bpf");
}
function submenu_color_management(current_menu) {
const list_sous_menu = ["montbd", "rapport_activite", "rapport_financier", "rapport_rh", "bpf"]
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/";
if (local_group_by === "client") {
myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Factures_Data_By_Client_V2/";
form.append("filter_client_id", "");
}
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_client() {
setfilter_invoice_group_by("client");
Getall_Qry_Invoice_Data("client");
}
function display_invoice_by_periode_cumule() {
setfilter_invoice_group_by("cumule");
Getall_Qry_Invoice_Data("");
}
const [Getall_Qry_Quotation_Data_result_JSON, setGetall_Qry_Quotation_Data_result_JSON] = useState([]);
const [Getall_Qry_Quotation_Data_api, setGetall_Qry_Quotation_Data_api] = useState();
const [Getall_Qry_Quotation_Data_message, setGetall_Qry_Quotation_Data_message] = useState();
const [Getall_Qry_Quotation_Data_result, setGetall_Qry_Quotation_Data_result] = useState([]);
function Getall_Qry_Quotation_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);
form.append("filter_client_id", "");
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Quotation_Data_By_Periode/";
if (local_group_by === "client") {
myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Quotation_Data_By_Client/";
}
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Qry_Quotation_Data res.data.status = " + res.data.status);
//console.log(" In Getall_Qry_Quotation_Data res.data.message r_class = " + res.data.message);
setGetall_Qry_Quotation_Data_result_JSON(JSON.parse('[' + res.data.message + ']'));
var jsonObj = JSON.parse('[' + res.data.message + ']');
//console.log("Getall_Qry_Quotation_Data_result_JSON jsonObj = ", jsonObj)
setGetall_Qry_Quotation_Data_api("true");
setGetall_Qry_Quotation_Data_result(res.data.message);
}
else {
setGetall_Qry_Quotation_Data_api("false");
setGetall_Qry_Quotation_Data_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Qry_Quotation_Data = ', error);
setGetall_Qry_Quotation_Data_api("false");
alert("Impossible de récuperer les données demandées")
//setmyApimyApiMessage("")
})
}
const [filter_quotation_group_by, setfilter_quotation_group_by] = useState("periode");
function display_quotation_by_formation() {
setfilter_quotation_group_by("class");
Getall_Qry_Quotation_Data("class");
}
function display_quotation_by_periode() {
setfilter_quotation_group_by("periode");
Getall_Qry_Quotation_Data("");
}
function display_quotation_by_client() {
setfilter_quotation_group_by("client");
Getall_Qry_Quotation_Data("client");
}
function display_quotation_by_periode_cumule() {
setfilter_quotation_group_by("cumule");
Getall_Qry_Quotation_Data("");
}
const [Getall_Qry_Previsionnel_Data_result_JSON, setGetall_Qry_Previsionnel_Data_result_JSON] = useState([]);
const [Getall_Qry_Previsionnel_Data_api, setGetall_Qry_Previsionnel_Data_api] = useState();
const [Getall_Qry_Previsionnel_Data_message, setGetall_Qry_Previsionnel_Data_message] = useState();
const [Getall_Qry_Previsionnel_Data_result, setGetall_Qry_Previsionnel_Data_result] = useState([]);
function Getall_Qry_Previsionnel_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("periode_start_date", date_from);
form.append("periode_end_date", date_to);
form.append("filter_value", filter_value);
form.append("filter_client_id", "");
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Facture_Previsionnelle_Data_By_Periode/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Qry_Previsionnel_Data res.data.status = " + res.data.status);
//console.log(" In Getall_Qry_Previsionnel_Data res.data.message r_class = " + res.data.message);
setGetall_Qry_Previsionnel_Data_result_JSON(JSON.parse('[' + res.data.message + ']'));
var jsonObj = JSON.parse('[' + res.data.message + ']');
//console.log("jsonObj = ", jsonObj)
setGetall_Qry_Previsionnel_Data_api("true");
setGetall_Qry_Previsionnel_Data_result(res.data.message);
}
else {
setGetall_Qry_Previsionnel_Data_api("false");
setGetall_Qry_Previsionnel_Data_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Qry_Previsionnel_Data = ', error);
setGetall_Qry_Previsionnel_Data_api("false");
alert("Impossible de récuperer les données demandées")
//setmyApimyApiMessage("")
})
}
const [Getall_Qry_RH_Data_result_JSON, setGetall_Qry_RH_Data_result_JSON] = useState([]);
const [Getall_Qry_RH_Data_api, setGetall_Qry_RH_Data_api] = useState();
const [Getall_Qry_RH_Data_message, setGetall_Qry_RH_Data_message] = useState();
const [Getall_Qry_RH_Data_result, setGetall_Qry_RH_Data_result] = useState([]);
function Getall_Qry_RH_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;
}
var event_type = "";
/*if (event_type_filter) {
event_type = event_type_filter;
}*/
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);
form.append("tab_rh_id", "all");
form.append("event_type", event_type);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Humain_Ressource_With_Planning/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Qry_RH_Data res.data.status = " + res.data.status);
//console.log(" In Getall_Qry_RH_Data res.data.message r_class = " + res.data.message);
setGetall_Qry_RH_Data_result_JSON(JSON.parse('[' + res.data.message + ']'));
var jsonObj = JSON.parse('[' + res.data.message + ']');
setGetall_Qry_RH_Data_api("true");
setGetall_Qry_RH_Data_result(res.data.message);
}
else {
setGetall_Qry_RH_Data_api("false");
setGetall_Qry_RH_Data_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Qry_RH_Data = ', error);
setGetall_Qry_RH_Data_api("false");
alert("Impossible de récuperer les données demandées")
//setmyApimyApiMessage("")
})
}
const [Getall_Qry_RH_Task_Cost_Data_result_JSON, setGetall_Qry_RH_Task_Cost_Data_result_JSON] = useState([]);
const [Getall_Qry_RH_Task_Cost_Data_api, setGetall_Qry_RH_Task_Cost_Data_api] = useState();
const [Getall_Qry_RH_Task_Cost_Data_message, setGetall_Qry_RH_Task_Cost_Data_message] = useState();
const [Getall_Qry_RH_Task_Cost_Data_result, setGetall_Qry_RH_Task_Cost_Data_result] = useState([]);
function Getall_Qry_RH_Task_Cost_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;
}
var event_type = "";
/*if (event_type_filter) {
event_type = event_type_filter;
}*/
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);
form.append("tab_rh_id", "all");
form.append("event_type", event_type);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Humain_Ressource_With_Planning_And_Cost/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Qry_RH_Task_Cost_Data res.data.status = " + res.data.status);
//console.log(" In Getall_Qry_RH_Task_Cost_Data res.data.message r_class = " + res.data.message);
setGetall_Qry_RH_Task_Cost_Data_result_JSON(JSON.parse('[' + res.data.message + ']'));
var jsonObj = JSON.parse('[' + res.data.message + ']');
setGetall_Qry_RH_Task_Cost_Data_api("true");
setGetall_Qry_RH_Task_Cost_Data_result(res.data.message);
}
else {
setGetall_Qry_RH_Task_Cost_Data_api("false");
setGetall_Qry_RH_Task_Cost_Data_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Qry_RH_Task_Cost_Data = ', error);
setGetall_Qry_RH_Task_Cost_Data_api("false");
alert("Impossible de récuperer les données demandées")
//setmyApimyApiMessage("")
})
}
/********* GESTION BPF */
const [Getall_Qry_BPF_PAVE_Data_result_JSON, setGetall_Qry_BPF_PAVE_Data_result_JSON] = useState();
const [Getall_Qry_BPF_PAVE_Data_api, setGetall_Qry_BPF_PAVE_Data_api] = useState();
const [Getall_Qry_BPF_PAVE_Data_message, setGetall_Qry_BPF_PAVE_Data_message] = useState();
const [Getall_Qry_BPF_PAVE_Data_result, setGetall_Qry_BPF_PAVE_Data_result] = useState([]);
function Getall_Qry_BPF_PAVE_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("periode_start_date", date_from);
form.append("periode_end_date", date_to);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Generate_BPF_From_partner_invoice_header/";
//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_BPF_PAVE_Data res.data.status = " + res.data.status);
// console.log(" In Getall_Qry_BPF_PAVE_Data res.data.message r_class = " + res.data.message);
setGetall_Qry_BPF_PAVE_Data_result_JSON(JSON.parse(res.data.message));
setGetall_Qry_BPF_PAVE_Data_api("true");
setGetall_Qry_BPF_PAVE_Data_result(res.data.message);
}
else {
setGetall_Qry_BPF_PAVE_Data_api("false");
setGetall_Qry_BPF_PAVE_Data_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Qry_BPF_PAVE_Data = ', error);
setGetall_Qry_BPF_PAVE_Data_api("false");
alert("Impossible de récuperer les données demandées")
//setmyApimyApiMessage("")
})
}
/****** FIN GESTION BPF */
return (
{isLoading &&
}
{/* Mon tableau de bord */}
Rapport Activite
Rapports Financiers
Ressources Humaine
Bilan Péd. Fin. (BPF)
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"
/>
}
{
// Recuperation des rapports d'activités
if (String(submenu) === "rapport_activite") {
Getall_Qry_Inscription_Data("");
Getall_Qry_Formation_Session("");
// Getall_Qry_Session_Data();
Getall_Qry_Session_Taux_Remplissage("");
}
// Recuperation des rapports financiers
if (String(submenu) === "rapport_financier") {
Getall_Qry_Invoice_Data();
Getall_Qry_Quotation_Data();
Getall_Qry_Previsionnel_Data();
}
// Recuperation des rapports ressources humaines
if (String(submenu) === "rapport_rh") {
Getall_Qry_RH_Data();
Getall_Qry_RH_Task_Cost_Data();
}
// Recuperation des rapports ressources humaines
if (String(submenu) === "bpf") {
Getall_Qry_BPF_PAVE_Data();
}
}}> Afficher
{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
Par Période
Par Ftion
Par Client
Par période (Cumulé)
{filter_invoice_group_by && String(filter_invoice_group_by) === "periode" &&
}
{filter_invoice_group_by && String(filter_invoice_group_by) === "client" &&
{
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: 'value', label: 'CA TTC', valueFormatter_CA },
]}
{...chartSetting}
margin={{ right: 15, left: 100 }}
/>}
{filter_invoice_group_by && String(filter_invoice_group_by) === "cumule" && }
{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 }}
/>}
}
{Getall_Qry_Quotation_Data_result_JSON && Getall_Qry_Quotation_Data_result_JSON.length > 0 &&
Getall_Qry_Quotation_Data_result_JSON[0].data &&
Le suivi des devis
Par Période
{/*Par Client */}
{/* Par période (Cumulé) */}
{filter_quotation_group_by && String(filter_quotation_group_by) === "periode" &&
}
{/*filter_quotation_group_by && String(filter_quotation_group_by) === "client" &&
*/}
{/*filter_quotation_group_by && String(filter_quotation_group_by) === "cumule" &&
*/}
}
{Getall_Qry_Previsionnel_Data_result_JSON && Getall_Qry_Previsionnel_Data_result_JSON.length > 0 &&
Getall_Qry_Previsionnel_Data_result_JSON[0].data &&
}
}
{String(submenu) === String("rapport_rh") &&
Rapports Ressources Humaines
{
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_RH_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,
ismanager: JSON.parse(item).ismanager,
fonction: JSON.parse(item).fonction,
agenda_event_title: JSON.parse(item).agenda_event_title,
agenda_event_code_session: JSON.parse(item).agenda_event_code_session,
agenda_event_type: JSON.parse(item).agenda_event_type,
agenda_date_jour: JSON.parse(item).agenda_date_jour,
agenda_event_start: JSON.parse(item).agenda_event_start,
agenda_event_end: JSON.parse(item).agenda_event_end,
event_duration_hour: JSON.parse(item).event_duration_hour,
agenda_event_sequence_session_id: JSON.parse(item).agenda_event_sequence_session_id,
}
))}
columns={columns}
pageSize={10}
className="datagridclass"
onRowDoubleClick={(newSelectionModel) => {
/*setgridline_id(newSelectionModel.row.id);
setaddOneSession("0");
setEdite_session("0");
//handleClick_edit_session_From_Line(newSelectionModel.row.id);
setselected_session_id(newSelectionModel.row._id);
setsession_selected_row_id(newSelectionModel.row.id);
setDialog_2_message(String(JSON.parse(rowss[newSelectionModel.row.id]).title));
setDialog_2_open(true);*/
}}
rowsPerPageOptions={[10]}
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
//sx={datagridSx}
getCellClassName={(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';
}*/
}}
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';
}*/
}}
getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"}
/>
{Getall_Qry_RH_Data_result &&
Getall_Qry_RH_Data_result.map((my_data) => (
{JSON.parse(my_data).total_duration &&
Durée totale : {JSON.parse(my_data).total_duration}
}
))}
{
setSelectionModel_task_cost(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_task_cost}
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={Getall_Qry_RH_Task_Cost_Data_result.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
rh_civilite: JSON.parse(item).rh_civilite,
rh_nom: JSON.parse(item).rh_nom,
rh_prenom: JSON.parse(item).rh_prenom,
rh_email: JSON.parse(item).rh_email,
rh_ismanager: JSON.parse(item).rh_ismanager,
rh_fonction: JSON.parse(item).rh_fonction,
rh_telephone_mobile: JSON.parse(item).rh_telephone_mobile,
rh_adr_adresse: JSON.parse(item).rh_adr_adresse,
rh_adr_code_postal: JSON.parse(item).rh_adr_code_postal,
rh_adr_ville: JSON.parse(item).rh_adr_ville,
rh_adr_pays: JSON.parse(item).rh_adr_pays,
rh_contrat_date_debut: JSON.parse(item).rh_contrat_date_debut,
rh_contrat_date_fin: JSON.parse(item).rh_contrat_date_fin,
rh_contrat_type_contrat: JSON.parse(item).rh_contrat_type_contrat,
rh_contrat_type_employe: JSON.parse(item).rh_contrat_type_employe,
rh_contrat_cout: JSON.parse(item).rh_contrat_cout,
rh_contrat_periodicite: JSON.parse(item).rh_contrat_periodicite,
rh_contrat_quantite: JSON.parse(item).rh_contrat_quantite,
rh_contrat_groupe_prix_achat_id: JSON.parse(item).rh_contrat_groupe_prix_achat_id,
rh_contrat_groupe_prix_achat_code: JSON.parse(item).rh_contrat_groupe_prix_achat_code,
rh_contrat_groupe_prix_achat_cout: JSON.parse(item).rh_contrat_groupe_prix_achat_cout,
rh_contrat_groupe_prix_achat_periodicite: JSON.parse(item).rh_contrat_groupe_prix_achat_periodicite,
rh_event_planning_event_title: JSON.parse(item).rh_event_planning_event_title,
rh_event_planning_even_comment: JSON.parse(item).rh_event_planning_even_comment,
rh_event_planning_event_type: JSON.parse(item).rh_event_planning_event_type,
rh_event_planning_event_duration_hour: JSON.parse(item).rh_event_planning_event_duration_hour,
rh_event_planning_agenda_date_jour: JSON.parse(item).rh_event_planning_agenda_date_jour,
rh_event_planning_event_start: JSON.parse(item).rh_event_planning_event_start,
rh_event_planning_event_end: JSON.parse(item).rh_event_planning_event_end,
rh_event_planning_event_cost: JSON.parse(item).rh_event_planning_event_cost,
}
))}
columns={columns_task_cost}
pageSize={10}
className="datagridclass"
onRowDoubleClick={(newSelectionModel) => {
}}
rowsPerPageOptions={[10]}
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
//sx={datagridSx}
getCellClassName={(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';
}*/
}}
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';
}*/
}}
getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"}
/>
{Getall_Qry_RH_Task_Cost_Data_result &&
Getall_Qry_RH_Task_Cost_Data_result.map((my_data) => (
{JSON.parse(my_data).total_duration &&
Durée totale : {JSON.parse(my_data).total_duration}
}
{JSON.parse(my_data).total_cost &&
Coût total : {JSON.parse(my_data).total_cost}
}
))}
}
{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
Par Période
Par Ftion
Par Session
Par période (Cumulé)
{
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 }}
/>
}
{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
Par Période
Par Ftion
Par période (Cumulé)
{
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("bpf") &&
Bilan Pédagogique et Financier (BPF)
C. Bilan financier hors taxes : Origine des produits de l'organisme
- des entreprises pour la formation de leurs salariés :
{Getall_Qry_BPF_PAVE_Data_result_JSON && Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c1_entreprise &&
{Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c1_entreprise[0].bpf_c1_entreprise}
}
- des organismes gestionnaires des fonds de la formation professionnelle pour des actions dispensées dans le cadre :
{Getall_Qry_BPF_PAVE_Data_result_JSON && Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c2_type_apprenant &&
Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c2_type_apprenant.length > 0 && Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c2_type_apprenant.map((my_bpf_c2_data) => (
{my_bpf_c2_data.Type_Apprenant_Desc}
{my_bpf_c2_data.TotalAmount_HT}
))}
- Total des produits provenant des organismes gestionnaires des fonds de la formation :
{Getall_Qry_BPF_PAVE_Data_result_JSON && Getall_Qry_BPF_PAVE_Data_result_JSON.total_bpf_c_type_apprenant &&
{Getall_Qry_BPF_PAVE_Data_result_JSON.total_bpf_c_type_apprenant}
}
{Getall_Qry_BPF_PAVE_Data_result_JSON && Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c3_c8_type_pouvoir_public &&
Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c3_c8_type_pouvoir_public.length > 0 && Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c3_c8_type_pouvoir_public.map((my_bpf_c3_c8_data) => (
{my_bpf_c3_c8_data.Type_pouvoir_public_desc}
{my_bpf_c3_c8_data.TotalAmount_HT}
))}
- de contrats conclus avec des personnes à titre individuel et à leurs frais :
{Getall_Qry_BPF_PAVE_Data_result_JSON && Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c9_is_company_particulier &&
{Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_c9_is_company_particulier[0].TotalAmount_HT}
}
TOTAL DES PRODUITS RÉALISÉS AU TITRE DE LA FORMATION PROFESSIONNELLE :
ttttt
D. Bilan financier hors taxes : Charges de l'organisme
Ces données peuvent vous être transmises par votre comptable si vous en avez un, ce qui vous fera gagner un temps précieux.
Ne pas oublier les charge indirectes (ex : bouteilles d'eau achetées pour les apprenants, d'autres achats ponctuels, notes de frais de vos formateurs, etc)
E. Personnes dispensant des heures de formation
Nombre d'heures
Nombre apprenants
Personnes de votre organisme dispensant des heures de formation
{Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_e1_nb_formateurs_internee}
{Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_e1_nb_heures_formateurs_internes}
Personnes extérieures à votre organisme dispensant des heures de formation dans le cadre de contrats de sous-traitance
{Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_e2_nb_formateurs_externes}
{Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_e2_nb_heures_formateurs_externes}
F. Type de stagiaires de l'organisme
Nombre d'heures
Nombre apprenants
{Getall_Qry_BPF_PAVE_Data_result_JSON && Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_f_class_niveau_formation &&
Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_f_class_niveau_formation.length > 0 && Getall_Qry_BPF_PAVE_Data_result_JSON.bpf_f_class_niveau_formation.map((my_bpf_f_data) => (
{my_bpf_f_data.Class_Level_Desc}
{my_bpf_f_data.Nb_Apprenant_By_Class_Level}
{my_bpf_f_data.total_nb_heure_formation_by_level}
))}
Imprimer
}
{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) &&
Pour utiliser votre tableau de bord, Merci de le configurer à partir du menu : "Configuration" == > "Tableau de bord"
}
}
)
}
export default Mon_Tableau_De_Bord;