08/06/23 - 21h
parent
269b5a78f3
commit
71a39865c4
|
@ -32,6 +32,9 @@ import { RiAddCircleLine } from "react-icons/ri";
|
||||||
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
|
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
|
||||||
import 'react-tooltip/dist/react-tooltip.css'
|
import 'react-tooltip/dist/react-tooltip.css'
|
||||||
import { Tooltip } from 'react-tooltip'
|
import { Tooltip } from 'react-tooltip'
|
||||||
|
import Popup from 'reactjs-popup';
|
||||||
|
import 'reactjs-popup/dist/index.css';
|
||||||
|
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
|
||||||
|
|
||||||
function Abonnement(props) {
|
function Abonnement(props) {
|
||||||
|
|
||||||
|
@ -378,6 +381,7 @@ function Abonnement(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const [getCurrentUserData_result, setgetCurrentUserData_result] = useState([]);
|
const [getCurrentUserData_result, setgetCurrentUserData_result] = useState([]);
|
||||||
|
const [Client_end_date_abonnement, setClient_end_date_abonnement] = useState();
|
||||||
|
|
||||||
function getCurrentUserData() {
|
function getCurrentUserData() {
|
||||||
|
|
||||||
|
@ -393,11 +397,18 @@ function Abonnement(props) {
|
||||||
//console.log(" In getCurrentUserData res.data.message = " + res.data.message);
|
//console.log(" In getCurrentUserData res.data.message = " + res.data.message);
|
||||||
setmyApiResponse("True");
|
setmyApiResponse("True");
|
||||||
setResult(res.data.message);
|
setResult(res.data.message);
|
||||||
setgetCurrentUserData_result(res.data.messag)
|
setgetCurrentUserData_result(res.data.message)
|
||||||
|
|
||||||
var mylocaltraining = JSON.parse(res.data.message);
|
var mylocaltraining = JSON.parse(res.data.message);
|
||||||
if (mylocaltraining) {
|
if (mylocaltraining) {
|
||||||
|
|
||||||
|
|
||||||
|
if (mylocaltraining.end_date_abonnement && String(mylocaltraining.end_date_abonnement).length > 3) {
|
||||||
|
|
||||||
|
setClient_end_date_abonnement(mylocaltraining.end_date_abonnement);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (mylocaltraining.invoice_vat_num) {
|
if (mylocaltraining.invoice_vat_num) {
|
||||||
document.getElementsByName("vat_num")[0].value = mylocaltraining.invoice_vat_num;
|
document.getElementsByName("vat_num")[0].value = mylocaltraining.invoice_vat_num;
|
||||||
document.getElementsByName("vat_num")[0].disabled = true;
|
document.getElementsByName("vat_num")[0].disabled = true;
|
||||||
|
@ -496,11 +507,7 @@ function Abonnement(props) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
function confirmAbonnement_avec_arret_encours(packs) {
|
||||||
function confirmAbonnement(packs) {
|
|
||||||
|
|
||||||
window.scrollTo(0, 0);
|
|
||||||
|
|
||||||
if (String(packs).toLowerCase() === String("decouverte")) {
|
if (String(packs).toLowerCase() === String("decouverte")) {
|
||||||
|
|
||||||
if (String(periode) === String("Mensuel")) {
|
if (String(periode) === String("Mensuel")) {
|
||||||
|
@ -571,6 +578,101 @@ function Abonnement(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function confirmAbonnement(packs) {
|
||||||
|
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
|
||||||
|
if (Client_end_date_abonnement && String(Client_end_date_abonnement).length > 3) {
|
||||||
|
|
||||||
|
confirmAlert({
|
||||||
|
title: '',
|
||||||
|
message: "Votre abonnement actuel s'arrete le "+Client_end_date_abonnement+", en confirmant ce nouvel abonnement, votre demande d'arrêt sera annulée.",
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
label: 'Oui',
|
||||||
|
onClick: () => { confirmAbonnement_avec_arret_encours(packs); }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Non',
|
||||||
|
onClick: () => { return }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (String(packs).toLowerCase() === String("decouverte")) {
|
||||||
|
|
||||||
|
if (String(periode) === String("Mensuel")) {
|
||||||
|
if (String(packs).toLowerCase() === String("standard")) {
|
||||||
|
setpackprice("50");
|
||||||
|
}
|
||||||
|
else if (String(packs).toLowerCase() === String("gold")) {
|
||||||
|
setpackprice("90");
|
||||||
|
}
|
||||||
|
else if (String(packs).toLowerCase() === String("decouverte")) {
|
||||||
|
setpackprice("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String(periode) === String("Annuel")) {
|
||||||
|
if (String(packs).toLowerCase() === String("standard")) {
|
||||||
|
setpackprice("600");
|
||||||
|
}
|
||||||
|
else if (String(packs).toLowerCase() === String("gold")) {
|
||||||
|
setpackprice("1080");
|
||||||
|
}
|
||||||
|
else if (String(packs).toLowerCase() === String("decouverte")) {
|
||||||
|
setpackprice("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setgotocheckout("1");
|
||||||
|
setselectedpacks(packs);
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!paymentmode || Object.keys(paymentmode).length <= 0) {
|
||||||
|
alert(" Vous devez ajouter un mode de Paiement pour activer de ce pack")
|
||||||
|
return;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
if (String(periode) === String("Mensuel")) {
|
||||||
|
if (String(packs).toLowerCase() === String("standard")) {
|
||||||
|
setpackprice("50");
|
||||||
|
}
|
||||||
|
else if (String(packs).toLowerCase() === String("gold")) {
|
||||||
|
setpackprice("90");
|
||||||
|
}
|
||||||
|
else if (String(packs).toLowerCase() === String("decouverte")) {
|
||||||
|
setpackprice("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String(periode) === String("Annuel")) {
|
||||||
|
if (String(packs).toLowerCase() === String("standard")) {
|
||||||
|
setpackprice("600");
|
||||||
|
}
|
||||||
|
else if (String(packs).toLowerCase() === String("gold")) {
|
||||||
|
setpackprice("1080");
|
||||||
|
}
|
||||||
|
else if (String(packs).toLowerCase() === String("decouverte")) {
|
||||||
|
setpackprice("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setgotocheckout("1");
|
||||||
|
setselectedpacks(packs);
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const [StopAbonnement_api, setStopAbonnement_api] = useState([]);
|
const [StopAbonnement_api, setStopAbonnement_api] = useState([]);
|
||||||
const [StopAbonnement_message, setStopAbonnement_message] = useState([]);
|
const [StopAbonnement_message, setStopAbonnement_message] = useState([]);
|
||||||
const [StopAbonnement_result, setStopAbonnement_result] = useState([]);
|
const [StopAbonnement_result, setStopAbonnement_result] = useState([]);
|
||||||
|
@ -621,11 +723,11 @@ function Abonnement(props) {
|
||||||
message: "Confirmez l'arret de votre abonnement " + String(localpacks),
|
message: "Confirmez l'arret de votre abonnement " + String(localpacks),
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
label: 'Yes',
|
label: 'Oui',
|
||||||
onClick: () => { StopAbonnement(); }
|
onClick: () => { StopAbonnement(); }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'No',
|
label: 'No,',
|
||||||
onClick: () => { return }
|
onClick: () => { return }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -800,7 +902,7 @@ function Abonnement(props) {
|
||||||
form.append("discount_type", code_promo_type);
|
form.append("discount_type", code_promo_type);
|
||||||
form.append("discount_valeur", code_promo_valeur);
|
form.append("discount_valeur", code_promo_valeur);
|
||||||
form.append("discount_qty", new_nb_formations);
|
form.append("discount_qty", new_nb_formations);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
/!\ : Important, il faut preciser le nombre d'article envoyé avec ceci : form.append("nb_product", nb_article);
|
/!\ : Important, il faut preciser le nombre d'article envoyé avec ceci : form.append("nb_product", nb_article);
|
||||||
|
@ -817,7 +919,7 @@ function Abonnement(props) {
|
||||||
|
|
||||||
|
|
||||||
form.append("0", JSON.stringify({
|
form.append("0", JSON.stringify({
|
||||||
"code": currentpack, "prix": packprice, "comment": "nc", "qty": new_nb_formations,
|
"code": currentpack, "prix": packprice, "comment": "nc", "qty": new_nb_formations,
|
||||||
"pack_products": prod_service
|
"pack_products": prod_service
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -944,11 +1046,11 @@ function Abonnement(props) {
|
||||||
message: "Confirmez la modification du nombre de formations",
|
message: "Confirmez la modification du nombre de formations",
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
label: 'Yes',
|
label: 'Oui',
|
||||||
onClick: () => { New_Ordervalidation(); }
|
onClick: () => { New_Ordervalidation(); }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'No',
|
label: 'Non',
|
||||||
onClick: () => { return }
|
onClick: () => { return }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1176,24 +1278,24 @@ function Abonnement(props) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{code_promo_text_to_display && String(code_promo_text_to_display) != "" &&
|
{code_promo_text_to_display && String(code_promo_text_to_display) != "" &&
|
||||||
<div style={{ "width": "100%", "float": "left" }} id="div_nb_formation" className="mob_heigh">
|
<div style={{ "width": "100%", "float": "left" }} id="div_nb_formation" className="mob_heigh">
|
||||||
<div style={{ "textAlign": "left", "width": "50%", "float": "left", "color": "green", "fontSize": "bold" }}>
|
<div style={{ "textAlign": "left", "width": "50%", "float": "left", "color": "green", "fontSize": "bold" }}>
|
||||||
Montant Remise :
|
Montant Remise :
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{String(handleOnblur_Code_Promo_api) === "true" &&
|
||||||
|
<div style={{ "textAlign": "right", "width": "50%", "float": "right", "color": "green", "fontSize": "bold" }}>
|
||||||
|
{String(code_promo_type) === "fix" && <nav>
|
||||||
|
- {(((packprice * new_nb_formations) - parseFloat(code_promo_valeur))).toFixed(2)} €
|
||||||
|
</nav>}
|
||||||
|
|
||||||
|
{String(code_promo_type) === "percent" && <nav>
|
||||||
|
- {((((packprice * new_nb_formations) * ((parseFloat(code_promo_valeur) / 100))))).toFixed(2)} €
|
||||||
|
</nav>}
|
||||||
|
</div>}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{String(handleOnblur_Code_Promo_api) === "true" &&
|
|
||||||
<div style={{ "textAlign": "right", "width": "50%", "float": "right", "color": "green", "fontSize": "bold" }}>
|
|
||||||
{String(code_promo_type) === "fix" && <nav>
|
|
||||||
- {(((packprice * new_nb_formations) - parseFloat(code_promo_valeur)) ).toFixed(2)} €
|
|
||||||
</nav>}
|
|
||||||
|
|
||||||
{String(code_promo_type) === "percent" && <nav>
|
|
||||||
- {((((packprice * new_nb_formations) * ( (parseFloat(code_promo_valeur) / 100)))) ).toFixed(2)} €
|
|
||||||
</nav>}
|
|
||||||
</div>}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<div style={{ "width": "100%", "float": "left" }} id="div_nb_formation" className="mob_heigh">
|
<div style={{ "width": "100%", "float": "left" }} id="div_nb_formation" className="mob_heigh">
|
||||||
|
|
|
@ -175,11 +175,11 @@ const ButtonHilight = () => {
|
||||||
message: 'Confirmez la deconnexion (user)',
|
message: 'Confirmez la deconnexion (user)',
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
label: 'Yes',
|
label: 'Oui',
|
||||||
onClick: () => user_logout_confirmation()
|
onClick: () => user_logout_confirmation()
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'No',
|
label: 'Non',
|
||||||
onClick: () => { return }
|
onClick: () => { return }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue