From 7e1a6e01c681251fd66fefa7bb4e00f2edbf754f Mon Sep 17 00:00:00 2001 From: cherif Date: Sun, 21 Apr 2024 19:12:56 +0200 Subject: [PATCH] ss --- src/components/Partner_Client.js | 6 +- src/components/Partner_Commande.js | 131 +++++++++++++++++-- src/styles/components/_partner_commande.scss | 32 +++++ 3 files changed, 153 insertions(+), 16 deletions(-) diff --git a/src/components/Partner_Client.js b/src/components/Partner_Client.js index 2699138..c1494f9 100644 --- a/src/components/Partner_Client.js +++ b/src/components/Partner_Client.js @@ -9,11 +9,7 @@ import Button from '@mui/material/Button'; import SendIcon from '@mui/icons-material/Send'; import { getCookie } from 'react-use-cookie'; import { useHistory } from "react-router-dom"; -import PartnerInfo from "./UpdatePartnerInfo"; -import PartenairStat from "./PartenairStat"; -import { Helmet } from "react-helmet"; -import bannerimg2 from "../mysy_img/MYSY-LOGO-BLUE.png"; -import logowhite from "../mysy_img/MYSY-LOGO-WHITE.png"; + import Dialog from '@mui/material/Dialog'; import DialogActions from '@mui/material/DialogActions'; diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index 3bf21bc..b34cb52 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -3073,6 +3073,64 @@ const Partner_Commande = (props) => { } + + + const [Valide_Quotation_And_Insert_To_Session_api, setValide_Quotation_And_Insert_To_Session_api] = useState(); + const [Valide_Quotation_And_Insert_To_Session_message, setValide_Quotation_And_Insert_To_Session_message] = useState(); + const [Valide_Quotation_And_Insert_To_Session_result, setValide_Quotation_And_Insert_To_Session_result] = useState(); + function Valide_Quotation_And_Insert_To_Session() { + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("quotation_id", selected_id); + + + //console.log("### form = ", form); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Insert_Quotation_To_Session/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + //console.log(" In Add_Update_One_Order_Line_Data res.data.status = " + res.data.status); + //console.log(" In Add_Update_One_Order_Line_Data res.data.message r_class = " + res.data.message); + + setLoading(false); + if (String(res.data.status) === String("true")) { + setValide_Quotation_And_Insert_To_Session_api("true"); + setValide_Quotation_And_Insert_To_Session_message(res.data.message); + clean_all_filters(); + Getall_Parter_Orders_No_Filter(); + + Display_Detail_Order_data(selected_id); + if (document.getElementById('myRef_head')) { + var divh = document.getElementById('myRef_head').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + + + alert(res.data.message); + } + else { + setValide_Quotation_And_Insert_To_Session_api("false"); + setValide_Quotation_And_Insert_To_Session_message(res.data.message); + + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + + console.warn('Valide_Quotation_And_Insert_To_Session : Not good man :( Valide_Quotation_And_Insert_To_Session = ' + error); + setValide_Quotation_And_Insert_To_Session_api("false"); + alert(" Impossible de valider le devis et d'inserer les lignes dans la session "); + }) + + + } + 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(); @@ -3401,7 +3459,7 @@ const Partner_Commande = (props) => { } - + {String(p_detail_header_statut_label).toLowerCase() === "facturé" &&
Article {
{String(p_detail_header_statut_label).toLowerCase() === "brouillon" && - String(p_detail_header_statut_label).toLowerCase() !== "facturé" && + String(p_detail_header_statut_label).toLowerCase() !== "facturé" && } {String(p_detail_header_statut_label).toLowerCase() === "en cours" && - String(p_detail_header_type).toLowerCase() === "commande" && + String(p_detail_header_type).toLowerCase() === "commande" && } {String(selected_order_header_type) === "commande" && String(p_detail_header_statut_label).toLowerCase() === "traité" && - } + } - {String(selected_order_header_type) === "devis" && } - {String(p_detail_header_statut_label).toLowerCase() !== "facturé" && } + {String(selected_order_header_type) === "devis" && } + + {String(selected_order_header_type) === "devis" && + Valider et Reserver + } + + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, vous allez valider le devis et reserver automatiquement les places dans la session
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
+ + } + + {String(p_detail_header_statut_label).toLowerCase() !== "facturé" && } {String(p_detail_header_statut_label).toLowerCase() !== "traité" && - String(p_detail_header_statut_label).toLowerCase() !== "facturé" && Supprimer } + String(p_detail_header_statut_label).toLowerCase() !== "facturé" && + Supprimer } modal nested @@ -5479,11 +5588,11 @@ const Partner_Commande = (props) => {

{String(p_detail_header_statut_label).toLowerCase() === "en cours" && - } + } - {String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && } - {String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && } + {String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && } + {String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && }
diff --git a/src/styles/components/_partner_commande.scss b/src/styles/components/_partner_commande.scss index 03a094f..768dc69 100644 --- a/src/styles/components/_partner_commande.scss +++ b/src/styles/components/_partner_commande.scss @@ -268,6 +268,16 @@ height: 2rem !important; } + .bton_add_sous_menu_cmd_gauche { + background: #c8cfd5; + color: black; + width: 100%; + height: 2rem !important; + } + + + + .bton_put_to_invoice { background: #d5f38f; color: black; @@ -848,6 +858,14 @@ height: 2rem !important; } + .bton_add_sous_menu_cmd_gauche { + background: #c8cfd5; + color: black; + width: 100%; + height: 2rem !important; + } + + .bton_put_to_invoice { background: #d5f38f; color: black; @@ -1456,6 +1474,13 @@ height: 2rem !important; } + .bton_add_sous_menu_cmd_gauche { + background: #c8cfd5; + color: black; + width: 100%; + height: 2rem !important; + } + .bton_put_to_invoice { background: #d5f38f; color: black; @@ -1980,6 +2005,13 @@ height: 2rem !important; } + .bton_add_sous_menu_cmd_gauche { + background: #c8cfd5; + color: black; + width: 100% !important; + height: 2rem !important; + } + .bton_put_to_invoice { background: #d5f38f; color: black;