From 84e5f96cdc70fca67d341f10388cc2a968564808 Mon Sep 17 00:00:00 2001 From: cherif Date: Sat, 27 Apr 2024 22:02:51 +0200 Subject: [PATCH] 27/04/2024 - 22h --- src/components/Crm_Opportunite.js | 3 +- src/components/Dashbord_Factures.js | 158 ++-- src/components/Dashbord_Inscription.js | 180 ++-- .../Dashbord_Ressources_Humaines.js | 831 +++++++++++------- ...ashbord_Ressources_Humaines_Tache_Couts.js | 607 +++++++++---- ...hbord_Ressources_Humaines_Tache_by_rhid.js | 333 ++++++- src/components/Mon_Tableau_De_Bord.js | 81 +- src/components/Partner_Commande.js | 21 +- src/styles/components/_partner_commande.scss | 2 +- 9 files changed, 1568 insertions(+), 648 deletions(-) diff --git a/src/components/Crm_Opportunite.js b/src/components/Crm_Opportunite.js index 68dc3e8..1110b17 100644 --- a/src/components/Crm_Opportunite.js +++ b/src/components/Crm_Opportunite.js @@ -2429,7 +2429,8 @@ const CRM_Opportunite = (props) => { }} - + getEstimatedRowHeight={() => 200} + getRowHeight={() => "auto"} />
diff --git a/src/components/Dashbord_Factures.js b/src/components/Dashbord_Factures.js index a28f4eb..8adb2c2 100644 --- a/src/components/Dashbord_Factures.js +++ b/src/components/Dashbord_Factures.js @@ -303,6 +303,24 @@ const Dashbord_Factures = (props) => { margin: 100, }; + + const chartSetting_nb = { + yAxis: [ + { + label: " Nomnbre de ", + }, + ], + width: 1000, + height: 400, + sx: { + [`.${axisClasses.left} .${axisClasses.label}`]: { + transform: 'translate(-20px, 0)', + }, + }, + margin: 100, + }; + + const valueFormatter_CA = (value) => `${value}€`; const valueFormatter_count = (value) => `${value} Fact`; @@ -472,10 +490,13 @@ const Dashbord_Factures = (props) => { tdb_title = document.getElementsByName("tdb_title")[0].value; } */ - if (document.getElementsByName("filtre11")[0]) { - filter_val = document.getElementsByName("filtre11")[0].value; - } + /* if (document.getElementsByName("filtre11")[0]) { + filter_val = document.getElementsByName("filtre11")[0].value; + }*/ + if (filter_value) { + filter_val = filter_value + } // Si filter_val = "d", alors on va recuperer l'interval de date if (String(filter_val) === "d") { var date_from = p_filter_date_from; @@ -528,6 +549,12 @@ const Dashbord_Factures = (props) => { } + const New_option_periode = [ + { "id": "m0", "label": "Mois en cours", "value": "m0" }, + { "id": "m1", "label": "Mois précédant ", "value": "m1" }, + { "id": "d", "label": "Choisir des dates", "value": "d" }, + + ] return (
@@ -560,71 +587,76 @@ const Dashbord_Factures = (props) => {
Filtre
- { - setfilter_value(e.target.value); - } - } + options={New_option_periode} + onChange={(event, value) => { + if (value && value.value) { + setfilter_value(value.value); + + } else { + setfilter_value(""); + } + }} + + renderInput={(params) => + } + /> - > - Mois en cours    - Mois précédant   - Choisir des dates   -
- {filter_value && String(filter_value) === "d" &&
-
- Date Debut - { - setp_filter_date_from(format(date, 'dd/MM/yyyy')); +
+
+ Date Debut + { + setp_filter_date_from(format(date, 'dd/MM/yyyy')); - /> + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style session_caract_Dialog_DatePicker" + locale='fr-FR' -
+ /> -
- Date Fin - { - setp_filter_date_to(format(date, 'dd/MM/yyyy')); +
- } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style enable_style" - /> +
+ Date Fin + { + setp_filter_date_to(format(date, 'dd/MM/yyyy')); -
+ } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + /> -
+
+ +
+
} +
Client
@@ -644,18 +676,13 @@ const Dashbord_Factures = (props) => { if (value && value._id) { setp_detail_partner_client_id(value._id); - setp_detail_partner_client_nom(value.label); - - } else { setp_detail_partner_client_id(""); setp_detail_partner_client_nom(""); } - Getall_Qry_Invoice_Data(); - }} renderInput={(params) => { />}
-
} +


+
+
+
+
- -
+ +
@@ -601,7 +778,7 @@ const Dashbord_Ressources_Humaines = (props) => { className="datagridclass" onRowDoubleClick={(newSelectionModel) => { - + }} @@ -643,13 +820,30 @@ const Dashbord_Ressources_Humaines = (props) => { }} + getEstimatedRowHeight={() => 200} + getRowHeight={() => "auto"} + />
+ {Getall_Qry_RH_Data_result && + Getall_Qry_RH_Data_result.map((my_data) => ( +
+ {JSON.parse(my_data).total_duration && + } + + + +
+ ))}
@@ -664,203 +858,222 @@ const Dashbord_Ressources_Humaines = (props) => {
- - -
-
- - - - - -
- - {tdb_title && String(tdb_title) === "3" &&
- -
+
- + -
+ - + ) diff --git a/src/components/Dashbord_Ressources_Humaines_Tache_Couts.js b/src/components/Dashbord_Ressources_Humaines_Tache_Couts.js index 908481b..a05bef5 100644 --- a/src/components/Dashbord_Ressources_Humaines_Tache_Couts.js +++ b/src/components/Dashbord_Ressources_Humaines_Tache_Couts.js @@ -20,9 +20,18 @@ import { } from "@mui/material"; import { ResponsiveBar } from "@nivo/bar"; - +import Link from '@mui/material/Link'; +import { PiDotsThree } from "react-icons/pi"; 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 Button from '@mui/material/Button'; + const Dashbord_Ressources_Humaines_Tache_Couts = (props) => { const [gridline_id, setgridline_id] = useState(""); const [isLoading, setLoading] = useState(); @@ -33,47 +42,82 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => { date_today_90j.setDate(date_today_90j.getDate() - 90); const [selectionModel_task_cost, setSelectionModel_task_cost] = React.useState([]); + const [filter_type_tache, setfilter_type_tache] = useState(""); + + function ExpandableCell_50({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( + + ); + } + + const columns_task_cost = [ { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, - { field: 'rh_civilite', headerName: 'Civ.', hide: false, minWidth: 50, flex: 1, maxWidth: 60 }, - { field: 'rh_nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 20 }, - { field: 'rh_prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200 }, - { field: 'rh_email', headerName: 'Email', hide: true, flex: 1, minWidth: 200 }, - { field: 'rh_ismanager', headerName: 'Manager', hide: true, minWidth: 50, flex: 1, maxWidth: 100 }, - { field: 'rh_fonction', headerName: 'Fonction', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_telephone_mobile', headerName: 'Mobile', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_adr_adresse', headerName: 'Adesse', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_adr_code_postal', headerName: 'CP', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_adr_ville', headerName: 'Ville', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_adr_pays', headerName: 'Pays', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, + { 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: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_contrat_date_fin', headerName: 'Ctrat Au', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_contrat_type_contrat', headerName: 'Ctrat Type', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_contrat_type_employe', headerName: 'Ctrat Empl.', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_contrat_cout', headerName: 'Ctrat Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_contrat_periodicite', headerName: 'Ctrat Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_contrat_quantite', headerName: 'Ctrat Qte', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_contrat_groupe_prix_achat_id', headerName: 'Grp Prix ID', hide: true, Width: 0, }, - { field: 'rh_contrat_groupe_prix_achat_code', headerName: 'Grp Prix Code', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_contrat_groupe_prix_achat_cout', headerName: 'Grp Prix Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_contrat_groupe_prix_achat_periodicite', headerName: 'Grp Prix Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150 }, + { 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, }, - { field: 'rh_event_planning_even_comment', headerName: 'Planning Comment', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_event_planning_event_type', headerName: 'Planning Type', hide: false, minWidth: 100, flex: 1, maxWidth: 100 }, - { field: 'rh_event_planning_event_duration_hour', headerName: 'Planning Durée (h)', hide: false, minWidth: 50, flex: 1, maxWidth: 100 }, - { field: 'rh_event_planning_agenda_date_jour', headerName: 'Planning Date', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'rh_event_planning_event_start', headerName: 'Planning Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 }, - { field: 'rh_event_planning_event_end', headerName: 'Planning Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 }, - { field: 'rh_event_planning_event_cost', headerName: 'Planning Cout Total (HT)', hide: false, minWidth: 150, flex: 1, maxWidth: 150 }, + { 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 [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')); @@ -109,7 +153,10 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => { 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"); + if (selected_employee_id && String(setselected_employee_id).length > 5) + form.append("tab_rh_id", selected_employee_id); + else + form.append("tab_rh_id", "all"); form.append("event_type", event_type_filter); @@ -197,6 +244,78 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => { }) } + + const [New_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]); + + const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState(); + const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState(); + const [Getall_Training_Employee_No_Filter_result, setGetall_Training_Employee_No_Filter_result] = useState(); + function Getall_Training_Employee_No_Filter(event) { + + 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_List_Ressource_Humaine_no_filter/"; + + + + axios.post(myurl, form).then(res => { + + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Training_Employee_No_Filter res.data.status = " + res.data.status); + //console.log(" In Getall_Training_Employee_No_Filter res.data.message r_class = " + res.data.message); + setGetall_Training_Employee_No_Filter_api("true"); + setGetall_Training_Employee_No_Filter_result(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_nom = JSON.parse(x).nom; + var local_prenom = JSON.parse(x).prenom; + var local_ismanager = JSON.parse(x).ismanager; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom + " " + local_prenom, + "nom": local_nom, + "prenom": local_prenom, + "ismanager": local_ismanager + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Getall_Training_Employee_No_Filter_result(new_data2); + + } + else { + setGetall_Training_Employee_No_Filter_api("false"); + setGetall_Training_Employee_No_Filter_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( Getall_Training_Employee_No_Filter = ', error); + setGetall_Training_Employee_No_Filter_api("false"); + alert(" Impossible de recuperer la liste des employés"); + //setmyApimyApiMessage("") + }) + } + + const [selected_employee_id, setselected_employee_id] = useState(""); + + + + useEffect(() => { setp_filter_date_from(props.user_dashbord_filter_start); @@ -246,12 +365,177 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => { } + + const New_option_type_planing = [ + { "id": "absence", "label": "Absence", "value": "absence" }, + { "id": "planning", "label": "Planning", "value": "planning" }, + { "id": "autre", "label": "Autre", "value": "autre" }, + { "id": "", "label": "", "value": "" }, + ] + + const New_option_periode = [ + { "id": "m0", "label": "Mois en cours", "value": "m0" }, + { "id": "m1", "label": "Mois précédant ", "value": "m1" }, + { "id": "d", "label": "Choisir des dates", "value": "d" }, + + ] + + + return (
{isLoading &&
} +
+
+ 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 enable_style" + locale='fr-FR' + + /> + +
+
+
+
+ Date Fin + { + setp_filter_date_to(format(date, 'dd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + /> + +
+
+ +
} +
+ +
+
+ Type Tache
+ + { + if (value && value.value) { + setfilter_type_tache(value.value); + + + } else { + setfilter_type_tache(""); + } + }} + + renderInput={(params) => + } + /> + + + +
+ +
+ Employé
+ + { + if (value && value._id) { + setselected_employee_id(value._id); + + } else { + setselected_employee_id(""); + } + }} + + renderInput={(params) => + } + /> + + +
+
+ +
+
+
+
+ +
+
@@ -323,150 +607,171 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => {  
-
+
-
-   - +   + - + { + onSelectionModelChange={(newSelectionModel) => { 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} + /*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, + 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, + 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" + columns={columns_task_cost} + pageSize={10} + className="datagridclass" - onRowDoubleClick={(newSelectionModel) => { - - }} + onRowDoubleClick={(newSelectionModel) => { + + }} - rowsPerPageOptions={[10]} - disableSelectionOnClick - components={{ - Toolbar: GridToolbar, - }} - //sx={datagridSx} - getCellClassName={(params) => { + 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'; - } + // 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) => { + getRowClassName={(params) => { - // Pour la gestion de la couleur de zone double cliquée - if (String(params.row.id) === String(gridline_id)) { + // 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'; - } + 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 && + } + +
+ ))} +
+ +
diff --git a/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js b/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js index b46c4f7..00fac97 100644 --- a/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js +++ b/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js @@ -20,9 +20,18 @@ import { } from "@mui/material"; import { ResponsiveBar } from "@nivo/bar"; - +import Link from '@mui/material/Link'; +import { PiDotsThree } from "react-icons/pi"; 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 Button from '@mui/material/Button'; + const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => { const [gridline_id, setgridline_id] = useState(""); const [isLoading, setLoading] = useState(); @@ -32,27 +41,57 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => { var date_today_90j = new Date(); date_today_90j.setDate(date_today_90j.getDate() - 90); + const [filter_type_tache, setfilter_type_tache] = useState(""); + + function ExpandableCell_50({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( + + ); + } + + const columns = [ { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, - { field: 'civilite', headerName: 'Civ.', hide: false, minWidth: 50, flex: 1, maxWidth: 60 }, - { field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 20 }, - { field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200 }, - { field: 'email', headerName: 'Email', hide: false, flex: 1, minWidth: 200 }, - { field: 'ismanager', headerName: 'Manager', hide: false, minWidth: 50, flex: 1, maxWidth: 100 }, - { field: 'fonction', headerName: 'Fonction', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, - - { field: 'agenda_event_title', headerName: 'Titre Event', hide: false, minWidth: 200, flex: 1, }, - { field: 'agenda_event_code_session', headerName: 'Code session', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'agenda_event_type', headerName: 'Type Event', hide: false, minWidth: 100, flex: 1, maxWidth: 100 }, - { field: 'event_duration_hour', headerName: 'Durée (h)', hide: false, minWidth: 50, flex: 1, maxWidth: 100 }, - { field: 'agenda_date_jour', headerName: 'Date', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, - { field: 'agenda_event_start', headerName: 'Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 }, - { field: 'agenda_event_end', headerName: 'Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 }, - { field: 'agenda_event_sequence_session_id', headerName: 'agenda_id', hide: true, maxWidth: 1 }, - + { 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 [p_filter_date_from, setp_filter_date_from] = useState(date_today_90j.toLocaleDateString('fr-FR')); @@ -60,7 +99,7 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => { const [event_type_filter, setevent_type_filter] = useState(props.user_dashbord_filter_type_envent); - + const [filter_value, setfilter_value] = useState(""); const [Getall_Qry_RH_Data_result_JSON, setGetall_Qry_RH_Data_result_JSON] = useState([]); @@ -95,7 +134,10 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => { 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"); + if (selected_employee_id && String(setselected_employee_id).length > 5) + form.append("tab_rh_id", selected_employee_id); + else + form.append("tab_rh_id", "all"); form.append("event_type", event_type); @@ -183,9 +225,81 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => { }) } + + const [New_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]); + + const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState(); + const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState(); + const [Getall_Training_Employee_No_Filter_result, setGetall_Training_Employee_No_Filter_result] = useState(); + function Getall_Training_Employee_No_Filter(event) { + + 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_List_Ressource_Humaine_no_filter/"; + + + + axios.post(myurl, form).then(res => { + + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Training_Employee_No_Filter res.data.status = " + res.data.status); + //console.log(" In Getall_Training_Employee_No_Filter res.data.message r_class = " + res.data.message); + setGetall_Training_Employee_No_Filter_api("true"); + setGetall_Training_Employee_No_Filter_result(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_nom = JSON.parse(x).nom; + var local_prenom = JSON.parse(x).prenom; + var local_ismanager = JSON.parse(x).ismanager; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom + " " + local_prenom, + "nom": local_nom, + "prenom": local_prenom, + "ismanager": local_ismanager + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Getall_Training_Employee_No_Filter_result(new_data2); + + } + else { + setGetall_Training_Employee_No_Filter_api("false"); + setGetall_Training_Employee_No_Filter_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( Getall_Training_Employee_No_Filter = ', error); + setGetall_Training_Employee_No_Filter_api("false"); + alert(" Impossible de recuperer la liste des employés"); + //setmyApimyApiMessage("") + }) + } + + const [selected_employee_id, setselected_employee_id] = useState(""); + + useEffect(() => { setp_filter_date_from(props.user_dashbord_filter_start); + + setp_filter_date_to(props.user_dashbord_filter_end); setevent_type_filter(props.user_dashbord_filter_type_envent); @@ -231,12 +345,176 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => { } + + const New_option_type_planing = [ + { "id": "absence", "label": "Absence", "value": "absence" }, + { "id": "planning", "label": "Planning", "value": "planning" }, + { "id": "autre", "label": "Autre", "value": "autre" }, + { "id": "", "label": "", "value": "" }, + ] + + const New_option_periode = [ + { "id": "m0", "label": "Mois en cours", "value": "m0" }, + { "id": "m1", "label": "Mois précédant ", "value": "m1" }, + { "id": "d", "label": "Choisir des dates", "value": "d" }, + + ] + + return (
{isLoading &&
} +
+
+ 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 enable_style" + locale='fr-FR' + + /> + +
+
+
+
+ Date Fin + { + setp_filter_date_to(format(date, 'dd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + /> + +
+
+ +
} +
+ +
+
+ Type Tache
+ + { + if (value && value.value) { + setfilter_type_tache(value.value); + + + } else { + setfilter_type_tache(""); + } + }} + + renderInput={(params) => + } + /> + + + +
+ +
+ Employé
+ + { + if (value && value._id) { + setselected_employee_id(value._id); + + } else { + setselected_employee_id(""); + } + }} + + renderInput={(params) => + } + /> + + +
+
+ +
+
+
+
+ +
+
@@ -435,6 +713,8 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => { } }} + getEstimatedRowHeight={() => 200} + getRowHeight={() => "auto"} /> @@ -442,6 +722,21 @@ const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => {
+ {Getall_Qry_RH_Data_result && + Getall_Qry_RH_Data_result.map((my_data) => ( +
+ + {JSON.parse(my_data).total_duration && + } + + + +
+ ))}
diff --git a/src/components/Mon_Tableau_De_Bord.js b/src/components/Mon_Tableau_De_Bord.js index dfad525..8a1c1c8 100644 --- a/src/components/Mon_Tableau_De_Bord.js +++ b/src/components/Mon_Tableau_De_Bord.js @@ -170,11 +170,51 @@ const Mon_Tableau_De_Bord = (props) => {
} - {/* Gestion des TBD des ressources humaines */} + + {/* 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" && + + + } + + + + +
+ + ))} +
} + + {/* Gestion des TBD des ressources humaines */} + {display_nb_column &&
+ {Get_Connected_User_Dashbord_result && + Get_Connected_User_Dashbord_result.map((step) => ( +
@@ -218,45 +258,6 @@ const Mon_Tableau_De_Bord = (props) => {
} - {/* 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(Get_Connected_User_Dashbord_api) === "true" && (!Get_Connected_User_Dashbord_result || Get_Connected_User_Dashbord_result.length <= 0) &&
diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index 1bd477e..470f5eb 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -102,10 +102,10 @@ const Partner_Commande = (props) => { const columns = [ { field: '_id', headerName: '_id', hide: true }, { field: 'id', headerName: 'id', hide: true }, - { field: 'order_header_ref_interne', headerName: 'Reference', maxWidth: 200, minWidth : 180, flex:1, hide: false, editable: false, renderCell: (params) => , }, + { field: 'order_header_ref_interne', headerName: 'Reference', maxWidth: 200, minWidth: 180, flex: 1, hide: false, editable: false, renderCell: (params) => , }, { field: 'order_header_type', headerName: 'Type', width: 100, hide: false, editable: false }, { - field: 'order_header_status', headerName: 'Statut', maxWidth : 150, flex :1, hide: false, editable: false, + field: 'order_header_status', headerName: 'Statut', maxWidth: 150, flex: 1, hide: false, editable: false, valueFormatter: (params) => { if (String(params.value) === "-1") return "Annulé"; @@ -122,11 +122,11 @@ const Partner_Commande = (props) => { }, }, - { field: 'order_header_client_id', headerName: 'Client_Id', width: 0, hide: true, editable: false }, - { field: 'order_header_client_nom', headerName: 'Nom Client', minWidth: 200, flex: 1 , renderCell: (params) => , }, + { field: 'order_header_client_id', headerName: 'Client_Id', width: 0, hide: true, editable: false }, + { field: 'order_header_client_nom', headerName: 'Nom Client', minWidth: 200, flex: 1, renderCell: (params) => , }, { field: 'order_header_vendeur_id', headerName: 'Vendeur Id', width: 0, hide: true, editable: false }, - { field: 'order_header_vendeur_nom_prenom', headerName: 'Vendeur', width: 150, flex: 1, editable: false, flex:1 }, - { field: 'order_header_date_cmd', headerName: 'Date', minWidth: 150, hide: false, editable: false, flex: 1 , renderCell: (params) => , }, + { field: 'order_header_vendeur_nom_prenom', headerName: 'Vendeur', width: 150, flex: 1, editable: false, flex: 1 }, + { field: 'order_header_date_cmd', headerName: 'Date', minWidth: 150, hide: false, editable: false, flex: 1, renderCell: (params) => , }, { field: 'order_header_date_expiration', headerName: 'Date Expiration', minWidth: 150, hide: false, editable: false }, @@ -4170,6 +4170,9 @@ const Partner_Commande = (props) => { setp_add_cmd_header_vendeur_id_label(value.label); + } else { + setp_add_cmd_header_vendeur_id(""); + setp_add_cmd_header_vendeur_id_label(""); } }} @@ -5838,14 +5841,14 @@ const Partner_Commande = (props) => { {String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && } {String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && } - +

{String(p_detail_header_devis_date_validation).length > 5 && } {String(p_detail_header_devis_date_envoi).length > 5 && } - - {(!p_detail_header_devis_date_validation || String(p_detail_header_devis_date_validation).length < 5) && } + + {(!p_detail_header_devis_date_validation || String(p_detail_header_devis_date_validation).length < 5) && } {(!p_detail_header_devis_date_envoi || String(p_detail_header_devis_date_envoi).length < 5) && } diff --git a/src/styles/components/_partner_commande.scss b/src/styles/components/_partner_commande.scss index aebb611..dba678c 100644 --- a/src/styles/components/_partner_commande.scss +++ b/src/styles/components/_partner_commande.scss @@ -2047,7 +2047,7 @@ .bton_put_to_invoice { background: #d5f38f; color: black; - width: 25% !important; + width: 100% !important; height: 3rem !important; }