03/02/2026
parent
c5703167fc
commit
93c7731ca7
|
|
@ -70,7 +70,7 @@ function Facture(props) {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
|
||||
function handleClick(event, cellValues) {
|
||||
|
|
|
|||
|
|
@ -1076,7 +1076,7 @@ registerLocale('fr', fr);
|
|||
if (String(res.data.status) === "true") {
|
||||
setLoading(false);
|
||||
//console.log(" In Get_Invoice_Data res.data.status = " + res.data.status);
|
||||
//console.log(" In Get_Invoice_Data res.data.message r_class = " + res.data.message);
|
||||
console.log(" In Get_Invoice_Data res.data.message r_class = " + res.data.message);
|
||||
setGetAttendee_api("true");
|
||||
setGetAttendee_result(res.data.message);
|
||||
|
||||
|
|
|
|||
|
|
@ -199,6 +199,8 @@ const Partner_Commande = (props) => {
|
|||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "4"
|
||||
&& String(cellValues.row.order_header_type) === "devis" && "Perdu"}
|
||||
|
||||
{cellValues.row.order_header_status && String(cellValues.row.order_header_status) === "5"
|
||||
&& String(cellValues.row.order_header_type) === "devis" && "Facturé"}
|
||||
|
||||
|
||||
</div>
|
||||
|
|
@ -854,7 +856,7 @@ const Partner_Commande = (props) => {
|
|||
//console.log(" ### setNew_GetCurrentPartnerClass_result = ", New_GetCurrentPartnerClass_result);
|
||||
}
|
||||
|
||||
console.log(" ## new_data2 = ", new_data2)
|
||||
// console.log(" ## new_data2 = ", new_data2)
|
||||
|
||||
} else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + res.data.message);
|
||||
|
|
@ -874,15 +876,15 @@ const Partner_Commande = (props) => {
|
|||
}
|
||||
|
||||
|
||||
const [New_Getall_TrainingSession_For_Given_Class_result, setNew_Getall_TrainingSession_For_Given_Class_result] = useState([ {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"code_session": "",
|
||||
"titre": "",
|
||||
"date_debut": "",
|
||||
"date_fin": "",
|
||||
}]);
|
||||
const [New_Getall_TrainingSession_For_Given_Class_result, setNew_Getall_TrainingSession_For_Given_Class_result] = useState([{
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"code_session": "",
|
||||
"titre": "",
|
||||
"date_debut": "",
|
||||
"date_fin": "",
|
||||
}]);
|
||||
|
||||
const [Getall_TrainingSession_For_Given_Class_api, setGetall_TrainingSession_For_Given_Class_api] = useState();
|
||||
const [Getall_TrainingSession_For_Given_Class_message, setGetall_TrainingSession_For_Given_Class_message] = useState();
|
||||
|
|
@ -956,15 +958,15 @@ const Partner_Commande = (props) => {
|
|||
setNew_Getall_TrainingSession_For_Given_Class_result(new_data2);
|
||||
|
||||
} else {
|
||||
setNew_Getall_TrainingSession_For_Given_Class_result([ {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"code_session": "",
|
||||
"titre": "",
|
||||
"date_debut": "",
|
||||
"date_fin": "",
|
||||
}])
|
||||
setNew_Getall_TrainingSession_For_Given_Class_result([{
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"code_session": "",
|
||||
"titre": "",
|
||||
"date_debut": "",
|
||||
"date_fin": "",
|
||||
}])
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1597,6 +1599,10 @@ const Partner_Commande = (props) => {
|
|||
setp_detail_header_statut_label("Perdu");
|
||||
}
|
||||
|
||||
else if (String(mylocal_order.order_header_status) === "5") {
|
||||
setp_detail_header_statut_label("Facturé");
|
||||
}
|
||||
|
||||
else if (String(mylocal_order.order_header_status) === "-1") {
|
||||
setp_detail_header_statut_label("Annulé");
|
||||
}
|
||||
|
|
@ -4162,6 +4168,12 @@ const Partner_Commande = (props) => {
|
|||
form.append("order_header_id", selected_id);
|
||||
|
||||
|
||||
if (!rows_order_lines || rows_order_lines.length <= 0) {
|
||||
setdisplay_alert_mysy("1");
|
||||
setalert_message("Ce devis ne contient aucune ligne à confirmer");
|
||||
setalert_type("error");
|
||||
return;
|
||||
}
|
||||
//console.log("### form = ", form);
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Confirm_Partner_Order_Header_And_Lines/";
|
||||
setLoading(true);
|
||||
|
|
@ -4536,6 +4548,69 @@ const Partner_Commande = (props) => {
|
|||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
const [Invoice_Quotation_Data_api, setInvoice_Quotation_Data_api] = useState();
|
||||
const [Invoice_Quotation_Data_message, setInvoice_Quotation_Data_message] = useState();
|
||||
const [Invoice_Quotation_Data_result, setInvoice_Quotation_Data_result] = useState();
|
||||
function Invoice_Quotation_Data() {
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("order_id", selected_id);
|
||||
form.append("order_ref_interne", order_internal_ref);
|
||||
|
||||
|
||||
//console.log("### form = ", form);
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Invoice_Partner_Quotation/";
|
||||
|
||||
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")) {
|
||||
// clean_article_detail_fields();
|
||||
setInvoice_Quotation_Data_api("true");
|
||||
setInvoice_Quotation_Data_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);
|
||||
setdisplay_alert_mysy("1");
|
||||
setalert_message(res.data.message);
|
||||
setalert_type("success");
|
||||
}
|
||||
else {
|
||||
setInvoice_Quotation_Data_api("false");
|
||||
setInvoice_Quotation_Data_message(res.data.message);
|
||||
|
||||
// alert(res.data.message);
|
||||
setdisplay_alert_mysy("1");
|
||||
setalert_message(res.data.message);
|
||||
setalert_type("error");
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
|
||||
console.warn('Invoice_Quotation_Data : Not good man :( Invoice_Quotation_Data = ' + error);
|
||||
setInvoice_Quotation_Data_api("false");
|
||||
alert(" Impossible de facturer le devis ");
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
const [Get_Class_Data_api, setGet_Class_Data_api] = useState();
|
||||
|
|
@ -6092,7 +6167,7 @@ const Partner_Commande = (props) => {
|
|||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
{/*** Si c'est pour une formation */}
|
||||
{article_formation_ou_produit && String(article_formation_ou_produit) === "formation" &&
|
||||
<div>
|
||||
|
|
@ -7767,19 +7842,19 @@ const Partner_Commande = (props) => {
|
|||
</Button>*/}
|
||||
|
||||
|
||||
<Button variant="outlined" onClick={submenu_add_one_order}
|
||||
className="detail_class_submenu bton_add_session"
|
||||
id='menu_import_participant' name='menu_import_participant'>Ajout 1 Commande
|
||||
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
|
||||
</Button>
|
||||
|
||||
<Button variant="outlined" onClick={submenu_add_one_quotation}
|
||||
className="detail_class_submenu bton_add_session"
|
||||
id='menu_import_participant' name='menu_import_participant'>Ajout 1 Devis
|
||||
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
|
||||
|
||||
</Button>
|
||||
|
||||
{/*<Button variant="outlined" onClick={ submenu_add_one_order}
|
||||
className="detail_class_submenu bton_add_session"
|
||||
id='menu_import_participant' name='menu_import_participant'>Ajout 1 Commande
|
||||
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
|
||||
|
||||
</Button>*/}
|
||||
|
||||
|
||||
</div>}
|
||||
</div>
|
||||
|
|
@ -7884,30 +7959,7 @@ const Partner_Commande = (props) => {
|
|||
/>}
|
||||
|
||||
|
||||
{/*<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="detail_header_status"
|
||||
id="detail_header_status"
|
||||
select
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_detail_header_statut}
|
||||
onChange={(e) => {
|
||||
setp_detail_header_statut(e.target.value);
|
||||
setOrder_data_changed("1");
|
||||
}
|
||||
}
|
||||
|
||||
>
|
||||
<MenuItem value="0" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Brouillon </MenuItem>
|
||||
<MenuItem value="1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >En cours </MenuItem>
|
||||
<MenuItem value="2" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Traité </MenuItem>
|
||||
<MenuItem value="-1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Annulé </MenuItem>
|
||||
</TextField>*/}
|
||||
|
||||
</div>}
|
||||
{String(order_data_edit_mode) === "1" && String(p_detail_header_type) === "devis" && <div className="session_caract"> Statut<br />
|
||||
|
|
@ -9018,10 +9070,64 @@ const Partner_Commande = (props) => {
|
|||
|
||||
|
||||
{String(props.check_user_acces_right("commande", "write")) === "1" && String(selected_order_header_type) === "devis" &&
|
||||
( p_detail_header_statut === "1" || p_detail_header_statut === "3") &&
|
||||
<Popup
|
||||
trigger={
|
||||
<Button variant="outlined" className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Facturer </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, vous allez <i><font color="red"> lancer le processus de facturation</font></i>. <br />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
Invoice_Quotation_Data();
|
||||
close();
|
||||
}}> Valider </button>
|
||||
|
||||
</div>
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
<button
|
||||
className="gest_bton_popup_annuler"
|
||||
onClick={() => {
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Popup>
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
{/*String(props.check_user_acces_right("commande", "write")) === "1" && String(selected_order_header_type) === "devis" &&
|
||||
(String(p_detail_header_statut_label).toLowerCase().trim() === "en cours" || String(p_detail_header_statut_label).toLowerCase().trim() === "gagné") &&
|
||||
String(p_detail_header_order_header_ref_interne) === "" &&
|
||||
<Button variant="outlined" onClick={Convert_Quotation_To_Order_Data} className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Convertir en Cmd </Button>
|
||||
}
|
||||
*/}
|
||||
|
||||
{String(selected_order_header_type) === "devis" &&
|
||||
(String(p_detail_header_statut_label).toLowerCase().trim() === "en cours" || String(p_detail_header_statut_label).toLowerCase().trim() === "gagné") &&
|
||||
|
|
|
|||
|
|
@ -1139,9 +1139,9 @@ const Partner_Facture = (props) => {
|
|||
|
||||
//document.getElementsByName("detail_header_ref_cient")[0].value = "";
|
||||
if (mylocal_order.order_header_ref_client) {
|
||||
setp_detail_header_ref_interne(mylocal_order.order_header_ref_client);
|
||||
setp_detail_header_ref_client(mylocal_order.order_header_ref_client);
|
||||
} else {
|
||||
setp_detail_header_ref_interne("")
|
||||
setp_detail_header_ref_client("")
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -4796,7 +4796,7 @@ const Partner_Facture = (props) => {
|
|||
/>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div className="session_caract"> Ref. Commande<br />
|
||||
|
|
|
|||
Loading…
Reference in New Issue