From 23140c3c948b5ad420abd1f7fda83baf3996fcfa Mon Sep 17 00:00:00 2001 From: cherif Date: Sun, 14 Jul 2024 22:49:19 +0200 Subject: [PATCH] 14/07/2024 - 22h --- .../Dashbord_Factures_Devis_Par_Periode.js | 2 +- ...hbord_Ressources_Humaines_Tache_by_rhid.js | 2 +- src/components/Employes.js | 21 +- src/components/Mon_Tableau_De_Bord.js | 960 +++++++++++++++++- src/components/Partner_Commande.js | 234 ++++- 5 files changed, 1140 insertions(+), 79 deletions(-) diff --git a/src/components/Dashbord_Factures_Devis_Par_Periode.js b/src/components/Dashbord_Factures_Devis_Par_Periode.js index f5168a6..2b67193 100644 --- a/src/components/Dashbord_Factures_Devis_Par_Periode.js +++ b/src/components/Dashbord_Factures_Devis_Par_Periode.js @@ -37,7 +37,7 @@ import { PieChart } from '@mui/x-charts/PieChart'; import fileDownload from 'js-file-download' const pieParams = { height: 200, margin: { right: 5 } }; const palette = ['red', 'blue', 'green']; - + const Dashbord_Factures_Devis_Par_Periode = (props) => { const history = useHistory(); const [isLoading, setLoading] = useState(); diff --git a/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js b/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js index 39ea389..59f01a3 100644 --- a/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js +++ b/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js @@ -176,7 +176,7 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (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(); diff --git a/src/components/Employes.js b/src/components/Employes.js index e83fe1d..197dc2f 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -3683,6 +3683,7 @@ const Employes = (props) => { "question_id": "", "label": "", "question_question": "", + "question_type": "", }; new_data2.push(node); @@ -5785,7 +5786,7 @@ const Employes = (props) => { var local_class_id = "-"; var local_related_collection = "ressource_humaine"; - var url = process.env.REACT_APP_API_URL + "myclass/api/Export_Excel_Survey_Stat_Data_For_Given_related_collection_id/" + stored_cookie + "/" +local_related_collection+"/"+ selected_id + "/" + date_from + "/" + date_to + "/" + selected_statistic_question_id + "/"+local_class_id+"/"; + var url = process.env.REACT_APP_API_URL + "myclass/api/Export_Excel_Survey_Stat_Data_For_Given_related_collection_id/" + stored_cookie + "/" + local_related_collection + "/" + selected_id + "/" + date_from + "/" + date_to + "/" + selected_statistic_question_id + "/" + local_class_id + "/"; //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url); @@ -8533,7 +8534,7 @@ const Employes = (props) => { - + @@ -9053,7 +9054,7 @@ const Employes = (props) => { - +
@@ -9620,7 +9621,7 @@ const Employes = (props) => { - +
@@ -9870,7 +9871,7 @@ const Employes = (props) => { - +  
@@ -9982,7 +9983,7 @@ const Employes = (props) => { - +
@@ -10139,7 +10140,7 @@ const Employes = (props) => { - +
@@ -10219,7 +10220,7 @@ const Employes = (props) => { - +
@@ -10370,6 +10371,9 @@ const Employes = (props) => { + + + @@ -10378,6 +10382,7 @@ const Employes = (props) => {
Choisir une question {New_Getall_Employee_Statistic_Question_List_result && New_Getall_Employee_Statistic_Question_List_result.length > 0 && +
diff --git a/src/components/Mon_Tableau_De_Bord.js b/src/components/Mon_Tableau_De_Bord.js index 7a0e833..130c3c4 100644 --- a/src/components/Mon_Tableau_De_Bord.js +++ b/src/components/Mon_Tableau_De_Bord.js @@ -7,7 +7,8 @@ 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' @@ -49,6 +50,7 @@ import { useTheme, } from "@mui/material"; import { tokens } from "../theme"; +import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; const Mon_Tableau_De_Bord = (props) => { @@ -62,6 +64,103 @@ const Mon_Tableau_De_Bord = (props) => { 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 ( + + ); + } + + const [selectionModel, setSelectionModel] = React.useState([]); + function Get_Connected_User_Dashbord() { var form = new FormData(); @@ -150,9 +249,14 @@ const Mon_Tableau_De_Bord = (props) => { } + function submenu_rapport_rh() { + setsubmenu("rapport_rh"); + submenu_color_management("rapport_rh"); + } + function submenu_color_management(current_menu) { - const list_sous_menu = ["montbd", "rapport_activite", "rapport_financier"] + const list_sous_menu = ["montbd", "rapport_activite", "rapport_financier", "rapport_rh"] for (let i = 0; i < list_sous_menu.length; i++) { @@ -565,6 +669,12 @@ const Mon_Tableau_De_Bord = (props) => { 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); @@ -615,17 +725,323 @@ const Mon_Tableau_De_Bord = (props) => { } - function display_invoice_by_session() { - setfilter_invoice_group_by("class"); - Getall_Qry_Invoice_Data("class"); + 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("class"); - Getall_Qry_Invoice_Data("class"); + 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("") + }) + } + + + return (
@@ -638,6 +1054,7 @@ const Mon_Tableau_De_Bord = (props) => { +
@@ -735,6 +1152,14 @@ const Mon_Tableau_De_Bord = (props) => { // 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(); } }}> Afficher @@ -759,7 +1184,7 @@ const Mon_Tableau_De_Bord = (props) => { - +
@@ -777,6 +1202,48 @@ const Mon_Tableau_De_Bord = (props) => { />} + {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" && { return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, 8)}` + " \n" + `${month.slice(8, 12)}` } } - - - }, + } + , }]} series={[ { dataKey: 'TotalAmount_HT', label: 'CA HT', valueFormatter_CA }, @@ -814,10 +1280,428 @@ const Mon_Tableau_De_Bord = (props) => {
} +
+
+ + + {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
+
+ + + {/**/} + {/* */} + +
+ {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 && + } + + + +
+ ))} + +
+
+
+ +
+
+ + +   + +
+
+ +
+   + + { + 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 && + } + + {JSON.parse(my_data).total_cost && + } + +
+ ))} +
+ +
+ + +
+ + +
} + {String(submenu) === String("rapport_activite") &&

Rapport d'activité

@@ -847,18 +1731,18 @@ const Mon_Tableau_De_Bord = (props) => { valueFormatter: (month, context) => { if (month) { - if (String(month).length < 4) { - return `${month.slice(0, 4)}` - } + 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 >= 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)}` + else if (String(month).length > 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, 8)}` + " \n" + `${month.slice(8, 12)}` + } } - } }, @@ -905,18 +1789,18 @@ const Mon_Tableau_De_Bord = (props) => { scaleType: 'band', dataKey: 'label', tickPlacement: 'middle', valueFormatter: (month, context) => { if (month) { - if (String(month).length < 4) { - return `${month.slice(0, 4)}` - } + 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 >= 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)}` + else if (String(month).length > 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, 8)}` + " \n" + `${month.slice(8, 12)}` + } } - } }, } ] @@ -961,18 +1845,18 @@ const Mon_Tableau_De_Bord = (props) => { valueFormatter: (month, context) => { if (month) { - if (String(month).length < 4) { - return `${month.slice(0, 4)}` - } + 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 >= 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)}` + else if (String(month).length > 8) { + return `${month.slice(0, 4)}` + " \n" + `${month.slice(4, 8)}` + " \n" + `${month.slice(8, 12)}` + } } - } } }]} diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index f8f0262..3f86c79 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -1097,11 +1097,16 @@ const Partner_Commande = (props) => { if (mylocal_order.related_order_internal_ref) { setp_detail_header_order_header_ref_interne(mylocal_order.related_order_internal_ref); - console.log(" ### mylocal_order.related_order_internal_ref = ", mylocal_order.related_order_internal_ref); } else { setp_detail_header_order_header_ref_interne(""); } + if (mylocal_order.closure_reason) { + setp_detail_comment_raison_cloture(mylocal_order.closure_reason); + } else { + setp_detail_comment_raison_cloture(""); + } + //document.getElementsByName("detail_header_ref_interne")[0].value = ""; if (mylocal_order.order_header_ref_interne) { setp_detail_header_ref_interne(mylocal_order.order_header_ref_interne); @@ -1874,6 +1879,9 @@ const Partner_Commande = (props) => { const [p_detail_header_ref_client, setp_detail_header_ref_client] = useState(); const [p_detail_header_ref_interne, setp_detail_header_ref_interne] = useState(); + const [p_detail_comment_raison_cloture, setp_detail_comment_raison_cloture] = React.useState(""); + + const [p_detail_header_devis_date_validation, setp_detail_header_devis_date_validation] = useState(); const [p_detail_header_devis_date_envoi, setp_detail_header_devis_date_envoi] = useState(); @@ -3832,6 +3840,87 @@ const Partner_Commande = (props) => { { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres. ] + const New_Option_Cloture_Devis = [ + { "id": "4", "label": "Perte", "value": "4" }, + { "id": "2", "label": "Cloture", "value": "2" }, + { "id": "", "label": "", "value": "" }, + ] + const [Dialog_Cloture_Devis_open, setDialog_Cloture_Devis_open] = React.useState(false); + + const Close_Dialog_Cloture_Devis_open = () => { + setp_new_raison_cloture(""); + setp_new_comment_raison_cloture(""); + setDialog_Cloture_Devis_open(false); + }; + + const [p_new_raison_cloture, setp_new_raison_cloture] = React.useState(""); + const [p_new_comment_raison_cloture, setp_new_comment_raison_cloture] = React.useState(""); + + + const [Closure_Given_Quotation_api, setClosure_Given_Quotation_api] = useState(); + const [Closure_Given_Quotation_message, setClosure_Given_Quotation_message] = useState(); + const [Closure_Given_Quotation_result, setClosure_Given_Quotation_result] = useState(); + function Closure_Given_Quotation() { + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("order_header_id", selected_id); + form.append("order_header_status", setp_new_raison_cloture); + form.append("closure_reason", setp_new_comment_raison_cloture); + + + //console.log(" form == ", form); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Closure_Partner_Quotation_Header/"; + + + setLoading(true); + axios.post(myurl, form).then(res => { + //console.log(" In Closure_Given_Quotation res.data.status = " + res.data.status); + //console.log(" In Closure_Given_Quotation res.data.message r_class = " + res.data.message); + + setLoading(false); + if (String(res.data.status) === String("true")) { + setClosure_Given_Quotation_api("true"); + setClosure_Given_Quotation_result(res.data.message); + + Getall_Parter_Orders_No_Filter(); + + setOrder_data_changed(""); + setorder_data_edit_mode(""); + Display_Detail_Order_data(selected_id); + Close_Dialog_Cloture_Devis_open(); + alert(res.data.message); + + if (document.getElementById('myRef_head')) { + var divh = document.getElementById('myRef_head').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + disable_Order_Header_DetailFields(); + + } + else { + setClosure_Given_Quotation_api("false"); + setClosure_Given_Quotation_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + + setLoading(false); + console.warn('UpdateStagiaireData : Not good man :( Closure_Given_Quotation = ' + error); + setClosure_Given_Quotation_api("false"); + alert(" Impossible de faire la mise à jour"); + + }) + } + return ( @@ -3841,6 +3930,101 @@ const Partner_Commande = (props) => {
} + {/****** Dialog pour cloturer un devis (gerer la perte d'un devis avec motif, ou simple cloture) */} + + + + Cloture devis {String(p_detail_header_ref_interne)} + + + +
Raison Cloture + { + + if (value && value.value) { + setp_new_raison_cloture(value.value); + + } else { + setp_new_raison_cloture(""); + + } + }} + + + renderInput={(params) => + } + /> +
+ + + + + {p_new_raison_cloture && String(p_new_raison_cloture) !== "" && +
Commentaire + { + setp_new_comment_raison_cloture(e.target.value); + } + } + + //label="Commentaire" + //variant="standard" + multiline + minRows={2} + maxRows={2} + rows={2} + + + /> + +
} + + +
+ + + + +
+ {p_new_raison_cloture && String(p_new_raison_cloture) !== "" &&
+ +
} +
+ +
+ +
+ + +
+
+ + + {/****** Dialog pour cloturer un devis (gerer la perte d'un devis avec motif, ou simple cloture) */} + + {/* Dialog pour gerer la signature digitale */} {
Utilisez les filtres !
- {/* { - setp_filtre1(e.target.value); - - }} - > - Ref. Interne   - Ref. Externe (chez le client)   - Nom Client   - Lié à la Formation (code externe)   - Lié à la session (code session)   - - - - -*/} - -{New_Option_Filter && New_Option_Filter.length > 0 && 0 && { onChange={(event, value) => { if (value && value.value) { setp_filtre1(value.value); - }else{ + } else { setp_filtre1(""); } @@ -4717,7 +4879,7 @@ const Partner_Commande = (props) => { /> } />} -
+
@@ -4778,7 +4940,7 @@ const Partner_Commande = (props) => { {p_filtre2 &&
- {New_Option_Filter && New_Option_Filter.length > 0 && 0 && { {p_filtre3 &&
- {New_Option_Filter && New_Option_Filter.length > 0 && 0 && { />
- {String(order_data_edit_mode) !== "1" &&
Statut + {String(order_data_edit_mode) !== "1" &&
Statut {p_detail_header_order_header_ref_interne && String(p_detail_header_order_header_ref_interne).length > 2 && -   +   }
@@ -6368,7 +6530,17 @@ const Partner_Commande = (props) => {
)} - } + + } + {String(p_detail_header_statut_label).toLowerCase() !== "traité" && + String(p_detail_header_statut_label).toLowerCase() !== "facturé" && + String(selected_order_header_type) === "devis" && + + }

{String(p_detail_header_statut_label).toLowerCase() === "en cours" &&