+{% load dae %}
<fieldset>
<h2>Contrat</h2>
<table>
<td>{%if dossier.remplacement %}oui{% else %}non{%endif %}</td>
</tr>
<tr>
+ <th>Est un cadre?</th>
+ <td>{%if dossier.est_cadre %}oui{% else %}non{%endif %}</td>
+ </tr>
+ <tr>
<th>Durée</th>
<td> du {{ dossier.contrat_date_debut }} au {{ dossier.contrat_date_fin }}</td>
</tr>
<h2>Classement et salaire de base</h2>
<h3>Ancien dossier <span class="info">(le cas échéant)</span></h3>
-{% if dossier.salaire_anterieur != None %}
+{% with dossier.employe.id_rh.get_latest_dossier_ordered_by_date_fin_and_principal as ancien_dossier %}
+{% if ancien_dossier %}
<table>
- <tbody>
- <tr>
- <td colspan="7">
- {{ dossier.employe }} <span class="info">{{ dossier.employe.id_rh.dossier_set.all.0.poste1.type_poste.nom }} {{ dossier.employe.id_rh.dossier_set.all.0.complement1 }}</span>
- </td>
- </tr>
- <tr>
- <th>Classement antérieur</th>
- <th>Salaire antérieur</th>
- <th>Statut antérieur</th>
- <th>Type contrat</th>
- </tr>
- <tr>
- <td>{{ dossier.classement_anterieur|default:"" }}</td>
- <td class="montant">{{ dossier.salaire_anterieur|floatformat:0 }} {{ dossier.devise_anterieur.code }} ({{ dossier.get_salaire_anterieur_euros|floatformat:0 }}€)</td>
- <td>{{ dossier.statut_anterieur|default:"" }}</td>
- <td>{{ dossier.type_contrat_anterieur|default:"" }}</td>
- </tr>
- </tbody>
+ <tbody>
+ <tr>
+ <th>Classement</th>
+ <th>Statut</th>
+ <th>Implantation</th>
+ <th>Employé</th>
+ <th>Poste</th>
+ <th>Salaire</th>
+ <th>Salaire EUR</th>
+ </tr>
+ <tr class="gris-bkg">
+ <td>{{ ancien_dossier.classement|default:"" }}</td>
+ <td>{{ ancien_dossier.statut|default:"" }}</td>
+ <td>{{ ancien_dossier.poste.implantation }}</td>
+ <td>{{ dossier.employe }}</td>
+ <td>{{ ancien_dossier.poste.nom }}</td>
+ {% with ancien_dossier.get_salaire as salaire %}
+ <td>{{ salaire }}</td>
+ <td>{{ salaire.montant_euros_float|floatformat:2 }} EUR</td>
+ {% endwith %}
+ </tr>
+ {% if ancien_dossier and ancien_dossier.remunerations.all.count > 0 %}
+ <tr>
+ <td colspan="1">
+ Rémunération
+ </td>
+ <td colspan="6">
+ {% rh_remun_form_for_year ancien_dossier %}
+ </td>
+ </tr>
+ {% endif %}
+ </tbody>
</table>
{% else %}
<p>Il n'y a pas d'ancien dossier pour cet employé</p>
{% endif %}
+{% endwith %}
<h3>Précédent titulaire <span class="info">(le cas échéant)</span></h3>
{% if dossier.classement_titulaire_anterieur %}
+{% with dossier.get_dossier_precedent_titulaire as precedent_titulaire %}
<table>
<tbody>
<tr>
- <td colspan="3">
- {{ dossier.employe_anterieur|default:"" }}
- </td>
- </tr>
- <tr>
- <th>Classement du titulaire antérieur</th>
- <th>Salaire du titulaire antérieur</th>
- <th>Statut du titulaire antérieur</th>
- </tr>
- <tr>
- <td>{{ dossier.classement_titulaire_anterieur|default:"" }}</td>
- <td class="montant">{{ dossier.salaire_titulaire_anterieur|floatformat:0 }} {{ dossier.devise_titulaire_anterieur.code }} ({{ dossier.get_salaire_titulaire_anterieur_euros|floatformat:0 }}€)</td>
- <td>{{ dossier.statut_titulaire_anterieur|default:"" }}</td>
- </tr>
+ <th>Classement</th>
+ <th>Statut</th>
+ <th>Implantation</th>
+ <th>Employé</th>
+ <th>Poste</th>
+ <th>Salaire</th>
+ <th>Salaire EUR</th>
+ </tr>
+ <tr>
+ <td>{{ precedent_titulaire.classement|default:"" }}</td>
+ <td>{{ precedent_titulaire.statut|default:"" }}</td>
+ <td>{{ precedent_titulaire.poste.implantation }}</td>
+ <td>{{ precedent_titulaire.employe }}</td>
+ <td>{{ precedent_titulaire.poste.nom }}</td>
+ {% with precedent_titulaire.get_salaire as salaire %}
+ <td>{{ salaire }}</td>
+ <td>{{ salaire.montant_euros_float|floatformat:2 }} EUR</td>
+ {% endwith %}
+ </tr>
+ {% if precedent_titulaire and precedent_titulaire.remunerations.all.count > 0 %}
+ <tr>
+ <td colspan="1">
+ Rémunération
+ </td>
+ <td colspan="6">
+ {% rh_remun_form_for_year precedent_titulaire %}
+ </td>
+ </tr>
+ {% endif %}
</tbody>
<table>
+{% endwith %}
{% else %}
<p>Il n'y a pas de précédent titulaire</p>
{% endif %}
</fieldset>
<fieldset>
-<h2>Accès et ouverture des comptes</h2>
+<h2>Accès et ouvertures des comptes</h2>
<table>
<tbody>
<tr>