Commit | Line | Data |
---|---|---|
5d680e84 | 1 | {% extends 'base.html' %} |
37bf2d05 | 2 | |
498881f4 | 3 | {% block title %}RH - DAE{% endblock %} |
4 | {% block titre %}Ressources humaines{% endblock %} | |
5efcd48e | 5 | {% block sous_titre %} |
6 | Demande d'autorisation d'embauche | |
7 | {% endblock %} | |
498881f4 | 8 | |
37bf2d05 | 9 | {% block extrahead %} |
703e5cfb NC |
10 | <script src="{{ MEDIA_URL }}js/jquery-1.5.1.min.js" |
11 | type="text/javascript"></script> | |
12 | <script src="{{ MEDIA_URL }}js/jquery-ui-1.8.11.custom.min.js" | |
13 | type="text/javascript"></script> | |
14 | <link href="{{ MEDIA_URL }}/css/redmond/jquery-ui-1.8.11.custom.css" | |
15 | rel="stylesheet" /> | |
ce110fb9 OL |
16 | |
17 | <style> | |
18 | h1.section {background-color: #D0E8F8; text-align: center; color: #5F5F5F; margin: 50px 0px 26px 0px; border-bottom: 3px solid #BBD8EC; padding: 4px;} | |
19 | .row {padding: 10px 0px; clear: both; display:block;} | |
20 | .row * {float: left; margin: 0px; padding: 0px; margin-right: 4px;} | |
21 | .row li {list-style-type: none;} | |
22 | .underline {text-decoration: underline;} | |
23 | .clear {display: block; clear: both;} | |
24 | .note {text-decoration: underline; font-style: italic; margin-left: 12px;} | |
25 | .info {font-size:13px; font-style: italic;} | |
26 | .noborder {border:none; margin:0; padding; 0} | |
27 | tr.noborder td {border:none; padding-left: 0;} | |
28 | </style> | |
37bf2d05 NC |
29 | {% endblock %} |
30 | ||
37bf2d05 | 31 | {% block main %} |
498881f4 | 32 | <h1>Demande d'autorisation de création de poste</h1> |
33 | ||
5efcd48e | 34 | <form action="" method="post"> |
35 | <fieldset> | |
36 | <h2> | |
37 | {% if new %} | |
38 | Nouveau poste | |
39 | {% else %} | |
40 | Poste existant : {{ poste.nom }} ({{ poste.implantation.nom }}) | |
41 | {% endif %} | |
42 | </h2> | |
43 | <table> | |
44 | <tbody> | |
45 | <tr> | |
46 | <th>{{ form.poste.label_tag }} :<br />{{ form.poste.errors }}</th> | |
47 | <td>{{ form.poste }}</td> | |
48 | </tr> | |
49 | <tr> | |
50 | <th>{{ form.nom.label_tag }} :<br />{{ form.nom.errors }}</th> | |
51 | <td>{{ form.nom }}</td> | |
52 | </tr> | |
53 | <tr> | |
54 | <th>{{ form.type_poste.label_tag }} :<br />{{ form.type_poste.errors }}</th> | |
55 | <td>{{ form.type_poste }}</td> | |
56 | </tr> | |
57 | <tr> | |
58 | <th>{{ form.implantation.label_tag }} :<br />{{ form.implantation.errors }}</th> | |
59 | <td>{{ form.implantation }}</td> | |
60 | </tr> | |
61 | <tr> | |
62 | <th>{{ form.service.label_tag }} :<br />{{ form.service.errors }}</th> | |
63 | <td>{{ form.service }}</td> | |
64 | </tr> | |
65 | <tr> | |
66 | <th>{{ form.responsable.label_tag }} :<br />{{ form.responsable.errors }}</th> | |
67 | <td>{{ form.responsable }}</td> | |
68 | </tr> | |
69 | </tbody> | |
70 | </table> | |
71 | </fieldset> | |
d949462d | 72 | |
5efcd48e | 73 | <fieldset> |
74 | <h2>Recrutement</h2> | |
75 | <table> | |
76 | <tbody> | |
77 | <tr> | |
78 | <th>{{ form.statut_residence.label_tag }} :<br />{{ form.statut_residence.errors }}</th> | |
79 | <td> | |
80 | <span class="row"> | |
81 | {{ form.statut_residence }} | |
82 | {{ form.mise_a_disposition.label_tag }} | |
83 | {{ form.mise_a_disposition.errors }} | |
84 | {{ form.mise_a_disposition }} | |
85 | </span> | |
86 | </td> | |
87 | </tr> | |
88 | <tr> | |
89 | <th>{{ form.appel.label_tag }} :<br />{{ form.appel.errors }}</th> | |
90 | <td> | |
91 | <span class="row"> | |
92 | {{ form.appel }} | |
93 | </span> | |
94 | </td> | |
95 | </tr> | |
96 | </tbody> | |
97 | </table> | |
98 | </fieldset> | |
d949462d | 99 | |
5efcd48e | 100 | <fieldset> |
101 | <h2>Durée prévue du poste </h2> | |
9fb2ccd9 | 102 | <span class="info">Indépendamment du titulaire du poste</span> |
5efcd48e | 103 | <table> |
104 | <tbody> | |
105 | <tr> | |
106 | <th rowspan="2">Durée :</th> | |
107 | <td>du</td> | |
108 | <td> | |
109 | {{ form.date_debut }}<br /> | |
110 | <span class="info">({{form.date_debut.help_text }})</span><br /> | |
111 | {{ form.date_debut.errors }} | |
112 | </td> | |
113 | <td> au </td> | |
114 | <td> | |
115 | {{ form.date_fin }}<br /> | |
116 | <span class="info">({{form.date_fin.help_text }})</span><br /> | |
117 | {{ form.date_fin.errors }} | |
118 | </td> | |
119 | </tr> | |
120 | <tr> | |
121 | <td colspan="4" class="info">Pour une durée indéterminée, spécifier uniquement la date de début.</td> | |
ce110fb9 OL |
122 | </tr> |
123 | <tr> | |
5efcd48e | 124 | <th>{{ form.regime_travail.label_tag }} :<br />{{ form.regime_travail.errors }}</th> |
125 | <td colspan="4"> | |
126 | {{ form.regime_travail }} | |
127 | <span class="info">{{ form.regime_travail.help_text }}</span> | |
ce110fb9 | 128 | </td> |
0f23302a | 129 | </tr> |
5efcd48e | 130 | <tr> |
131 | <th> | |
132 | {{ form.regime_travail_nb_heure_semaine.label_tag }} :<br /> | |
133 | {{ form.regime_travail_nb_heure_semaine.errors }} | |
134 | </th> | |
135 | <td colspan="4">{{ form.regime_travail_nb_heure_semaine }}</td> | |
136 | </tr> | |
137 | </tbody> | |
0f23302a | 138 | </table> |
5efcd48e | 139 | </fieldset> |
0f23302a | 140 | |
5efcd48e | 141 | <fieldset> |
142 | <h2>Classement du poste</h2> | |
143 | <table> | |
144 | <tbody> | |
145 | <tr> | |
146 | <th></th> | |
147 | <th>Échelon AUF</th> | |
96d32304 | 148 | <th>Coefficient</th> |
5efcd48e | 149 | <th>Valeur du point</th> |
3d627bfd | 150 | <th>Devise</th> |
151 | <th colspan="2">Salaire de base</th> | |
152 | <th colspan="2">Indemnité, responsabilité (le cas échéant)</th> | |
153 | <th colspan="2">Autres</th> | |
154 | <th colspan="2">TOTAL</th> | |
8e30e17f | 155 | <th>Taux > €</th> |
3d627bfd | 156 | <th colspan="2">Conversion EUR</th> |
5efcd48e | 157 | </tr> |
158 | <tr> | |
159 | <th>Minimum</th> | |
160 | <td>{{ form.classement_min }}</td> | |
96d32304 | 161 | <td>{{ form.coefficient_min }}</td> |
5efcd48e | 162 | <td> |
163 | {{ form.valeur_point_min }} | |
164 | {{ form.valeur_point_min.errors }} | |
165 | </td> | |
3d627bfd | 166 | <td> |
167 | {{ form.devise_min }} | |
168 | {{ form.devise_min.errors }} | |
169 | </td> | |
8e30e17f | 170 | <td >{{ form.salaire_min }}</td> |
3d627bfd | 171 | <td><span class="devise_min_code">EUR</span></td> |
5efcd48e | 172 | <td>{{ form.indemn_min }}</td> |
3d627bfd | 173 | <td><span class="devise_min_code">EUR</span></td> |
5efcd48e | 174 | <td>{{ form.autre_min }}</td> |
3d627bfd | 175 | <td><span class="devise_min_code">EUR</span></td> |
8e30e17f | 176 | <td id="total_min" class="cell-nombre">0.00</td> |
3d627bfd | 177 | <td><span class="devise_min_code">EUR</span></td> |
8e30e17f | 178 | <td id="taux_min_euro_display">1</td> |
179 | <td id="total_min_euro" class="cell-nombre">0.00</td> | |
3d627bfd | 180 | <td>€</td> |
0f23302a | 181 | </tr> |
182 | <tr> | |
5efcd48e | 183 | <th>Maximun</th> |
184 | <td>{{ form.classement_max }}</td> | |
96d32304 | 185 | <td>{{ form.coefficient_max }}</td> |
5efcd48e | 186 | <td> |
187 | {{ form.valeur_point_max }} | |
188 | {{ form.valeur_point_max.errors }} | |
ce110fb9 | 189 | </td> |
3d627bfd | 190 | <td> |
191 | {{ form.devise_max }} | |
192 | {{ form.devise_max.errors }} | |
193 | </td> | |
5efcd48e | 194 | <td>{{ form.salaire_max }}</td> |
3d627bfd | 195 | <td><span class="devise_max_code">EUR</span></td> |
5efcd48e | 196 | <td>{{ form.indemn_max }}</td> |
3d627bfd | 197 | <td><span class="devise_max_code">EUR</span></td> |
5efcd48e | 198 | <td>{{ form.autre_max }}</td> |
3d627bfd | 199 | <td><span class="devise_max_code">EUR</span></td> |
8e30e17f | 200 | <td id="total_max" class="cell-nombre">0.00</td> |
3d627bfd | 201 | <td><span class="devise_max_code">EUR</span></td> |
8e30e17f | 202 | <td id="taux_max_euro_display">1</td> |
203 | <td id="total_max_euro" class="cell-nombre">0.00</td> | |
3d627bfd | 204 | <td>€</td> |
ce110fb9 | 205 | </tr> |
5efcd48e | 206 | </tbody> |
0f23302a | 207 | </table> |
ce110fb9 | 208 | |
0f23302a | 209 | <p class="info">N.B Conversion en EUROS au taux de change budgétaire</p> |
5efcd48e | 210 | </fieldset> |
211 | ||
212 | {% if new %} | |
213 | <fieldset> | |
214 | <h2>Éléments de comparaison</h2> | |
215 | <p class="info">Compléter uniquement lors de la création d'un poste</p> | |
216 | <table> | |
217 | <tbody> | |
218 | <tr> | |
219 | <th></th> | |
220 | <th>Locale</th> | |
221 | <th>Université</th> | |
222 | <th>Fonction publique</th> | |
223 | <th>ONG</th> | |
224 | <th>Autre</th> | |
225 | </tr> | |
226 | <tr> | |
227 | <th>Minimum</th> | |
228 | <td>{{ form.comp_locale_min }}</td> | |
229 | <td>{{ form.comp_universite_min }}</td> | |
230 | <td>{{ form.comp_fonctionpub_min }}</td> | |
231 | <td>{{ form.comp_ong_min }}</td> | |
232 | <td>{{ form.comp_autre_min }}</td> | |
233 | </tr> | |
234 | <tr> | |
235 | <th>Maximum</th> | |
236 | <td>{{ form.comp_locale_max }}</td> | |
237 | <td>{{ form.comp_universite_max }}</td> | |
238 | <td>{{ form.comp_fonctionpub_max }}</td> | |
239 | <td>{{ form.comp_ong_max }}</td> | |
240 | <td>{{ form.comp_autre_max }}</td> | |
241 | </tr> | |
242 | </tbody> | |
243 | </table> | |
5efcd48e | 244 | </fieldset> |
245 | {% endif %} | |
ce110fb9 | 246 | |
5efcd48e | 247 | {% comment %} |
0f23302a | 248 | <h1 class="section clear">SECTION 2 - PERSONNEL ENGAGÉ</h1> |
249 | <div class="row"></div> | |
ce110fb9 | 250 | |
0f23302a | 251 | <h1 class="section">SECTION 3 - COÛT GLOBAL</h1> |
252 | <div class="row"></div> | |
ce110fb9 | 253 | |
0f23302a | 254 | <h1 class="section">SECTION 4 - JUSTIFICATION DE LA DEMANDE (OBLIGATOIRE)</h1> |
255 | <div class="row"></div> | |
5efcd48e | 256 | {% endcomment %} |
3ed49093 | 257 | <input type="submit" name="save" value="Sauvegarder" /> |
5efcd48e | 258 | </form> |
3ed49093 | 259 | |
5efcd48e | 260 | <fieldset> |
261 | <h2>Financement</h2> | |
3ed49093 | 262 | |
5efcd48e | 263 | <table cellspacing="0" id="financing"> |
3ed49093 NC |
264 | <tr> |
265 | <th>Type</th> | |
266 | <th>Montant</th> | |
267 | <th>Devise</th> | |
268 | <th>Pourcentage</th> | |
269 | <th>Commentaire</th> | |
270 | <th></th> | |
271 | </tr> | |
272 | {% for fin in poste.financements.all %} | |
273 | <tr> | |
43d04712 | 274 | <td>{{ fin.get_type_display }}</td> |
3ed49093 | 275 | <td>{{ fin.montant }}</td> |
43d04712 | 276 | <td>€ |
277 | {% comment %} | |
278 | {{ fin.devise }} | |
279 | {% endcomment %} | |
280 | </td> | |
3ed49093 NC |
281 | <td>{{ fin.pourcentage }}</td> |
282 | <td>{{ fin.commentaire }}</td> | |
283 | <td><a href="{% url financement poste_key fin.id %}">Modifier</a></td> | |
284 | </tr> | |
285 | {% empty %} | |
286 | <tr> | |
287 | <td colspan="5"> | |
288 | {% if new %} | |
289 | Vous devez enregister ce nouveau poste avant de pouvoir spécifier | |
290 | la ou les sources de financement. | |
291 | {% else %} | |
292 | Aucun financement au registre | |
293 | {% endif %} | |
294 | </td> | |
295 | </tr> | |
296 | {% endfor %} | |
5efcd48e | 297 | </table> |
298 | {% if not new %} | |
703e5cfb | 299 | <a href="{% url financement poste_key %}" class="new"> |
3ed49093 NC |
300 | Ajouter une source de financement |
301 | </a> | |
5efcd48e | 302 | {% endif %} |
703e5cfb | 303 | |
5efcd48e | 304 | <div id="financing-form"></div> |
305 | </fieldset> | |
703e5cfb | 306 | |
b50b0cd3 | 307 | <script type="text/javascript"> |
308 | $('#id_poste').change(function() { | |
309 | window.location = '{% url poste %}/' + $(this).val(); | |
310 | }); | |
311 | $('#financing a, a.new').click(function() { | |
312 | $('#financing-form').load($(this).attr('href') + '?ajax=1') | |
313 | .dialog({ | |
314 | modal: true, | |
315 | height: 500, | |
316 | width: 550 | |
317 | }); | |
318 | return false; | |
319 | }); | |
3d627bfd | 320 | |
321 | /* CLASSEMENT MIN */ | |
85668061 | 322 | $(document).ready(function() { |
3d627bfd | 323 | valeur_min = '<input type="hidden" id="valeur_min" name="valeur_min" value="0" disabled="disabled">' |
324 | devise_min_code = '<input type="hidden" id="devise_min_code" name="devise_min_code" value="5" disabled="disabled">' | |
8e30e17f | 325 | taux_min_euro = '<input type="hidden" id="taux_min_euro" name="taux_min_euro" value="1" disabled="disabled">' |
85668061 | 326 | $('#id_valeur_point_min').after(valeur_min) |
3d627bfd | 327 | $('#id_devise_min').after(devise_min_code) |
8e30e17f | 328 | $('#total_min_euro').after(taux_min_euro) |
85668061 | 329 | }); |
8e30e17f | 330 | /* bindings */ |
85668061 | 331 | $('#id_coefficient_min').bind('coeff_min_modified', function(){ |
332 | $('#id_salaire_min').trigger('update_salaire_min'); | |
333 | }); | |
3d627bfd | 334 | $('.devise_min_code').bind('update_devise_min_code', function(){ |
335 | devise_code = $('#devise_min_code').val(); | |
336 | $('.devise_min_code').empty(); | |
337 | $('.devise_min_code').text(devise_code); | |
338 | }); | |
85668061 | 339 | $('#id_salaire_min').bind('update_salaire_min', function(){ |
340 | valeur = $('#valeur_min').val(); | |
341 | coeff = $('#id_coefficient_min').val(); | |
342 | salaire = coeff * valeur; | |
343 | salaire = clean_float(salaire); | |
3d627bfd | 344 | $(this).val(salaire); |
85668061 | 345 | $('#total_min').trigger('update_total_min'); |
346 | }); | |
347 | $('#total_min').bind('update_total_min', function(){ | |
348 | total = 0; | |
349 | salaire = $('#id_salaire_min').val(); | |
350 | indemn = $('#id_indemn_min').val(); | |
351 | autre = $('#id_autre_min').val(); | |
352 | salaire = clean_float(salaire); | |
353 | indemn = clean_float(indemn); | |
354 | autre = clean_float(autre); | |
355 | total = salaire + indemn + autre; | |
3d627bfd | 356 | $(this).empty(); |
357 | $(this).text(total.toFixed(2)); | |
8e30e17f | 358 | $('#total_min_euro').trigger('update_total_min_euro'); |
359 | }); | |
360 | $('#total_min_euro').bind('update_total_min_euro', function(){ | |
361 | total = $('#total_min').text(); | |
362 | taux_euro = $('#taux_min_euro').val(); | |
363 | total = clean_float(total); | |
364 | taux_euro = clean_float(taux_euro); | |
365 | total_euro = total * taux_euro; | |
366 | $(this).empty(); | |
367 | $(this).text(total_euro.toFixed(2)); | |
85668061 | 368 | }); |
3d627bfd | 369 | /* change */ |
85668061 | 370 | $('#id_coefficient_min').change(function(){ |
3d627bfd | 371 | $(this).trigger('coeff_min_modified'); |
85668061 | 372 | }); |
b50b0cd3 | 373 | $('#id_classement_min').change(function() { |
b50b0cd3 | 374 | url = "{% url dae_coefficient %}"; |
8e30e17f | 375 | $.post(url, {'classement':$(this).val()}, function(data){ |
b50b0cd3 | 376 | $('#id_coefficient_min').val(data["coefficient"]); |
85668061 | 377 | $('#id_coefficient_min').trigger('coeff_min_modified'); |
b50b0cd3 | 378 | }, 'json'); |
379 | }); | |
85668061 | 380 | $('#id_valeur_point_min').change(function() { |
3d627bfd | 381 | url_valeur = "{% url dae_valeur %}"; |
382 | url_devise = "{% url dae_devise %}"; | |
1849a509 | 383 | min_now = $('#id_valeur_point_min').val(); |
384 | max_now = $('#id_valeur_point_max').val(); | |
3d627bfd | 385 | $.post(url_valeur, {'valeur_point':$(this).val()}, function(data){ |
85668061 | 386 | $('#valeur_min').val(data["valeur"]); |
387 | $('#id_salaire_min').trigger('update_salaire_min'); | |
8e30e17f | 388 | $('#total_min_euro').trigger('update_total_min_euro'); |
1849a509 | 389 | if (max_now == '') |
390 | $('#id_valeur_point_max').val(min_now); | |
391 | $('#valeur_max').val(data["valeur"]); | |
392 | $('#id_salaire_max').trigger('update_salaire_max'); | |
393 | $('#total_max_euro').trigger('update_total_max_euro'); | |
85668061 | 394 | }, 'json'); |
3d627bfd | 395 | $.post(url_devise, {'valeur_point':$(this).val()}, function(data){ |
396 | $('#id_devise_min').val(data["devise"]); | |
397 | $('#devise_min_code').val(data["devise_code"]); | |
8e30e17f | 398 | $('#taux_min_euro').val(data["taux_euro"]); |
399 | $('#taux_min_euro_display').empty(); | |
400 | $('#taux_min_euro_display').text(data["taux_euro"]); | |
3d627bfd | 401 | $('.devise_min_code').trigger('update_devise_min_code'); |
8e30e17f | 402 | $('#total_min_euro').trigger('update_total_min_euro'); |
1849a509 | 403 | if (max_now == '') |
404 | $('#id_devise_max').val(data["devise"]); | |
405 | $('#devise_max_code').val(data["devise_code"]); | |
406 | $('#taux_max_euro').val(data["taux_euro"]); | |
407 | $('#taux_max_euro_display').empty(); | |
408 | $('#taux_max_euro_display').text(data["taux_euro"]); | |
409 | $('.devise_max_code').trigger('update_devise_max_code'); | |
410 | $('#total_max_euro').trigger('update_total_max_euro'); | |
3d627bfd | 411 | }, 'json'); |
412 | }); | |
413 | $('#id_devise_min').change(function(){ | |
414 | url_devise_code = "{% url dae_devise_code %}"; | |
415 | $.post(url_devise_code, {'devise':$(this).val()}, function(data){ | |
416 | $('#devise_min_code').val(data["devise_code"]); | |
8e30e17f | 417 | $('#taux_min_euro').val(data["taux_euro"]); |
418 | $('#taux_min_euro_display').empty(); | |
419 | $('#taux_min_euro_display').text(data["taux_euro"]); | |
3d627bfd | 420 | $('.devise_min_code').trigger('update_devise_min_code'); |
8e30e17f | 421 | $('#total_min_euro').trigger('update_total_min_euro'); |
3d627bfd | 422 | }, 'json'); |
85668061 | 423 | }); |
424 | $('#id_salaire_min').change(function(){ | |
425 | $('#total_min').trigger('update_total_min'); | |
426 | }); | |
427 | $('#id_indemn_min').change(function(){ | |
428 | $('#total_min').trigger('update_total_min'); | |
429 | }); | |
430 | $('#id_autre_min').change(function(){ | |
431 | $('#total_min').trigger('update_total_min'); | |
432 | }); | |
433 | ||
3d627bfd | 434 | /* CLASSEMENT MAX */ |
681bf3d0 | 435 | $(document).ready(function() { |
436 | valeur_max = '<input type="hidden" id="valeur_max" name="valeur_max" value="0" disabled="disabled">' | |
437 | devise_max_code = '<input type="hidden" id="devise_max_code" name="devise_max_code" value="5" disabled="disabled">' | |
438 | taux_max_euro = '<input type="hidden" id="taux_max_euro" name="taux_max_euro" value="1" disabled="disabled">' | |
439 | $('#id_valeur_point_max').after(valeur_max) | |
440 | $('#id_devise_max').after(devise_max_code) | |
441 | $('#total_max_euro').after(taux_max_euro) | |
442 | }); | |
443 | /* bindings */ | |
444 | $('#id_coefficient_max').bind('coeff_max_modified', function(){ | |
445 | $('#id_salaire_max').trigger('update_salaire_max'); | |
446 | }); | |
447 | $('.devise_max_code').bind('update_devise_max_code', function(){ | |
448 | devise_code = $('#devise_max_code').val(); | |
449 | $('.devise_max_code').empty(); | |
450 | $('.devise_max_code').text(devise_code); | |
451 | }); | |
452 | $('#id_salaire_max').bind('update_salaire_max', function(){ | |
453 | valeur = $('#valeur_max').val(); | |
454 | coeff = $('#id_coefficient_max').val(); | |
455 | salaire = coeff * valeur; | |
456 | salaire = clean_float(salaire); | |
457 | $(this).val(salaire); | |
458 | $('#total_max').trigger('update_total_max'); | |
459 | }); | |
460 | $('#total_max').bind('update_total_max', function(){ | |
461 | total = 0; | |
462 | salaire = $('#id_salaire_max').val(); | |
463 | indemn = $('#id_indemn_max').val(); | |
464 | autre = $('#id_autre_max').val(); | |
465 | salaire = clean_float(salaire); | |
466 | indemn = clean_float(indemn); | |
467 | autre = clean_float(autre); | |
468 | total = salaire + indemn + autre; | |
469 | $(this).empty(); | |
470 | $(this).text(total.toFixed(2)); | |
471 | $('#total_max_euro').trigger('update_total_max_euro'); | |
472 | }); | |
473 | $('#total_max_euro').bind('update_total_max_euro', function(){ | |
474 | total = $('#total_max').text(); | |
475 | taux_euro = $('#taux_max_euro').val(); | |
476 | total = clean_float(total); | |
477 | taux_euro = clean_float(taux_euro); | |
478 | total_euro = total * taux_euro; | |
479 | $(this).empty(); | |
480 | $(this).text(total_euro.toFixed(2)); | |
481 | }); | |
482 | /* change */ | |
483 | $('#id_coefficient_max').change(function(){ | |
484 | $(this).trigger('coeff_max_modified'); | |
485 | }); | |
b50b0cd3 | 486 | $('#id_classement_max').change(function() { |
b50b0cd3 | 487 | url = "{% url dae_coefficient %}"; |
3d627bfd | 488 | $.post(url, {'classement':$(this).val()}, function(data){ |
b50b0cd3 | 489 | $('#id_coefficient_max').val(data["coefficient"]); |
681bf3d0 | 490 | $('#id_coefficient_max').trigger('coeff_max_modified'); |
491 | }, 'json'); | |
492 | }); | |
493 | $('#id_valeur_point_max').change(function() { | |
494 | url_valeur = "{% url dae_valeur %}"; | |
495 | url_devise = "{% url dae_devise %}"; | |
1849a509 | 496 | min_now = $('#id_valeur_point_min').val(); |
497 | max_now = $('#id_valeur_point_max').val(); | |
681bf3d0 | 498 | $.post(url_valeur, {'valeur_point':$(this).val()}, function(data){ |
499 | $('#valeur_max').val(data["valeur"]); | |
500 | $('#id_salaire_max').trigger('update_salaire_max'); | |
501 | $('#total_max_euro').trigger('update_total_max_euro'); | |
1849a509 | 502 | if (min_now == '') |
503 | $('#id_valeur_point_min').val(max_now); | |
504 | $('#valeur_min').val(data["valeur"]); | |
505 | $('#id_salaire_min').trigger('update_salaire_min'); | |
506 | $('#total_min_euro').trigger('update_total_min_euro'); | |
b50b0cd3 | 507 | }, 'json'); |
681bf3d0 | 508 | $.post(url_devise, {'valeur_point':$(this).val()}, function(data){ |
509 | $('#id_devise_max').val(data["devise"]); | |
510 | $('#devise_max_code').val(data["devise_code"]); | |
511 | $('#taux_max_euro').val(data["taux_euro"]); | |
512 | $('#taux_max_euro_display').empty(); | |
513 | $('#taux_max_euro_display').text(data["taux_euro"]); | |
514 | $('.devise_max_code').trigger('update_devise_max_code'); | |
515 | $('#total_max_euro').trigger('update_total_max_euro'); | |
1849a509 | 516 | if (min_now == '') |
517 | $('#id_devise_min').val(data["devise"]); | |
518 | $('#devise_min_code').val(data["devise_code"]); | |
519 | $('#taux_min_euro').val(data["taux_euro"]); | |
520 | $('#taux_min_euro_display').empty(); | |
521 | $('#taux_min_euro_display').text(data["taux_euro"]); | |
522 | $('.devise_min_code').trigger('update_devise_min_code'); | |
523 | $('#total_min_euro').trigger('update_total_min_euro'); | |
681bf3d0 | 524 | }, 'json'); |
525 | }); | |
526 | $('#id_devise_max').change(function(){ | |
527 | url_devise_code = "{% url dae_devise_code %}"; | |
528 | $.post(url_devise_code, {'devise':$(this).val()}, function(data){ | |
529 | $('#devise_max_code').val(data["devise_code"]); | |
530 | $('#taux_max_euro').val(data["taux_euro"]); | |
531 | $('#taux_max_euro_display').empty(); | |
532 | $('#taux_max_euro_display').text(data["taux_euro"]); | |
533 | $('.devise_max_code').trigger('update_devise_max_code'); | |
534 | $('#total_max_euro').trigger('update_total_max_euro'); | |
535 | }, 'json'); | |
536 | }); | |
537 | $('#id_salaire_max').change(function(){ | |
538 | $('#total_max').trigger('update_total_max'); | |
539 | }); | |
540 | $('#id_indemn_max').change(function(){ | |
541 | $('#total_max').trigger('update_total_max'); | |
542 | }); | |
543 | $('#id_autre_max').change(function(){ | |
544 | $('#total_max').trigger('update_total_max'); | |
b50b0cd3 | 545 | }); |
85668061 | 546 | |
3d627bfd | 547 | /* helpers */ |
85668061 | 548 | function clean_float(value){ |
549 | if (value == undefined) | |
550 | output = 0; | |
551 | else | |
552 | output = parseFloat(value); | |
553 | output = Math.round(output*100)/100; | |
554 | return output; | |
555 | } | |
b50b0cd3 | 556 | |
557 | </script> | |
5d680e84 | 558 | {% endblock %} |