04/10/2024 - 11h45

recette2
cherif 2024-10-04 11:41:55 +02:00
parent 96afb9c28b
commit c802936002
2 changed files with 172 additions and 45 deletions

View File

@ -5390,7 +5390,7 @@ const DisplayPartnerSession = (props) => {
const [p_one_location_type_label, setp_one_location_type_label] = useState("");
const [p_one_is_bpf, setp_one_is_bpf] = useState("0");
const [p_one_is_bpf_label, setp_one_is_bpf_label] = useState("Non");
const [p_one_is_bpf_label, setp_one_is_bpf_label] = useState("Oui");
function annuleSessionUpdate() {
clearSessionFields();
@ -15849,7 +15849,7 @@ const DisplayPartnerSession = (props) => {
} else {
setp_one_is_bpf("");
setp_one_is_bpf_label("");
setp_one_is_bpf_label("Non");
}
}}

View File

@ -1442,6 +1442,7 @@ const Partner_Commande = (props) => {
}
//document.getElementsByName("detail_nom_client")[0].value = "";
if (mylocal_order.order_header_client_nom) {
setp_detail_header_client_nom(mylocal_order.order_header_client_nom);
@ -1598,6 +1599,13 @@ const Partner_Commande = (props) => {
}
if (mylocal_order.order_header_inclus_bpf) {
setp_add_cmd_header_order_inclus_bpf(mylocal_order.order_header_inclus_bpf);
} else {
setp_add_cmd_header_order_inclus_bpf("");
}
disable_Order_Header_DetailFields();
order_header_submenu_main();
@ -2094,7 +2102,7 @@ const Partner_Commande = (props) => {
if (mylocal_order.order_line_type_apprenant) {
setp_add_line_item_type_apprenant(mylocal_order.order_line_type_apprenant);
}else{
} else {
setp_add_line_item_type_apprenant("");
}
@ -2155,6 +2163,7 @@ const Partner_Commande = (props) => {
function submenu_add_one_order() {
clean_order_detail_fields();
Getall_Partner_Paiement_Condition();
setp_add_cmd_header_order_type("commande");
@ -2166,6 +2175,8 @@ const Partner_Commande = (props) => {
function submenu_add_one_quotation() {
clean_order_detail_fields();
Getall_Parter_Devis_Config_Points();
Getall_Partner_Paiement_Condition();
setp_add_cmd_header_order_type("devis");
@ -2257,6 +2268,12 @@ const Partner_Commande = (props) => {
document.getElementsByName("detail_header_type")[0].style.backgroundColor = "#FFFFFF";
}
if (document.getElementsByName("order_header_inclus_bpf")[0]) {
document.getElementsByName("order_header_inclus_bpf")[0].disabled = false;
document.getElementsByName("order_header_inclus_bpf")[0].style.backgroundColor = "#FFFFFF";
}
if (document.getElementsByName("detail_header_status")[0]) {
document.getElementsByName("detail_header_status")[0].disabled = false;
document.getElementsByName("detail_header_status")[0].style.backgroundColor = "#FFFFFF";
@ -2415,6 +2432,12 @@ const Partner_Commande = (props) => {
document.getElementsByName("detail_header_type")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("order_header_inclus_bpf")[0]) {
document.getElementsByName("order_header_inclus_bpf")[0].disabled = true;
document.getElementsByName("order_header_inclus_bpf")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("detail_header_status")[0]) {
document.getElementsByName("detail_header_status")[0].disabled = true;
document.getElementsByName("detail_header_status")[0].style.backgroundColor = "#ECEFF1";
@ -2724,6 +2747,12 @@ const Partner_Commande = (props) => {
form.append("order_header_montant_reduction", "");
if (p_add_cmd_header_order_inclus_bpf)
form.append("order_header_inclus_bpf", p_add_cmd_header_order_inclus_bpf);
else
form.append("order_header_inclus_bpf", "");
//console.log(" form == ", form);
var myurl = "";
@ -3020,7 +3049,7 @@ const Partner_Commande = (props) => {
return;
}
console.log("### form = ", form);
//console.log("### form = ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_Order_Line/";
@ -3118,6 +3147,7 @@ const Partner_Commande = (props) => {
setp_add_line_item_taxe("");
setp_add_line_item_taxe_amount("");
setp_add_line_item_total_amount_ttc("");
setp_add_line_item_type_apprenant("");
setpartner_taux_tva("20");
@ -3175,6 +3205,7 @@ const Partner_Commande = (props) => {
form.append("order_header_adr_liv_code_postal", p_detail_header_liv_code_postal);
form.append("order_header_adr_liv_ville", p_detail_header_liv_ville);
form.append("order_header_adr_liv_pays", p_detail_header_liv_pays);
form.append("order_header_inclus_bpf", p_add_cmd_header_order_inclus_bpf);
if (!p_add_cmd_header_client_id || String(p_add_cmd_header_client_id).length < 2) {
@ -3274,6 +3305,8 @@ const Partner_Commande = (props) => {
const [p_add_cmd_header_ref_client, setp_add_cmd_header_ref_client] = useState("");
const [p_add_cmd_header_condition_paiement_id, setp_add_cmd_header_condition_paiement_id] = useState("");
const [p_add_cmd_header_order_inclus_bpf, setp_add_cmd_header_order_inclus_bpf] = useState("1");
function clean_order_detail_fields() {
setp_add_cmd_header_client_id();
@ -3284,6 +3317,7 @@ const Partner_Commande = (props) => {
setp_add_cmd_header_date_expiration_cmd(date_today_90j.toLocaleDateString('fr-FR'));
setp_add_cmd_header_order_type();
setp_add_cmd_header_order_location_type("1");
setp_add_cmd_header_order_inclus_bpf("1");
setp_add_cmd_header_ref_client();
setp_add_cmd_header_condition_paiement_id("");
@ -4546,6 +4580,21 @@ const Partner_Commande = (props) => {
]
const inclus_bpf_tab = [
{
value: '1',
label: 'Oui',
},
{
value: '0',
label: 'Non',
},
{
value: '',
label: '',
},
];
return (
@ -5920,6 +5969,8 @@ const Partner_Commande = (props) => {
if (value && value.value) {
setp_add_cmd_header_order_location_type(value.value);
} else {
setp_add_cmd_header_order_location_type("");
}
}}
@ -5932,29 +5983,37 @@ const Partner_Commande = (props) => {
/>}
{/*<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="order_header_location_type"
id="order_header_location_type"
</div>
<div className="session_caract_Dialog" > Inclus BPF <br />
{inclus_bpf_tab && inclus_bpf_tab.length > 0 && p_add_cmd_header_order_inclus_bpf && <Autocomplete
disablePortal
name="order_header_inclus_bpf"
id="order_header_inclus_bpf"
fullWidth
value={p_add_cmd_header_order_location_type}
onChange={(e) => {
setp_add_cmd_header_order_location_type(e.target.value);
value={inclus_bpf_tab.filter((data) => (data).value === String(p_add_cmd_header_order_inclus_bpf))[0].label}
options={inclus_bpf_tab}
onChange={(event, value) => {
if (value && value.value) {
setp_add_cmd_header_order_inclus_bpf(value.value);
} else {
setp_add_cmd_header_order_inclus_bpf("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
}
/>}
select
>
<MenuItem value="inter" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Inter &nbsp;</MenuItem>
<MenuItem value="intra" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Intra &nbsp;</MenuItem>
<MenuItem value="" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Autre &nbsp;</MenuItem>
</TextField>*/}
</div>
<div className="session_caract_Dialog_comment_2_lines" > Commentaire <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
@ -6604,30 +6663,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 &nbsp;&nbsp;</MenuItem>
<MenuItem value="1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >En cours &nbsp;</MenuItem>
<MenuItem value="2" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Fermé &nbsp;</MenuItem>
<MenuItem value="-1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Annulé &nbsp;</MenuItem>
</TextField> */}
</div>}
@ -6653,6 +6689,53 @@ const Partner_Commande = (props) => {
/>
</div>
{String(order_data_edit_mode) !== "1" && <div className="session_caract"> Inclus BPF<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="order_header_inclus_bpf"
id="order_header_inclus_bpf"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={inclus_bpf_tab.filter((data) => (data).value === String(p_add_cmd_header_order_inclus_bpf))[0].label}
/>
</div>}
{String(order_data_edit_mode) === "1" && <div className="session_caract"> Inclus BPF<br />
{inclus_bpf_tab && inclus_bpf_tab.length > 0 && <Autocomplete
disablePortal
name="order_header_inclus_bpf"
id="order_header_inclus_bpf"
className="disabled_style"
value={inclus_bpf_tab.filter((data) => (data).value === String(p_add_cmd_header_order_inclus_bpf))[0].label}
options={inclus_bpf_tab}
onChange={(event, value) => {
setOrder_data_changed("1");
if (value && value.value) {
setp_add_cmd_header_order_inclus_bpf(value.value);
} else {
setp_add_cmd_header_order_inclus_bpf("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>}
</div>}
{String(order_data_edit_mode) === "1" && <div className="session_caract" >
Conditions Paiement <br />
@ -7577,7 +7660,51 @@ const Partner_Commande = (props) => {
{String(selected_order_header_type) === "commande" &&
String(p_detail_header_statut_label).toLowerCase() === "traité" &&
<Button variant="outlined" onClick={Invoice_Order_Data} className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Facturer </Button>}
<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}>
&times;
</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_Order_Data();
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(selected_order_header_type) === "devis" &&