From 1ebb54d192c55e6c47c3b4088cd4d81ae10904ec Mon Sep 17 00:00:00 2001 From: cherif Date: Sun, 18 Feb 2024 13:54:53 +0100 Subject: [PATCH] 18/02/2024 - 14h --- src/components/Config_Document.js | 300 ++++++++++++------ src/components/Employes.js | 5 +- src/components/Materiels.js | 147 --------- src/components/Module_Absence.js | 3 +- src/components/Partner_Commande.js | 6 +- .../Partner_Config_Session_Steps.js | 4 +- src/components/Partner_Config_Technique.js | 2 +- src/components/Partner_Facture.js | 6 +- src/components/Partner_Prix_Achat.js | 4 +- src/styles/components/_config_document.scss | 8 + src/styles/components/_partner_commande.scss | 16 +- 11 files changed, 235 insertions(+), 266 deletions(-) diff --git a/src/components/Config_Document.js b/src/components/Config_Document.js index 297a961..9dcd320 100644 --- a/src/components/Config_Document.js +++ b/src/components/Config_Document.js @@ -201,11 +201,11 @@ const Config_Documents = (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(); + const [p_filtre2, setp_filtre2] = useState(""); + const [p_filtre2_value, setp_filtre2_value] = useState(""); const [p_filtre3, setp_filtre3] = useState(); const [p_filtre3_value, setp_filtre3_value] = useState(); @@ -391,6 +391,7 @@ const Config_Documents = (props) => { setp_detail_contenu_doc(); setp_detail_nom(""); setp_detail_ref_interne(""); + setcourrier_template_type_document_ref_interne("") setp_detail_sujet(""); setp_detail_type_doc(""); setfield_programme(); @@ -402,7 +403,9 @@ const Config_Documents = (props) => { setp_one_detail_contenu_doc(); setp_one_detail_nom(""); setp_one_detail_ref_interne(""); + setcourrier_template_type_document_ref_interne(''); setp_one_detail_sujet(""); + setoriginal_courrier_template_id(""); setp_one_detail_courrier_template_type_document_ref_interne(""); @@ -450,6 +453,12 @@ const Config_Documents = (props) => { if (mylocal_document.nom) setp_one_detail_nom(mylocal_document.nom); + if (mylocal_document.original_courrier_template_id) + setoriginal_courrier_template_id(mylocal_document.original_courrier_template_id); + else + setoriginal_courrier_template_id("") + + if (mylocal_document.type_doc) @@ -545,6 +554,8 @@ const Config_Documents = (props) => { } + const [courrier_template_type_document_ref_interne, setcourrier_template_type_document_ref_interne] = useState(""); + const [Get_Default_Original_Partner_Document_Data_api, setGet_Default_Original_Partner_Document_Data_api] = useState(); const [Get_Default_Original_Partner_Document_Data_message, setGet_Default_Original_Partner_Document_Data_message] = useState(); @@ -560,6 +571,7 @@ const Config_Documents = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); form.append("ref_interne", p_detail_ref_interne); + form.append("original_courrier_template_id", original_courrier_template_id); //console.log(" ## form = ", form); @@ -568,15 +580,19 @@ const Config_Documents = (props) => { axios.post(myurl, form).then(res => { setLoading(false); if (String(res.data.status) === "true") { - //console.log(" In Get_Default_Original_Partner_Document_Data res.data.status = " + res.data.status); - //console.log(" In Get_Default_Original_Partner_Document_Data res.data.message r_class = " + res.data.message); + console.log(" In Get_Default_Original_Partner_Document_Data res.data.status = " + res.data.status); + console.log(" In Get_Default_Original_Partner_Document_Data res.data.message r_class = " + res.data.message); + console.log(" ~~~11111"); setGet_Default_Original_Partner_Document_Data_api("true"); + console.log(" ~~~2222"); setGet_Default_Original_Partner_Document_Data_result(res.data.message); + console.log(" ~~~333"); if (res.data.message.length > 0) { + console.log(" ~~~444"); var mylocal_document = JSON.parse(res.data.message); - + console.log(" ~~~5555"); if (mylocal_document.nom) setp_detail_nom(mylocal_document.nom); @@ -591,6 +607,7 @@ const Config_Documents = (props) => { + document.getElementsByName("document_ref_interne")[0].value = ""; if (mylocal_document.ref_interne) { setp_detail_ref_interne(mylocal_document.ref_interne); @@ -603,14 +620,17 @@ const Config_Documents = (props) => { setone_field_programme(""); if (mylocal_document.contenu_doc) { - setone_field_programme(String(mylocal_document.contenu_doc)); - setone_field_programme_initial_value(String(mylocal_document.contenu_doc)); + + setfield_programme(String(mylocal_document.contenu_doc)); + setfield_programme_initial_value(String(mylocal_document.contenu_doc)); + } setone_field_corp_mail(""); if (mylocal_document.corps_mail) { - setone_field_programme(String(mylocal_document.corps_mail)); - setone_field_programme_initial_value(String(mylocal_document.corps_mail)); + + set_field_corp_mail(String(mylocal_document.corps_mail)); + set_field_corp_mail_initial_value(String(mylocal_document.corps_mail)); } setp_detail_joint_pdf(false); @@ -691,6 +711,10 @@ const Config_Documents = (props) => { if (res.data.message.length > 0) { var mylocal_document = JSON.parse(res.data.message); + if (mylocal_document._id) + setoriginal_courrier_template_id(mylocal_document._id); + + if (mylocal_document.nom) setp_one_detail_nom(mylocal_document.nom); @@ -719,6 +743,13 @@ const Config_Documents = (props) => { setp_one_detail_sujet(mylocal_document.sujet); } + setp_detail_joint_pdf(false) + if (mylocal_document.joint_pdf) { + if (String(mylocal_document.joint_pdf) === "1") + setp_detail_joint_pdf(true) + + } + if (mylocal_document.duplicate) { setp_one_detail_duplicate(mylocal_document.duplicate); @@ -735,8 +766,8 @@ const Config_Documents = (props) => { set_field_corp_mail(""); if (mylocal_document.corps_mail) { - set_field_corp_mail(String(mylocal_document.corps_mail)); - set_field_corp_mail_initial_value(String(mylocal_document.corps_mail)); + setone_field_corp_mail(String(mylocal_document.corps_mail)); + setone_field_corp_mail_initial_value(String(mylocal_document.corps_mail)); } @@ -1029,6 +1060,14 @@ const Config_Documents = (props) => { } + if (original_courrier_template_id) + form.append("original_courrier_template_id", original_courrier_template_id); + else { + form.append("original_courrier_template_id", ""); + + } + + if (p_one_detail_cible) form.append("cible", p_one_detail_cible); else { @@ -1142,7 +1181,7 @@ const Config_Documents = (props) => { setAdd_one_Partner_Document_api("true"); setAdd_one_Partner_Document_result(res.data.message); - + setoriginal_courrier_template_id(""); clear_one_detail_fields(); setadd_one_document(); setdisplay_add_one_document(); @@ -1519,6 +1558,62 @@ const Config_Documents = (props) => { + const [Getall_Partner_Document_With_filter_api, setGetall_Partner_Document_With_filter_api] = useState(); + const [Getall_Partner_Document_With_filter_message, setGetall_Partner_Document_With_filter_message] = useState(); + const [Getall_Partner_Document_With_filter_result, setGetall_Partner_Document_With_filter_result] = useState(); + function Getall_Partner_Document_With_filter(event) { + + var form = new FormData(); + // Recuperation des parametres + var filtre1 = p_filtre1; + var filtre2 = p_filtre2; + + + var filtre1_value = ""; + var filtre2_value = ""; + + // Recuperation des valeurs de filtres + + if (p_filtre1_value) { + filtre1_value = p_filtre1_value; + form.append(filtre1, filtre1_value); + } + + if (p_filtre2_value) { + filtre2_value = p_filtre2_value; + form.append(filtre2, filtre2_value); + } + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Document_with_filter/"; + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Partner_Document_With_filter res.data.status = " + res.data.status); + //console.log(" In Getall_Partner_Document_With_filter res.data.message r_class = " + res.data.message); + setGetall_Partner_Document_With_filter_api("true"); + setGetall_Partner_Document_With_filter_result(res.data.message); + setRows(res.data.message); + } + else { + setGetall_Partner_Document_With_filter_api("false"); + setGetall_Partner_Document_With_filter_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Partner_Document_With_filter = ', error); + setGetall_Partner_Document_With_filter_api("false"); + alert(" Impossible de recuperer la liste des documents"); + //setmyApimyApiMessage("") + }) + } + const [Get_Given_Personnalisable_Fields_From_template_ID_api, setGet_Given_Personnalisable_Fields_From_template_ID_api] = useState(); const [Get_Given_Personnalisable_Fields_From_template_ID_message, setGet_Given_Personnalisable_Fields_From_template_ID_message] = useState(); const [Get_Given_Personnalisable_Fields_From_template_ID_result, setGet_Given_Personnalisable_Fields_From_template_ID_result] = useState(); @@ -1658,6 +1753,10 @@ const Config_Documents = (props) => { } const [display_add_one_document, setdisplay_add_one_document] = React.useState(); + + const [original_courrier_template_id, setoriginal_courrier_template_id] = React.useState(""); + + function Get_And_Display_Selected_Document() { setdisplay_add_one_document("1"); @@ -1960,10 +2059,42 @@ const Config_Documents = (props) => { } + function clean_all_filters() { + + + setp_filtre1(""); + setp_filtre1_value(""); + + setp_filtre2(""); + setp_filtre2_value(""); + + setp_filtre3(""); + setp_filtre3_value(""); + + setp_filtre4(""); + setp_filtre4_value(""); + + + + setgridline_id(''); + setSelectionModel([]); + setsubmenu(""); + + Getall_Partner_Document_No_filter(); + } + + // end gestion pièces jointes const [gridline_id, setgridline_id] = useState(""); + const New_Option_Filter = [ + { "id": "nom", "label": "Nom Document", "value": "nom" }, + { "id": "ref_interne", "label": "Ref. Interne", "value": "ref_interne" }, + { "id": "", "label": "", "value": "" }, + { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres. + ] + return (
{isLoading &&
@@ -2098,7 +2229,29 @@ const Config_Documents = (props) => {
Utilisez les filtres !
- 0 && (data).value === String(p_filtre1))[0].label} + options={New_Option_Filter} + onChange={(event, value) => { + if (value && value.value) { + setp_filtre1(value.value); + + } + + }} + + renderInput={(params) => + } + />} + {/* { Lié a la Session (code session)   - + */}
@@ -2164,8 +2317,8 @@ const Config_Documents = (props) => {   { - setp_filtre1(); - setp_filtre1_value(); + setp_filtre1(""); + setp_filtre1_value(""); }} /> @@ -2177,7 +2330,31 @@ const Config_Documents = (props) => { {p_filtre2 &&
- 0 && (data).value === String(p_filtre2))[0].label} + options={New_Option_Filter} + onChange={(event, value) => { + if (value && value.value) { + setp_filtre2(value.value); + + } + + }} + + renderInput={(params) => + } + />} + + + {/* { Lié a la Session (code session)   - + */}
{String(p_filtre2).length > 2 && @@ -2255,92 +2432,17 @@ const Config_Documents = (props) => { } - {p_filtre3 && -
-
- { - setp_filtre3(e.target.value) - }} - > - Email   - Nom   - Lié a la Formation (code externe)   - Lié a la Session (code session)   - - - -
-
- {String(p_filtre3).length > 2 && - setp_filtre3_value(e.target.value)} - InputProps={{ - endAdornment: ( - - { - setp_filtre3_value(""); - }} /> - - ), - }} - - />} -
- - {String(p_filtre2).length > 2 && } - - {String(p_filtre3).length > 2 && } -
- }
-
-
@@ -3125,9 +3227,9 @@ const Config_Documents = (props) => { }} renderInput={(params) => + /> } /> diff --git a/src/components/Employes.js b/src/components/Employes.js index 3cce858..6d56cad 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -7768,7 +7768,8 @@ const Employes = (props) => {
@@ -8551,7 +8552,7 @@ const Employes = (props) => { }} className="detail_class_submenu bton_add_session" id='menu_import_participant' name='menu_import_participant'>Ajout 1 Contrat   - ajout commande +
diff --git a/src/components/Materiels.js b/src/components/Materiels.js index 780bfb9..72ec69d 100644 --- a/src/components/Materiels.js +++ b/src/components/Materiels.js @@ -2431,7 +2431,6 @@ const Materiels = (props) => { { "id": "ref_interne", "label": "Ref. Interne", "value": "ref_interne" }, { "id": "", "label": "", "value": "" }, { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres. - ] return ( @@ -2668,152 +2667,6 @@ const Materiels = (props) => { } - {/*p_filtre3 && -
-
- { - setp_filtre3(e.target.value) - }} - > - Ref. Intenne   - Nom   - Lié a la Formation (code externe)   - Lié a la Session (code session)   - Lié a l'employe (email)   - - -
-
- {String(p_filtre3).length > 2 && - setp_filtre3_value(e.target.value)} - InputProps={{ - endAdornment: ( - - { - setp_filtre3_value(""); - }} /> - - ), - }} - - />} -
- - {String(p_filtre2).length > 2 && } - - {String(p_filtre3).length > 2 && } -
- */} - - {/* - {p_filtre4 && -
-
- { - setp_filtre4(e.target.value) - }} - > - Email   - Nom   - Code Session    - Titre Formation   - - - -
-
- {String(p_filtre4).length > 2 && - setp_filtre2_value(e.target.value)} - InputProps={{ - endAdornment: ( - - { - setp_filtre4_value(""); - }} /> - - ), - }} - - />} -
- - - - {String(p_filtre2).length > 2 && } - -
- } - */}
diff --git a/src/components/Module_Absence.js b/src/components/Module_Absence.js index 425e169..2a6f2d2 100644 --- a/src/components/Module_Absence.js +++ b/src/components/Module_Absence.js @@ -49,6 +49,7 @@ import { RepeatOnRounded, RestaurantMenu } from "@mui/icons-material"; import { alignPropType } from "react-bootstrap/esm/types"; import ToggleSwitch from "./ToggleSwitch"; +import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5"; const Module_Absence = (props) => { const myconntected_employee_id = props.conntected_employee_id; @@ -1500,7 +1501,7 @@ const [Get_Partner_Debut_Fin_Journee_api, setGet_Partner_Debut_Fin_Journee_api]
diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index d7bedd2..cac8779 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -42,6 +42,7 @@ import { TransitionProps } from '@mui/material/transitions'; 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"; const Partner_Commande = (props) => { @@ -4199,13 +4200,14 @@ const Partner_Commande = (props) => {
diff --git a/src/components/Partner_Config_Session_Steps.js b/src/components/Partner_Config_Session_Steps.js index 1262a56..d726044 100644 --- a/src/components/Partner_Config_Session_Steps.js +++ b/src/components/Partner_Config_Session_Steps.js @@ -39,7 +39,7 @@ import DialogContentText from '@mui/material/DialogContentText'; 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"; const Partner_Configuration_Session_Steps = (props) => { @@ -732,7 +732,7 @@ const Partner_Configuration_Session_Steps = (props) => {
diff --git a/src/components/Partner_Config_Technique.js b/src/components/Partner_Config_Technique.js index dc83048..33f52b5 100644 --- a/src/components/Partner_Config_Technique.js +++ b/src/components/Partner_Config_Technique.js @@ -1752,7 +1752,7 @@ const Partner_Configuration_Technique = (props) => {
*/}
diff --git a/src/components/Partner_Facture.js b/src/components/Partner_Facture.js index 240486f..557b990 100644 --- a/src/components/Partner_Facture.js +++ b/src/components/Partner_Facture.js @@ -34,7 +34,7 @@ import { CiTrash } from "react-icons/ci"; import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md"; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; - +import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5"; const Partner_Facture = (props) => { @@ -2468,7 +2468,9 @@ const Partner_Facture = (props) => {
+ + +
  { const history = useHistory(); @@ -856,7 +856,7 @@ const Partner_Prix_Achat = (props) => { }} className="detail_class_submenu bton_add_session" id='menu_import_participant' name='menu_import_participant'>Ajout 1 Prix   - ajout commande +
diff --git a/src/styles/components/_config_document.scss b/src/styles/components/_config_document.scss index b7b74ad..f39b976 100644 --- a/src/styles/components/_config_document.scss +++ b/src/styles/components/_config_document.scss @@ -242,12 +242,14 @@ background: #c8cfd5; color: black; width: 100%; + height: 2rem !important; } .bton_import_excel { background: #c8cfd5; color: black; width: 100% !important; + height: 2rem !important; } .div_row_gauche_etendu { @@ -812,12 +814,14 @@ background: #c8cfd5; color: black; width: 50%; + height: 2rem !important; } .bton_import_excel { background: #c8cfd5; color: black; width: 65% !important; + height: 2rem !important; } .div_row_gauche_etendu { @@ -1423,12 +1427,14 @@ background: #c8cfd5; color: black; width: 50%; + height: 2rem !important; } .bton_import_excel { background: #c8cfd5; color: black; width: 50% !important; + height: 2rem !important; } .div_row_gauche_etendu { @@ -1917,12 +1923,14 @@ color: black; width: 40% !important; margin-left: 10px; + height: 2rem !important; } .bton_import_excel { background: #c8cfd5; color: black; width: 40% !important; + height: 2rem !important; } .div_row_gauche_etendu { diff --git a/src/styles/components/_partner_commande.scss b/src/styles/components/_partner_commande.scss index 5e43d5d..f6fab17 100644 --- a/src/styles/components/_partner_commande.scss +++ b/src/styles/components/_partner_commande.scss @@ -258,14 +258,14 @@ background: #c8cfd5; color: black; width: 100%; - height: 2 rem !important; + height: 2rem !important; } .bton_add_sous_menu { background: #c8cfd5; color: black; width: 100%; - height: 2 rem !important; + height: 2rem !important; } .bton_put_to_invoice { @@ -837,14 +837,14 @@ background: #c8cfd5; color: black; width: 50%; - height: 2 rem !important; + height: 2rem !important; } .bton_add_sous_menu { background: #c8cfd5; color: black; width: 100%; - height: 2 rem !important; + height: 2rem !important; } .bton_put_to_invoice { @@ -1444,14 +1444,14 @@ background: #c8cfd5; color: black; width: 40%; - height: 2 rem !important; + height: 2rem !important; } .bton_add_sous_menu { background: #c8cfd5; color: black; width: 100%; - height: 2 rem !important; + height: 2rem !important; } .bton_put_to_invoice { @@ -1967,14 +1967,14 @@ background: #c8cfd5; color: black; width: 25% !important; - height: 2 rem !important; + height: 2rem !important; } .bton_add_sous_menu { background: #c8cfd5; color: black; width: 25% !important; - height: 2 rem !important; + height: 2rem !important; } .bton_put_to_invoice {