diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index a861762..384bf48 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -51,8 +51,36 @@ import ChevronRightIcon from '@mui/icons-material/ChevronRight'; import { TreeView } from '@mui/x-tree-view/TreeView'; import { TreeItem } from '@mui/x-tree-view/TreeItem'; +import { makeStyles } from "@material-ui/core/styles"; +import CancelPresentationIcon from '@mui/icons-material/CancelPresentation'; +import { IconButton } from '@material-ui/core'; + + +const useStyles = makeStyles((theme) => ({ + + dialog: { + position: 'absolute', + // left: 10, + top: 400 + }, + + paper: { + overflowY: 'unset', + }, + customizedButton: { + position: 'absolute', + left: '95%', + top: '-9%', + backgroundColor: 'lightgray', + color: 'gray', + }, +})); + + const Partner_Commande = (props) => { + const classes = useStyles(); + const history = useHistory(); const [submenu, setsubmenu] = useState(""); const [rowss, setRows] = useState([]); @@ -225,11 +253,87 @@ const Partner_Commande = (props) => { const columns_order_lines = [ { field: '_id', headerName: '_id', hide: true, editable: false }, { field: 'id', headerName: 'id', hide: true, editable: false }, + { field: 'order_line_class_id', headerName: 'order_line_class_id', hide: true, editable: false }, + { field: 'order_line_formation', headerName: 'intenal_url', width: 0, hide: true, editable: false }, { field: 'order_line_session_id', headerName: 'session_id', width: 0, hide: true, editable: false }, - { field: 'order_line_formation_title', headerName: 'Titre', width: 250, hide: false, editable: false, flex: 1 }, - { field: 'order_line_session_code', headerName: 'Code Session', width: 250, hide: false, editable: false, flex: 1 }, - { field: 'order_line_formation_external_code', headerName: 'Code Formation', width: 150, hide: false, editable: false }, + { field: 'order_line_formation_title', headerName: 'Titre', minwidth: 200, flex: 1, hideable: true, resizable: true, renderCell: (params) => , }, + { field: 'order_line_session_code', headerName: 'Code Session', minwidth: 200, flex: 1, hideable: true, resizable: true, + renderCell: (cellValues) => { + return ( + + + + ); + }, + }, + + { + field: "Session", headerName: 'Sessionii', + renderCell: (cellValues) => { + return ( + + + + ); + } + }, + + { field: 'order_line_formation_external_code', headerName: 'Code Formation', minwidth: 200, flex: 1, hideable: true, resizable: true, renderCell: (params) => , }, { field: 'order_line_formation_duration', headerName: 'Durée', width: 80, hide: false, editable: false }, { field: 'order_line_qty', headerName: 'Qte', width: 100, hide: false, editable: false }, { field: 'order_line_prix_unitaire', headerName: 'Prix Unit.', width: 100, hide: false, editable: false }, @@ -313,6 +417,7 @@ const Partner_Commande = (props) => { ); } }, + { field: "delete", headerName: 'Supprimer', renderCell: (cellValues) => { @@ -1058,6 +1163,11 @@ const Partner_Commande = (props) => { const myRef_head = useRef(null); const [selected_id, setselected_id] = useState(""); const [selected_order_line_id, setselected_order_line_id] = useState(""); + + const [selected_order_line_row_number_id, setselected_order_line_row_number_id] = useState(""); + const [selected_order_line_class_id, setselected_order_line_class_id] = useState(""); + + const [selected_order_header_type, setselected_order_header_type] = useState(); const [order_internal_ref, setorder_internal_ref] = useState(""); @@ -2735,10 +2845,10 @@ const Partner_Commande = (props) => { console.log(" GLOBAL #### total_taux_tax_bef = ", total_taux_tax_bef); - const total_taux_tax =1 + total_taux_tax_bef; + const total_taux_tax = 1 + total_taux_tax_bef; + + const total_base1_total_reduction = (total_base1 - total_reduction); - const total_base1_total_reduction = (total_base1 - total_reduction) ; - const montant_ttc = (total_base1_total_reduction * total_taux_tax).toFixed(2); console.log(" GLOBAL #### total_taux_tax = ", total_taux_tax); @@ -2746,8 +2856,8 @@ const Partner_Commande = (props) => { console.log(" GLOBAL #### montant_ttc = ", montant_ttc); - var montant_taxe_tva = ((total_base1 - total_reduction) * total_taux_tax_bef ).toFixed(2); - // var montant_ttc = ((total_base1 - total_reduction) * (1 + [parseFloat(String(partner_taux_tva)) / 100])).toFixed(2); //(total_base2 + montant_taxe_tva).toFixed(2); + var montant_taxe_tva = ((total_base1 - total_reduction) * total_taux_tax_bef).toFixed(2); + // var montant_ttc = ((total_base1 - total_reduction) * (1 + [parseFloat(String(partner_taux_tva)) / 100])).toFixed(2); //(total_base2 + montant_taxe_tva).toFixed(2); console.log(" GLOBAL #### montant_taxe_tva = ", montant_taxe_tva, " ### montant_ttc = ", montant_ttc); @@ -4124,6 +4234,97 @@ const Partner_Commande = (props) => { ] + const [Dialog_Create_Session_open, setDialog_Create_Session_open] = React.useState(false); + + const Close_Dialog_Create_Session_open = () => { + + setnew_session_date_debut(""); + setnew_session_date_fin(""); + setnew_session_nb_place(""); + setnew_session_code(""); + + setDialog_Create_Session_open(false); + }; + + const [new_session_date_debut, setnew_session_date_debut] = useState(); + const [new_session_date_fin, setnew_session_date_fin] = useState(); + const [new_session_code, setnew_session_code] = useState(""); + const [new_session_nb_place, setnew_session_nb_place] = useState(""); + + const filterPassedTime_start = (time) => { + const currentDate = new Date(); + const selectedDate = new Date(time); + + return currentDate.getTime() < selectedDate.getTime(); + }; + + + + const [Create_Session_From_Quotation_api, setCreate_Session_From_Quotation_api] = useState(); + const [Create_Session_From_Quotation_message, setCreate_Session_From_Quotation_message] = useState(); + const [Create_Session_From_Quotation_result, setCreate_Session_From_Quotation_result] = useState(); + function Create_Session_From_Quotation() { + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + // zzzz + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("date_debut", format(new_session_date_debut, 'dd/MM/yyyy')); + form.append("date_fin", format(new_session_date_fin, 'dd/MM/yyyy')); + form.append("nb_participant", new_session_nb_place); + form.append("class_id", selected_order_line_class_id); + form.append("code_session", new_session_code); + form.append("quotation_line_id", selected_order_line_id); + + console.log(" form == ", form); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_SessionFormation_From_Quotation_Line/"; + + + setLoading(true); + axios.post(myurl, form).then(res => { + //console.log(" In Create_Session_From_Quotation res.data.status = " + res.data.status); + //console.log(" In Create_Session_From_Quotation res.data.message r_class = " + res.data.message); + + setLoading(false); + if (String(res.data.status) === String("true")) { + setCreate_Session_From_Quotation_api("true"); + setCreate_Session_From_Quotation_result(res.data.message); + + Getall_Parter_Orders_No_Filter(); + + Close_Dialog_Create_Session_open(); + handleClick_edit_order_From_Line(selected_order_line_row_number_id); + alert(res.data.message); + + /*if (document.getElementById('myRef_head')) { + var divh = document.getElementById('myRef_head').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + }*/ + disable_Order_Header_DetailFields(); + + } + else { + setCreate_Session_From_Quotation_api("false"); + setCreate_Session_From_Quotation_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + + setLoading(false); + console.warn('UpdateStagiaireData : Not good man :( Create_Session_From_Quotation = ' + error); + setCreate_Session_From_Quotation_api("false"); + alert(" Impossible de faire la mise à jour"); + + }) + } + return ( @@ -4133,11 +4334,190 @@ const Partner_Commande = (props) => { } + {/****** Dialog pour créer une session depuis un devis */} + + null} + + PaperProps={{ + + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + //position: 'absolute', + //top: default_h + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + className="displaypartnersession mysy_MuiPaper-root" + + > + + Création Session + + + +
+ + Date début + { + + let local_date = new Date(date).getTime(); + let date_end_session = new Date(new_session_date_fin).getTime(); + let date_start_session = new Date(new_session_date_debut).getTime(); + + /* console.log(" local_date = ", local_date); + console.log(" date_end_session = ", date_end_session); + console.log(" date_start_session = ", date_start_session);*/ + + if (local_date > date_end_session) { + alert(" La date est après la fin de la session"); + return; + } + + + setnew_session_date_debut(date); + } + } + showTimeSelect={false} + filterTime={filterPassedTime_start} + dateFormat="dd/MM/yyyy" + className="disabled_style " + + locale='fr-FR' + /> + +
+ +
+ + + Date fin + { + + let local_date = new Date(date).getTime(); + let date_end_session = new Date(new_session_date_fin).getTime(); + let date_start_session = new Date(new_session_date_debut).getTime(); + + + + + if (local_date < date_start_session) { + alert(" La date est avant le début de la session"); + return; + } + + + setnew_session_date_fin(date); + } + } + showTimeSelect={false} + filterTime={filterPassedTime_start} + dateFormat="dd/MM/yyyy" + className="disabled_style" + fullWidth + locale='fr-FR' + + /> + + +
+ +
Code Session + { + setnew_session_code(e.target.value); + } + } + + /> + +
+ +
Nb Places + { + setnew_session_nb_place(e.target.value); + } + } + + /> + +
+ + + +
+ + + + +
+
+ +
+
+ +
+ + + + + +
+ + +
+
+ + + {/****** fin Dialog pour créer une session depuis un devis */} + + + {/****** Dialog pour cloturer un devis (gerer la perte d'un devis avec motif, ou simple cloture) */} null} @@ -4234,7 +4614,7 @@ const Partner_Commande = (props) => { {/* Dialog pour gerer la signature digitale */} null} > @@ -4349,7 +4729,7 @@ const Partner_Commande = (props) => { {/****** Dialog pour la gestion d'un article (formation) */} null} > @@ -4967,7 +5347,7 @@ const Partner_Commande = (props) => { className="partner_commande" static onClose={() => null} - > + > {Dialog_1_message} @@ -7120,6 +7500,7 @@ const Partner_Commande = (props) => { order_line_montant_toutes_taxes: JSON.parse(item).order_line_montant_toutes_taxes, order_line_taux_taxe: JSON.parse(item).order_line_taux_taxe, + order_line_class_id: JSON.parse(item).class_id, } ))} diff --git a/src/components/TestUrl_new.js b/src/components/TestUrl_new.js index c41e00b..645a2fb 100644 --- a/src/components/TestUrl_new.js +++ b/src/components/TestUrl_new.js @@ -293,8 +293,30 @@ const TestUrl_New = (props) => { }) } + const [tab_label, settab_label] = useState([]); + + function Get_Local_Label(){ + var new_data2 = []; + var node1 = { + "_id": "@text1", + "label": "text1_label", + }; + + + var node2 = { + "_id": "@text2", + "label": "text2_label", + }; + + new_data2.push(node1); + new_data2.push(node2); + + settab_label(new_data2); + + } useEffect(() => { + Get_Local_Label(); Get_List_Agenda_Events(); Get_Personnalisable_Collections(); Get_Personnalisable_Collection_and_Fields(); @@ -796,53 +818,7 @@ const TestUrl_New = (props) => { - -
I can now be moved around!
-
- -
-

- Gestion du module Module_Email_Management - -

- - - - zzz - -
- - - editorRef_description.current = editor} - initialValue={field_description} - onKeyUp={editor_keyup} - onEditorChange={(newValue, editor) => { - - if (String(editor_tochange) === "1") { - //alert(" change"); - DataUpdated() - seteditor_tochange(""); - } - }} - - init={{ - resize: false, - height: 300, - menubar: false, - plugins: [ - 'advlist autolink lists link image charmap print preview anchor', - 'searchreplace visualblocks code fullscreen', - 'insertdatetime media table paste code help wordcount' - ], - - content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px; }' - }} - /> + @@ -860,43 +836,7 @@ const TestUrl_New = (props) => {
- {rows_champs_specifics && - rows_champs_specifics.map((champ_spec) => ( -
{JSON.parse(champ_spec).field_label}
-
- -
- ))} - -
- - - - - {rows_champs_specifics && - rows_champs_specifics.map((champ_spec) => ( -
'{champ_spec.field_value}'
- ))} - -
+
liste des events = diff --git a/src/styles/components/_displaypartnersession.scss b/src/styles/components/_displaypartnersession.scss index 246559b..2dbe88b 100644 --- a/src/styles/components/_displaypartnersession.scss +++ b/src/styles/components/_displaypartnersession.scss @@ -2686,6 +2686,7 @@ } + // end media @@ -2719,6 +2720,17 @@ + .disabled_style_100_percent_row { + font-size: small !important; + color: black; + width: 100% !important; + height: 3.5rem !important; + margin: 5px !important; + border-radius: 5px; + background: white; + border: solid gainsboro 1px; + } + .css-md26zr-MuiInputBase-root-MuiOutlinedInput-root { height: 3rem !important; }