From 63437606a46804957ff3288113bb8baa78941ed5 Mon Sep 17 00:00:00 2001 From: davin baragiotta Date: Thu, 7 Apr 2011 06:44:31 -0400 Subject: [PATCH 1/1] =?utf8?q?debug=20devise,=20taux=20et=20totaux=20(devise?= =?utf8?q?=20et=20euro)=20apr=C3=A8s=20reload?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- project/dae/templates/dae/poste.html | 52 ++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/project/dae/templates/dae/poste.html b/project/dae/templates/dae/poste.html index 75a3670..4c574c6 100644 --- a/project/dae/templates/dae/poste.html +++ b/project/dae/templates/dae/poste.html @@ -167,7 +167,10 @@ Demande d'autorisation d'embauche {{ form.devise_min }} {{ form.devise_min.errors }} - {{ form.salaire_min }} + + {{ form.salaire_min }} + {{ form.salaire_min.errors }} + EUR {{ form.indemn_min }} EUR @@ -191,7 +194,10 @@ Demande d'autorisation d'embauche {{ form.devise_max }} {{ form.devise_max.errors }} - {{ form.salaire_max }} + + {{ form.salaire_max }} + {{ form.salaire_max.errors }} + EUR {{ form.indemn_max }} EUR @@ -209,7 +215,7 @@ Demande d'autorisation d'embauche

N.B Conversion en EUROS au taux de change budgétaire

- {% if new %} + {% comment %}{% if new %}{% endcomment %}

Éléments de comparaison

Compléter uniquement lors de la création d'un poste

@@ -242,7 +248,7 @@ Demande d'autorisation d'embauche
- {% endif %} + {% comment %}{% endif %}{% endcomment %} {% comment %}

SECTION 2 - PERSONNEL ENGAGÉ

@@ -326,6 +332,22 @@ Demande d'autorisation d'embauche $('#id_valeur_point_min').after(valeur_min) $('#id_devise_min').after(devise_min_code) $('#total_min_euro').after(taux_min_euro) + + /* simuler id_devise_min change */ + devise_min = $('#id_devise_min').val(); + url_devise_code = "{% url dae_devise_code %}"; + $.post(url_devise_code, {'devise':devise_min}, function(data){ + $('#devise_min_code').val(data["devise_code"]); + $('#taux_min_euro').val(data["taux_euro"]); + $('#taux_min_euro_display').empty(); + $('#taux_min_euro_display').text(data["taux_euro"]); + $('.devise_min_code').trigger('update_devise_min_code'); + $('#total_min_euro').trigger('update_total_min_euro'); + }, 'json'); + /* total */ + $('#total_min').trigger('update_total_min'); + /* total euro */ + $('#total_min_euro').trigger('update_total_min_euro'); }); /* bindings */ $('#id_coefficient_min').bind('coeff_min_modified', function(){ @@ -411,8 +433,9 @@ Demande d'autorisation d'embauche }, 'json'); }); $('#id_devise_min').change(function(){ + devise_min = $('#id_devise_min').val(); url_devise_code = "{% url dae_devise_code %}"; - $.post(url_devise_code, {'devise':$(this).val()}, function(data){ + $.post(url_devise_code, {'devise':devise_min}, function(data){ $('#devise_min_code').val(data["devise_code"]); $('#taux_min_euro').val(data["taux_euro"]); $('#taux_min_euro_display').empty(); @@ -439,6 +462,22 @@ Demande d'autorisation d'embauche $('#id_valeur_point_max').after(valeur_max) $('#id_devise_max').after(devise_max_code) $('#total_max_euro').after(taux_max_euro) + + /* simuler id_devise_max change */ + devise_max = $('#id_devise_max').val(); + url_devise_code = "{% url dae_devise_code %}"; + $.post(url_devise_code, {'devise':devise_max}, function(data){ + $('#devise_max_code').val(data["devise_code"]); + $('#taux_max_euro').val(data["taux_euro"]); + $('#taux_max_euro_display').empty(); + $('#taux_max_euro_display').text(data["taux_euro"]); + $('.devise_max_code').trigger('update_devise_max_code'); + $('#total_max_euro').trigger('update_total_max_euro'); + }, 'json'); + /* total */ + $('#total_max').trigger('update_total_max'); + /* total euro */ + $('#total_max_euro').trigger('update_total_max_euro'); }); /* bindings */ $('#id_coefficient_max').bind('coeff_max_modified', function(){ @@ -524,8 +563,9 @@ Demande d'autorisation d'embauche }, 'json'); }); $('#id_devise_max').change(function(){ + devise_max = $('#id_devise_max').val(); url_devise_code = "{% url dae_devise_code %}"; - $.post(url_devise_code, {'devise':$(this).val()}, function(data){ + $.post(url_devise_code, {'devise':devise_max}, function(data){ $('#devise_max_code').val(data["devise_code"]); $('#taux_max_euro').val(data["taux_euro"]); $('#taux_max_euro_display').empty(); -- 1.7.10.4