recette2
parent
a305e2172c
commit
d6850449bd
|
@ -20,7 +20,7 @@ import fileDownload from 'js-file-download'
|
||||||
import Popup from 'reactjs-popup';
|
import Popup from 'reactjs-popup';
|
||||||
import 'reactjs-popup/dist/index.css';
|
import 'reactjs-popup/dist/index.css';
|
||||||
import { FcSearch } from "react-icons/fc";
|
import { FcSearch } from "react-icons/fc";
|
||||||
import { FcAlarmClock, FcMultipleSmartphones, FcWorkflow } from "react-icons/fc";
|
import { FcAlarmClock, FcMultipleSmartphones, FcWorkflow, FcComments } from "react-icons/fc";
|
||||||
import DatePicker from "react-datepicker";
|
import DatePicker from "react-datepicker";
|
||||||
import "react-datepicker/dist/react-datepicker.css";
|
import "react-datepicker/dist/react-datepicker.css";
|
||||||
import { format } from 'date-fns'
|
import { format } from 'date-fns'
|
||||||
|
@ -1048,6 +1048,33 @@ const DisplayPartnerSession = (props) => {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ field: 'comment', headerName: 'Comment', width: 100, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||||
|
|
||||||
|
{
|
||||||
|
field: "adcomment", headerName: 'Ajout Com.',
|
||||||
|
renderCell: (cellValues) => {
|
||||||
|
return (
|
||||||
|
|
||||||
|
<Button
|
||||||
|
|
||||||
|
onClick={(event) => {
|
||||||
|
// handleClick_valide_emargement(event, cellValues); zzz
|
||||||
|
|
||||||
|
setp_detail_emargement_comment(cellValues.row.comment) ;
|
||||||
|
|
||||||
|
setselected_emargement_user(cellValues.row.prenom+ " "+cellValues.row.nom) ;
|
||||||
|
setselected_emargement_date("Du "+cellValues.row.sequence_start+" au "+cellValues.row.sequence_end);
|
||||||
|
setselected_emargement_id(cellValues.row._id);
|
||||||
|
setDialog_COMMENT_EMARGEMENTE_open(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<FcComments />
|
||||||
|
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1488,6 +1515,8 @@ const DisplayPartnerSession = (props) => {
|
||||||
var internal_url = line.class_internal_url;
|
var internal_url = line.class_internal_url;
|
||||||
setselected_internal_url(line.class_internal_url);
|
setselected_internal_url(line.class_internal_url);
|
||||||
|
|
||||||
|
setselected_session_invoiced_statut(line.invoiced_statut);
|
||||||
|
|
||||||
var session_id = line._id;
|
var session_id = line._id;
|
||||||
setselected_session_id(session_id);
|
setselected_session_id(session_id);
|
||||||
|
|
||||||
|
@ -2319,6 +2348,9 @@ const DisplayPartnerSession = (props) => {
|
||||||
const [selected_internal_url, setselected_internal_url] = useState();
|
const [selected_internal_url, setselected_internal_url] = useState();
|
||||||
const [selected_class_title, setselected_class_title] = useState();
|
const [selected_class_title, setselected_class_title] = useState();
|
||||||
|
|
||||||
|
const [selected_session_invoiced_statut, setselected_session_invoiced_statut] = useState("");
|
||||||
|
|
||||||
|
|
||||||
const [one_selected_internal_url, setone_selected_internal_url] = useState();
|
const [one_selected_internal_url, setone_selected_internal_url] = useState();
|
||||||
|
|
||||||
|
|
||||||
|
@ -4015,7 +4047,7 @@ const DisplayPartnerSession = (props) => {
|
||||||
let [edit_session_form, setedit_session_form] = useState(false);
|
let [edit_session_form, setedit_session_form] = useState(false);
|
||||||
function enableSessionFields() {
|
function enableSessionFields() {
|
||||||
|
|
||||||
// zzzz
|
|
||||||
|
|
||||||
if (rowss && String(gridline_id).length > 0 && rowss.length > 0) {
|
if (rowss && String(gridline_id).length > 0 && rowss.length > 0) {
|
||||||
var local_session_invoice_status = JSON.parse(rowss[gridline_id]).invoiced_statut;
|
var local_session_invoice_status = JSON.parse(rowss[gridline_id]).invoiced_statut;
|
||||||
|
@ -9381,6 +9413,59 @@ const DisplayPartnerSession = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const [Update_Comment_Given_Emargement_api, setUpdate_Comment_Given_Emargement_api] = useState();
|
||||||
|
const [Update_Comment_Given_Emargement_message, setUpdate_Comment_Given_Emargement_message] = useState();
|
||||||
|
const [Update_Comment_Given_Emargement_result, setUpdate_Comment_Given_Emargement_result] = useState();
|
||||||
|
function Update_Comment_Given_Emargement(emargement_id) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*console.log(" ### date , email, matin,matin_val, apresmidi, apresmidi_val = ",
|
||||||
|
date, email, matin, matin_val, apresmidi, apresmidi_val);*/
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
form.append("token", stored_cookie);
|
||||||
|
form.append("tab_ids", emargement_id);
|
||||||
|
form.append("comment", p_detail_emargement_comment);
|
||||||
|
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Given_Emargement_Data/";
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
//console.log(" In UpdateStagiaireData res.data.status = " + res.data.status);
|
||||||
|
//console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message);
|
||||||
|
setUpdate_Comment_Given_Emargement_api("true");
|
||||||
|
setUpdate_Comment_Given_Emargement_result(res.data.message);
|
||||||
|
GetListeEmargement(selected_session_id, selected_internal_url);
|
||||||
|
alert(res.data.message);
|
||||||
|
} else if (String(res.data.status) === String("Err_Connexion")) {
|
||||||
|
alert('Erreur: ' + res.data.message);
|
||||||
|
history.push("/Connexion");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setUpdate_Comment_Given_Emargement_api("false");
|
||||||
|
setUpdate_Comment_Given_Emargement_message(res.data.message);
|
||||||
|
alert(res.data.message);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
setLoading(false);
|
||||||
|
console.warn('Update_Comment_Given_Emargement : Not good man :( mysearchtext = ' + error);
|
||||||
|
setUpdate_Comment_Given_Emargement_api("false");
|
||||||
|
alert(" Impossible de mettre à jour l'émargement");
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function submenu_add_one_tuteur() {
|
function submenu_add_one_tuteur() {
|
||||||
setDialog_tuteur_1_open(true);
|
setDialog_tuteur_1_open(true);
|
||||||
}
|
}
|
||||||
|
@ -11078,7 +11163,7 @@ const DisplayPartnerSession = (props) => {
|
||||||
|
|
||||||
const [p_detail_invoice_split_facture_done, setp_detail_invoice_split_facture_done] = useState("");
|
const [p_detail_invoice_split_facture_done, setp_detail_invoice_split_facture_done] = useState("");
|
||||||
|
|
||||||
|
const [p_detail_emargement_comment, setp_detail_emargement_comment] = useState("");
|
||||||
|
|
||||||
const New_Option_Type_split_invoice = [
|
const New_Option_Type_split_invoice = [
|
||||||
|
|
||||||
|
@ -11094,6 +11179,24 @@ const DisplayPartnerSession = (props) => {
|
||||||
setdisplay_session_with_alert(event.target.checked);
|
setdisplay_session_with_alert(event.target.checked);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const [Dialog_COMMENT_EMARGEMENTE_open, setDialog_COMMENT_EMARGEMENTE_open] = React.useState(false);
|
||||||
|
const Dialog_COMMENT_EMARGEMENTE_handleClose = () => {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const Dialog_COMMENT_EMARGEMENTE_handleClose_buton = () => {
|
||||||
|
setselected_emargement_id("");
|
||||||
|
setselected_emargement_user("");
|
||||||
|
setselected_emargement_date("");
|
||||||
|
setDialog_COMMENT_EMARGEMENTE_open(false);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const [selected_emargement_user, setselected_emargement_user] = useState("");
|
||||||
|
const [selected_emargement_date, setselected_emargement_date] = useState("");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="displaypartnersession">
|
<div className="displaypartnersession">
|
||||||
|
|
||||||
|
@ -11102,6 +11205,124 @@ const DisplayPartnerSession = (props) => {
|
||||||
</div>}
|
</div>}
|
||||||
|
|
||||||
|
|
||||||
|
{ /******** Dialog de comment emargement */}
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
open={Dialog_COMMENT_EMARGEMENTE_open}
|
||||||
|
onClose={Dialog_COMMENT_EMARGEMENTE_handleClose}
|
||||||
|
className="displaypartnersession"
|
||||||
|
>
|
||||||
|
|
||||||
|
<DialogTitle>MySy Information</DialogTitle>
|
||||||
|
<DialogContent className="DialogContent_width" style={{ "minHeight": "15rem" }}>
|
||||||
|
<DialogContentText>
|
||||||
|
{selected_emargement_date}<br/>{selected_emargement_user}
|
||||||
|
</DialogContentText>
|
||||||
|
|
||||||
|
|
||||||
|
<TextField
|
||||||
|
autoFocus
|
||||||
|
margin="dense"
|
||||||
|
id="emargement_comment"
|
||||||
|
name="emargement_comment"
|
||||||
|
multiline
|
||||||
|
rows={2}
|
||||||
|
fullWidth
|
||||||
|
|
||||||
|
step="any"
|
||||||
|
value={p_detail_emargement_comment}
|
||||||
|
onChange={(e) => {
|
||||||
|
if (String(selected_session_invoiced_statut) !== "1" && String(selected_session_invoiced_statut) !== "2") {
|
||||||
|
setp_detail_emargement_comment(e.target.value);
|
||||||
|
} else if (String(selected_session_invoiced_statut) === "1") {
|
||||||
|
alert(" La session est en cours de facturation ")
|
||||||
|
} else if (String(selected_session_invoiced_statut) === "2") {
|
||||||
|
alert(" La session est déjà facturée ")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</DialogContent>
|
||||||
|
|
||||||
|
|
||||||
|
{String(selected_session_invoiced_statut) !== "1" && String(selected_session_invoiced_statut) !== "2" && <div>
|
||||||
|
<DialogActions>
|
||||||
|
<div className="div_row">
|
||||||
|
<div className="div_row_gauche">
|
||||||
|
|
||||||
|
|
||||||
|
<Popup
|
||||||
|
trigger={
|
||||||
|
<Button
|
||||||
|
className="bton_enreg_dialog"> Mettre à jour </Button>
|
||||||
|
|
||||||
|
}
|
||||||
|
modal
|
||||||
|
nested
|
||||||
|
position="center center"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
{close => (
|
||||||
|
<div>
|
||||||
|
<button className="gest_close" onClick={close}>
|
||||||
|
×
|
||||||
|
</button>
|
||||||
|
<div className="gest_header"> MySy Information </div>
|
||||||
|
<div className="gest_content">
|
||||||
|
{' '}
|
||||||
|
|
||||||
|
|
||||||
|
<font> Confirmer la mise à jour du partage de facture
|
||||||
|
</font>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div className="gest_actions">
|
||||||
|
<div style={{ "width": "45%", "float": "left" }}>
|
||||||
|
<button className="gest_bton_popup" onClick={(event) => {
|
||||||
|
Update_Comment_Given_Emargement(selected_emargement_id);
|
||||||
|
close();
|
||||||
|
}}> Valider </button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div style={{ "width": "45%", "float": "right" }}>
|
||||||
|
<button
|
||||||
|
className="gest_bton_popup"
|
||||||
|
onClick={() => {
|
||||||
|
//console.log('modal closed ');
|
||||||
|
close();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Annuler
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Popup>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||||
|
<Button onClick={Dialog_COMMENT_EMARGEMENTE_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</DialogActions>
|
||||||
|
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
{ /******** End de comment emargement */}
|
||||||
|
|
||||||
|
|
||||||
{ /******** Dialog de Split Facture */}
|
{ /******** Dialog de Split Facture */}
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
|
@ -12523,6 +12744,9 @@ const DisplayPartnerSession = (props) => {
|
||||||
<DialogContentText>
|
<DialogContentText>
|
||||||
{Dialog_2_message}
|
{Dialog_2_message}
|
||||||
</DialogContentText>
|
</DialogContentText>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div className="div_row" > <hr className="mysy_hr_text" />
|
<div className="div_row" > <hr className="mysy_hr_text" />
|
||||||
</div>
|
</div>
|
||||||
<div className="div_row_dialog">
|
<div className="div_row_dialog">
|
||||||
|
@ -13791,6 +14015,10 @@ const DisplayPartnerSession = (props) => {
|
||||||
|
|
||||||
setsession_selected_row_id(newSelectionModel.row.id);
|
setsession_selected_row_id(newSelectionModel.row.id);
|
||||||
|
|
||||||
|
setselected_session_invoiced_statut(newSelectionModel.row.invoiced_statut);
|
||||||
|
|
||||||
|
console.log(" ### newSelectionModel.row.invoiced_statut = ", newSelectionModel.row.invoiced_statut);
|
||||||
|
|
||||||
setDialog_2_message(String(JSON.parse(rowss[newSelectionModel.row.id]).title));
|
setDialog_2_message(String(JSON.parse(rowss[newSelectionModel.row.id]).title));
|
||||||
setDialog_2_open(true);
|
setDialog_2_open(true);
|
||||||
|
|
||||||
|
@ -19416,6 +19644,9 @@ const DisplayPartnerSession = (props) => {
|
||||||
date_envoi: JSON.parse(item).date_envoi,
|
date_envoi: JSON.parse(item).date_envoi,
|
||||||
date_emargement: JSON.parse(item).date_emargement,
|
date_emargement: JSON.parse(item).date_emargement,
|
||||||
signature: JSON.parse(item).mysy_manual_signature_img,
|
signature: JSON.parse(item).mysy_manual_signature_img,
|
||||||
|
|
||||||
|
comment: JSON.parse(item).comment,
|
||||||
|
|
||||||
}
|
}
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue