13/12/2023 - 15h00

recette2
cherif 2023-12-13 15:07:58 +01:00
parent da0a4c4628
commit e0742a4d14
9 changed files with 3724 additions and 140 deletions

View File

@ -268,7 +268,7 @@ const Dashbord_Formation = (props) => {
name="one_sessiondatedebut"
id="one_sessiondatedebut"
selected={new Date(moment(p_filter_date_from, "dd/MM/yyyy"))}
selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_from(format(date, 'dd/MM/yyyy'));
@ -288,7 +288,7 @@ const Dashbord_Formation = (props) => {
<DatePicker
name="one_sessiondatefin"
id="one_sessiondatefin"
selected={new Date(moment(p_filter_date_to, "dd/MM/yyyy"))}
selected={new Date(moment(p_filter_date_to, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_to(format(date, 'dd/MM/yyyy'));

View File

@ -386,7 +386,7 @@ const Dashbord_Session = (props) => {
name="one_sessiondatedebut"
id="one_sessiondatedebut"
selected={new Date(moment(p_filter_date_from, "dd/MM/yyyy"))}
selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_from(format(date, 'dd/MM/yyyy'));
@ -406,7 +406,7 @@ const Dashbord_Session = (props) => {
<DatePicker
name="one_sessiondatefin"
id="one_sessiondatefin"
selected={new Date(moment(p_filter_date_to, "dd/MM/yyyy"))}
selected={new Date(moment(p_filter_date_to, "DD/MM/YYYY"))}
onChange={(date) => {
setp_filter_date_to(format(date, 'dd/MM/yyyy'));

View File

@ -1180,10 +1180,10 @@ const DisplayPartnerSession = (props) => {
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Ressource_Humaine_no_filter/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
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);
@ -1197,6 +1197,7 @@ const DisplayPartnerSession = (props) => {
}
}).catch((error) => {
setLoading(false);
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");
@ -8670,96 +8671,18 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
<h3> Vos sessions de formation </h3>
<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="code_session" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Code Session &nbsp;&nbsp;</MenuItem>
<MenuItem value="class_external_code" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Code Formation (code externe) &nbsp;</MenuItem>
<MenuItem value="class_title" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Titre Formation &nbsp;</MenuItem>
<MenuItem value="session_start_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date debut session &nbsp;</MenuItem>
<MenuItem value="session_end_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date fin session &nbsp;</MenuItem>
</TextField>
</div>
<div className="div_row_droite texte_area_filter_value" >
{p_filtre1 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="filtre1_value"
id="filtre1_value"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_filtre1_value}
onChange={(e) => { setp_filtre1_value(e.target.value); }}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre1_value("");
}} />
</InputAdornment>
),
}}
/>
}
</div>
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip01" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
&nbsp; <MdAddCircleOutline onClick={(e) => {
setp_filtre2("1");
}} />
</a>
</div>}
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip02" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
}}
/>
</a>
</div>}
</div>
{p_filtre2 &&
<div>
<div className="titre1"> Utilisez les filtres !</div>
<div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter">
<div className="div_row_gauche texte_area_filter" >
<TextField
name="filtre2"
name="filtre1"
label="Choisir un champ"
select
sx={{ m: 1, width: '100%' }}
options={filters}
value={p_filtre2}
value={p_filtre1}
onChange={(e) => {
setp_filtre2(e.target.value)
setp_filtre1(e.target.value)
}}
>
@ -8769,74 +8692,153 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
<MenuItem value="session_start_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date debut session &nbsp;</MenuItem>
<MenuItem value="session_end_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date fin session &nbsp;</MenuItem>
</TextField>
</div>
<div className="div_row_droite texte_area_filter" >
{String(p_filtre2).length > 3 &&
<div className="div_row_droite texte_area_filter_value" >
{p_filtre1 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="filtre2_value"
id="filtre2_value"
name="filtre1_value"
id="filtre1_value"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_filtre2_value}
onChange={(e) => setp_filtre2_value(e.target.value)}
value={p_filtre1_value}
onChange={(e) => { setp_filtre1_value(e.target.value); }}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre2_value("");
setp_filtre1_value("");
}} />
</InputAdornment>
),
}}
/>}
/>
}
</div>
{String(p_filtre2).length > 3 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip04" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip04" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
}}
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip01" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
&nbsp; <MdAddCircleOutline onClick={(e) => {
setp_filtre2("1");
}} />
</a>
</div>}
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip02" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
}}
/>
</a>
</div>}
</div>
}
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="bton_enreg" onClick={Getall_TrainingSession}>Rechercher
</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<Button variant="contained" className="bton_annule" onClick={clean_all_filters}>Annuler
</Button>
</div>
</div>}
{p_filtre2 &&
<div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter">
<TextField
name="filtre2"
label="Choisir un champ"
select
sx={{ m: 1, width: '100%' }}
options={filters}
value={p_filtre2}
onChange={(e) => {
setp_filtre2(e.target.value)
}}
>
<MenuItem value="code_session" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Code Session &nbsp;&nbsp;</MenuItem>
<MenuItem value="class_external_code" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Code Formation (code externe) &nbsp;</MenuItem>
<MenuItem value="class_title" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Titre Formation &nbsp;</MenuItem>
<MenuItem value="session_start_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date debut session &nbsp;</MenuItem>
<MenuItem value="session_end_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date fin session &nbsp;</MenuItem>
</TextField>
</div>
<div className="div_row_droite texte_area_filter" >
{String(p_filtre2).length > 3 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="filtre2_value"
id="filtre2_value"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_filtre2_value}
onChange={(e) => setp_filtre2_value(e.target.value)}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre2_value("");
}} />
</InputAdornment>
),
}}
/>}
</div>
{String(p_filtre2).length > 3 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip04" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip04" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
}}
/>
</a>
</div>}
</div>
}
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="bton_enreg" onClick={Getall_TrainingSession}>Rechercher
</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<Button variant="contained" className="bton_annule" onClick={clean_all_filters}>Annuler
</Button>
</div>
</div>}
</div>
<br />
<div style={{ "textAlign": "left", "float": "left", "width": "100%" , "paddingRight":"10px"}} id="participant_menu_tab">
<div style={{ "textAlign": "left", "float": "left", "width": "100%", "paddingRight": "10px" }} id="participant_menu_tab">
<div className="session_data">
@ -8922,11 +8924,11 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
color: "black",
fontSize: 14
},
'& .line--statut--selected': {
backgroundColor: '#FBF2EF',
color: 'black',
},
},
'& .line--statut--pair': {
backgroundColor: 'rgba(235, 235, 235, .7)',
color: 'black',
@ -10702,7 +10704,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
<h5> Gestion séquences </h5>
<div className="div_row" style={{ "border": "None", paddingRight: '10px' }}>
<div className="div_row" style={{ "border": "None", paddingRight: '10px' }}>
<div className="session_data">
<div style={{ "border": "None" }}>

View File

@ -97,7 +97,7 @@ const Employes = (props) => {
return String(params.value);
},
},
{ field: 'nom', headerName: 'Nom', flex: 1, hide: false, minWidth: 150 },
{ field: 'prenom', headerName: 'Prénom', flex: 1, hide: false, minWidth: 150 },
{ field: 'email', headerName: 'Email', flex: 1, hideable: false, minWidth: 200 },
@ -2251,6 +2251,9 @@ const Employes = (props) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
async function submenu_detail_employe() {
setsubmenu("detail_employe");
@ -2274,6 +2277,11 @@ const Employes = (props) => {
document.getElementById("affectation").style.color = "black";
}
if (document.getElementById("contrat")) {
document.getElementById("contrat").style.backgroundColor = "#d8edfc";
document.getElementById("contrat").style.color = "black";
}
//console.log(" ### employee_data_edit_mode = ", employee_data_edit_mode);
if (String(employee_data_edit_mode) !== "1")
disable_Employee_DetailFields();
@ -2310,6 +2318,37 @@ const Employes = (props) => {
document.getElementById("droit_acces").style.color = "black";
}
if (document.getElementById("contrat")) {
document.getElementById("contrat").style.backgroundColor = "#d8edfc";
document.getElementById("contrat").style.color = "black";
}
}
async function submenu_contrat() {
setsubmenu("contrat");
await sleep(5);
if (document.getElementById("contrat")) {
document.getElementById("contrat").style.backgroundColor = "#104277";
document.getElementById("contrat").style.color = "white";
}
if (document.getElementById("affectation")) {
document.getElementById("affectation").style.backgroundColor = "#d8edfc";
document.getElementById("affectation").style.color = "black";
}
if (document.getElementById("detail_employe")) {
document.getElementById("detail_employe").style.backgroundColor = "#d8edfc";
document.getElementById("detail_employe").style.color = "black";
}
if (document.getElementById("droit_acces")) {
document.getElementById("droit_acces").style.backgroundColor = "#d8edfc";
document.getElementById("droit_acces").style.color = "black";
}
}
@ -2334,6 +2373,12 @@ const Employes = (props) => {
document.getElementById("affectation").style.backgroundColor = "#d8edfc";
document.getElementById("affectation").style.color = "black";
}
if (document.getElementById("contrat")) {
document.getElementById("contrat").style.backgroundColor = "#d8edfc";
document.getElementById("contrat").style.color = "black";
}
setSelectionModel_affectations([]);
setdisplay_affectation("0");
setAdd_new_affectation("");
@ -4134,7 +4179,7 @@ const Employes = (props) => {
<br />
</div>
<div className="div_row" style={{paddingRight: '10px' }}>
<div className="div_row" style={{ paddingRight: '10px' }}>
<div className="session_data">
<div style={{ "border": "None" }}>
@ -4172,7 +4217,7 @@ const Employes = (props) => {
backgroundColor: '#F7F2E0',
color: 'black',
},
/*"& .MuiDataGrid-virtualScrollerRenderZone": {
"& .MuiDataGrid-row": {
@ -4184,7 +4229,7 @@ const Employes = (props) => {
color: "black",
fontSize: 14
},
'& .line--statut--selected': {
backgroundColor: '#FBF2EF',
color: 'black',
@ -4227,7 +4272,7 @@ const Employes = (props) => {
profil: JSON.parse(item).profil,
fonction: JSON.parse(item).fonction,
ismanager: JSON.parse(item).ismanager,
}
))}
@ -4283,10 +4328,10 @@ const Employes = (props) => {
if (String(params.row.id) === String(gridline_id)) {
return 'line--statut--selected';
}
else if( parseInt(String(params.row.id)) % 2 === 0){
else if (parseInt(String(params.row.id)) % 2 === 0) {
return 'line--statut--pair';
}
else if( parseInt(String(params.row.id)) % 2 !== 0){
else if (parseInt(String(params.row.id)) % 2 !== 0) {
return 'line--statut--impair';
}
@ -4360,6 +4405,7 @@ const Employes = (props) => {
<Button variant="outlined" onClick={submenu_detail_employe} className="detail_class_submenu" id='detail_employe' name='detail_employe'>Détail employé</Button>
<Button variant="outlined" onClick={submenu_droit_acces} className="detail_class_submenu" id='droit_acces' name='droit_acces'>Droits d'acces </Button>
<Button variant="outlined" onClick={submenu_affectation} className="detail_class_submenu" id='affectation' name='affectation'>Affectation </Button>
<Button variant="outlined" onClick={submenu_contrat} className="detail_class_submenu" id='affectation' name='contrat'>Contrat </Button>
</div>
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Détail Employé </nav>
@ -5138,6 +5184,7 @@ const Employes = (props) => {
<Button variant="outlined" onClick={submenu_detail_employe} className="detail_class_submenu" id='detail_employe' name='detail_employe'>Détail employé</Button>
<Button variant="outlined" onClick={submenu_droit_acces} className="detail_class_submenu" id='droit_acces' name='droit_acces'>Droits d'acces </Button>
<Button variant="outlined" onClick={submenu_affectation} className="detail_class_submenu" id='affectation' name='affectation'>Affectation </Button>
<Button variant="outlined" onClick={submenu_contrat} className="detail_class_submenu" id='affectation' name='contrat'>Contrat </Button>
</div>
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Ajouter un Employé </nav>
@ -5606,11 +5653,12 @@ const Employes = (props) => {
{String(submenu) === "affectation" && <div className="div_row" style={{paddingRight: '10px' }}>
{String(submenu) === "affectation" && <div className="div_row" style={{ paddingRight: '10px' }}>
<div className="div_row">
<Button variant="outlined" onClick={submenu_detail_employe} className="detail_class_submenu" id='detail_employe' name='detail_employe'>Détail employé</Button>
<Button variant="outlined" onClick={submenu_droit_acces} className="detail_class_submenu" id='droit_acces' name='droit_acces'>Droits d'acces </Button>
<Button variant="outlined" onClick={submenu_affectation} className="detail_class_submenu" id='affectation' name='affectation'>Affectation </Button>
<Button variant="outlined" onClick={submenu_contrat} className="detail_class_submenu" id='affectation' name='contrat'>Contrat </Button>
</div>
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Liste Affectations </nav>
<div className="session_data">
@ -6171,6 +6219,7 @@ const Employes = (props) => {
<Button variant="outlined" onClick={submenu_detail_employe} className="detail_class_submenu" id='detail_employe' name='detail_employe'>Détail employé</Button>
<Button variant="outlined" onClick={submenu_droit_acces} className="detail_class_submenu" id='droit_acces' name='droit_acces'>Droits d'acces </Button>
<Button variant="outlined" onClick={submenu_affectation} className="detail_class_submenu" id='affectation' name='affectation'>Affectation </Button>
<Button variant="outlined" onClick={submenu_contrat} className="detail_class_submenu" id='affectation' name='contrat'>Contrat </Button>
</div>
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Droits d'acces système </nav>
@ -6459,6 +6508,20 @@ const Employes = (props) => {
</div>
</div>}
{String(submenu) === "contrat" && <div className="div_row">
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Droit Acces </nav>
<div className="div_row">
<Button variant="outlined" onClick={submenu_detail_employe} className="detail_class_submenu" id='detail_employe' name='detail_employe'>Détail employé</Button>
<Button variant="outlined" onClick={submenu_droit_acces} className="detail_class_submenu" id='droit_acces' name='droit_acces'>Droits d'acces </Button>
<Button variant="outlined" onClick={submenu_affectation} className="detail_class_submenu" id='affectation' name='affectation'>Affectation </Button>
<Button variant="outlined" onClick={submenu_contrat} className="detail_class_submenu" id='affectation' name='contrat'>Contrat </Button>
</div>
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}>Detail du contrat </nav>
<h3> ici les contrat, les prix d'achat, etcttttt, la categorie (interne, externe), etc</h3>
</div>}
</div >
);

View File

@ -37,6 +37,8 @@ import {
FcFlowChart, FcReading, FcFinePrint, FcCancel, FcCalendar,
} from "react-icons/fc";
import { BiPurchaseTag } from "react-icons/bi";
import { BsTools } from "react-icons/bs";
import DisplayPartnerSession from "./DisplayPartnerSession";
@ -54,6 +56,7 @@ import Partner_Configuration_Jours_Travail from "./Partner_Config_Jours_Travail"
import Dashbord_Session from "./Dashbord_Session";
import Mon_Tableau_De_Bord from "./Mon_Tableau_De_Bord";
import Dashbord_Formation from "./Dashbord_Formation";
import Partner_Prix_Achat from "./Partner_Prix_Achat";
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
@ -312,7 +315,7 @@ const Partner = (props) => {
'mes_sessions', 'setuplms', 'facture', 'pricing', 'mes_clients', 'mes_devis', 'mes_cmd',
'mes_stagiaires', 'mes_employes', 'mon_materiel', 'config_document', 'factures_client', "config_technique",
"config_champ_specific", "module_agenda", "config_session_steps", "config_jours_heures", "dashbord_formation",
"dashbord_session", "mon_tableau_de_bord"]
"dashbord_session", "mon_tableau_de_bord", "prix_achat"]
if (action && list_menu.includes(action)) {
@ -413,6 +416,16 @@ const Partner = (props) => {
}
function prix_achat_func(event) {
setmenu("prix_achat");
setapiexcelimportmessage();
setformation_file_name();
history.push("/Partner/prix_achat");
document.body.style.backgroundColor = "#ffffff";
}
function config_technique_func(event) {
@ -1183,6 +1196,12 @@ const Partner = (props) => {
{String(menu) === "factures_client" && <div className="sousmenu_selected" onClick={mes_factures_client_func}> &nbsp;&nbsp; <FcCollect FcKindle="icone_menu" />&nbsp;MES FACTURES</div>}
</div>
<div>
<hr className="my_hr" />
{String(menu) !== "prix_achat" && <div className="sousmenu" onClick={prix_achat_func}>&nbsp;&nbsp;<BiPurchaseTag className="icone_menu" />&nbsp;MES PRIX ACHAT</div>}
{String(menu) === "prix_achat" && <div className="sousmenu_selected" onClick={prix_achat_func}> &nbsp;&nbsp; <BiPurchaseTag FcKindle="icone_menu" />&nbsp;MES PRIX ACHAT</div>}
</div>
<div class="separator"> Espace E-Learning </div>
@ -1464,7 +1483,7 @@ const Partner = (props) => {
{String(menu) === "mes_sessions" &&
<div className="div_droite">
<DisplayPartnerSession conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("session", "read")} write_access={check_user_acces_right("session", "write")} />
<DisplayPartnerSession conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("session", "read")} write_access={check_user_acces_right("session", "write")} />
</div>
}
@ -1480,6 +1499,12 @@ const Partner = (props) => {
</div>
}
{String(menu) === "prix_achat" &&
<div className="div_droite">
<Partner_Prix_Achat conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("prix_achat", "read")} write_access={check_user_acces_right("prix_achat", "write")} />
</div>
}
{String(menu) === "mon_materiel" &&
<div className="div_droite">
@ -1489,7 +1514,7 @@ const Partner = (props) => {
{String(menu) === "mes_cmd" &&
<div className="div_droite">
<Partner_Commande conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("commande", "read")} write_access={check_user_acces_right("commande", "write")} />
<Partner_Commande conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("commande", "read")} write_access={check_user_acces_right("commande", "write")} />
</div>
}
@ -1514,7 +1539,7 @@ const Partner = (props) => {
{String(menu) === "abonnement" && <div className="div_droite">
<Abonnement currentpack={partnerPackService} conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("abonnement", "read")} write_access={check_user_acces_right("abonnement", "write")} />
<Abonnement currentpack={partnerPackService} conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("abonnement", "read")} write_access={check_user_acces_right("abonnement", "write")} />
</div>
}
@ -1525,7 +1550,7 @@ const Partner = (props) => {
{String(menu) === "mes_clients" && <div className="div_droite">
<Partner_Client conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("client", "read")} write_access={check_user_acces_right("client", "write")} />
<Partner_Client conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("client", "read")} write_access={check_user_acces_right("client", "write")} />
</div>
}

View File

@ -1134,6 +1134,8 @@ const Partner_Configuration_Technique = (props) => {
<div>
<div className="div_row" style={{ paddingRight: '10px' }}>
<h3> Les types de client </h3>
<div className="session_data">
<div style={{ "border": "None" }}>

View File

@ -0,0 +1,864 @@
import React, { useRef, useState, useEffect } from "react";
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
import Button from '@mui/material/Button';
import axios from "axios";
import { getCookie, setCookie } from 'react-use-cookie';
import { useHistory } from "react-router-dom";
import CheckOut from "./CheckOut";
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
import { Editor } from '@tinymce/tinymce-react';
import parse from 'html-react-parser';
import { FcViewDetails, FcDisapprove } from "react-icons/fc";
import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'
import add_plus from "../mysy_img/plus.png";
import excel_icone from "../mysy_img/excel_icone.png";
import participants from "../mysy_img/participants.png";
import fileDownload from 'js-file-download'
import Popup from 'reactjs-popup';
import 'reactjs-popup/dist/index.css';
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { format } from 'date-fns'
import moment from "moment";
import InputAdornment from '@mui/material/InputAdornment';
import { AiFillCloseCircle } from "react-icons/ai";
import Box from '@mui/material/Box';
import { Typography, LinearProgress, sliderClasses } from '@mui/material';
import styled from 'styled-components';
import { CiTrash } from "react-icons/ci";
import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
import { TransitionProps } from '@mui/material/transitions';
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import { Global } from "recharts";
const Partner_Prix_Achat = (props) => {
const history = useHistory();
const [submenu, setsubmenu] = useState("");
const [rowss, setRows] = useState([]);
const [selectionModel, setSelectionModel] = React.useState([]);
const [rows_order_lines, setrows_order_lines] = useState([]);
const [selectionModel_order_lines, setselectionModel_order_lines] = React.useState([]);
const [isLoading, setLoading] = useState();
var date_today_90j = new Date();
date_today_90j.setDate(date_today_90j.getDate() + 90);
const [p_filtre1, setp_filtre1] = useState();
const [p_filtre1_value, setp_filtre1_value] = useState();
const [p_filtre2, setp_filtre2] = useState();
const [p_filtre2_value, setp_filtre2_value] = useState();
const [p_filtre3, setp_filtre3] = useState();
const [p_filtre3_value, setp_filtre3_value] = useState();
const [p_filtre4, setp_filtre4] = useState();
const [p_filtre4_value, setp_filtre4_value] = useState();
const filters = [
{ value: 'code_session', label: 'Code Session' },
{ value: 'class_title', label: 'Titre Formation' },
{ value: 'certif', label: 'Certification' }
]
const columns = [
{ field: '_id', headerName: '_id', hide: true },
{ field: 'id', headerName: 'id', hide: true },
{ field: 'code_groupe_prix', headerName: 'Code', hide: false, editable: false, flex: 1, minWidth: 150, },
{ field: 'periodicite', headerName: 'Périodicité', flex: 1, minWidth: 150, hide: false, editable: false },
{ field: 'date_debut', headerName: 'Début', flex: 1, minWidth: 150, hide: true, editable: false },
{ field: 'date_fin', headerName: 'Fin', flex: 1, minWidth: 150, hideable: false, },
{ field: 'fournisseur', headerName: 'Fournisseur', flex: 1, minWidth: 150, hide: true, editable: false },
{ field: 'prix', headerName: 'prix', flex: 1, minWidth: 150, hideable: false, editable: false },
{
field: "delete", headerName: 'Supprimer', flex: 1, minWidth: 150,
renderCell: (cellValues) => {
return (
<Popup
trigger={<Button
onClick={(event) => {
// handleClick_delete(event, cellValues);
}}
>
<CiTrash />
</Button>}
modal
nested
position="center center"
>
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
En confirmant cette opération, le groupe de prix sera <i><font color="red"> définitivement supprimé</font></i>. <br />
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
handleClick_delete_Pruch_Price_Grp(event, cellValues);
close();
}}> Valider </button>
</div>
<div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
close();
}}
>
Annuler
</button>
</div>
</div>
</div>
)}
</Popup>
);
}
}
]
const [Ge_Partner_Purchase_Prices_api, setGe_Partner_Purchase_Prices_api] = useState();
const [Ge_Partner_Purchase_Prices_message, setGe_Partner_Purchase_Prices_message] = useState();
const [Ge_Partner_Purchase_Prices_result, setGe_Partner_Purchase_Prices_result] = useState([]);
function Ge_Partner_Purchase_Prices(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_Partner_Group_Purchase_Price_List/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Ge_Partner_Purchase_Prices res.data.status = " + res.data.status);
//console.log(" In Ge_Partner_Purchase_Prices res.data.message r_class = " + res.data.message);
setGe_Partner_Purchase_Prices_api("true");
setGe_Partner_Purchase_Prices_result(res.data.message);
}
else {
setGe_Partner_Purchase_Prices_api("false");
setGe_Partner_Purchase_Prices_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Ge_Partner_Purchase_Prices = ', error);
setGe_Partner_Purchase_Prices_api("false");
alert(" Impossible de recuperer la liste des prix d'achat ");
//setmyApimyApiMessage("")
})
}
useEffect(() => {
Ge_Partner_Purchase_Prices();
window.scrollTo({
top: 0,
behavior: "smooth",
});
}, [])
const [selected_pruchase_price_id, setselected_pruchase_price_id] = useState();
const [gridline_id, setgridline_id] = useState("");
const [p_purchase_price_code, setp_purchase_price_code] = useState("");
const [p_purchase_price_fournisseur, setp_purchase_price_fournisseur] = useState("");
const [p_purchase_price_prix, setp_purchase_price_prix] = useState("");
const [p_purchase_price_periodicite, setp_purchase_price_periodicite] = useState("");
const [p_purchase_price_date_debut, setp_purchase_price_date_debut] = useState(new Date().toLocaleDateString('fr-FR'));
const [p_purchase_price_date_fin, setp_purchase_price_date_fin] = useState(date_today_90j.toLocaleDateString('fr-FR'));
const [Dialog_pruch_price_open, setDialog_pruch_price_open] = React.useState(false);
function func_Dialog_pruch_price_open(message) {
setDialog_pruch_price_open(true);
}
const Dialog_pruch_price_open_handleClose = () => {
//alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const Dialog_pruch_price_handleClose_buton = () => {
setp_purchase_price_code();
setp_purchase_price_fournisseur();
setp_purchase_price_prix();
setp_purchase_price_periodicite();
setp_purchase_price_date_debut(new Date().toLocaleDateString('fr-FR'));
setp_purchase_price_date_fin(date_today_90j.toLocaleDateString('fr-FR'));
setselected_pruchase_price_id('');
setdialog_data_changed('');
setDialog_pruch_price_open(false);
};
const Dialog_pruch_price_handleClose = () => {
setDialog_pruch_price_open(false);
};
function handleClick_edit_groupe_purch_price_From_Line(selected_row_id) {
var line = JSON.parse(Ge_Partner_Purchase_Prices_result[selected_row_id]);
setselected_pruchase_price_id(line._id);
setp_purchase_price_code(line.code_groupe_prix);
setp_purchase_price_fournisseur(line.fournisseur);
setp_purchase_price_prix(line.prix);
setp_purchase_price_periodicite(line.periodicite);
setp_purchase_price_date_debut(line.date_debut);
setp_purchase_price_date_fin(line.date_fin);
setDialog_pruch_price_open(true);
}
const [Add_Update_Grp_Purchase_Price_api, setAdd_Update_Grp_Purchase_Price_api] = useState();
const [Add_Update_Grp_Purchase_Price_message, setAdd_Update_Grp_Purchase_Price_message] = useState();
const [Add_Update_Grp_Purchase_Price_result, setAdd_Update_Grp_Purchase_Price_result] = useState();
function Add_Update_Grp_Purchase_Price(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = "";
if (String(selected_pruchase_price_id).trim().length > 2) {
// Il s'agit d'une mise à jour
myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Group_Purchase_Price/";
form.append("_id", selected_pruchase_price_id);
form.append("code_groupe_prix", p_purchase_price_code);
form.append("periodicite", p_purchase_price_periodicite);
form.append("date_debut", p_purchase_price_date_debut);
form.append("date_fin", p_purchase_price_date_fin);
form.append("fournisseur", p_purchase_price_fournisseur);
form.append("prix", p_purchase_price_prix);
} else {
// Il s'agit d'une creation
myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Group_Purchase_Price/";
form.append("code_groupe_prix", p_purchase_price_code);
form.append("periodicite", p_purchase_price_periodicite);
form.append("date_debut", p_purchase_price_date_debut);
form.append("date_fin", p_purchase_price_date_fin);
form.append("fournisseur", p_purchase_price_fournisseur);
form.append("prix", p_purchase_price_prix);
}
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Add_Update_Grp_Purchase_Price res.data.status = " + res.data.status);
//console.log(" In Add_Update_Grp_Purchase_Price res.data.message r_class = " + res.data.message);
setAdd_Update_Grp_Purchase_Price_api("true");
setAdd_Update_Grp_Purchase_Price_result(res.data.message);
Dialog_pruch_price_handleClose_buton();
Ge_Partner_Purchase_Prices();
setSelectionModel([]);
setgridline_id();
alert(res.data.message);
}
else {
setAdd_Update_Grp_Purchase_Price_api("false");
setAdd_Update_Grp_Purchase_Price_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Add_Update_Grp_Purchase_Price = ', error);
setAdd_Update_Grp_Purchase_Price_api("false");
alert(" Impossible d'ajouter / mettre à jour le groupe de prix d'achat");
//setmyApimyApiMessage("")
})
}
const [handleClick_delete_Pruch_Price_Grp_api, sethandleClick_delete_Pruch_Price_Grp_api] = useState();
const [handleClick_delete_Pruch_Price_Grp_message, sethandleClick_delete_Pruch_Price_Grp_message] = useState();
const [handleClick_delete_Pruch_Price_Grp_result, sethandleClick_delete_Pruch_Price_Grp_result] = useState();
function handleClick_delete_Pruch_Price_Grp(event, cellValues) {
var group_prix = cellValues.row._id;
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("_id", group_prix);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Group_Purchase_Price/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In handleClick_delete_Pruch_Price_Grp res.data.status = " + res.data.status);
//console.log(" In handleClick_delete_Pruch_Price_Grp res.data.message r_class = " + res.data.message);
sethandleClick_delete_Pruch_Price_Grp_api("true");
sethandleClick_delete_Pruch_Price_Grp_result(res.data.message);
Dialog_pruch_price_handleClose_buton();
setSelectionModel([]);
setgridline_id();
Ge_Partner_Purchase_Prices();
alert(res.data.message);
}
else {
sethandleClick_delete_Pruch_Price_Grp_api("false");
sethandleClick_delete_Pruch_Price_Grp_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( handleClick_delete_Pruch_Price_Grp = ', error);
sethandleClick_delete_Pruch_Price_Grp_api("false");
alert(" Impossible de supprimer le groupe de prix d'achat");
//setmyApimyApiMessage("")
})
}
const [dialog_data_changed, setdialog_data_changed] = useState();
return (
<div className="partner_prix_achat">
{isLoading && <div className="loader-container">
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
</div>}
<Dialog
open={Dialog_pruch_price_open}
onClose={Dialog_pruch_price_handleClose}
className="displaypartnersession"
>
<DialogTitle>Groupe prix achat </DialogTitle>
<DialogContent className="DialogContent_width">
<div className="session_caract_Dialog" > Code groupe de prix
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_code_groupe_prix"
id="event_dialog_code_groupe_prix"
fullWidth
value={p_purchase_price_code}
onChange={(e) => {
setp_purchase_price_code(e.target.value);
setdialog_data_changed("1");
}
}
/>
</div>
<div className="session_caract_Dialog" > Fournisseur
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_fournisseur"
id="event_dialog_fournisseur"
fullWidth
value={p_purchase_price_fournisseur}
onChange={(e) => {
setp_purchase_price_fournisseur(e.target.value);
setdialog_data_changed("1");
}
}
/>
</div>
<div className="session_caract_Dialog" > Périodicité
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_periodocite"
id="event_dialog_periodocite"
select
fullWidth
value={p_purchase_price_periodicite}
onChange={(e) => {
setp_purchase_price_periodicite(e.target.value);
setdialog_data_changed("1");
}
}
>
<MenuItem value="fixe" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Fixe &nbsp;</MenuItem>
<MenuItem value="heure" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Par heure &nbsp;</MenuItem>
<MenuItem value="jour" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Par jour &nbsp;</MenuItem>
<MenuItem value="mois" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Par mois &nbsp;</MenuItem>
<MenuItem value="annee" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Par année &nbsp;</MenuItem>
</TextField>
</div>
<div className="session_caract_Dialog" > Debut
<DatePicker
name="event_dialog_date_debut"
id="event_dialog_date_debut"
selected={new Date(moment(p_purchase_price_date_debut, "DD/MM/YYYY"))}
onChange={(date) => {
setp_purchase_price_date_debut(format(date, 'd/MM/yyyy'));
setdialog_data_changed("1");
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style session_caract_Dialog_DatePicker"
locale='fr-FR'
/>
</div>
<div className="session_caract_Dialog" > Fin
<DatePicker
name="event_dialog_date_fin"
id="event_dialog_date_fin"
selected={new Date(moment(p_purchase_price_date_fin, "DD/MM/YYYY"))}
onChange={(date) => {
setp_purchase_price_date_fin(format(date, 'd/MM/yyyy'));
setdialog_data_changed("1");
}
}
showTimeSelect={false}
dateFormat="dd/MM/yyyy"
className="disabled_style session_caract_Dialog_DatePicker"
locale='fr-FR'
/>
</div>
<div className="session_caract_Dialog" > Prix
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_fournisseur"
id="event_dialog_fournisseur"
type="number"
step="any"
fullWidth
value={p_purchase_price_prix}
onChange={(e) => {
setp_purchase_price_prix(e.target.value);
setdialog_data_changed("1");
}
}
/>
</div>
{String(dialog_data_changed) === "1" && <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center", "width": "100%" }}>
/!\ Pensez à enregistrer les modifications
</div>}
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
{String(selected_pruchase_price_id).trim().length > 2 && <Button onClick={Add_Update_Grp_Purchase_Price} className="bton_enreg_dialog">Mettre à jour</Button>}
{String(selected_pruchase_price_id).trim() === "" && <Button onClick={Add_Update_Grp_Purchase_Price} className="bton_enreg_dialog">Ajouter</Button>}
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Dialog_pruch_price_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
</div>
</DialogActions>
</Dialog>
<h3> Vos prix d'achat </h3>
<div>
<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="code_session" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Code Session &nbsp;&nbsp;</MenuItem>
<MenuItem value="class_external_code" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Code Formation (code externe) &nbsp;</MenuItem>
<MenuItem value="class_title" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Titre Formation &nbsp;</MenuItem>
<MenuItem value="session_start_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date debut session &nbsp;</MenuItem>
<MenuItem value="session_end_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date fin session &nbsp;</MenuItem>
</TextField>
</div>
<div className="div_row_droite texte_area_filter_value" >
{p_filtre1 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="filtre1_value"
id="filtre1_value"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_filtre1_value}
onChange={(e) => { setp_filtre1_value(e.target.value); }}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre1_value("");
}} />
</InputAdornment>
),
}}
/>
}
</div>
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip01" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
&nbsp; <MdAddCircleOutline onClick={(e) => {
setp_filtre2("1");
}} />
</a>
</div>}
{p_filtre1 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip02" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip02" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline onClick={(e) => {
setp_filtre1();
setp_filtre1_value();
}}
/>
</a>
</div>}
</div>
{p_filtre2 &&
<div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter">
<TextField
name="filtre2"
label="Choisir un champ"
select
sx={{ m: 1, width: '100%' }}
options={filters}
value={p_filtre2}
onChange={(e) => {
setp_filtre2(e.target.value)
}}
>
<MenuItem value="code_session" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Code Session &nbsp;&nbsp;</MenuItem>
<MenuItem value="class_external_code" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Code Formation (code externe) &nbsp;</MenuItem>
<MenuItem value="class_title" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Titre Formation &nbsp;</MenuItem>
<MenuItem value="session_start_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date debut session &nbsp;</MenuItem>
<MenuItem value="session_end_date" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Date fin session &nbsp;</MenuItem>
</TextField>
</div>
<div className="div_row_droite texte_area_filter" >
{String(p_filtre2).length > 3 &&
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="filtre2_value"
id="filtre2_value"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_filtre2_value}
onChange={(e) => setp_filtre2_value(e.target.value)}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<AiFillCloseCircle
style={{ 'cursor': "pointer", "color": "orangered" }}
onClick={(e) => {
setp_filtre2_value("");
}} />
</InputAdornment>
),
}}
/>}
</div>
{String(p_filtre2).length > 3 && <div className='filter_bton_add'>
<Tooltip id="my-tooltip04" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="my-tooltip04" data-tooltip-content="Supprimer cette ligne de filtre">
&nbsp; <MdRemoveCircleOutline
onClick={(e) => {
setp_filtre2();
setp_filtre2_value();
}}
/>
</a>
</div>}
</div>
}
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="bton_enreg" onClick={"Getall_TrainingSession"}>Rechercher
</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<Button variant="contained" className="bton_annule" onClick={"clean_all_filters"}>Annuler
</Button>
</div>
</div>}
</div>
<div className="div_row" style={{ "paddingRight": "10px" }}>
<div className="session_data">
<div style={{ "border": "None" }}>
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
&nbsp;
<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={Ge_Partner_Purchase_Prices_result.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
date_debut: JSON.parse(item).date_debut,
date_fin: JSON.parse(item).date_fin,
code_groupe_prix: JSON.parse(item).code_groupe_prix,
periodicite: JSON.parse(item).periodicite,
fournisseur: JSON.parse(item).fournisseur,
prix: JSON.parse(item).prix,
}
))}
columns={columns}
pageSize={10}
className="datagridclass"
onRowDoubleClick={(newSelectionModel) => {
setgridline_id(newSelectionModel.row.id);
setselected_pruchase_price_id(newSelectionModel.row._id);
handleClick_edit_groupe_purch_price_From_Line(newSelectionModel.row.id);
}}
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';
}
}}
/>
</Box>
<br />
</div>
</div>
</div>
</div>
<div className="div_row" style={{ "border": "None" }}>
<div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
<Button variant="outlined" onClick={() => {
setp_purchase_price_fournisseur();
setp_purchase_price_prix();
setp_purchase_price_periodicite();
setp_purchase_price_date_debut(new Date().toLocaleDateString('fr-FR'));
setp_purchase_price_date_fin(date_today_90j.toLocaleDateString('fr-FR'));
setselected_pruchase_price_id('');
setdialog_data_changed('');
setDialog_pruch_price_open(true);
}}
className="detail_class_submenu bton_add_session"
id='menu_import_participant' name='menu_import_participant'>Ajout 1 Prix &nbsp;
<img src={add_plus} alt="ajout commande" className="icon_plus" />
</Button>
</div>
</div>
</div >
)
}
export default Partner_Prix_Achat;

File diff suppressed because it is too large Load Diff

View File

@ -91,4 +91,5 @@
@import "./components/mon_tableau_de_bord";
@import "./components/dashbord_formation";
@import "./components/module_historique_action";
@import "./components/partner_prix_achat";