diff --git a/Js/fonctions.js b/Js/fonctions.js index 66d9988..7eea550 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -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; diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 35ce63c..a021247 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -892,7 +892,7 @@ - +