diff --git a/src/components/AddPartnerClient.js b/src/components/AddPartnerClient.js index d6c170e..b9bab62 100644 --- a/src/components/AddPartnerClient.js +++ b/src/components/AddPartnerClient.js @@ -427,7 +427,7 @@ const AddParnerClient = (props) => { } useEffect(() => { - + Get_List_Client_Type(); if (String(props.new_customer) !== "1") { setformedit_mode("0"); @@ -440,7 +440,7 @@ const AddParnerClient = (props) => { setdatamodification_invoice("0"); Get_List_Contact_Of_client_Part(); - Get_List_Client_Type(); + } else { @@ -900,32 +900,32 @@ const AddParnerClient = (props) => { } function Disable_fields() { - if (document.getElementsByName("client_email")) { + if (document.getElementsByName("client_email" && document.getElementsByName("client_email")[0])) { document.getElementsByName("client_email")[0].disabled = true; document.getElementsByName("client_email")[0].style.backgroundColor = "#ECEFF1"; } - if (document.getElementsByName("client_nom")) { + if (document.getElementsByName("client_nom") && document.getElementsByName("client_nom")[0]) { document.getElementsByName("client_nom")[0].disabled = true; document.getElementsByName("client_nom")[0].style.backgroundColor = "#ECEFF1"; } - if (document.getElementsByName("client_raison_sociale")) { + if (document.getElementsByName("client_raison_sociale") && document.getElementsByName("client_raison_sociale")[0]) { document.getElementsByName("client_raison_sociale")[0].disabled = true; document.getElementsByName("client_raison_sociale")[0].style.backgroundColor = "#ECEFF1"; } - if (document.getElementsByName("client_adresse")) { + if (document.getElementsByName("client_adresse") && document.getElementsByName("client_adresse")[0]) { document.getElementsByName("client_adresse")[0].disabled = true; document.getElementsByName("client_adresse")[0].style.backgroundColor = "#ECEFF1"; } - if (document.getElementsByName("client_ville")) { + if (document.getElementsByName("client_ville") && document.getElementsByName("client_ville")[0]) { document.getElementsByName("client_ville")[0].disabled = true; document.getElementsByName("client_ville")[0].style.backgroundColor = "#ECEFF1"; } - if (document.getElementsByName("client_pays")) { + if (document.getElementsByName("client_pays") && document.getElementsByName("client_pays")[0]) { document.getElementsByName("client_pays")[0].disabled = true; document.getElementsByName("client_pays")[0].style.backgroundColor = "#ECEFF1"; } @@ -1215,6 +1215,7 @@ const AddParnerClient = (props) => { } form.append("raison_sociale", client_raison_sociale); + var client_adresse = "" if (document.getElementsByName("client_adresse")) { client_adresse = document.getElementsByName("client_adresse")[0].value; @@ -1982,12 +1983,12 @@ const AddParnerClient = (props) => { setis_contact_include_com(false); - if (mylocalclient_contact.include_com){ - + if (mylocalclient_contact.include_com) { + if (String(mylocalclient_contact.include_com) === "1") setis_contact_include_com(true); } - + if (mylocalclient_contact.siret) @@ -2145,7 +2146,7 @@ const AddParnerClient = (props) => { return (
- {String(props.new_customer) === "1" &&
+ {String(props.new_customer) === "1" &&
@@ -2200,6 +2201,36 @@ const AddParnerClient = (props) => { />
+
Type client
+ { + setp_client_type_id(e.target.value); + + }} + > + + {Get_List_Client_Type_result && + Get_List_Client_Type_result.map((myclass) => ( + + {JSON.parse(myclass).code} + + + ))} + + +
N° Siret
{ />
-
Email
+
Site web
{
Enregistrer   + } modal @@ -2429,7 +2460,7 @@ const AddParnerClient = (props) => {
-
Raison sociale
+
Raison sociale
{
} - {String(formedit_mode) === "1" &&
Type client
+ {String(formedit_mode) === "1" &&
Type client
{
{(JSON.parse(client).nom || JSON.parse(client).prenom) &&
- {String(partner_document_data_edit_mode) !== "1" &&
+ {String(partner_document_data_edit_mode) !== "1" && String(p_detail_type_doc) === "email" &&
Joindre en PDF
{ - {String(partner_document_data_edit_mode) === "1" &&
+ {String(partner_document_data_edit_mode) === "1" && String(p_detail_type_doc) === "email" &&
Joindre en PDF
{
} - {String(partner_document_data_edit_mode) === "1" &&
- @@ -3042,7 +3059,7 @@ const Config_Documents = (props) => {
- Type de document 1
+ Type de document
{
- Sujet 1
+ Sujet
{
-
- Joindre en PDF bbb
+ {String(p_one_detail_type_doc) === "email" &&
+ Joindre en PDF
{ /> -
+
}
- Version par defaut bbb
+ Version par defaut
{ - + setLoading(false); if (String(res.data.status) === String("true")) { //console.log(" In Send_Stagiaire_Conventions_By_Email res.data.status = " + res.data.status); //console.log(" In Send_Stagiaire_Conventions_By_Email res.data.message r_class = " + res.data.message); @@ -7717,6 +7724,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair } }).catch((error) => { + setLoading(false); console.warn('Not good man :( Send_Stagiaire_Conventions_By_Email = ', error); setSend_Stagiaire_Conventions_By_Email_api("false"); alert("Impossible d'envoyer la convention par email"); @@ -7733,6 +7741,15 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair var url = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_PDF/" + stored_cookie + "/" + selected_session_id + "/" + selected_convention_id; + console.log(" #### selected_convention_id = ", selected_convention_id); + + if (String(selected_convention_id) === "default_pdf") { + // Il s'agit d'envoyer les convention par defaut de type mail + url = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Default_Convention_From_Session_By_PDF/" + stored_cookie + "/" + selected_session_id + "/" + selected_convention_id; + + } + + console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id); setLoading(true); axios.get(url, { responseType: 'blob', },) @@ -8418,9 +8435,17 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair value={selected_convention_id} onChange={(e) => { + setselected_convention_id(e.target.value); - var result2 = Get_List_Stagiaire_Conventions_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(e.target.value)) - setselected_convention_type(JSON.parse(result2).type_doc); + if (String(e.target.value) === "default_mail") { + setselected_convention_type("email"); + } + else if (String(e.target.value) === "default_pdf") { + setselected_convention_type("pdf"); + } else { + var result2 = Get_List_Stagiaire_Conventions_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(e.target.value)) + setselected_convention_type(JSON.parse(result2).type_doc); + } settab_convention_pieces_jointes_result([]); } @@ -8435,7 +8460,17 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair ))} + + Email par default  Email + + + + PDF par default  PDF + +