24/02/2024 - 22h30

recette2
cherif 2024-02-24 22:09:53 +01:00
parent 1ebb54d192
commit 0f2bc5c873
5 changed files with 1025 additions and 302 deletions

View File

@ -67,6 +67,10 @@ const AddParnerClient = (props) => {
const [p_client_invoice_siret, setclient_invoice_siret] = useState("");
const [p_client_invoice_tva, setclient_invoice_tva] = useState("");
const [p_client_invoice_adresse, setclient_invoice_adresse] = useState("");
const [p_client_invoice_paiement_condition_code, setp_client_invoice_paiement_condition_code] = useState("");
const [p_client_invoice_paiement_condition_id, setp_client_invoice_paiement_condition_id] = useState("");
const [p_client_invoice_ville, setclient_invoice_ville] = useState("");
const [p_client_invoice_code_postal, setclient_invoice_code_postal] = useState("");
const [p_client_invoice_pays, setclient_invoice_pays] = useState("");
@ -516,8 +520,93 @@ const AddParnerClient = (props) => {
})
}
const [New_Getall_Partner_Paiement_Condition_result, setNew_Getall_Partner_Paiement_Condition_result] = useState([]);
const [Getall_Partner_Paiement_Condition_api, setGetall_Partner_Paiement_Condition_api] = useState();
const [Getall_Partner_Paiement_Condition_message, setGetall_Partner_Paiement_Condition_message] = useState();
const [Getall_Partner_Paiement_Condition_result, setGetall_Partner_Paiement_Condition_result] = useState([]);
function Getall_Partner_Paiement_Condition(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Paiement_Condition/";
//setLoading(true);
axios.post(myurl, form).then(res => {
//setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_Paiement_Condition res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_Paiement_Condition res.data.message r_class = " + res.data.message);
setGetall_Partner_Paiement_Condition_api("true");
setGetall_Partner_Paiement_Condition_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_code = JSON.parse(x).code;
var local_description = JSON.parse(x).description;
var local_nb_jour = JSON.parse(x).nb_jour;
var local_depart = JSON.parse(x).depart;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"description": local_description,
"nb_jour": local_nb_jour,
"depart": local_depart,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"description": "",
"nb_jour": "",
"depart": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Paiement_Condition_result(new_data2);
}
else {
setGetall_Partner_Paiement_Condition_api("false");
setGetall_Partner_Paiement_Condition_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
//setLoading(false);
console.warn('Not good man :( Getall_Partner_Paiement_Condition = ', error);
setGetall_Partner_Paiement_Condition_api("false");
alert(" Impossible de recuperer la liste des conditions de paiement");
//setmyApimyApiMessage("")
})
}
useEffect(() => {
Get_List_Client_Type();
Getall_Partner_Paiement_Condition();
if (String(props.new_customer) !== "1") {
setformedit_mode("0");
@ -681,6 +770,16 @@ const AddParnerClient = (props) => {
else
setclient_invoice_adresse("");
if (mylocalclient.invoice_condition_paiement_id)
setp_client_invoice_paiement_condition_id(mylocalclient.invoice_condition_paiement_id);
else
setp_client_invoice_paiement_condition_id("");
if (mylocalclient.invoice_condition_paiement_code)
setp_client_invoice_paiement_condition_code(mylocalclient.invoice_condition_paiement_code);
else
setp_client_invoice_paiement_condition_code("");
if (mylocalclient.invoice_ville)
setclient_invoice_ville(mylocalclient.invoice_ville);
else
@ -777,6 +876,16 @@ const AddParnerClient = (props) => {
else
setclient_invoice_adresse("");
if (mylocalclient.invoice_condition_paiement_id)
setp_client_invoice_paiement_condition_id(mylocalclient.invoice_condition_paiement_id);
else
setp_client_invoice_paiement_condition_id("");
if (mylocalclient.invoice_condition_paiement_code)
setp_client_invoice_paiement_condition_code(mylocalclient.invoice_condition_paiement_code);
else
setp_client_invoice_paiement_condition_code("");
if (mylocalclient.invoice_ville)
setclient_invoice_ville(mylocalclient.invoice_ville);
else
@ -1658,6 +1767,9 @@ const AddParnerClient = (props) => {
}
form.append("invoice_tva", client_invoice_tva);
form.append("invoice_condition_paiement_id", p_client_invoice_paiement_condition_id);
var client_invoice_adresse = ""
if (document.getElementsByName("client_invoice_adresse")) {
client_invoice_adresse = document.getElementsByName("client_invoice_adresse")[0].value;
@ -1745,6 +1857,12 @@ const AddParnerClient = (props) => {
document.getElementsByName("client_invoice_adresse")[0].value = "";
}
if (document.getElementsByName("client_invoice_paiement_condition")) {
document.getElementsByName("client_invoice_paiement_condition")[0].value = "";
}
if (document.getElementsByName("client_invoice_ville")) {
document.getElementsByName("client_invoice_ville")[0].value = "";
}
@ -1780,11 +1898,17 @@ const AddParnerClient = (props) => {
document.getElementsByName("client_invoice_tva")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("client_invoice_paiement_condition")) {
document.getElementsByName("client_invoice_paiement_condition")[0].disabled = true;
document.getElementsByName("client_invoice_paiement_condition")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("client_invoice_adresse")) {
document.getElementsByName("client_invoice_adresse")[0].disabled = true;
document.getElementsByName("client_invoice_adresse")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("client_invoice_ville")) {
document.getElementsByName("client_invoice_ville")[0].disabled = true;
document.getElementsByName("client_invoice_ville")[0].style.backgroundColor = "#ECEFF1";
@ -1824,6 +1948,11 @@ const AddParnerClient = (props) => {
document.getElementsByName("client_invoice_tva")[0].style.backgroundColor = "#FFFFFF";
}
if (document.getElementsByName("client_invoice_paiement_condition")) {
document.getElementsByName("client_invoice_paiement_condition")[0].disabled = false;
document.getElementsByName("client_invoice_paiement_condition")[0].style.backgroundColor = "#FFFFFF";
}
if (document.getElementsByName("client_invoice_adresse")) {
document.getElementsByName("client_invoice_adresse")[0].disabled = false;
document.getElementsByName("client_invoice_adresse")[0].style.backgroundColor = "#FFFFFF";
@ -3118,6 +3247,45 @@ const AddParnerClient = (props) => {
/>
</div>
<div className="session_caract"> Conditions Paiement<br />
{String(formedit_mode_invoice) !== "1" && <TextField
required
name="client_invoice_paiement_condition"
//label="Adresse"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_client_invoice_paiement_condition_code}
onChange={(e) => setp_client_invoice_paiement_condition_code(e.target.value)}
/>}
{String(formedit_mode_invoice) === "1" && New_Getall_Partner_Paiement_Condition_result && New_Getall_Partner_Paiement_Condition_result.length > 0 &&
<Autocomplete
disablePortal
name="client_invoice_paiement_condition"
id="client_invoice_paiement_condition"
value={New_Getall_Partner_Paiement_Condition_result.filter((data) => (data).label === String(p_client_invoice_paiement_condition_code))[0].label}
options={New_Getall_Partner_Paiement_Condition_result}
className="disabled_style"
onChange={(event, value) => {
if (value && value._id) {
setp_client_invoice_paiement_condition_code(value.code);
setp_client_invoice_paiement_condition_id(value._id);
DataUpdated_Invoice_Data();
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>}
</div>
<div className="session_caract"> Adresse<br />
<TextField
required
@ -3132,6 +3300,8 @@ const AddParnerClient = (props) => {
onChange={(e) => setclient_invoice_adresse(e.target.value)}
/>
</div>
<div className="session_caract"> Ville<br />
<TextField
required

View File

@ -3186,31 +3186,7 @@ const Config_Documents = (props) => {
<div className="div_row_gauche"> Choisir le document à ajouter <br />
{/* <TextField
name="champ_table"
id="champ_table"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style enable_style"
value={selecte_defaul_doc_to_add}
onChange={(e) => {
setselecte_defaul_doc_to_add(e.target.value);
}}
>
{Get_List_Personnalisable_Default_Document_result &&
Get_List_Personnalisable_Default_Document_result.map((mycollection) => (
<MenuItem key={JSON.parse(mycollection)._id}
value={JSON.parse(mycollection)._id}
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontSize": "12px" }}>
{JSON.parse(mycollection).nom}&nbsp; - &nbsp; <b>{JSON.parse(mycollection).type_doc} </b>&nbsp;
</MenuItem>
))}
</TextField>*/}
<Autocomplete
disablePortal

View File

@ -530,9 +530,9 @@ const Partner_Commande = (props) => {
//---
var node = {
"_id": local_id,
"_id": local_id,
"id": localid,
"label": local_title,
"label": local_title,
"internal_url": local_internal_url,
"title": local_title,
"ispublished": local_is_published,
@ -545,9 +545,9 @@ const Partner_Commande = (props) => {
var node = {
"_id": "",
"_id": "",
"id": "",
"label": "",
"label": "",
"internal_url": "",
"title": "",
"ispublished": "",
@ -584,6 +584,7 @@ const Partner_Commande = (props) => {
Getall_Parter_Orders_No_Filter();
GetCurrentPartnerClass();
Get_Given_Partner_Config_Point_Taux_TVA();
Getall_Partner_Paiement_Condition();
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
@ -890,8 +891,12 @@ const Partner_Commande = (props) => {
setp_detail_header_ref_interne(mylocal_order.order_header_ref_interne);
}
if (mylocal_order.order_header_condition_paiement) {
setp_detail_header_condition_paiement(mylocal_order.order_header_condition_paiement);
if (mylocal_order.order_header_paiement_condition_code) {
setp_detail_header_condition_paiement_code(mylocal_order.order_header_paiement_condition_code);
}
if (mylocal_order.order_header_paiement_condition_id) {
setp_detail_header_condition_paiement_id(mylocal_order.order_header_paiement_condition_id);
}
@ -1490,6 +1495,8 @@ const Partner_Commande = (props) => {
function submenu_add_one_order() {
Getall_Partner_Paiement_Condition();
setp_add_cmd_header_order_type("commande");
setDialog_1_message(" Nouvelle commande");
setDialog_Detail_Commande_open(true);
@ -1498,6 +1505,7 @@ const Partner_Commande = (props) => {
function submenu_add_one_quotation() {
Getall_Partner_Paiement_Condition();
setp_add_cmd_header_order_type("devis");
setDialog_1_message(" Nouveau devis");
setDialog_Detail_Commande_open(true);
@ -1519,7 +1527,8 @@ const Partner_Commande = (props) => {
const [p_detail_header_comment, setp_detail_header_comment] = useState();
const [p_detail_header_date_cmd, setp_detail_header_date_cmd] = useState(new Date().toLocaleDateString('fr-FR'));
const [p_detail_header_date_expiration, setp_detail_header_date_expiration] = useState(date_today_90j.toLocaleDateString('fr-FR'));
const [p_detail_header_condition_paiement, setp_detail_header_condition_paiement] = useState();
const [p_detail_header_condition_paiement_code, setp_detail_header_condition_paiement_code] = useState("");
const [p_detail_header_condition_paiement_id, setp_detail_header_condition_paiement_id] = useState("");
const [p_detail_header_ref_client, setp_detail_header_ref_client] = useState();
const [p_detail_header_ref_interne, setp_detail_header_ref_interne] = useState();
@ -1895,10 +1904,10 @@ const Partner_Commande = (props) => {
else
form.append("order_header_vendeur_id", "");
if (p_detail_header_condition_paiement)
form.append("order_header_condition_paiement", p_detail_header_condition_paiement);
if (p_detail_header_condition_paiement_id)
form.append("order_header_condition_paiement_id", p_detail_header_condition_paiement_id);
else
form.append("order_header_condition_paiement", "");
form.append("order_header_condition_paiement_id", "");
if (p_detail_header_date_expiration_val)
form.append("order_header_date_expiration", p_detail_header_date_expiration);
@ -2323,7 +2332,7 @@ const Partner_Commande = (props) => {
form.append("order_header_comment", p_add_cmd_header_comment);
form.append("order_header_date_cmd", p_add_cmd_header_date_cmd);
form.append("order_header_date_expiration", p_add_cmd_header_date_expiration_cmd);
form.append("order_header_condition_paiement", p_add_cmd_header_condition_paiement);
form.append("order_header_condition_paiement_id", p_add_cmd_header_condition_paiement_id);
form.append("order_header_ref_client", p_add_cmd_header_ref_client);
form.append("order_header_vendeur_id", p_add_cmd_header_vendeur_id);
form.append("order_header_type", p_add_cmd_header_order_type);
@ -2424,7 +2433,7 @@ const Partner_Commande = (props) => {
const [p_add_cmd_header_order_type, setp_add_cmd_header_order_type] = useState("");
const [p_add_cmd_header_order_location_type, setp_add_cmd_header_order_location_type] = useState("");
const [p_add_cmd_header_ref_client, setp_add_cmd_header_ref_client] = useState("");
const [p_add_cmd_header_condition_paiement, setp_add_cmd_header_condition_paiement] = useState("");
const [p_add_cmd_header_condition_paiement_id, setp_add_cmd_header_condition_paiement_id] = useState("");
function clean_order_detail_fields() {
@ -2438,7 +2447,7 @@ const Partner_Commande = (props) => {
setp_add_cmd_header_order_location_type();
setp_add_cmd_header_ref_client();
setp_add_cmd_header_condition_paiement();
setp_add_cmd_header_condition_paiement_id("");
setp_detail_header_fact_adr();
setp_detail_header_fact_code_postal();
@ -3045,6 +3054,92 @@ const Partner_Commande = (props) => {
const [gridline_id, setgridline_id] = useState("");
const [New_Getall_Partner_Paiement_Condition_result, setNew_Getall_Partner_Paiement_Condition_result] = useState([]);
const [Getall_Partner_Paiement_Condition_api, setGetall_Partner_Paiement_Condition_api] = useState();
const [Getall_Partner_Paiement_Condition_message, setGetall_Partner_Paiement_Condition_message] = useState();
const [Getall_Partner_Paiement_Condition_result, setGetall_Partner_Paiement_Condition_result] = useState([]);
function Getall_Partner_Paiement_Condition(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Paiement_Condition/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_Paiement_Condition res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_Paiement_Condition res.data.message r_class = " + res.data.message);
setGetall_Partner_Paiement_Condition_api("true");
setGetall_Partner_Paiement_Condition_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_code = JSON.parse(x).code;
var local_description = JSON.parse(x).description;
var local_nb_jour = JSON.parse(x).nb_jour;
var local_depart = JSON.parse(x).depart;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"description": local_description,
"nb_jour": local_nb_jour,
"depart": local_depart,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"description": "",
"nb_jour": "",
"depart": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Paiement_Condition_result(new_data2);
}
else {
setGetall_Partner_Paiement_Condition_api("false");
setGetall_Partner_Paiement_Condition_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Partner_Paiement_Condition = ', error);
setGetall_Partner_Paiement_Condition_api("false");
alert(" Impossible de recuperer la liste des conditions de paiement");
//setmyApimyApiMessage("")
})
}
return (
<div className="partner_commande">
@ -3081,14 +3176,14 @@ const Partner_Commande = (props) => {
className="partner_commande"
>
<DialogTitle>Edition Détail ligne <font style={{fontWeight:"700"}}> {String(p_detail_header_type).toLocaleUpperCase()} </font> </DialogTitle>
<DialogTitle>Edition Détail ligne <font style={{ fontWeight: "700" }}> {String(p_detail_header_type).toLocaleUpperCase()} </font> </DialogTitle>
<DialogContent>
{/*p_add_line_item = {p_add_line_item} <br/>*/}
{/*p_add_line_item = {p_add_line_item} <br/>*/}
{(p_add_line_item || String(p_add_line_item) === "") && String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="session_caract_Dialog" > Article
<Autocomplete
disablePortal
name="ref_article"
@ -3096,7 +3191,7 @@ const Partner_Commande = (props) => {
fullWidth
options={New_GetCurrentPartnerClass_result}
value={New_GetCurrentPartnerClass_result.filter((data) => (data).internal_url === String(p_add_line_item))[0].label}
onChange={(event, value) => {
// setp_champ_table(value.nom_champ_technique);
setp_add_line_item(value.internal_url);
@ -3107,9 +3202,9 @@ const Partner_Commande = (props) => {
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps = {{...params.inputProps, style: { fontSize: 12, height:"1.4rem" }}}
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
/>
}
/>
@ -3503,38 +3598,12 @@ const Partner_Commande = (props) => {
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps = {{...params.inputProps, style: { fontSize: 12, height:"1.4rem" }}}
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
/>
}
/>
{/*<TextField
required
autoFocus
margin="dense"
id="ref_client"
//label="Client"
select
fullWidth
//variant="standard"
value={p_add_cmd_header_client_id}
onChange={(e) => {
setp_add_cmd_header_client_id(e.target.value);
Get_Givent_Partner_Client_Data(e.target.value);
}
}
>
{Get_List_Partner_Clients_result &&
Get_List_Partner_Clients_result.map((myclient) => (
<MenuItem key={JSON.parse(myclient).nom} value={JSON.parse(myclient)._id}
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "height": "3rem" }}>
{JSON.parse(myclient).nom}&nbsp;&nbsp;
</MenuItem>
))}
</TextField>*/}
</div>
@ -3639,9 +3708,9 @@ const Partner_Commande = (props) => {
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps = {{...params.inputProps, style: { fontSize: 12, height:"1.4rem" }}}
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
/>
}
/>
@ -3672,22 +3741,29 @@ const Partner_Commande = (props) => {
</div>
<div className="session_caract_Dialog" > Conditions Paiement <br />
{New_Getall_Partner_Paiement_Condition_result && New_Getall_Partner_Paiement_Condition_result.length > 0 &&
<Autocomplete
disablePortal
name="order_paiement_condition"
id="order_paiement_condition"
fullWidth
//value={New_Getall_Partner_Paiement_Condition_result.filter((data) => (data).label === String(p_add_cmd_header_condition_paiement))[0].label}
options={New_Getall_Partner_Paiement_Condition_result}
onChange={(event, value) => {
if (value && value._id) {
setp_add_cmd_header_condition_paiement_id(value._id);
}
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="order_paiement_condition"
id="order_paiement_condition"
}}
fullWidth
value={p_add_cmd_header_condition_paiement}
onChange={(e) => {
setp_add_cmd_header_condition_paiement(e.target.value);
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
}
}
/>
/>
}
/>}
</div>
@ -4122,7 +4198,7 @@ const Partner_Commande = (props) => {
setgridline_id(newSelectionModel.row.id);
handleClick_edit_order_From_Line(newSelectionModel.row.id);
}
}
}
rowsPerPageOptions={[10]}
//disableSelectionOnClick
@ -4206,8 +4282,8 @@ const Partner_Commande = (props) => {
<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 &nbsp;
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
</Button>
<br />
@ -4367,28 +4443,34 @@ const Partner_Commande = (props) => {
{String(order_data_edit_mode) === "1" && <div className="session_caract" >
Conditions Paiement <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_header_order_paiement_condition"
id="detail_header_order_paiement_condition"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_header_condition_paiement}
onChange={(e) => {
setp_detail_header_condition_paiement(e.target.value);
setOrder_data_changed("1");
}
}
{New_Getall_Partner_Paiement_Condition_result && New_Getall_Partner_Paiement_Condition_result.length > 0 &&
<Autocomplete
disablePortal
name="detail_header_order_paiement_condition"
id="detail_header_order_paiement_condition"
value={New_Getall_Partner_Paiement_Condition_result.filter((data) => (data).label === String(p_detail_header_condition_paiement_code))[0].label}
options={New_Getall_Partner_Paiement_Condition_result}
className="disabled_style"
onChange={(event, value) => {
if (value && value._id) {
setp_detail_header_condition_paiement_code(value.code);
setp_detail_header_condition_paiement_id(value._id);
setOrder_data_changed("1");
}
}}
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 />
{String(order_data_edit_mode) !== "1" && <div className="session_caract" > Conditions Paiement <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
@ -4401,7 +4483,7 @@ const Partner_Commande = (props) => {
}}
disabled={false}
className="disabled_style"
value={p_detail_header_condition_paiement}
value={p_detail_header_condition_paiement_code}
/>
@ -5206,9 +5288,9 @@ const Partner_Commande = (props) => {
<div style={{ "border": "None" }}>
<nav onClick={Ajouter_une_ligne_article} style={{ "fontSize": "18px", "fontWeight": '600', "marginLeft": "10px", "marginTop": "10px", "cursor": "pointer" }}
className="bton_add_line"> <Button> Ajouter une ligne
&nbsp; <FcAddDatabase style={{"fontSize":"medium"}}/>
</Button>
className="bton_add_line"> <Button> Ajouter une ligne
&nbsp; <FcAddDatabase style={{ "fontSize": "medium" }} />
</Button>
</nav>
<div style={{ height: 550, width: '100%', paddingRight: '1px' }}>
&nbsp;
@ -5259,8 +5341,8 @@ const Partner_Commande = (props) => {
}}
>
<DataGrid
// checkboxSelection
disableSelectionOnClick
// checkboxSelection
disableSelectionOnClick
onSelectionModelChange={(newSelectionModel) => {
setselectionModel_order_lines(newSelectionModel);
/*if (newSelectionModel.length === 1)

View File

@ -54,6 +54,8 @@ const Partner_Configuration_Technique = (props) => {
const [selectionModel_site_ftion, setselectionModel_site_ftion] = React.useState([]);
const [selectionModel_paiement_ction, setselectionModel_paiement_ction] = React.useState([]);
const [rows_order_lines, setrows_order_lines] = useState([]);
const [selectionModel_order_lines, setselectionModel_order_lines] = React.useState([]);
@ -81,67 +83,6 @@ const Partner_Configuration_Technique = (props) => {
{ field: 'config_value', headerName: 'Valeur config', flex: 1, hide: false, editable: false },
/* {
field: "delete", headerName: 'Supprimer',
renderCell: (cellValues) => {
return (
<Popup
trigger={<Button
onClick={(event) => {
// handleClick_delete(event, cellValues);
}}
>
<CiTrash />
</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, le document sera <i><font color="red"> définitivement supprimé</font></i>. <br />
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
//handleClick_delete(event, cellValues);
//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>
);
}
}*/
]
const columns_type_client = [
@ -150,46 +91,49 @@ const Partner_Configuration_Technique = (props) => {
{ field: 'code', headerName: 'Nom Configuration', flex: 1, hide: false, editable: false },
{ field: 'description', headerName: 'Valeur config', flex: 1, hide: false, editable: false },
{ field: 'is_financeur', headerName: 'Financeur', flex: 1, hide: false, editable: false ,
renderCell: (cellValues) => {
return (
{
field: 'is_financeur', headerName: 'Financeur', flex: 1, hide: false, editable: false,
renderCell: (cellValues) => {
return (
<div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
{String(cellValues.row.is_financeur) === "1" && "Oui"}&nbsp;
{String(cellValues.row.is_financeur) !== "1" && "Non"}&nbsp;
<div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
{String(cellValues.row.is_financeur) === "1" && "Oui"}&nbsp;
{String(cellValues.row.is_financeur) !== "1" && "Non"}&nbsp;
</div>
</div>
);
},
);
},
{
field: 'is_client', headerName: 'Client', flex: 1, hide: false, editable: false,
renderCell: (cellValues) => {
return (
},
{ field: 'is_client', headerName: 'Client', flex: 1, hide: false, editable: false,
renderCell: (cellValues) => {
return (
<div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
{String(cellValues.row.is_client) === "1" && "Oui"}&nbsp;
{String(cellValues.row.is_client) !== "1" && "Non"}&nbsp;
<div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
{String(cellValues.row.is_client) === "1" && "Oui"}&nbsp;
{String(cellValues.row.is_client) !== "1" && "Non"}&nbsp;
</div>
</div>
);
);
},
},
},
{ field: 'is_fournisseur', headerName: 'Fournisseur', flex: 1, hide: false, editable: false ,
renderCell: (cellValues) => {
return (
{
field: 'is_fournisseur', headerName: 'Fournisseur', flex: 1, hide: false, editable: false,
renderCell: (cellValues) => {
return (
<div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
{String(cellValues.row.is_fournisseur) === "1" && "Oui"}&nbsp;
{String(cellValues.row.is_fournisseur) !== "1" && "Non"}&nbsp;
<div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
{String(cellValues.row.is_fournisseur) === "1" && "Oui"}&nbsp;
{String(cellValues.row.is_fournisseur) !== "1" && "Non"}&nbsp;
</div>
</div>
);
);
},
},
},
{
field: "delete", headerName: 'Supprimer',
@ -326,6 +270,76 @@ const Partner_Configuration_Technique = (props) => {
}
]
const columns_paiement_condition = [
{ field: '_id', headerName: '_id', hide: true },
{ field: 'id', headerName: 'id', hide: true },
{ field: 'code', headerName: 'Code', flex: 1, hide: false, editable: false },
{ field: 'description', headerName: 'description', flex: 1, hide: false, editable: false },
{ field: 'nb_jour', headerName: 'Jours', flex: 1, hide: false, editable: false },
{ field: 'depart', headerName: 'Départ', flex: 1, hide: false, editable: false },
{
field: "delete", headerName: 'Supprimer',
renderCell: (cellValues) => {
return (
<Popup
trigger={<Button
>
<CiTrash />
</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, la condition de paiement sera <i><font color="red"> définitivement supprimée</font></i>. <br />
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
handleClick_delete_Paiement_Ction(event, cellValues);
//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>
);
}
}
]
const myRef = useRef(null)
@ -335,6 +349,7 @@ const Partner_Configuration_Technique = (props) => {
Getall_Parter_config_Points();
Getall_Parter_type_client();
Getall_Partner_Site_Formation();
Getall_Partner_Paiement_Condition();
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
@ -439,6 +454,90 @@ const Partner_Configuration_Technique = (props) => {
}
const [New_Getall_Partner_Paiement_Condition_result, setNew_Getall_Partner_Paiement_Condition_result] = useState([]);
const [Getall_Partner_Paiement_Condition_api, setGetall_Partner_Paiement_Condition_api] = useState();
const [Getall_Partner_Paiement_Condition_message, setGetall_Partner_Paiement_Condition_message] = useState();
const [Getall_Partner_Paiement_Condition_result, setGetall_Partner_Paiement_Condition_result] = useState([]);
function Getall_Partner_Paiement_Condition(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Paiement_Condition/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_Paiement_Condition res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_Paiement_Condition res.data.message r_class = " + res.data.message);
setGetall_Partner_Paiement_Condition_api("true");
setGetall_Partner_Paiement_Condition_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_code = JSON.parse(x).code;
var local_description = JSON.parse(x).description;
var local_nb_jour = JSON.parse(x).nb_jour;
var local_depart = JSON.parse(x).depart;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"description": local_description,
"nb_jour": local_nb_jour,
"depart": local_depart,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"description": "",
"nb_jour": "",
"depart": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Paiement_Condition_result(new_data2);
}
else {
setGetall_Partner_Paiement_Condition_api("false");
setGetall_Partner_Paiement_Condition_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Partner_Paiement_Condition = ', error);
setGetall_Partner_Paiement_Condition_api("false");
alert(" Impossible de recuperer la liste des conditions de paiement");
//setmyApimyApiMessage("")
})
}
const [Getall_Parter_config_Points_api, setGetall_Parter_config_Points_api] = useState();
const [Getall_Parter_config_Points_message, setGetall_Parter_config_Points_message] = useState();
@ -709,6 +808,8 @@ const Partner_Configuration_Technique = (props) => {
const [gridline_id, setgridline_id] = useState("");
const [gridline_site_ftion_id, setgridline_site_ftion_id] = useState("");
const [gridline_paiement_ction_id, setgridline_paiement_ction_id] = useState("");
const [display_detail_type_client, setdisplay_detail_type_client] = React.useState();
@ -792,6 +893,12 @@ const Partner_Configuration_Technique = (props) => {
const [p_detail_site_rattachement_nom, setp_detail_site_rattachement_nom] = useState("");
const [selected_paiement_id, setselected_paiement_id] = useState("");
const [p_detail_paiement_code, setp_detail_paiement_code] = useState("");
const [p_detail_paiement_description, setp_detail_paiement_description] = useState("");
const [p_detail_paiement_nb_jour, setp_detail_paiement_nb_jour] = useState("");
const [p_detail_paiement_depart, setp_detail_paiement_depart] = useState("");
const [Add_Update_Client_Type_api, setAdd_Update_Client_Type_api] = useState();
const [Add_Update_Client_Type_message, setAdd_Update_Client_Type_message] = useState();
@ -945,6 +1052,69 @@ const Partner_Configuration_Technique = (props) => {
}
const [Add_Update_Paiement_Ction_api, setAdd_Update_Paiement_Ction_api] = useState();
const [Add_Update_Paiement_Ction_message, setAdd_Update_Paiement_Ction_message] = useState();
const [Add_Update_Paiement_Ction_result, setAdd_Update_Paiement_Ction_result] = useState();
function Add_Update_Paiement_Ction(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = "";
if (String(selected_paiement_id).trim().length > 2) {
// Il s'agit d'une mise à jour
myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Paiement_Condition/";
form.append("_id", selected_paiement_id);
form.append("code", p_detail_paiement_code);
form.append("description", p_detail_paiement_description);
form.append("nb_jour", p_detail_paiement_nb_jour);
form.append("depart", p_detail_paiement_depart);
} else {
// Il s'agit d'une creation
myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Paiement_Condition/";
form.append("code", p_detail_paiement_code);
form.append("description", p_detail_paiement_description);
form.append("nb_jour", p_detail_paiement_nb_jour);
form.append("depart", p_detail_paiement_depart);
}
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Add_Update_Paiement_Ction res.data.status = " + res.data.status);
//console.log(" In Add_Update_Paiement_Ction res.data.message r_class = " + res.data.message);
setAdd_Update_Paiement_Ction_api("true");
setAdd_Update_Paiement_Ction_result(res.data.message);
Dialog_paiement_ction_1_handleClose_buton();
Getall_Partner_Paiement_Condition();
alert(res.data.message);
}
else {
setAdd_Update_Paiement_Ction_api("false");
setAdd_Update_Paiement_Ction_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Add_Update_Paiement_Ction = ', error);
setAdd_Update_Paiement_Ction_api("false");
alert(" Impossible d'ajouter / mettre à jour la condition de paiement");
//setmyApimyApiMessage("")
})
}
const [handleClick_delete_Type_Client_api, sethandleClick_delete_Type_Client_api] = useState();
const [handleClick_delete_Type_Client_message, sethandleClick_delete_Type_Client_message] = useState();
const [handleClick_delete_Type_Client_result, sethandleClick_delete_Type_Client_result] = useState();
@ -1041,6 +1211,54 @@ const Partner_Configuration_Technique = (props) => {
})
}
const [handleClick_delete_Paiement_Ction_api, sethandleClick_delete_Paiement_Ction_api] = useState();
const [handleClick_delete_Paiement_Ction_message, sethandleClick_delete_Paiement_Ction_message] = useState();
const [handleClick_delete_Paiement_Ction_result, sethandleClick_delete_Paiement_Ction_result] = useState();
function handleClick_delete_Paiement_Ction(event, cellValues) {
var local_paiement_ction_id = cellValues.row._id;
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("_id", local_paiement_ction_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Paiement_Condition/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In handleClick_delete_Paiement_Ction res.data.status = " + res.data.status);
//console.log(" In handleClick_delete_Paiement_Ction res.data.message r_class = " + res.data.message);
sethandleClick_delete_Paiement_Ction_api("true");
sethandleClick_delete_Paiement_Ction_result(res.data.message);
Getall_Partner_Paiement_Condition();
alert(res.data.message);
}
else {
sethandleClick_delete_Paiement_Ction_api("false");
sethandleClick_delete_Paiement_Ction_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( handleClick_delete_Paiement_Ction = ', error);
sethandleClick_delete_Paiement_Ction_api("false");
alert(" Impossible de supprimer la condition de paiement");
//setmyApimyApiMessage("")
})
}
const New_Config_Point = [
{ "id": "tva", "label": "tva", "value": "tva" },
{ "id": "smtp_server", "label": "smtp_server", "value": "smtp_server" },
@ -1051,7 +1269,13 @@ const Partner_Configuration_Technique = (props) => {
{ "id": "partner_jour_heure", "label": "partner_jour_heure", "value": "partner_jour_heure" },
{ "id": "partner_devise", "label": "partner_devise", "value": "partner_devise" },
{ "id": "", "label": "", "value": "" },
]
const New_Config_paiement_ction_depart = [
{ "id": "facture", "label": "Date Facture", "value": "facture" },
{ "id": "mois", "label": "Fin de Mois", "value": "mois" },
{ "id": "", "label": "", "value": "" },
]
const [Dialog_site_ftion_1_message, setDialog_site_ftion_1_message] = React.useState(false);
@ -1080,6 +1304,26 @@ const Partner_Configuration_Technique = (props) => {
};
const [Dialog_paiement_ction_1_message, setDialog_paiement_ction_1_message] = React.useState(false);
const [Dialog_paiement_ction_1_open, setDialog_paiement_ction_1_open] = React.useState(false);
const Dialog_paiement_ction_1_handleClose = () => {
};
const Dialog_paiement_ction_1_handleClose_buton = () => {
setgridline_paiement_ction_id("");
setselected_paiement_id("");
setp_detail_paiement_code("");
setp_detail_paiement_description("");
setp_detail_paiement_nb_jour("");
setp_detail_paiement_depart("");
setDialog_paiement_ction_1_open(false);
};
return (
<div className="partner_configuration_technique">
@ -1161,71 +1405,6 @@ const Partner_Configuration_Technique = (props) => {
{/*<div className="session_caract_Dialog" > Caracteristiques
<Tooltip className="tooltip_css" id="tooltip_financeur" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="tooltip_financeur" data-tooltip-html="Si ce type s'applique aux organismes finaceurs, cliquez 'OUI' ">
<nav style={{ "height": '3rem' }}
onChange={(e) => {
if (p_type_client_is_financeur === true)
setp_type_client_is_financeur(false)
else {
setp_type_client_is_financeur(true);
}
}}
id="toggleSwitchNav" name="toggleSwitchNav">
<ToggleSwitch
label="S'applique aux financeurs ?" id="toggleSwitch" name="toggleSwitch" checked={p_type_client_is_financeur} style={{ height: "2rem" }} />
</nav>
</a>
<Tooltip className="tooltip_css" id="tooltip_fsseur" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="tooltip_fsseur" data-tooltip-html="Si ce type s'applique aux fournisseurs, cliquez 'OUI' ">
<nav style={{ "height": '3rem' }}
onChange={(e) => {
if (p_type_client_is_fournisseur === true)
setp_type_client_is_fournisseur(false)
else {
setp_type_client_is_fournisseur(true);
}
}}
id="toggleSwitchNav" name="toggleSwitchNav">
<ToggleSwitch
label="S'applique aux fournisseurs ? " id="toggleSwitch" name="toggleSwitch" checked={p_type_client_is_fournisseur} style={{ height: "2rem" }} />
</nav>
</a>
<Tooltip className="tooltip_css" id="tooltip_is_client" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="tooltip_is_client" data-tooltip-html="Si ce type s'applique aux clients, cliquez 'OUI' ">
<nav style={{ "height": '3rem' }}
onChange={(e) => {
if (p_type_client_is_client === true)
setp_type_client_is_client(false)
else {
setp_type_client_is_client(true);
}
}}
id="toggleSwitchNav" name="toggleSwitchNav">
<ToggleSwitch
label="S'applique aux clients ? " id="toggleSwitch" name="toggleSwitch" checked={p_type_client_is_client} style={{ height: "2rem" }} />
</nav>
</a>
</div>*/}
</DialogContent>
@ -1495,6 +1674,126 @@ const Partner_Configuration_Technique = (props) => {
</Dialog>
<Dialog
open={Dialog_paiement_ction_1_open}
onClose={Dialog_paiement_ction_1_handleClose}
className="displaypartnersession"
>
<DialogTitle> Condition de Paiement </DialogTitle>
<DialogContent className="DialogContent_width">
<div className="session_caract_Dialog" > code
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_paiement_ction_code"
id="event_dialog_paiement_ction_code"
fullWidth
value={p_detail_paiement_code}
onChange={(e) => {
setp_detail_paiement_code(e.target.value);
}
}
/>
</div>
<div className="session_caract_Dialog" > Description
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_paiement_ction_description"
id="event_dialog_paiement_ction_description"
fullWidth
value={p_detail_paiement_description}
onChange={(e) => {
setp_detail_paiement_description(e.target.value);
}
}
/>
</div>
<div className="session_caract_Dialog" > Nb Jours
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_paiement_ction_nb_jour"
id="event_dialog_paiement_ction_nb_jour"
fullWidth
type="number"
inputProps={{ min: "0", max: "100", step: "1" }}
value={p_detail_paiement_nb_jour}
onChange={(e) => {
setp_detail_paiement_nb_jour(e.target.value);
}
}
/>
</div>
<div className="session_caract_Dialog" > Départ
{p_detail_paiement_depart && New_Config_paiement_ction_depart && New_Config_paiement_ction_depart.length > 0 &&
<Autocomplete
disablePortal
name="event_dialog_paiement_ction_depart"
id="event_dialog_paiement_ction_depart"
//className="disabled_style"
fullWidth
value={New_Config_paiement_ction_depart.filter((data) => (data).value === String(p_detail_paiement_depart))[0].label}
options={New_Config_paiement_ction_depart}
onChange={(event, value) => {
if (value && value.value) {
setp_detail_paiement_depart(value.value);
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>}
</div>
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
{String(selected_paiement_id).trim().length > 2 && <Button onClick={Add_Update_Paiement_Ction} className="bton_enreg_dialog">Mettre à jour</Button>}
{String(selected_paiement_id).trim() === "" && <Button onClick={Add_Update_Paiement_Ction} className="bton_enreg_dialog">Ajouter</Button>}
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Dialog_paiement_ction_1_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
</div>
</DialogActions>
</Dialog>
<h3> Votre configuration technique </h3>
<div className="div_row">
<div className="titre1"> Utilisez les filtres !</div>
@ -1789,36 +2088,7 @@ const Partner_Configuration_Technique = (props) => {
/>
{/*<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_config_point"
id="detail_config_point"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_config_point}
onChange={(e) => {
setp_detail_config_point(e.target.value);
setConfig_data_changed("1");
}
}
>
<MenuItem value="tva" style={{ "paddingLeft": "55px", "textAlign": "left", "width": "100%" }}>tva</MenuItem>
<MenuItem value="smtp_server" style={{ "paddingLeft": "55px", "textAlign": "left", "width": "100%" }} >smtp_server &nbsp;</MenuItem>
<MenuItem value="smtp_user" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >smtp_user &nbsp;</MenuItem>
<MenuItem value="smtp_user_pwd" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >smtp_user_pwd &nbsp;</MenuItem>
<MenuItem value="smtp_count_from_name" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >smtp_count_from_name</MenuItem>
<MenuItem value="smtp_count_port" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >smtp_count_port</MenuItem>
<MenuItem value="partner_smtp" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >partner_smtp</MenuItem>
<MenuItem value="partner_jour_heure" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Nb Heure par jour</MenuItem>
</TextField>*/}
</div>}
{String(config_data_edit_mode) !== "1" &&
@ -2300,6 +2570,191 @@ const Partner_Configuration_Technique = (props) => {
</div>
<div>
<div className="div_row" style={{ paddingRight: '10px' }}>
<h3> Les conditions de paiement </h3>
<div className="session_data">
<div style={{ "border": "None" }}>
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
&nbsp;
<Box
sx={{
height: 500,
width: '100%',
paddingRight: '1px',
// Gestion des cellule "statut"
'& .cell--status--encours': {
backgroundColor: '#E6F7C8',
color: '#1a3e72',
fontWeight: 'light',
},
'& .cell--status--traite': {
backgroundColor: '#E6CEAA',
color: '#F9E79F',
fontWeight: 'light',
},
/*"& .MuiDataGrid-virtualScrollerRenderZone": {
"& .MuiDataGrid-row": {
"&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
}
},*/
"& .MuiDataGrid-columnHeaders": {
backgroundColor: "#c8cfd5",
color: "black",
fontSize: 14
},
'& .line--statut--selected': {
backgroundColor: '#FBF2EF',
color: 'black',
},
'& .line--statut--pair': {
backgroundColor: 'rgba(235, 235, 235, .7)',
color: 'black',
},
'& .line--statut--impair': {
backgroundColor: '#FFFFFF',
color: 'black',
},
}}
>
<DataGrid
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
selectionModel_paiement_ction(newSelectionModel);
}}
selectionModel={selectionModel_paiement_ction}
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={Getall_Partner_Paiement_Condition_result.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
code: JSON.parse(item).code,
description: JSON.parse(item).description,
nb_jour: JSON.parse(item).nb_jour,
depart: JSON.parse(item).depart,
}
))}
columns={columns_paiement_condition}
pageSize={10}
className="datagridclass"
onRowDoubleClick={(newSelectionModel) => {
setgridline_paiement_ction_id(newSelectionModel.row.id);
setselected_paiement_id(newSelectionModel.row._id);
setp_detail_paiement_code(newSelectionModel.row.code);
setp_detail_paiement_description(newSelectionModel.row.description);
setp_detail_paiement_nb_jour(newSelectionModel.row.nb_jour);
setp_detail_paiement_depart(newSelectionModel.row.depart);
setDialog_paiement_ction_1_open(true);
}}
rowsPerPageOptions={[10]}
//disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
//sx={datagridSx}
getCellClassName={(params) => {
//field === "order_header_status"
if (params.field === "order_header_status" && String(params.value) == "0") {
return 'cell--status--brouillon';
}
if (params.field === "order_header_status" && String(params.value) == "1") {
return 'cell--status--encours';
}
if (params.field === "order_header_status" && String(params.value) == "2") {
return 'cell--status--traite';
}
if (params.field === "order_header_status" && String(params.value) == "3") {
return 'cell--status--facture';
}
}}
getRowClassName={(params) => {
if (String(params.row.status) === "-1") {
return 'line--statut--annule';
}
if (String(params.row.status) === "0") {
return 'line--statut--preinscrit';
}
if (String(params.row.status) === "1") {
return 'line--statut--inscrit';
}
// Pour la gestion de la couleur de zone double cliquée
if (String(params.row.id) === String(gridline_id)) {
return 'line--statut--selected';
}
else if (parseInt(String(params.row.id)) % 2 === 0) {
return 'line--statut--pair';
}
else if (parseInt(String(params.row.id)) % 2 !== 0) {
return 'line--statut--impair';
}
}}
/>
</Box>
<br />
</div>
</div>
</div>
<div className="div_row" style={{ "border": "None" }}>
<div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
<Button variant="outlined" onClick={() => {
setgridline_paiement_ction_id("");
setselected_paiement_id("");
setp_detail_paiement_code("");
setp_detail_paiement_description("");
setp_detail_paiement_nb_jour("");
setp_detail_paiement_depart("");
setDialog_paiement_ction_1_open(true);
}}
className="detail_class_submenu bton_add_session"
id='menu_import_participant' name='menu_import_participant'>Ajout 1 condition &nbsp;
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
</Button>
</div>
</div>
<div className="div_row" ref={myRef_type_client} id="myRef_type_client"> &nbsp;</div>
</div>
</div>
</div>
)

View File

@ -466,7 +466,8 @@ const Partner_Facture = (props) => {
const [p_detail_header_comment, setp_detail_header_comment] = useState();
const [p_detail_header_date_cmd, setp_detail_header_date_cmd] = useState(new Date().toLocaleDateString('fr-FR'));
const [p_detail_header_date_expiration, setp_detail_header_date_expiration] = useState(date_today_90j.toLocaleDateString('fr-FR'));
const [p_detail_header_condition_paiement, setp_detail_header_condition_paiement] = useState();
const [p_detail_header_condition_paiement_id, setp_detail_header_condition_paiement_id] = useState("");
const [p_detail_header_condition_paiement_code, setp_detail_header_condition_paiement_code] = useState("");
const [p_detail_header_ref_client, setp_detail_header_ref_client] = useState();
const [p_detail_header_ref_interne, setp_detail_header_ref_interne] = useState();
@ -733,6 +734,15 @@ const Partner_Facture = (props) => {
setp_detail_header_date_expiration_val(mylocal_order.order_header_date_cmd);
}
if (mylocal_order.order_header_paiement_condition_code) {
setp_detail_header_condition_paiement_code(mylocal_order.order_header_paiement_condition_code);
}
if (mylocal_order.order_header_paiement_condition_id) {
setp_detail_header_condition_paiement_id(mylocal_order.order_header_paiement_condition_id);
}
//document.getElementsByName("detail_nom_client")[0].value = "";
if (mylocal_order.order_header_client_nom) {
@ -1173,6 +1183,12 @@ const Partner_Facture = (props) => {
document.getElementsByName("detail_header_ref_interne")[0].style.backgroundColor = "#FFFFFF";
}
if (document.getElementsByName("detail_header_order_paiement_condition")[0]) {
document.getElementsByName("detail_header_order_paiement_condition")[0].disabled = false;
document.getElementsByName("detail_header_order_paiement_condition")[0].style.backgroundColor = "#FFFFFF";
}
if (document.getElementsByName("detail_header_date_cmd")[0]) {
document.getElementsByName("detail_header_date_cmd")[0].disabled = false;
document.getElementsByName("detail_header_date_cmd")[0].style.backgroundColor = "#FFFFFF";
@ -1317,6 +1333,11 @@ const Partner_Facture = (props) => {
document.getElementsByName("detail_header_ref_interne")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("detail_header_order_paiement_condition")[0]) {
document.getElementsByName("detail_header_order_paiement_condition")[0].disabled = true;
document.getElementsByName("detail_header_order_paiement_condition")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("detail_header_date_cmd")[0]) {
document.getElementsByName("detail_header_date_cmd")[0].disabled = true;
document.getElementsByName("detail_header_date_cmd")[0].style.backgroundColor = "#ECEFF1";
@ -1982,6 +2003,25 @@ const Partner_Facture = (props) => {
/>
</div>
<div className="session_caract" > Conditions Paiement <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_header_order_paiement_condition"
id="detail_header_order_paiement_condition"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_header_condition_paiement_code}
/>
</div>
<div className="session_caract"> Date Commande<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
@ -2468,8 +2508,8 @@ const Partner_Facture = (props) => {
<div style={{ "border": "None" }}>
<nav onClick={"Ajouter_une_ligne_article"} style={{ "fontSize": "18px", "fontWeight": '600', "marginLeft": "10px", "marginTop": "10px", "cursor": "pointer" }}> <Button> Ajouter une annotation
&nbsp;
</Button>
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
</Button>
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
</nav>
<div style={{ height: 550, width: '100%', paddingRight: '1px' }}>
&nbsp;