recette2
parent
8dc18ab154
commit
7e1a6e01c6
|
@ -9,11 +9,7 @@ import Button from '@mui/material/Button';
|
||||||
import SendIcon from '@mui/icons-material/Send';
|
import SendIcon from '@mui/icons-material/Send';
|
||||||
import { getCookie } from 'react-use-cookie';
|
import { getCookie } from 'react-use-cookie';
|
||||||
import { useHistory } from "react-router-dom";
|
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 Dialog from '@mui/material/Dialog';
|
||||||
import DialogActions from '@mui/material/DialogActions';
|
import DialogActions from '@mui/material/DialogActions';
|
||||||
|
|
|
@ -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_api, setInvoice_Order_Data_api] = useState();
|
||||||
const [Invoice_Order_Data_message, setInvoice_Order_Data_message] = useState();
|
const [Invoice_Order_Data_message, setInvoice_Order_Data_message] = useState();
|
||||||
const [Invoice_Order_Data_result, setInvoice_Order_Data_result] = useState();
|
const [Invoice_Order_Data_result, setInvoice_Order_Data_result] = useState();
|
||||||
|
@ -5415,25 +5473,76 @@ const Partner_Commande = (props) => {
|
||||||
<div style={{ "width": "23%", "float": "left", "textAlign": "right", "paddingTop": "2rem" }}>
|
<div style={{ "width": "23%", "float": "left", "textAlign": "right", "paddingTop": "2rem" }}>
|
||||||
|
|
||||||
{String(p_detail_header_statut_label).toLowerCase() === "brouillon" &&
|
{String(p_detail_header_statut_label).toLowerCase() === "brouillon" &&
|
||||||
String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <Button variant="outlined" onClick={Confirm_Order_Data} className="detail_class_submenu bton_add_sous_menu"> Confirmer</Button>
|
String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <Button variant="outlined" onClick={Confirm_Order_Data} className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Confirmer</Button>
|
||||||
}
|
}
|
||||||
|
|
||||||
{String(p_detail_header_statut_label).toLowerCase() === "en cours" &&
|
{String(p_detail_header_statut_label).toLowerCase() === "en cours" &&
|
||||||
String(p_detail_header_type).toLowerCase() === "commande" && <Button variant="outlined" onClick={Make_Order_Ready_To_Invoice} className="detail_class_submenu bton_add_sous_menu bton_put_to_invoice" > Pret pour Facturation </Button>
|
String(p_detail_header_type).toLowerCase() === "commande" && <Button variant="outlined" onClick={Make_Order_Ready_To_Invoice} className="detail_class_submenu bton_add_sous_menu_cmd_gauche bton_put_to_invoice" > Pret pour Facturation </Button>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{String(selected_order_header_type) === "commande" &&
|
{String(selected_order_header_type) === "commande" &&
|
||||||
String(p_detail_header_statut_label).toLowerCase() === "traité" &&
|
String(p_detail_header_statut_label).toLowerCase() === "traité" &&
|
||||||
<Button variant="outlined" onClick={Invoice_Order_Data} className="detail_class_submenu bton_add_sous_menu"> Facturer </Button>}
|
<Button variant="outlined" onClick={Invoice_Order_Data} className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Facturer </Button>}
|
||||||
|
|
||||||
{String(selected_order_header_type) === "devis" && <Button variant="outlined" onClick={Convert_Quotation_To_Order_Data} className="detail_class_submenu bton_add_sous_menu"> Convertir en Cmd </Button>}
|
{String(selected_order_header_type) === "devis" && <Button variant="outlined" onClick={Convert_Quotation_To_Order_Data} className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Convertir en Cmd </Button>}
|
||||||
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <Button variant="outlined" onClick={Cancel_Order_Data} className="detail_class_submenu bton_add_sous_menu"> Annuler </Button>}
|
|
||||||
|
{String(selected_order_header_type) === "devis" &&
|
||||||
|
<Popup
|
||||||
|
trigger={
|
||||||
|
<Button variant="outlined" className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Valider et Reserver </Button>
|
||||||
|
}
|
||||||
|
|
||||||
|
modal
|
||||||
|
nested
|
||||||
|
position="center center"
|
||||||
|
>
|
||||||
|
{close => (
|
||||||
|
<div>
|
||||||
|
<button className="gest_close" onClick={close}>
|
||||||
|
×
|
||||||
|
</button>
|
||||||
|
<div className="gest_header"> MySy Information </div>
|
||||||
|
<div className="gest_content">
|
||||||
|
{' '}
|
||||||
|
|
||||||
|
En confirmant cette opération, <b> vous allez valider le devis et reserver automatiquement les places dans la session</b> <br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div className="gest_actions">
|
||||||
|
<div style={{ "width": "45%", "float": "left" }}>
|
||||||
|
<button className="gest_bton_popup" onClick={(event) => {
|
||||||
|
Valide_Quotation_And_Insert_To_Session();
|
||||||
|
//console.log('modal closed ');
|
||||||
|
close();
|
||||||
|
}}> Valider </button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div style={{ "width": "45%", "float": "right" }}>
|
||||||
|
<button
|
||||||
|
className="gest_bton_popup"
|
||||||
|
onClick={() => {
|
||||||
|
//console.log('modal closed ');
|
||||||
|
close();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Annuler
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Popup>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <Button variant="outlined" onClick={Cancel_Order_Data} className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Annuler </Button>}
|
||||||
|
|
||||||
|
|
||||||
{String(p_detail_header_statut_label).toLowerCase() !== "traité" &&
|
{String(p_detail_header_statut_label).toLowerCase() !== "traité" &&
|
||||||
String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <Popup
|
String(p_detail_header_statut_label).toLowerCase() !== "facturé" &&
|
||||||
trigger={<Button variant="outlined" className="detail_class_submenu bton_add_sous_menu"> Supprimer </Button>}
|
<Popup
|
||||||
|
trigger={<Button variant="outlined" className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Supprimer </Button>}
|
||||||
|
|
||||||
modal
|
modal
|
||||||
nested
|
nested
|
||||||
|
@ -5479,11 +5588,11 @@ const Partner_Commande = (props) => {
|
||||||
<br /> <br />
|
<br /> <br />
|
||||||
{String(p_detail_header_statut_label).toLowerCase() === "en cours" &&
|
{String(p_detail_header_statut_label).toLowerCase() === "en cours" &&
|
||||||
|
|
||||||
<Button variant="outlined" onClick={Compute_Order_Header_Price} className="detail_class_submenu" id='order_header_main' name='order_header_main'>Mettre a jour prix</Button>}
|
<Button variant="outlined" onClick={Compute_Order_Header_Price} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Mettre a jour prix</Button>}
|
||||||
|
|
||||||
|
|
||||||
{String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && <Button variant="outlined" onClick={print_order_pdf} className="detail_class_submenu" id='order_header_main' name='order_header_main'>Imprimer pdf</Button>}
|
{String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && <Button variant="outlined" onClick={print_order_pdf} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>Imprimer pdf</Button>}
|
||||||
{String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && <Button variant="outlined" onClick={Send_Order_By_Email} className="detail_class_submenu" id='order_header_main' name='order_header_main'>envoyer par mail</Button>}
|
{String(p_detail_header_statut_label).toLowerCase() !== "brouillon" && <Button variant="outlined" onClick={Send_Order_By_Email} className="detail_class_submenu bton_add_sous_menu_cmd_gauche" id='order_header_main' name='order_header_main'>envoyer par mail</Button>}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -268,6 +268,16 @@
|
||||||
height: 2rem !important;
|
height: 2rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bton_add_sous_menu_cmd_gauche {
|
||||||
|
background: #c8cfd5;
|
||||||
|
color: black;
|
||||||
|
width: 100%;
|
||||||
|
height: 2rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.bton_put_to_invoice {
|
.bton_put_to_invoice {
|
||||||
background: #d5f38f;
|
background: #d5f38f;
|
||||||
color: black;
|
color: black;
|
||||||
|
@ -848,6 +858,14 @@
|
||||||
height: 2rem !important;
|
height: 2rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bton_add_sous_menu_cmd_gauche {
|
||||||
|
background: #c8cfd5;
|
||||||
|
color: black;
|
||||||
|
width: 100%;
|
||||||
|
height: 2rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.bton_put_to_invoice {
|
.bton_put_to_invoice {
|
||||||
background: #d5f38f;
|
background: #d5f38f;
|
||||||
color: black;
|
color: black;
|
||||||
|
@ -1456,6 +1474,13 @@
|
||||||
height: 2rem !important;
|
height: 2rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bton_add_sous_menu_cmd_gauche {
|
||||||
|
background: #c8cfd5;
|
||||||
|
color: black;
|
||||||
|
width: 100%;
|
||||||
|
height: 2rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
.bton_put_to_invoice {
|
.bton_put_to_invoice {
|
||||||
background: #d5f38f;
|
background: #d5f38f;
|
||||||
color: black;
|
color: black;
|
||||||
|
@ -1980,6 +2005,13 @@
|
||||||
height: 2rem !important;
|
height: 2rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bton_add_sous_menu_cmd_gauche {
|
||||||
|
background: #c8cfd5;
|
||||||
|
color: black;
|
||||||
|
width: 100% !important;
|
||||||
|
height: 2rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
.bton_put_to_invoice {
|
.bton_put_to_invoice {
|
||||||
background: #d5f38f;
|
background: #d5f38f;
|
||||||
color: black;
|
color: black;
|
||||||
|
|
Loading…
Reference in New Issue