14/07/2024 - 22h
parent
377297cf18
commit
23140c3c94
|
@ -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);
|
||||
|
||||
|
@ -10370,6 +10371,9 @@ const Employes = (props) => {
|
|||
<Button variant="outlined" onClick={submenu_evaluation} className="detail_class_submenu" id='evaluation' name='evaluation'>Evaluation </Button>
|
||||
<Button variant="outlined" onClick={submenu_statistiques} className="detail_class_submenu" id='statistiques' name='statistiques'>Statistiques </Button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Les Statitiques </nav>
|
||||
|
||||
|
||||
|
@ -10378,6 +10382,7 @@ const Employes = (props) => {
|
|||
<div className="session_caract">
|
||||
Choisir une question
|
||||
{New_Getall_Employee_Statistic_Question_List_result && New_Getall_Employee_Statistic_Question_List_result.length > 0 &&
|
||||
|
||||
<div style={{ width: '90%', }}>
|
||||
|
||||
|
||||
|
|
|
@ -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) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'email', headerName: 'Email', hide: true, flex: 1, minWidth: 250, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'ismanager', headerName: 'Manager', hide: true, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'fonction', headerName: 'Fonction', hide: true, minWidth: 200, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
|
||||
{ field: 'agenda_event_title', headerName: 'Titre Event', hide: false, minWidth: 250, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'agenda_event_code_session', headerName: 'Code session', hide: false, minWidth: 250, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'agenda_event_type', headerName: 'Type Event', hide: false, minWidth: 150, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'event_duration_hour', headerName: 'Durée (h)', hide: false, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'agenda_date_jour', headerName: 'Date', hide: false, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'agenda_event_start', headerName: 'Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'agenda_event_end', headerName: 'Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} /> },
|
||||
{ field: 'agenda_event_sequence_session_id', headerName: 'agenda_id', hide: true, maxWidth: 1, renderCell: (params) => <ExpandableCell_50 {...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) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_email', headerName: 'Email', hide: true, flex: 1, minWidth: 250, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_ismanager', headerName: 'Manager', hide: true, minWidth: 50, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_fonction', headerName: 'Fonction', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_telephone_mobile', headerName: 'Mobile', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_adr_adresse', headerName: 'Adesse', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_adr_code_postal', headerName: 'CP', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_adr_ville', headerName: 'Ville', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_adr_pays', headerName: 'Pays', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
|
||||
|
||||
{ field: 'rh_contrat_date_debut', headerName: 'Ctrat Du', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_contrat_date_fin', headerName: 'Ctrat Au', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_contrat_type_contrat', headerName: 'Ctrat Type', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_contrat_type_employe', headerName: 'Ctrat Empl.', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_contrat_cout', headerName: 'Ctrat Cout', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_contrat_periodicite', headerName: 'Ctrat Périodicité', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_contrat_quantite', headerName: 'Ctrat Qte', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
|
||||
{ field: 'rh_contrat_groupe_prix_achat_id', headerName: 'Grp Prix ID', hide: true, Width: 0, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_contrat_groupe_prix_achat_code', headerName: 'Grp Prix Code', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
|
||||
{ field: 'rh_contrat_groupe_prix_achat_cout', headerName: 'Grp Prix Cout', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_contrat_groupe_prix_achat_periodicite', headerName: 'Grp Prix Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
|
||||
|
||||
{ field: 'rh_event_planning_event_title', headerName: 'Planning Titre', hide: false, minWidth: 200, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_event_planning_even_comment', headerName: 'Planning Comment', hide: true, minWidth: 100, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_event_planning_event_type', headerName: 'Planning Type', hide: false, minWidth: 150, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_event_planning_event_duration_hour', headerName: 'Planning Durée (h)', hide: false, minWidth: 100, flex: 1, maxWidth: 100, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_event_planning_agenda_date_jour', headerName: 'Planning Date', hide: true, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_event_planning_event_start', headerName: 'Planning Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_event_planning_event_end', headerName: 'Planning Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
{ field: 'rh_event_planning_event_cost', headerName: 'Planning Cout Total (HT)', hide: false, minWidth: 150, flex: 1, maxWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||
|
||||
]
|
||||
|
||||
const [selectionModel_task_cost, setSelectionModel_task_cost] = React.useState([]);
|
||||
|
||||
function ExpandableCell_50({ value }) {
|
||||
const [expanded, setExpanded] = React.useState(false);
|
||||
|
||||
return (
|
||||
<nav>
|
||||
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
|
||||
|
||||
{expanded ? value : value.slice(0, 50)}
|
||||
{value.length > 50 && (
|
||||
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
||||
<Link
|
||||
type="button"
|
||||
component="button"
|
||||
sx={{ fontSize: 'inherit' }}
|
||||
onClick={() => setExpanded(!expanded)}
|
||||
>
|
||||
{expanded ? <nav> <PiDotsThree />Réduire</nav> : <nav> <PiDotsThree />Voir</nav>}
|
||||
</Link>
|
||||
)}
|
||||
</div>}
|
||||
|
||||
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
|
||||
|
||||
</div>
|
||||
}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
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 (
|
||||
<div className="mon_tableau_de_bord">
|
||||
|
@ -638,6 +1054,7 @@ const Mon_Tableau_De_Bord = (props) => {
|
|||
<Button variant="outlined" onClick={submenu_montbd} className="detail_class_submenu" id='montbd' name='montbd' >Mon tableau de bord </Button>
|
||||
<Button variant="outlined" onClick={submenu_rapport_activite} className="detail_class_submenu" id='rapport_activite' name='rapport_activite' >Rapport Activite </Button>
|
||||
<Button variant="outlined" onClick={submenu_rapport_financier} className="detail_class_submenu" id='rapport_financier' name='rapport_financier' >Rapports Financiers </Button>
|
||||
<Button variant="outlined" onClick={submenu_rapport_rh} className="detail_class_submenu" id='rapport_rh' name='rapport_rh' >Ressources Humaine </Button>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -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) => {
|
|||
|
||||
<Button variant="outlined" onClick={display_invoice_by_periode} className="detail_class_submenu" id='montbd' name='montbd' > Par Période </Button>
|
||||
<Button variant="outlined" onClick={display_invoice_by_formation} className="detail_class_submenu" id='rapport_activite' name='rapport_activite' >Par Ftion </Button>
|
||||
<Button variant="outlined" onClick={display_invoice_by_session} className="detail_class_submenu" id='rapport_activite' name='rapport_activite' >Par Session </Button>
|
||||
<Button variant="outlined" onClick={display_invoice_by_client} className="detail_class_submenu" id='rapport_activite' name='rapport_activite' >Par Client </Button>
|
||||
<Button variant="outlined" onClick={display_invoice_by_periode_cumule} className="detail_class_submenu" id='rapport_activite' name='rapport_activite' >Par période (Cumulé) </Button>
|
||||
|
||||
</div>
|
||||
|
@ -777,6 +1202,48 @@ const Mon_Tableau_De_Bord = (props) => {
|
|||
|
||||
/>}
|
||||
|
||||
{filter_invoice_group_by && String(filter_invoice_group_by) === "client" && <BarChart
|
||||
dataset={Getall_Qry_Invoice_Data_result_JSON[0].data}
|
||||
xAxis={[{
|
||||
scaleType: 'band', dataKey: 'Client_nom', tickPlacement: 'middle',
|
||||
valueFormatter: (month, context) => {
|
||||
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" && <BarChart
|
||||
dataset={Getall_Qry_Invoice_Data_result_JSON[0].data}
|
||||
xAxis={[{ scaleType: 'band', dataKey: 'month_year', tickPlacement: 'middle', }]}
|
||||
series={[
|
||||
{ dataKey: 'TotalAmount_cumule', label: 'CA TTC', valueFormatter_CA },
|
||||
{ dataKey: 'count', label: 'Count', valueFormatter_count },
|
||||
|
||||
]}
|
||||
{...chartSetting}
|
||||
margin={{ right: 15, left: 100 }}
|
||||
|
||||
/>}
|
||||
|
||||
|
||||
{filter_invoice_group_by && String(filter_invoice_group_by) === "class" &&
|
||||
<BarChart
|
||||
|
@ -797,9 +1264,8 @@ const Mon_Tableau_De_Bord = (props) => {
|
|||
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) => {
|
|||
</div>
|
||||
}
|
||||
|
||||
<hr className="hr_break" />
|
||||
<br />
|
||||
|
||||
|
||||
{Getall_Qry_Quotation_Data_result_JSON && Getall_Qry_Quotation_Data_result_JSON.length > 0 &&
|
||||
Getall_Qry_Quotation_Data_result_JSON[0].data &&
|
||||
<div>
|
||||
<div className="titre1"> Le suivi des devis </div>
|
||||
<div className="parent_group_by">
|
||||
|
||||
<Button variant="outlined" onClick={display_quotation_by_periode} className="detail_class_submenu" id='montbd' name='montbd' > Par Période </Button>
|
||||
{/*<Button variant="outlined" onClick={display_quotation_by_client} className="detail_class_submenu" id='rapport_activite' name='rapport_activite' >Par Client </Button>*/}
|
||||
{/* <Button variant="outlined" onClick={display_quotation_by_periode_cumule} className="detail_class_submenu" id='rapport_activite' name='rapport_activite' >Par période (Cumulé) </Button>*/}
|
||||
|
||||
</div>
|
||||
{filter_quotation_group_by && String(filter_quotation_group_by) === "periode" && <BarChart
|
||||
dataset={Getall_Qry_Quotation_Data_result_JSON[0].data}
|
||||
xAxis={[{ scaleType: 'band', dataKey: 'month_year', tickPlacement: 'middle' }]}
|
||||
series={[
|
||||
{ dataKey: 'nb_devis_gagne', label: 'Gagné', color: '#41B06E' },
|
||||
{ dataKey: 'nb_devis_perdu', label: 'Perdu', color: '#FA7070' },
|
||||
|
||||
]}
|
||||
{...chartSetting}
|
||||
margin={{ right: 15, left: 100 }}
|
||||
|
||||
/>}
|
||||
|
||||
{/*filter_quotation_group_by && String(filter_quotation_group_by) === "client" && <BarChart
|
||||
dataset={Getall_Qry_Quotation_Data_result_JSON[0].data}
|
||||
xAxis={[{ scaleType: 'band', dataKey: 'Client_nom', tickPlacement: 'middle' }]}
|
||||
series={[
|
||||
{ dataKey: 'nb_devis_gagne', label: 'Gagné', color: '#41B06E' },
|
||||
{ dataKey: 'nb_devis_perdu', label: 'Perdu', color: '#FA7070' },
|
||||
|
||||
]}
|
||||
{...chartSetting}
|
||||
margin={{ right: 15, left: 100 }}
|
||||
|
||||
/>*/}
|
||||
|
||||
{/*filter_quotation_group_by && String(filter_quotation_group_by) === "cumule" && <BarChart
|
||||
dataset={Getall_Qry_Invoice_Data_result_JSON[0].data}
|
||||
xAxis={[{ scaleType: 'band', dataKey: 'month_year', tickPlacement: 'middle' }]}
|
||||
series={[
|
||||
{ dataKey: 'nb_cumule_gagne', label: 'Gagné', color: '#41B06E' },
|
||||
{ dataKey: 'nb_cumule_perdu', label: 'Perdu', color: '#FA7070' },
|
||||
|
||||
]}
|
||||
{...chartSetting}
|
||||
margin={{ right: 15, left: 100 }}
|
||||
|
||||
/>*/}
|
||||
</div>}
|
||||
|
||||
<hr className="hr_break" />
|
||||
<br />
|
||||
|
||||
{Getall_Qry_Previsionnel_Data_result_JSON && Getall_Qry_Previsionnel_Data_result_JSON.length > 0 &&
|
||||
Getall_Qry_Previsionnel_Data_result_JSON[0].data &&
|
||||
<BarChart
|
||||
|
||||
dataset={Getall_Qry_Previsionnel_Data_result_JSON[0].data}
|
||||
xAxis={[{ scaleType: 'band', dataKey: 'month_year', tickPlacement: 'middle' }]}
|
||||
series={[
|
||||
{ dataKey: 'ca_month_previsionnel', label: 'CA Prév', valueFormatter_CA },
|
||||
|
||||
|
||||
|
||||
]}
|
||||
{...chartSetting}
|
||||
margin={{ right: 15, left: 100 }}
|
||||
|
||||
/>}
|
||||
|
||||
|
||||
</div>
|
||||
</Box>
|
||||
</div>}
|
||||
|
||||
{String(submenu) === String("rapport_rh") && <div style={{ "border": "None" }}>
|
||||
|
||||
<h3> Rapports Ressources Humaines </h3>
|
||||
<Box >
|
||||
<div className="session_data" >
|
||||
<div style={{ "border": "None" }}>
|
||||
|
||||
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
height: 500,
|
||||
width: '100%',
|
||||
paddingRight: '1px',
|
||||
|
||||
"& .MuiDataGrid-columnHeaders": {
|
||||
backgroundColor: "#c8cfd5",
|
||||
color: "black",
|
||||
fontSize: 14
|
||||
},
|
||||
|
||||
'& .line--statut--selected': {
|
||||
backgroundColor: '#FBF2EF',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--pair': {
|
||||
backgroundColor: 'rgba(235, 235, 235, .7)',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--impair': {
|
||||
backgroundColor: '#FFFFFF',
|
||||
color: 'black',
|
||||
},
|
||||
|
||||
}}
|
||||
>
|
||||
<DataGrid
|
||||
checkboxSelection
|
||||
|
||||
onSelectionModelChange={(newSelectionModel) => {
|
||||
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"}
|
||||
|
||||
|
||||
/>
|
||||
</Box>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
{Getall_Qry_RH_Data_result &&
|
||||
Getall_Qry_RH_Data_result.map((my_data) => (
|
||||
<div >
|
||||
|
||||
{JSON.parse(my_data).total_duration &&
|
||||
<nav style={{
|
||||
"paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontWeight": "600", "fontSize": "1.3rem",
|
||||
"color": '#6495ED', "marginBottom":"10px"
|
||||
}}>
|
||||
Durée totale : {JSON.parse(my_data).total_duration}
|
||||
|
||||
</nav>}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
))}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</Box>
|
||||
|
||||
<hr className="hr_break" />
|
||||
<br />
|
||||
|
||||
<Box >
|
||||
|
||||
|
||||
<div className="session_data">
|
||||
<div style={{ "border": "None" }}>
|
||||
|
||||
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
height: 500,
|
||||
width: '100%',
|
||||
paddingRight: '1px',
|
||||
|
||||
"& .MuiDataGrid-columnHeaders": {
|
||||
backgroundColor: "#c8cfd5",
|
||||
color: "black",
|
||||
fontSize: 14
|
||||
},
|
||||
|
||||
'& .line--statut--selected': {
|
||||
backgroundColor: '#FBF2EF',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--pair': {
|
||||
backgroundColor: 'rgba(235, 235, 235, .7)',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--impair': {
|
||||
backgroundColor: '#FFFFFF',
|
||||
color: 'black',
|
||||
},
|
||||
|
||||
}}
|
||||
>
|
||||
<DataGrid
|
||||
checkboxSelection
|
||||
|
||||
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}
|
||||
|
||||
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"}
|
||||
|
||||
|
||||
/>
|
||||
</Box>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
{Getall_Qry_RH_Task_Cost_Data_result &&
|
||||
Getall_Qry_RH_Task_Cost_Data_result.map((my_data) => (
|
||||
<div >
|
||||
|
||||
{JSON.parse(my_data).total_duration &&
|
||||
<nav style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontWeight": "600", "fontSize": "1.3rem",
|
||||
"color":'#6495ED' }}>
|
||||
Durée totale : {JSON.parse(my_data).total_duration}
|
||||
|
||||
</nav>}
|
||||
|
||||
{JSON.parse(my_data).total_cost &&
|
||||
<nav style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontWeight": "600", "fontSize": "1.3rem",
|
||||
"color":'#FF7F50', "marginBottom":"10px" }}>
|
||||
Coût total : {JSON.parse(my_data).total_cost}
|
||||
|
||||
</nav>}
|
||||
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</Box>
|
||||
|
||||
|
||||
</div>}
|
||||
|
||||
{String(submenu) === String("rapport_activite") && <div style={{ "border": "None" }}>
|
||||
<h3> Rapport d'activité </h3>
|
||||
<Box >
|
||||
|
|
|
@ -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) => {
|
|||
</div>}
|
||||
|
||||
|
||||
{/****** Dialog pour cloturer un devis (gerer la perte d'un devis avec motif, ou simple cloture) */}
|
||||
|
||||
<Dialog
|
||||
open={Dialog_Cloture_Devis_open}
|
||||
onClose={Close_Dialog_Cloture_Devis_open}
|
||||
className="partner_commande"
|
||||
>
|
||||
|
||||
<DialogTitle> Cloture devis <font style={{ fontWeight: "700" }}> {String(p_detail_header_ref_interne)} </font> </DialogTitle>
|
||||
<DialogContent style={{ "minHeight": "20rem", "width":"30rem" }}>
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" > Raison Cloture
|
||||
<Autocomplete
|
||||
disablePortal
|
||||
name="raison_cloture"
|
||||
id="raison_cloture"
|
||||
fullWidth
|
||||
options={New_Option_Cloture_Devis}
|
||||
|
||||
onChange={(event, value) => {
|
||||
|
||||
if (value && value.value) {
|
||||
setp_new_raison_cloture(value.value);
|
||||
|
||||
} else {
|
||||
setp_new_raison_cloture("");
|
||||
|
||||
}
|
||||
}}
|
||||
|
||||
|
||||
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
|
||||
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
|
||||
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{p_new_raison_cloture && String(p_new_raison_cloture) !== "" &&
|
||||
<div className="session_caract_Dialog_comment_2_lines" > Commentaire
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="comment_raison_cloture"
|
||||
id="comment_raison_cloture"
|
||||
|
||||
fullWidth
|
||||
|
||||
value={p_new_comment_raison_cloture}
|
||||
onChange={(e) => {
|
||||
setp_new_comment_raison_cloture(e.target.value);
|
||||
}
|
||||
}
|
||||
|
||||
//label="Commentaire"
|
||||
//variant="standard"
|
||||
multiline
|
||||
minRows={2}
|
||||
maxRows={2}
|
||||
rows={2}
|
||||
|
||||
|
||||
/>
|
||||
|
||||
</div>}
|
||||
|
||||
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
|
||||
|
||||
<div className="div_row">
|
||||
{p_new_raison_cloture && String(p_new_raison_cloture) !== "" && <div className="div_row_gauche">
|
||||
<Button onClick={Closure_Given_Quotation} className="bton_enreg_dialog">Mettre à jour</Button>
|
||||
</div>}
|
||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={Close_Dialog_Cloture_Devis_open} className="bton_annule_dialog" >Annuler</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
|
||||
{/****** Dialog pour cloturer un devis (gerer la perte d'un devis avec motif, ou simple cloture) */}
|
||||
|
||||
|
||||
|
||||
{/* Dialog pour gerer la signature digitale */}
|
||||
<Dialog
|
||||
|
@ -4673,29 +4857,7 @@ const Partner_Commande = (props) => {
|
|||
<div className="titre1"> Utilisez les filtres !</div>
|
||||
<div className="div_row" style={{ "marginBottom": "5px" }}>
|
||||
<div className="div_row_gauche texte_area_filter" >
|
||||
{/* <TextField
|
||||
name="filtre1"
|
||||
label="Choisir un champ"
|
||||
select
|
||||
sx={{ m: 1, width: '100%' }}
|
||||
value={p_filtre1}
|
||||
onChange={(e) => {
|
||||
setp_filtre1(e.target.value);
|
||||
|
||||
}}
|
||||
>
|
||||
<MenuItem value="ref_interne" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Ref. Interne </MenuItem>
|
||||
<MenuItem value="ref_externe" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Ref. Externe (chez le client) </MenuItem>
|
||||
<MenuItem value="client_nom" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Nom Client </MenuItem>
|
||||
<MenuItem value="formation" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Lié à la Formation (code externe) </MenuItem>
|
||||
<MenuItem value="code_session" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Lié à la session (code session) </MenuItem>
|
||||
|
||||
|
||||
</TextField>
|
||||
|
||||
*/}
|
||||
|
||||
{New_Option_Filter && New_Option_Filter.length > 0 && <Autocomplete
|
||||
{New_Option_Filter && New_Option_Filter.length > 0 && <Autocomplete
|
||||
disablePortal
|
||||
name="filtre1"
|
||||
id="filtre1"
|
||||
|
@ -4705,7 +4867,7 @@ const Partner_Commande = (props) => {
|
|||
onChange={(event, value) => {
|
||||
if (value && value.value) {
|
||||
setp_filtre1(value.value);
|
||||
}else{
|
||||
} else {
|
||||
setp_filtre1("");
|
||||
}
|
||||
|
||||
|
@ -6368,7 +6530,17 @@ const Partner_Commande = (props) => {
|
|||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Popup>}
|
||||
</Popup>
|
||||
}
|
||||
{String(p_detail_header_statut_label).toLowerCase() !== "traité" &&
|
||||
String(p_detail_header_statut_label).toLowerCase() !== "facturé" &&
|
||||
String(selected_order_header_type) === "devis" &&
|
||||
<Button variant="outlined" className="detail_class_submenu bton_add_sous_menu_cmd_gauche" onClick={(e) => {
|
||||
|
||||
setp_new_comment_raison_cloture(p_detail_comment_raison_cloture);
|
||||
setDialog_Cloture_Devis_open(true);
|
||||
}} > Perdu </Button>
|
||||
}
|
||||
|
||||
<br /> <br />
|
||||
{String(p_detail_header_statut_label).toLowerCase() === "en cours" &&
|
||||
|
|
Loading…
Reference in New Issue