This commit is contained in:
KANE LAZENI 2026-06-10 12:16:09 +00:00
parent 13cb908241
commit 067f2cb2a8
2 changed files with 35 additions and 53 deletions

View File

@ -3436,20 +3436,15 @@ function controle_numerique(controle)
function ajax_maj_prix_medicament_pha(idMedicament, tarifPublic, prix, controle)
{
alert("ajax_maj_prix_medicament_pha");
var appliquerMargePrixMedicament = $('#appliquerMargePrixMedicament').val();
var margePrixMedicament = $('#margePrixMedicament').val();
var typeMargePrixMedicament = $('#typeMargePrixMedicament').val();
var devise = $("#devise").val();
prix=prix.replace(",",".");
prix=prix.replace(/ /g,"");
controle.value=prix;
/*if(prix==0)
{
controle.focus();
@ -3462,12 +3457,9 @@ function ajax_maj_prix_medicament_pha(idMedicament, tarifPublic, prix, controle)
if(typeMargePrixMedicament=="Taux")
{
pourcentage = parseInt(tarifPublic) * parseInt(margePrixMedicament);
prixMarge = parseInt(pourcentage) / 100;
prixMarjore =parseInt(tarifPublic) + parseInt(prixMarge);
pourcentage = parseInt(tarifPublic) * parseInt(margePrixMedicament);
prixMarge = parseInt(pourcentage) / 100;
prixMarjore =parseInt(tarifPublic) + parseInt(prixMarge);
}else{
prixMarjore =parseInt(tarifPublic) + parseInt(margePrixMedicament);
}
@ -3476,42 +3468,39 @@ function ajax_maj_prix_medicament_pha(idMedicament, tarifPublic, prix, controle)
if(controle_numerique(controle))
{
if(appliquerMargePrixMedicament == "1")
{
if(prix > prixMarjore){
controle.value = tarifPublic;
controle.focus();
v_msg="D\u00e9sol\u00e9! Le prix saisi est sup\u00e9rieur \u00e0 la valeur de la marge de "+formatCurrency(prixMarge)+" "+devise+" appliquable au le prix syst\u00e8me de ce m\u00e9dicament.";
v_msgEng="Sorry! but the price entered is higher than the value of the margin "+formatCurrency(prixMarge)+" "+devise+" applicable to the system price of this medicine.";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idMedicament='+idMedicament+"&prix="+prix;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/majprixpha/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
$("#livraison").html(data);
getstatutacte("PH");
if(prix > prixMarjore){
controle.value = tarifPublic;
controle.focus();
v_msg="D\u00e9sol\u00e9! Le prix saisi est sup\u00e9rieur \u00e0 la valeur de la marge de "+formatCurrency(prixMarge)+" "+devise+" appliquable au le prix syst\u00e8me de ce m\u00e9dicament.";
v_msgEng="Sorry! but the price entered is higher than the value of the margin "+formatCurrency(prixMarge)+" "+devise+" applicable to the system price of this medicine.";
alert_ebene(v_msg, v_msgEng);
return;
}
donnees = 'idMedicament='+idMedicament+"&prix="+prix;
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/majprixpha/",
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
$("#livraison").html(data);
getstatutacte("PH");
},
error: function(data) {
},
complete: function() {
alerter_depassement_limite();
controle.focus();
}
});
},
error: function(data) {
},
complete: function() {
alerter_depassement_limite();
controle.focus();
}
});
}else{
donnees = 'idMedicament='+idMedicament+"&prix="+prix;
@ -3549,10 +3538,8 @@ function ajax_maj_prix_medicament_cso(idMedicament, tarifPublic, prix, controle)
prix=prix.replace(/ /g,"");
controle.value=prix;
prixMarge = parseInt(tarifPublic) + parseInt(margePrixMedicament);
margePrixMedicament = parseInt(margePrixMedicament);
if(controle_numerique(controle))
@ -3694,7 +3681,6 @@ function ajax_maj_prix_medicament_cso(idMedicament, tarifPublic, prix, controle)
type: 'POST',
data: donnees,
success: function(data) {
// $("#medicaments").html(data);
$("#livraison").html(data);
},
error: function(data) {
@ -3705,8 +3691,6 @@ function ajax_maj_prix_medicament_cso(idMedicament, tarifPublic, prix, controle)
}
});
}
}
}
@ -3715,8 +3699,6 @@ function ajax_maj_prix_medicament_cso(idMedicament, tarifPublic, prix, controle)
function maj_prixmanuel_pha(idLivre, nbreLivre, valeurActeManuel, controle)
{
alert("maj_prixmanuel_pha");
valeurActeManuel=valeurActeManuel.replace(/ /g,"");
valeurActeManuel=parseInt(valeurActeManuel.replace(",","."),10);
controle.value=valeurActeManuel;

View File

@ -892,7 +892,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.css" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.js" crossorigin="anonymous"></script>
<script src="Js/fonctions.js?ver=2026.06.10.00"></script>
<script src="Js/fonctions.js?ver=2026.06.10.01"></script>
<script src="Bootstrap/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script>