From 7b965dd81ffe688bb5a64cdf42718d77f26cc9a5 Mon Sep 17 00:00:00 2001 From: cherif Date: Mon, 12 Feb 2024 23:12:28 +0100 Subject: [PATCH] sdqsd --- src/components/AddPartnerClient.js | 282 +++++++++++++++-- src/components/DisplayPartnerSession.js | 262 +++++++++++----- src/components/DisplayPartnerStagiaires.js | 293 +++++++++++++++--- src/components/Partner_Client.js | 40 ++- src/components/Partner_Config_Technique.js | 165 +++++++++- .../components/_displaypartnersession.scss | 14 + 6 files changed, 894 insertions(+), 162 deletions(-) diff --git a/src/components/AddPartnerClient.js b/src/components/AddPartnerClient.js index bdb1e10..f5ce2d1 100644 --- a/src/components/AddPartnerClient.js +++ b/src/components/AddPartnerClient.js @@ -91,7 +91,7 @@ const AddParnerClient = (props) => { const [selected_contact_id, setelected_contact_id] = useState(""); - + function ExpandableCell_50({ value }) { const [expanded, setExpanded] = React.useState(false); @@ -485,6 +485,15 @@ const AddParnerClient = (props) => { new_data2.push(node); }); + //--- + var node = { + "_id": "", + "id": "", + "label": "", + "code": "", + + }; + new_data2.push(node); if (new_data2.length > 0) setNew_Get_List_Client_Type_result(new_data2); @@ -579,6 +588,26 @@ const AddParnerClient = (props) => { setclient_raison_sociale(""); } + + if (String(mylocalclient.is_financeur) === "1") + setp_client_is_financeur(true); + else + setp_client_is_financeur(false); + + + if (String(mylocalclient.is_client) === "1") + setp_client_is_client(true); + else + setp_client_is_client(false); + + + if (String(mylocalclient.is_fournisseur) === "1") + setp_client_is_fournisseur(true); + else + setp_client_is_fournisseur(false); + + + if (mylocalclient.adr_adresse) setclient_adresse(mylocalclient.adr_adresse); else @@ -1366,12 +1395,30 @@ const AddParnerClient = (props) => { else form.append("client_type_id", ""); + if (String(p_client_is_financeur) === "true") + form.append("is_financeur", "1"); + else + form.append("is_financeur", "0"); + + + if (String(p_client_is_fournisseur) === "true") + form.append("is_fournisseur", "1"); + else + form.append("is_fournisseur", "0"); + + + if (String(p_client_is_client) === "true") + form.append("is_client", "1"); + else + form.append("is_client", "0"); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Partner_Client/"; axios.post(myurl, form).then(res => { if (String(res.data.status) === String("true")) { - console.log(" In Add_New_PartnerClient res.data.status = " + res.data.status); - console.log(" In Add_New_PartnerClient res.data.message = " + res.data.message); + //console.log(" In Add_New_PartnerClient res.data.status = " + res.data.status); + //console.log(" In Add_New_PartnerClient res.data.message = " + res.data.message); setAdd_New_PartnerClient_api("true"); setAdd_New_PartnerClient_result(res.data.message); setformedit_mode("0"); @@ -1491,11 +1538,7 @@ const AddParnerClient = (props) => { } form.append("siret", client_siret); - var client_type_client_id = "" - if (document.getElementsByName("client_type_id")) { - client_type_client_id = document.getElementsByName("client_type_id")[0].value; - } - form.append("client_type_id", client_type_client_id); + var client_tva = "" @@ -1515,6 +1558,25 @@ const AddParnerClient = (props) => { else form.append("client_type_id", ""); + + if (String(p_client_is_financeur) === "true") + form.append("is_financeur", "1"); + else + form.append("is_financeur", "0"); + + + if (String(p_client_is_fournisseur) === "true") + form.append("is_fournisseur", "1"); + else + form.append("is_fournisseur", "0"); + + + if (String(p_client_is_client) === "true") + form.append("is_client", "1"); + else + form.append("is_client", "0"); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Partner_Client/"; axios.post(myurl, form).then(res => { @@ -2260,6 +2322,10 @@ const AddParnerClient = (props) => { { "id": "", "label": "", "value": "" }, ] + const [p_client_is_financeur, setp_client_is_financeur] = useState(false); + const [p_client_is_fournisseur, setp_client_is_fournisseur] = useState(false); + const [p_client_is_client, setp_client_is_client] = useState(true); + return (
@@ -2315,20 +2381,19 @@ const AddParnerClient = (props) => { if (value && value._id) { setp_client_type_id(value._id); - } }} //value={p_one_detail_client_rattachement_nom} renderInput={(params) => + /> } /> - {/* {
 
+
+ + + + +
+ +
+ + + + + + + + +
+ + +
+ + + + + + +
+ + +
+   +
{
} - {String(formedit_mode) === "1" &&
Type client
- 1 && + String(formedit_mode) === "1" &&
Type client
+ (data)._id === String(p_client_type_id))[0].label} + + onChange={(event, value) => { + if (value && value._id) { + setp_client_type_id(value._id); + + DataUpdated(); + + } + }} + + + renderInput={(params) => + } + /> + {/* { ))} - -
} +
*/} +
}
N° Siret
@@ -2772,7 +2937,7 @@ const AddParnerClient = (props) => { />
-
Site web
+
Site web 1
{ />
+ + + + + + +
  @@ -2808,7 +3046,7 @@ const AddParnerClient = (props) => { {String(formedit_mode) !== "1" &&
- +
} @@ -3101,9 +3339,9 @@ const AddParnerClient = (props) => { } }} renderInput={(params) => + /> } /> @@ -3142,7 +3380,7 @@ const AddParnerClient = (props) => { disabled={false} className="disabled_style" value={p_contact_civilite} - + /> @@ -3408,7 +3646,7 @@ const AddParnerClient = (props) => {
- +
} diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 940eade..1008ac3 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -263,9 +263,9 @@ const DisplayPartnerSession = (props) => { { field: 'domaine', headerName: 'Domaine', minWidth: datagrid_columns_size_model1, align: "center", hide: true, hideable: false, renderCell: (params) => , }, { field: 'published', headerName: 'publié', minWidth: datagrid_columns_size_model1, align: "center", hide: true, hideable: false, renderCell: (params) => , }, - { field: 'site_formation_id', headerName: 'site_formation_id', with: 0, align: "center", hide: true, hideable: false}, - { field: 'site_formation_nom', headerName: 'Site Ftion',with: 150, align: "center", hide: false, hideable: false, renderCell: (params) => , }, - + { field: 'site_formation_id', headerName: 'site_formation_id', with: 0, align: "center", hide: true, hideable: false }, + { field: 'site_formation_nom', headerName: 'Site Ftion', with: 150, align: "center", hide: false, hideable: false, renderCell: (params) => , }, + { field: 'duration', headerName: 'Durée', minWidth: datagrid_columns_size_model2, align: "center", hide: true, hideable: false, renderCell: (params) => , }, @@ -3669,6 +3669,11 @@ const DisplayPartnerSession = (props) => { document.getElementsByName("prix_session")[0].style.backgroundColor = "#ECEFF1"; } + if (document.getElementsByName("prix_session_by")[0]) { + document.getElementsByName("prix_session_by")[0].disabled = true; + document.getElementsByName("prix_session_by")[0].style.backgroundColor = "#ECEFF1"; + } + if (document.getElementsByName("titre_session")[0]) { document.getElementsByName("titre_session")[0].disabled = true; document.getElementsByName("titre_session")[0].style.backgroundColor = "#ECEFF1"; @@ -4214,6 +4219,8 @@ const DisplayPartnerSession = (props) => { form.append("location_type", p_detail_location_type); form.append("is_bpf", p_detail_is_bpf); + form.append("price_by", p_prix_session_by); + form.append("formateur_id", p_formateur_id); form.append("site_formation_id", p_session_site_formation_id); @@ -4450,6 +4457,7 @@ const DisplayPartnerSession = (props) => { form.append("titre", p_one_titre); form.append("location_type", p_one_location_type); form.append("is_bpf", p_one_is_bpf); + form.append("price_by", p_one_prix_session_by); form.append("session_status", p_one_session_status); @@ -4746,6 +4754,13 @@ const DisplayPartnerSession = (props) => { if (mylocaltraining.prix_session) setp_prix_session(mylocaltraining.prix_session); + + if (mylocaltraining.price_by) + setp_prix_session_by(mylocaltraining.price_by); + else + setp_prix_session_by(""); + + if (mylocaltraining.distantiel) { setp_session_distance(mylocaltraining.distantiel); if (String(mylocaltraining.distantiel) === "1") @@ -4947,6 +4962,7 @@ const DisplayPartnerSession = (props) => { const [p_lms_class_code, setp_lms_class_code] = useState(""); const [p_nb_participant, setp_nb_participant] = useState(""); const [p_prix_session, setp_prix_session] = useState(""); + const [p_prix_session_by, setp_prix_session_by] = useState(""); const [p_one_myclass_title, setp_one_myclass_title] = useState(""); @@ -4966,6 +4982,7 @@ const DisplayPartnerSession = (props) => { const [p_one_lms_class_code, setp_one_lms_class_code] = useState(""); const [p_one_nb_participant, setp_one_nb_participant] = useState(""); const [p_one_prix_session, setp_one_prix_session] = useState(""); + const [p_one_prix_session_by, setp_one_prix_session_by] = useState(""); const [p_one_session_ondemande, setp_one_session_ondemande] = useState("0"); const [p_one_session_ondemande_label, setp_one_session_ondemande_label] = useState("Non"); const [p_one_session_distance, setp_one_session_distance] = useState("0"); @@ -9321,6 +9338,11 @@ const DisplayPartnerSession = (props) => { } + const New_Price_by = [ + { "id": "persession", "label": "Par Session", "value": "persession" }, + { "id": "perstagiaire", "label": "Par Stagiaire", "value": "perstagiaire" }, + { "id": "", "label": "", "value": "" }, + ] return (
@@ -9970,9 +9992,9 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => + /> } /> @@ -10911,7 +10933,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -10978,7 +11000,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -11046,7 +11068,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -11108,7 +11130,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -11240,7 +11262,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -11412,7 +11434,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -11477,7 +11499,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -11515,7 +11537,7 @@ const DisplayPartnerSession = (props) => { className="disabled_style" options={New_Getall_Partner_Site_Formation_result} value={New_Getall_Partner_Site_Formation_result.filter((data) => (data)._id === String(p_session_site_formation_id))[0].label} - + onChange={(event, value) => { if (value && value._id && String(value._id).length > 2) { @@ -11570,9 +11592,9 @@ const DisplayPartnerSession = (props) => { } }} renderInput={(params) => + /> } />}
} @@ -11697,38 +11719,7 @@ const DisplayPartnerSession = (props) => {
} - {/*edit_session_form &&
Formateur
- { - setp_formateur_id(e.target.value); - IssessionChanged(); - } - } - - > - {Getall_Training_Employee_No_Filter_result && - Getall_Training_Employee_No_Filter_result.map((myclient) => ( - - {JSON.parse(myclient).nom}  {JSON.parse(myclient).prenom} - - - ))} - - -
*/} {edit_session_form &&
Formateur
{ }} renderInput={(params) => } @@ -11780,7 +11771,7 @@ const DisplayPartnerSession = (props) => { />
-
Prix session
+ {/*
Prix session
{ IssessionChanged(); }} /> +
*/} + +
Prix session
+ { + setp_prix_session(e.target.value); + IssessionChanged(); + }} + /> + + + {!edit_session_form && (data).value === String(p_prix_session_by))[0].label} + onChange={(e) => { + setp_prix_session(e.target.value); + IssessionChanged(); + }} + />} + + + {edit_session_form && (data).value === String(p_prix_session_by))[0].label} + + options={New_Price_by} + onChange={(event, value) => { + if (value && value.value) { + + setp_prix_session_by(value.value); + IssessionChanged(); + } + + }} + + renderInput={(params) => + } + />}
@@ -12019,7 +12074,7 @@ const DisplayPartnerSession = (props) => { renderInput={(params) => } @@ -12081,7 +12136,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -12126,7 +12181,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -12171,7 +12226,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -12218,7 +12273,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -12263,7 +12318,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -12399,7 +12454,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -12441,7 +12496,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -12530,9 +12585,9 @@ const DisplayPartnerSession = (props) => { } }} renderInput={(params) => + /> } />} @@ -12671,7 +12726,7 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => } @@ -12695,7 +12750,7 @@ const DisplayPartnerSession = (props) => { />
-
Prix session
+ {/*
Prix session
{ value={p_one_prix_session} onChange={(e) => setp_one_prix_session(e.target.value)} /> +
*/} + +
Prix session
+ setp_one_prix_session(e.target.value)} + /> + + { + if (value && value.value) { + setp_one_prix_session_by(value.value) + + } + + }} + + renderInput={(params) => + } + />
@@ -13316,9 +13410,9 @@ const DisplayPartnerSession = (props) => { } }} renderInput={(params) => + /> } /> @@ -13460,9 +13554,9 @@ const DisplayPartnerSession = (props) => { } }} renderInput={(params) => + /> } /> @@ -13508,9 +13602,9 @@ const DisplayPartnerSession = (props) => { value={p_one_detail_client_rattachement_nom} renderInput={(params) => + /> } />
@@ -13530,9 +13624,9 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => + /> } /> @@ -13807,9 +13901,9 @@ const DisplayPartnerSession = (props) => { } }} renderInput={(params) => + /> } /> @@ -14033,9 +14127,9 @@ const DisplayPartnerSession = (props) => { } }} renderInput={(params) => + /> } /> @@ -14178,9 +14272,9 @@ const DisplayPartnerSession = (props) => { } }} renderInput={(params) => + /> } /> @@ -14224,9 +14318,9 @@ const DisplayPartnerSession = (props) => { value={p_one_detail_client_rattachement_nom} renderInput={(params) => + /> } />
@@ -14247,9 +14341,9 @@ const DisplayPartnerSession = (props) => { }} renderInput={(params) => + /> } /> @@ -14645,9 +14739,9 @@ const DisplayPartnerSession = (props) => { value={p_detail_client_rattachement_nom} renderInput={(params) => + /> } /> @@ -14703,9 +14797,9 @@ const DisplayPartnerSession = (props) => { } }} renderInput={(params) => + /> } /> @@ -14856,9 +14950,9 @@ const DisplayPartnerSession = (props) => { } }} renderInput={(params) => + /> } />} diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js index 5eb39ea..f5d1ee0 100644 --- a/src/components/DisplayPartnerStagiaires.js +++ b/src/components/DisplayPartnerStagiaires.js @@ -54,6 +54,7 @@ import { FcDownRight, FcRight, FcSearch, FcViewDetails, FcOpenedFolder } from "r import { MdOutlineVisibility } from "react-icons/md"; import Link from '@mui/material/Link'; import { PiDotsThree } from "react-icons/pi"; +import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5"; const DisplayPartnerStagiaires = (props) => { const history = useHistory(); @@ -866,6 +867,7 @@ const DisplayPartnerStagiaires = (props) => { function handleClick_edit_session_From_Line(selected_row_id) { + Get_List_Partner_Financeurs(); var line = JSON.parse(rowss[selected_row_id]); @@ -986,6 +988,7 @@ const DisplayPartnerStagiaires = (props) => { setsubmenu(""); setSelectionModel([]); setselected_code_session(); + Get_List_Partner_Financeurs(); setaddOneParticipant("1"); @@ -1170,6 +1173,9 @@ const DisplayPartnerStagiaires = (props) => { setp_detail_client_rattachement_nom(); setp_detail_client_rattachement_id(); + setp_detail_financeur_rattachement_nom(); + setp_detail_financeur_rattachement_id(); + setp_detail_type_apprenant(); setp_detail_type_apprenant_label(); @@ -1243,8 +1249,13 @@ const DisplayPartnerStagiaires = (props) => { setp_one_detail_client_rattachement_nom(""); setp_one_detail_client_rattachement_id(""); + setp_one_detail_financeur_rattachement_id(""); + setp_one_detail_financeur_rattachement_nom(""); + setp_one_detail_type_apprenant(""); setp_one_detail_client_rattachement_id(""); + + setp_one_status_part(""); } @@ -2258,6 +2269,7 @@ const DisplayPartnerStagiaires = (props) => { Getall_TrainingSession(); Get_List_Partner_Clients(); GetCurrentPartnerClass(); + Get_List_Partner_Financeurs(); let windowWidth = window.innerWidth; if (windowWidth < 1001) { setdatagrid_columns_size_model2(10); @@ -2334,6 +2346,9 @@ const DisplayPartnerStagiaires = (props) => { const [p_detail_client_rattachement_nom, setp_detail_client_rattachement_nom] = useState(); const [p_detail_client_rattachement_id, setp_detail_client_rattachement_id] = useState(); + const [p_detail_financeur_rattachement_id, setp_detail_financeur_rattachement_id] = useState(); + const [p_detail_financeur_rattachement_nom, setp_detail_financeur_rattachement_nom] = useState(); + const [p_detail_apprenant_id, setp_detail_apprenant_id] = useState(""); const [p_detail_tuteur1_nom, setp_detail_tuteur1_nom] = useState(""); @@ -2379,6 +2394,9 @@ const DisplayPartnerStagiaires = (props) => { const [p_one_detail_client_rattachement_nom, setp_one_detail_client_rattachement_nom] = useState(); const [p_one_detail_client_rattachement_id, setp_one_detail_client_rattachement_id] = useState(); + const [p_one_detail_financeur_rattachement_id, setp_one_detail_financeur_rattachement_id] = useState(); + const [p_one_detail_financeur_rattachement_nom, setp_one_detail_financeur_rattachement_nom] = useState(); + const [p_one_detail_code_session, setp_one_detail_code_session] = useState(); @@ -2506,6 +2524,12 @@ const DisplayPartnerStagiaires = (props) => { } + if (mylocalattendee.financeur_rattachement_id) { + setp_detail_financeur_rattachement_id(mylocalattendee.financeur_rattachement_id); + setp_detail_financeur_rattachement_nom(mylocalattendee.financeur_rattachement_nom); + + } + if (mylocalattendee.civilite) setp_detail_civilite(mylocalattendee.civilite); @@ -2979,6 +3003,13 @@ const DisplayPartnerStagiaires = (props) => { else form.append("client_rattachement_id", ""); + + if (p_one_detail_financeur_rattachement_id) + form.append("financeur_rattachement_id", p_one_detail_financeur_rattachement_id); + else + form.append("financeur_rattachement_id", ""); + + form.append("modefinancement", ""); @@ -3155,13 +3186,6 @@ const DisplayPartnerStagiaires = (props) => { form.append("pays", ""); - - //--- - - - - - if (p_detail_mode_fin) form.append("modefinancement", p_detail_mode_fin); else @@ -3186,6 +3210,11 @@ const DisplayPartnerStagiaires = (props) => { else form.append("client_rattachement_id", ""); + if (p_detail_financeur_rattachement_id) + form.append("financeur_rattachement_id", p_detail_financeur_rattachement_id); + else + form.append("financeur_rattachement_id", ""); + /* Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenaire */ @@ -3346,6 +3375,86 @@ const DisplayPartnerStagiaires = (props) => { } + const [New_Get_List_Partner_Financeurs_result, setNew_Get_List_Partner_Financeurs_result] = useState([]); + + const [Get_List_Partner_Financeurs_api, setGet_List_Partner_Financeurs_api] = useState(); + const [Get_List_Partner_Financeurs_message, setGet_List_Partner_Financeurs_message] = useState(); + const [Get_List_Partner_Financeurs_result, setGet_List_Partner_Financeurs_result] = useState(); + function Get_List_Partner_Financeurs(event) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + form.append("token", stored_cookie); + form.append("is_financeur", "1"); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_List_Partner_Client_with_filter_Like/"; + setLoading(true); + + axios.post(myurl, form).then(res => { + //console.log(" In Get_List_Partner_Financeurs res.data.status = " + res.data.status); + //console.log(" In Get_List_Partner_Financeurs res.data.message r_class = " + res.data.message); + setLoading(false); + if (String(res.data.status) === String("true")) { + setGet_List_Partner_Financeurs_api("true"); + setGet_List_Partner_Financeurs_result(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_nom = JSON.parse(x).nom; + var local_raison_sociale = JSON.parse(x).raison_sociale; + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom, + "nom": local_nom, + "raison_sociale": local_raison_sociale, + + }; + new_data2.push(node); + }); + + //--- + var node = { + "_id": "", + "id": "", + "label": "", + "nom": "", + "raison_sociale": "", + + }; + new_data2.push(node); + + if (new_data2.length > 0) + setNew_Get_List_Partner_Financeurs_result(new_data2); + } + else if (String(res.data.status) === String("Err_Connexion")) { + alert('Erreur: ' + res.data.message); + history.push("/Connexion"); + } + else { + setGet_List_Partner_Financeurs_api("false"); + setGet_List_Partner_Financeurs_message(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Get_List_Partner_Financeurs = ', error); + setGet_List_Partner_Financeurs_api("false"); + //setmyApimyApiMessage("") + }) + } + + + + function annule_Add_One_Participant() { clear_one_Attende_Fields(); setaddOneParticipant(); @@ -3398,6 +3507,16 @@ const DisplayPartnerStagiaires = (props) => { new_data2.push(node); }); + var node = { + "_id": "", + "id": "", + "label": "", + "internal_url": "", + "title": "", + "external_code": "" + }; + new_data2.push(node); + if (new_data2.length > 0) setNew_GetCurrentPartnerClass_result(new_data2); @@ -5169,6 +5288,7 @@ const DisplayPartnerStagiaires = (props) => { const [selected_row_data_json_age, setselected_row_data_json_age] = useState(""); function Show_Detailled_stagiaire_Data() { + handleClick_edit_session_From_Line(gridline_id); Dialog_stagiaire_handleClose_buton(); } @@ -5835,9 +5955,9 @@ const DisplayPartnerStagiaires = (props) => { }} renderInput={(params) => + /> } /> @@ -6672,7 +6792,7 @@ const DisplayPartnerStagiaires = (props) => { }} renderInput={(params) => } @@ -6777,8 +6897,9 @@ const DisplayPartnerStagiaires = (props) => {
@@ -6859,9 +6980,9 @@ const DisplayPartnerStagiaires = (props) => { renderInput={(params) => + /> } /> @@ -6883,9 +7004,9 @@ const DisplayPartnerStagiaires = (props) => { value={p_one_detail_code_session} renderInput={(params) => + /> } /> } @@ -6904,9 +7025,9 @@ const DisplayPartnerStagiaires = (props) => { value={p_one_detail_code_session} renderInput={(params) => + /> } /> } @@ -6969,9 +7090,9 @@ const DisplayPartnerStagiaires = (props) => { } }} renderInput={(params) => + /> } /> {/* { } }} renderInput={(params) => + /> } /> @@ -7250,14 +7371,41 @@ const DisplayPartnerStagiaires = (props) => { }} renderInput={(params) => + /> } /> + + {New_Get_List_Partner_Financeurs_result && New_Get_List_Partner_Financeurs_result.length > 0 && +
Financeur
+ + { + if (value && value._id) { + setp_one_detail_financeur_rattachement_id(value._id); + setp_one_detail_financeur_rattachement_nom(value.nom); + + } + }} + + renderInput={(params) => + } + /> + +
} +
Type apprenant
{ }} renderInput={(params) => + /> } /> @@ -7549,9 +7697,9 @@ const DisplayPartnerStagiaires = (props) => { }} renderInput={(params) => + /> } /> @@ -7610,9 +7758,9 @@ const DisplayPartnerStagiaires = (props) => { value={p_detail_client_rattachement_nom} renderInput={(params) => + /> } /> @@ -7659,6 +7807,79 @@ const DisplayPartnerStagiaires = (props) => {
} + {New_Get_List_Partner_Financeurs_result && New_Get_List_Partner_Financeurs_result.length > 0 && + String(participant_data_edit_mode) === "1" &&
Financeur
+ + { + if (value && value._id) { + setp_detail_financeur_rattachement_id(value._id); + setp_detail_financeur_rattachement_nom(value.nom); + + + setparticipant_data_changed("1"); + Dialog_1_handle_change_participant_session(" Attention, vous allez modifier l'organisme financeur du participant"); + + + } + }} + value={p_detail_financeur_rattachement_nom} + + renderInput={(params) => + } + /> + +
} + + {String(participant_data_edit_mode) !== "1" && } + + {String(participant_data_edit_mode) === "1" &&
Type apprenant
{ }} renderInput={(params) => + /> } /> @@ -7738,9 +7959,9 @@ const DisplayPartnerStagiaires = (props) => { } }} renderInput={(params) => + /> } /> @@ -7767,9 +7988,9 @@ const DisplayPartnerStagiaires = (props) => { } }} renderInput={(params) => + /> } /> diff --git a/src/components/Partner_Client.js b/src/components/Partner_Client.js index b7d7434..7412d4f 100644 --- a/src/components/Partner_Client.js +++ b/src/components/Partner_Client.js @@ -124,29 +124,31 @@ const Partner_Client = (props) => { { field: 'nom', headerName: 'nom', width: 100, hide: false, editable: false, Width: 200, flex: 1, renderCell: (params) => , }, { field: 'email', headerName: 'email', width: 100, hideable: false, width: 200, flex: 1, renderCell: (params) => , }, - { field: 'telephone', headerName: 'Téléphone', width: 100, hide: false, editable: false, width: 100, renderCell: (params) => , }, - { field: 'adr_adresse', headerName: 'Adresse', width: 100, hide: true, editable: false, width: 100, renderCell: (params) => , }, + { field: 'telephone', headerName: 'Téléphone', width: 100, hide: false, editable: false, width: 100, renderCell: (params) => , }, + { field: 'adr_adresse', headerName: 'Adresse', width: 100, hide: true, editable: false, width: 100, renderCell: (params) => , }, { field: 'adr_code_postal', headerName: 'Code Postal', width: 100, hide: false, editable: false, width: 100, renderCell: (params) => , }, - { field: 'adr_ville', headerName: 'Ville', width: 100, hide: false, editable: false, renderCell: (params) => , }, - { field: 'adr_pays', headerName: 'Pays', width: 100, hide: true, editable: false, renderCell: (params) => , }, - { field: 'siret', headerName: 'Siret', width: 100, hide: true, editable: false, renderCell: (params) => , }, - { field: 'website', headerName: 'Siteweb', width: 100, hide: true, editable: false, renderCell: (params) => , }, + { field: 'adr_ville', headerName: 'Ville', width: 100, hide: false, editable: false, renderCell: (params) => , }, + { field: 'adr_pays', headerName: 'Pays', width: 100, hide: true, editable: false, renderCell: (params) => , }, + { field: 'siret', headerName: 'Siret', width: 100, hide: true, editable: false, renderCell: (params) => , }, + { field: 'website', headerName: 'Siteweb', width: 100, hide: true, editable: false, renderCell: (params) => , }, - /*{ - field: "update", headerName: 'Modifier', + { + field: "detail", headerName: 'Voir détail', renderCell: (cellValues) => { return (
{ - handleClick_modifier(event, cellValues); + + setgridline_id(cellValues.row.id) + handleClick_edit_session_From_Line(cellValues.row.id); }}>
); } - },*/ + }, { field: "delete", headerName: 'Supprimer', renderCell: (cellValues) => { @@ -471,6 +473,8 @@ const Partner_Client = (props) => { if (rows_list_clients[selected_row_id]) { + console.log(" OKKKKK "); + var line = JSON.parse(rows_list_clients[selected_row_id]); var clientmail = String(line.email); @@ -507,15 +511,15 @@ const Partner_Client = (props) => { - const [p_filtre1, setp_filtre1] = useState(); - const [p_filtre1_value, setp_filtre1_value] = useState(); + 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(); function clean_all_filters() { - setp_filtre1(); + setp_filtre1(""); setp_filtre1_value(); setp_filtre2(); setp_filtre2_value(); @@ -649,7 +653,7 @@ const Partner_Client = (props) => {
- +
@@ -684,6 +688,7 @@ const Partner_Client = (props) => { Nom    Email   +  
@@ -867,6 +872,7 @@ const Partner_Client = (props) => { }} > ( { @@ -912,10 +918,12 @@ const Partner_Client = (props) => { selectionModel={selectionModel} onRowDoubleClick={(newSelectionModel) => { + console.log(" 01 GRRRR newSelectionModel.row._id = ", newSelectionModel.row._id); setgridline_id(newSelectionModel.row.id); - setselected_id(newSelectionModel.row._id) + setselected_id(newSelectionModel.row._id); //handleClick_edit_session_From_Line(newSelectionModel.row.id); + console.log(" GRRRR newSelectionModel.row._id = ", newSelectionModel.row._id); setDialog_client_open(true); }} @@ -933,7 +941,7 @@ const Partner_Client = (props) => { } }} - + sx={{ "& .MuiDataGrid-cellContent": { minHeight: 100, diff --git a/src/components/Partner_Config_Technique.js b/src/components/Partner_Config_Technique.js index c03980e..dc83048 100644 --- a/src/components/Partner_Config_Technique.js +++ b/src/components/Partner_Config_Technique.js @@ -41,6 +41,7 @@ import DialogTitle from '@mui/material/DialogTitle'; import { TransitionProps } from '@mui/material/transitions'; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5"; +import ToggleSwitch from "./ToggleSwitch"; const Partner_Configuration_Technique = (props) => { @@ -148,6 +149,48 @@ const Partner_Configuration_Technique = (props) => { { field: 'id', headerName: 'id', hide: true }, { field: 'code', headerName: 'Nom Configuration', flex: 1, hide: false, editable: false }, { field: 'description', headerName: 'Valeur config', flex: 1, hide: false, editable: false }, + + { field: 'is_financeur', headerName: 'Financeur', flex: 1, hide: false, editable: false , + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.is_financeur) === "1" && "Oui"}  + {String(cellValues.row.is_financeur) !== "1" && "Non"}  + +
+ + ); + }, + + }, + { field: 'is_client', headerName: 'Client', flex: 1, hide: false, editable: false, + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.is_client) === "1" && "Oui"}  + {String(cellValues.row.is_client) !== "1" && "Non"}  + +
+ + ); + }, + }, + { field: 'is_fournisseur', headerName: 'Fournisseur', flex: 1, hide: false, editable: false , + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.is_fournisseur) === "1" && "Oui"}  + {String(cellValues.row.is_fournisseur) !== "1" && "Non"}  + +
+ + ); + }, + }, + { field: "delete", headerName: 'Supprimer', renderCell: (cellValues) => { @@ -680,6 +723,26 @@ const Partner_Configuration_Technique = (props) => { setp_type_client_code(line.code); setp_type_client_desc(line.description); + + if (String(line.is_financeur) === "1") + setp_type_client_is_financeur(true); + else + setp_type_client_is_financeur(false); + + + if (String(line.is_client) === "1") + setp_type_client_is_client(true); + else + setp_type_client_is_client(false); + + + if (String(line.is_fournisseur) === "1") + setp_type_client_is_fournisseur(true); + else + setp_type_client_is_fournisseur(false); + + + setDialog_type_client_1_open(true); } @@ -709,6 +772,12 @@ const Partner_Configuration_Technique = (props) => { const [p_type_client_desc, setp_type_client_desc] = useState(""); const [selected_type_client_id, setselected_type_client_id] = useState(""); + + const [p_type_client_is_financeur, setp_type_client_is_financeur] = useState(false); + const [p_type_client_is_fournisseur, setp_type_client_is_fournisseur] = useState(false); + const [p_type_client_is_client, setp_type_client_is_client] = useState(false); + + const [p_detail_code_site_stored, setp_detail_code_site_stored] = useState(""); const [p_detail_code_site, setp_detail_code_site] = useState(""); const [p_detail_nom_site, setp_detail_nom_site] = useState(""); @@ -735,6 +804,23 @@ const Partner_Configuration_Technique = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); + if (String(p_type_client_is_financeur) === "true") + form.append("is_financeur", "1"); + else + form.append("is_financeur", "0"); + + + if (String(p_type_client_is_fournisseur) === "true") + form.append("is_fournisseur", "1"); + else + form.append("is_fournisseur", "0"); + + + if (String(p_type_client_is_client) === "true") + form.append("is_client", "1"); + else + form.append("is_client", "0"); + var myurl = ""; @@ -1073,6 +1159,73 @@ const Partner_Configuration_Technique = (props) => {
+ + + {/**/} + + + + @@ -1295,9 +1448,9 @@ const Partner_Configuration_Technique = (props) => { } }} renderInput={(params) => + /> } />} @@ -1629,9 +1782,9 @@ const Partner_Configuration_Technique = (props) => { }} renderInput={(params) => + /> } /> @@ -1836,6 +1989,10 @@ const Partner_Configuration_Technique = (props) => { _id: JSON.parse(item)._id, code: JSON.parse(item).code, description: JSON.parse(item).description, + is_financeur: JSON.parse(item).is_financeur, + is_client: JSON.parse(item).is_client, + is_fournisseur: JSON.parse(item).is_fournisseur, + } ))} diff --git a/src/styles/components/_displaypartnersession.scss b/src/styles/components/_displaypartnersession.scss index ad80d52..c33a887 100644 --- a/src/styles/components/_displaypartnersession.scss +++ b/src/styles/components/_displaypartnersession.scss @@ -2056,6 +2056,20 @@ border: solid gainsboro 1px; } + .disabled_style_moitier { + //background-color: #ECEFF1; + font-size: small !important; + color: black; + width: 45% !important; + height: 3.5rem !important; + margin: 5px !important; + //border: none !important; + border-radius: 5px; + background: white; + border: solid gainsboro 1px; + float: left; + } + .training_caract { width: 30%; padding: 5px;