22/04/2024 - 17h30
parent
7e1a6e01c6
commit
2a258e6aa9
|
@ -506,7 +506,7 @@ const Module_Editique = (props) => {
|
|||
|
||||
}
|
||||
|
||||
console.log(" ### url = ", url);
|
||||
//console.log(" ### url = ", url);
|
||||
|
||||
//console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id);
|
||||
setLoading(true);
|
||||
|
@ -1877,53 +1877,7 @@ const Module_Editique = (props) => {
|
|||
|
||||
</div>}
|
||||
|
||||
{/*
|
||||
{String(selected_convention_type) === "email" && <div className="session_caract_Dialog" > Type Document aa<br />
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, width: '75%' }}
|
||||
|
||||
name="event_dialog_type_convention"
|
||||
id="event_dialog_type_convention"
|
||||
|
||||
value="email"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
{String(selected_convention_type) === "email" && <label className="bton_image_class" style={{ "width": "20%", "float": "right", "height": "3.5rem", "paddingTop": "15px" }} onClick={(e) => {
|
||||
|
||||
if (selected_convention_email_test) {
|
||||
var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
|
||||
if (!selected_convention_email_test.match(validRegex)) {
|
||||
alert("L'adresse email de test est invalide.");
|
||||
return;
|
||||
}
|
||||
Send_Stagiaire_Conventions_By_Email_Test();
|
||||
} else {
|
||||
alert("L'adresse email de test est invalide.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}} > <FcSearch /> Test</label>}
|
||||
|
||||
</div>}
|
||||
|
||||
{String(selected_convention_type) === "pdf" && <div className="session_caract_Dialog" > Type Document bb<br />
|
||||
|
||||
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
|
||||
|
||||
name="event_dialog_type_convention"
|
||||
id="event_dialog_type_convention"
|
||||
|
||||
value="pdf"
|
||||
fullWidth
|
||||
/>
|
||||
|
||||
</div>}
|
||||
*/}
|
||||
|
||||
|
||||
{String(selected_convention_type) === "email" && <div className="session_caract_Dialog" >
|
||||
<Tooltip className="tooltip_css" id="test01" style={{ "fontSize": "12px" }} />
|
||||
|
@ -1963,19 +1917,7 @@ const Module_Editique = (props) => {
|
|||
</div>
|
||||
}
|
||||
|
||||
{/*String(selected_convention_type) === "email" && <div className="session_caract_Dialog" > Recevoir un pré-envoie
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_email_test_convention"
|
||||
id="event_dialog_email_test_convention"
|
||||
fullWidth
|
||||
value=""
|
||||
|
||||
/>
|
||||
|
||||
</div>
|
||||
*/}
|
||||
|
||||
|
||||
{String(selected_convention_type) === "email" &&
|
||||
String(actionmass_ftion_val) !== String("convention") && <div className="session_caract_Dialog" > Email destinaitaire
|
||||
|
|
|
@ -43,6 +43,9 @@ import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
|
|||
import { Global } from "recharts";
|
||||
import { FcAddDatabase } from "react-icons/fc";
|
||||
import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5";
|
||||
import ToggleSwitch from "./ToggleSwitch";
|
||||
import ToggleSwitch_v2_mysy from "./ToggleSwitch_v2_mysy";
|
||||
|
||||
|
||||
const Partner_Commande = (props) => {
|
||||
|
||||
|
@ -583,6 +586,62 @@ const Partner_Commande = (props) => {
|
|||
}
|
||||
|
||||
|
||||
const [partner_digital_signature_status, setpartner_digital_signature_status] = useState("0");
|
||||
const [local_partner_digital_signature_status, setlocal_partner_digital_signature_status] = useState(false);
|
||||
|
||||
|
||||
const [Getall_Partner_Digital_Sign_Status_api, setGetall_Partner_Digital_Sign_Status_api] = useState();
|
||||
const [Getall_Partner_Digital_Sign_Status_message, setGetall_Partner_Digital_Sign_Status_message] = useState();
|
||||
const [Getall_Partner_Digital_Sign_Status_result, setGetall_Partner_Digital_Sign_Status_result] = useState([]);
|
||||
function Getall_Partner_Digital_Sign_Status(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/Is_Partnair_Has_Digital_Signature/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
setLoading(false);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Getall_Partner_Digital_Sign_Status res.data.status = " + res.data.status);
|
||||
//console.log(" In Getall_Partner_Digital_Sign_Status res.data.message r_class = " + res.data.message);
|
||||
setGetall_Partner_Digital_Sign_Status_api("true");
|
||||
setGetall_Partner_Digital_Sign_Status_result(res.data.message);
|
||||
|
||||
|
||||
if (JSON.parse(res.data.message).config_name && JSON.parse(res.data.message).config_value) {
|
||||
|
||||
|
||||
if (String(JSON.parse(res.data.message).config_name) === "signature_digital" &&
|
||||
String(JSON.parse(res.data.message).config_value) === "1") {
|
||||
|
||||
setpartner_digital_signature_status("1");
|
||||
setlocal_partner_digital_signature_status(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
setGetall_Partner_Digital_Sign_Status_api("false");
|
||||
setGetall_Partner_Digital_Sign_Status_message(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Getall_Partner_Digital_Sign_Status = ', error);
|
||||
setGetall_Partner_Digital_Sign_Status_api("false");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
|
@ -593,6 +652,7 @@ const Partner_Commande = (props) => {
|
|||
Get_Given_Partner_Config_Point_Taux_TVA();
|
||||
Getall_Partner_Paiement_Condition();
|
||||
Getall_TrainingSession();
|
||||
Getall_Partner_Digital_Sign_Status();
|
||||
|
||||
if (document.getElementById('myRef_head')) {
|
||||
var divh = document.getElementById('myRef_head').offsetTop;
|
||||
|
@ -894,6 +954,18 @@ const Partner_Commande = (props) => {
|
|||
setp_detail_header_statut_label("Brouillon");
|
||||
}
|
||||
|
||||
if (mylocal_order.date_validation) {
|
||||
setp_detail_header_devis_date_validation(mylocal_order.date_validation);
|
||||
} else {
|
||||
setp_detail_header_devis_date_validation("");
|
||||
}
|
||||
|
||||
if (mylocal_order.date_envoi_quotation) {
|
||||
setp_detail_header_devis_date_envoi(mylocal_order.date_envoi_quotation);
|
||||
} else {
|
||||
setp_detail_header_devis_date_envoi("");
|
||||
}
|
||||
|
||||
//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);
|
||||
|
@ -1637,6 +1709,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_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();
|
||||
|
||||
const [p_detail_header_email_client, setp_detail_header_email_client] = useState();
|
||||
|
||||
const [p_detail_header_vendeur_nom, setp_detail_header_vendeur_nom] = useState();
|
||||
|
@ -2587,6 +2662,8 @@ const Partner_Commande = (props) => {
|
|||
setp_detail_header_liv_code_postal();
|
||||
sep_detail_header_liv_ville();
|
||||
setp_detail_header_liv_pays();
|
||||
setp_detail_header_devis_date_validation("");
|
||||
setp_detail_header_devis_date_envoi("");
|
||||
|
||||
}
|
||||
|
||||
|
@ -2823,6 +2900,11 @@ const Partner_Commande = (props) => {
|
|||
form.append("token", stored_cookie);
|
||||
form.append("order_id", selected_id);
|
||||
|
||||
if (local_partner_digital_signature_status === true) {
|
||||
form.append("request_digital_signature", "1");
|
||||
} else {
|
||||
form.append("request_digital_signature", "0");
|
||||
}
|
||||
|
||||
//console.log("### form = ", form);
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Send_Partner_Order_By_Email/";
|
||||
|
@ -3085,6 +3167,11 @@ const Partner_Commande = (props) => {
|
|||
form.append("token", stored_cookie);
|
||||
form.append("quotation_id", selected_id);
|
||||
|
||||
if (local_partner_digital_signature_status === true) {
|
||||
form.append("request_digital_signature", "1");
|
||||
} else {
|
||||
form.append("request_digital_signature", "0");
|
||||
}
|
||||
|
||||
//console.log("### form = ", form);
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Insert_Quotation_To_Session/";
|
||||
|
@ -3131,6 +3218,19 @@ const Partner_Commande = (props) => {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function Check_Electronic_Sign_Before_Sending_Email() {
|
||||
if (partner_digital_signature_status && String(partner_digital_signature_status) === "1") {
|
||||
|
||||
setDialog_signature_digitale_open(true);
|
||||
} else {
|
||||
|
||||
Send_Order_By_Email();
|
||||
}
|
||||
}
|
||||
|
||||
const [Invoice_Order_Data_api, setInvoice_Order_Data_api] = useState();
|
||||
const [Invoice_Order_Data_message, setInvoice_Order_Data_message] = useState();
|
||||
const [Invoice_Order_Data_result, setInvoice_Order_Data_result] = useState();
|
||||
|
@ -3345,6 +3445,29 @@ 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 [Dialog_signature_digitale_message, setDialog_signature_digitale_message] = React.useState(false);
|
||||
const [Dialog_signature_digitale_open, setDialog_signature_digitale_open] = React.useState(false);
|
||||
function Dialog_signature_digitale_handle_change_participant_session(message) {
|
||||
setDialog_signature_digitale_message(message);
|
||||
setDialog_signature_digitale_open(true);
|
||||
}
|
||||
|
||||
const Dialog_signature_digitale_handleClose = () => {
|
||||
//alert(" Utiliser le bouton 'fermer' ");
|
||||
//setOpen(false);
|
||||
};
|
||||
|
||||
const Dialog_signature_digitale_handleClose_buton = () => {
|
||||
|
||||
setDialog_signature_digitale_open(false);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
return (
|
||||
|
||||
<div className="partner_commande">
|
||||
|
@ -3353,6 +3476,100 @@ const Partner_Commande = (props) => {
|
|||
</div>}
|
||||
|
||||
|
||||
|
||||
{/* Dialog pour gerer la signature digitale */}
|
||||
<Dialog
|
||||
open={Dialog_signature_digitale_open}
|
||||
onClose={Dialog_signature_digitale_handleClose}
|
||||
className="displaypartnersession"
|
||||
>
|
||||
|
||||
<DialogTitle>MySy Information</DialogTitle>
|
||||
<DialogContent className="DialogContent_width" style={{ "minHeight": "20rem" }}>
|
||||
<DialogContentText>
|
||||
{Dialog_1_message}
|
||||
</DialogContentText>
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" > Type Document
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
|
||||
name="event_dialog_type_doc"
|
||||
id="event_dialog_type_doc"
|
||||
|
||||
fullWidth
|
||||
|
||||
value="Email"
|
||||
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{String(partner_digital_signature_status) === "1" && <div className="session_caract_Dialog" >
|
||||
<div className="session_caract_Dialog" >
|
||||
<Tooltip className="tooltip_css" id="tooltip_signat_dig" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="tooltip_signat_dig" data-tooltip-html="Utiliser la fonctionnalité de signature électronique pour ce document ">
|
||||
<nav className="disabled_style" style={{ "height": '3rem', border: "none" }}
|
||||
onChange={(e) => {
|
||||
|
||||
if (local_partner_digital_signature_status === true)
|
||||
setlocal_partner_digital_signature_status(false)
|
||||
else {
|
||||
|
||||
setlocal_partner_digital_signature_status(true);
|
||||
}
|
||||
|
||||
}}
|
||||
id="toggleSwitchNav_1" name="toggleSwitchNav_1">
|
||||
<ToggleSwitch
|
||||
label="Signature Digiale" id="toggleSwitch_1" name="toggleSwitch_1" checked={local_partner_digital_signature_status} style={{ height: "2rem" }} />
|
||||
</nav>
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>}
|
||||
|
||||
|
||||
|
||||
</DialogContent>
|
||||
|
||||
|
||||
|
||||
<DialogActions>
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
<Button onClick={(e) => {
|
||||
|
||||
|
||||
|
||||
Dialog_signature_digitale_handleClose_buton();
|
||||
Send_Order_By_Email();
|
||||
|
||||
}}
|
||||
className="bton_enreg_dialog">Envoyer </Button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={Dialog_signature_digitale_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</DialogActions>
|
||||
|
||||
</Dialog>
|
||||
{/* FIN Dialog pour gerer la signature digitale */}
|
||||
|
||||
|
||||
|
||||
<Dialog
|
||||
open={Dialog_1_open}
|
||||
onClose={Dialog_1_handleClose}
|
||||
|
@ -5592,7 +5809,18 @@ const Partner_Commande = (props) => {
|
|||
|
||||
|
||||
{String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && <Button variant="outlined" onClick={print_order_pdf} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Imprimer pdf</Button>}
|
||||
{String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && <Button variant="outlined" onClick={Send_Order_By_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>envoyer par mail</Button>}
|
||||
{String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>envoyer par mail</Button>}
|
||||
|
||||
<br /> <br />
|
||||
|
||||
{String(p_detail_header_devis_date_validation).length > 5 && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Validé le {String(p_detail_header_devis_date_validation).substring(0, 10)}</Button>}
|
||||
{String(p_detail_header_devis_date_envoi).length > 5 && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Envoyé le {String(p_detail_header_devis_date_envoi).substring(0, 10)}</Button>}
|
||||
|
||||
|
||||
{(!p_detail_header_devis_date_validation || String(p_detail_header_devis_date_validation).length < 5) && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Non Validé </Button>}
|
||||
{(!p_detail_header_devis_date_envoi || String(p_detail_header_devis_date_envoi).length < 5) && <Button variant="outlined" onClick={Check_Electronic_Sign_Before_Sending_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Non Envoyé </Button>}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -2058,7 +2058,7 @@
|
|||
}
|
||||
|
||||
.ps-menu-button{
|
||||
height: 35px !important;
|
||||
height: 45px !important;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue