07/03/2024 - 22h30

recette2
cherif 2024-03-07 22:42:41 +01:00
parent 1b58661790
commit 78de0e0028
1 changed files with 251 additions and 154 deletions

View File

@ -267,6 +267,19 @@ const DisplayPartnerSession = (props) => {
{ field: 'site_formation_nom', headerName: 'Site Ftion', with: 150, align: "center", hide: false, renderCell: (params) => <ExpandableCell_50 {...params} />, }, { field: 'site_formation_nom', headerName: 'Site Ftion', with: 150, align: "center", hide: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{
field: 'invoiced_statut', headerName: 'Facturé', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: false,
valueFormatter: (params) => {
if (String(params.value) === "2")
return "Oui";
else if (String(params.value) === "1")
return "Part.";
else
return "Non";
},
},
{ field: 'duration', headerName: 'Durée', minWidth: datagrid_columns_size_model2, align: "center", hide: true, renderCell: (params) => <ExpandableCell_50 {...params} />, }, { field: 'duration', headerName: 'Durée', minWidth: datagrid_columns_size_model2, align: "center", hide: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ {
@ -1780,6 +1793,8 @@ const DisplayPartnerSession = (props) => {
function submenu_inscrit() { function submenu_inscrit() {
setsubmenu("inscrit"); setsubmenu("inscrit");
GetListeInscrit(selected_session_id, selected_internal_url);
if (document.getElementById("inscrit")) { if (document.getElementById("inscrit")) {
document.getElementById("inscrit").style.backgroundColor = "#104277"; document.getElementById("inscrit").style.backgroundColor = "#104277";
document.getElementById("inscrit").style.color = "white"; document.getElementById("inscrit").style.color = "white";
@ -3246,10 +3261,7 @@ const DisplayPartnerSession = (props) => {
if (String(actionmass_insc_val) === "facturer") { if (String(actionmass_insc_val) === "facturer") {
setDialog_FACTURATION_FORMATION_open(true); setDialog_FACTURATION_FORMATION_open(true);
GetListeInscrit(selected_session_id, selected_internal_url);
} else { } else {
@ -3323,7 +3335,7 @@ const DisplayPartnerSession = (props) => {
form.append("email_test", ""); form.append("email_test", "");
form.append("email_production", ""); form.append("email_production", "");
console.log(" #### form = ", form); //console.log(" #### form = ", form);
@ -3339,6 +3351,7 @@ const DisplayPartnerSession = (props) => {
//console.log(" In Invoice_Session_Formation_By_Selected_Inscrit res.data.message r_class = " + res.data.message); //console.log(" In Invoice_Session_Formation_By_Selected_Inscrit res.data.message r_class = " + res.data.message);
setInvoice_Session_Formation_By_Selected_Inscrit_api("true"); setInvoice_Session_Formation_By_Selected_Inscrit_api("true");
setInvoice_Session_Formation_By_Selected_Inscrit_result(res.data.message); setInvoice_Session_Formation_By_Selected_Inscrit_result(res.data.message);
GetListeInscrit(selected_session_id, selected_internal_url);
alert(res.data.message); alert(res.data.message);
@ -9574,7 +9587,12 @@ const DisplayPartnerSession = (props) => {
] ]
const New_Option_Inscription = [
{ "id": "confirmation", "label": "Renvoyer une confirmation", "value": "confirmation" },
{ "id": "impression", "label": "Imprimer fiches", "value": "impression" },
{ "id": "annule inscription", "label": "Annuler inscription", "value": "annule inscription" },
{ "id": "facturer", "label": "Facturer", "value": "facturer" },
]
const [Dialog_FACTURATION_FORMATION_open, setDialog_FACTURATION_FORMATION_open] = React.useState(false); const [Dialog_FACTURATION_FORMATION_open, setDialog_FACTURATION_FORMATION_open] = React.useState(false);
const Dialog_FACTURATION_FORMATION_handleClose = () => { const Dialog_FACTURATION_FORMATION_handleClose = () => {
@ -10515,13 +10533,6 @@ const DisplayPartnerSession = (props) => {
<Button onClick={(e) => { <Button onClick={(e) => {
if (String(selected_session_id).length > 2) {
// On alerte juste l'utilisateur que l'email de test n'est pas vide, juste au cas ou il aurait cliqué par erreur sur l'envoie.
const response = window.confirm(" Continuez la facturation?");
if (!response) {
return;
}
}
Dialog_FACTURATION_FORMATION_handleClose_buton(); Dialog_FACTURATION_FORMATION_handleClose_buton();
Invoice_Session_Formation_By_Selected_Inscrit(); Invoice_Session_Formation_By_Selected_Inscrit();
@ -10844,6 +10855,14 @@ const DisplayPartnerSession = (props) => {
fontSize: 14 fontSize: 14
}, },
'& .line--statut--invoiced': {
backgroundColor: '#EAFAF1',
color: '#239B56',
fontWeight: '700'
},
'& .line--statut--selected': { '& .line--statut--selected': {
backgroundColor: '#FBF2EF', backgroundColor: '#FBF2EF',
color: 'black', color: 'black',
@ -10905,6 +10924,7 @@ const DisplayPartnerSession = (props) => {
site_formation_id: JSON.parse(item).site_formation_id, site_formation_id: JSON.parse(item).site_formation_id,
site_formation_nom: JSON.parse(item).site_formation_code, site_formation_nom: JSON.parse(item).site_formation_code,
invoiced_statut: JSON.parse(item).invoiced_statut,
} }
))} ))}
@ -10940,6 +10960,13 @@ const DisplayPartnerSession = (props) => {
}} }}
//sx={datagridSx} //sx={datagridSx}
getCellClassName={(params) => { getCellClassName={(params) => {
// Traitement du statut "facturé"
if (String(params.row.invoiced_statut) === "2") {
return 'line--statut--invoiced';
}
//field === 'distantiel' //field === 'distantiel'
if (params.field === 'distantiel' && String(params.value) === "1") { if (params.field === 'distantiel' && String(params.value) === "1") {
return 'cell--distantiel'; return 'cell--distantiel';
@ -10974,6 +11001,8 @@ const DisplayPartnerSession = (props) => {
return 'cell--etape--annule'; return 'cell--etape--annule';
} }
// Pour la gestion de la couleur de zone double cliquée // Pour la gestion de la couleur de zone double cliquée
if (String(params.row.id) === String(gridline_id)) { if (String(params.row.id) === String(gridline_id)) {
return 'line--statut--selected'; return 'line--statut--selected';
@ -11160,7 +11189,7 @@ const DisplayPartnerSession = (props) => {
{String(addOneSession) !== "1" && <div className="session_data" onChange={IssessionChanged}> {String(addOneSession) !== "1" && <div className="session_data" onChange={IssessionChanged}>
<div className="div_row" style={{ "marginTop": "1rem", "marginBottom": "1rem" }}> {/*<div className="div_row" style={{ "marginTop": "1rem", "marginBottom": "1rem" }}>
<div className="div_row_gauche"> <div className="div_row_gauche">
&nbsp; &nbsp;
@ -11184,7 +11213,8 @@ const DisplayPartnerSession = (props) => {
</div> </div>
</div> </div>*/}
<br/>
<div className="session_caract"> <b> Formation </b><br /> <div className="session_caract"> <b> Formation </b><br />
<TextField <TextField
@ -14819,7 +14849,38 @@ const DisplayPartnerSession = (props) => {
</div>} </div>}
</div> </div>
{String(addOneParticipant) !== "1" && <div className="session_data" style={{ height: 500, width: '100%' }}> {String(addOneParticipant) !== "1" &&
<div className="session_data" >
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
&nbsp;
<Box
sx={{
height: 500,
width: '100%',
paddingRight: '2px',
[`& .${gridClasses.cell}`]: {
py: 1,
},
'& .line--statut--invoiced': {
backgroundColor: '#EAFAF1',
color: '#239B56',
fontWeight: '700'
},
"& .MuiDataGrid-columnHeaders": {
backgroundColor: "#c8cfd5",
color: "black",
fontSize: 14
},
}}
>
<DataGrid <DataGrid
checkboxSelection checkboxSelection
onSelectionModelChange={(newSelectionModel_insc) => { onSelectionModelChange={(newSelectionModel_insc) => {
@ -14856,6 +14917,17 @@ const DisplayPartnerSession = (props) => {
pageSize={10} pageSize={10}
className="datagridclass" className="datagridclass"
getCellClassName={(params) => {
// Pour la gestion de la couleur si la ligne est facturée
if (String(params.row.invoiced) === "1") {
return 'line--statut--invoiced';
}
}}
rowsPerPageOptions={[10]} rowsPerPageOptions={[10]}
disableSelectionOnClick disableSelectionOnClick
components={{ components={{
@ -14871,11 +14943,12 @@ const DisplayPartnerSession = (props) => {
}} }}
/> />
</Box>
{selectionModel_insc && selectionModel_insc.length >= 1 && {selectionModel_insc && selectionModel_insc.length >= 1 &&
<div className="block_en_mass"> <div className="block_en_mass">
<nav className='traitement_mass'>Traitement en masse / Inscrit</nav> <nav className='traitement_mass'>Traitement en masse / Inscrit</nav>
&nbsp;<select &nbsp;
{/*<select
id={"actionmassinscr"} name={"actionmassinscr"} id={"actionmassinscr"} name={"actionmassinscr"}
onChange={actionmass_inscrit} onChange={actionmass_inscrit}
className="action_mass"> className="action_mass">
@ -14885,11 +14958,34 @@ const DisplayPartnerSession = (props) => {
<option value="annule inscription">Annuler inscription</option> <option value="annule inscription">Annuler inscription</option>
<option value="facturer">Facturer</option> <option value="facturer">Facturer</option>
</select> &nbsp; </select> &nbsp;*/}
<Autocomplete
disablePortal
id="combo-box-demo"
className="block_en_mass_select"
fullWidth
options={New_Option_Inscription}
onChange={(event, value) => {
if (String(value.value) === "confirmation" || String(value.value) === "impression" || String(value.value) === "annule inscription" ||
String(value.value) === "facturer") {
setactionmass_insc_val(value.value);
}
else {
setactionmass_insc_val();
}
{actionmass_insc_val && }}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
{actionmass_insc_val && <nav className='block_en_mass_bton_action'>
<Popup <Popup
trigger={<Button className="bton_traiter_en_mass" > trigger={<Button className="bton_enreg" style={{ "width": "90%" }}>
<FcAcceptDatabase /> Traiter <FcAcceptDatabase /> Traiter
</Button>} </Button>}
@ -14932,6 +15028,7 @@ const DisplayPartnerSession = (props) => {
</div> </div>
)} )}
</Popup> </Popup>
</nav>
} }
<br /> <br />
@ -14975,7 +15072,7 @@ const DisplayPartnerSession = (props) => {
</div>} </div>}
</div>
</div>} </div>}