def get_comp_autre_max_euros(self):
return (float)(self.comp_autre_max) * self.get_taux_comparaison()
+
def __unicode__(self):
"""
Cette fonction est consommatrice SQL car elle cherche les dossiers qui ont été liés à celui-ci.
On retire les MAD BSTG
"""
return [r for r in self.remuneration_set.all() if r.type_id not in (2, )]
+
+ def get_total_couts_auf(self):
+ total = 0.0
+ for r in self.get_couts_auf():
+ total += r.montant_euro()
+ return total
def get_aides_auf(self):
"""
"""
return [r for r in self.remuneration_set.all() if r.type_id in (2, )]
+ def get_total_aides_auf(self):
+ total = 0.0
+ for r in self.get_aides_auf():
+ total += r.montant_euro()
+ return total
+
+ def get_total_remun(self):
+ return self.get_total_couts_auf() + self.get_total_aides_auf()
+
# Tester l'enregistrement car les models.py sont importés au complet
if not reversion.is_registered(Dossier):
reversion.register(Dossier)
return self.devise.tauxchange_set.order_by('-annee').all()[0].taux
def montant_euro(self):
- return round(float(self.montant) / float(self.taux_devise()), 2)
+ return round(float(self.montant) * float(self.taux_devise()), 2)
def montant_euro_mois(self):
return round(self.montant_euro() / 12, 2)
--- /dev/null
+<tr>
+ <th>Type</th>
+ <th>Devise locale</th>
+ <th>Mensuel</th>
+ <th>Annuel</th>
+ <th colspan="2">Conversion en Euros</th>
+ <th>Précision</th>
+</tr>
+
+<tr>
+ <th colspan="5">Coûts AUF</th>
+ <th id="sous-total-cout" class="montant">{{ dossier.get_total_couts_auf|floatformat }}</th>
+ <th>EUR</th>
+</tr>
+
+{% for remun in dossier.get_couts_auf %}
+ <tr class="cout">
+ <td>{{ remun.type }}</td>
+ <td>{{ remun.devise }}</td>
+ <td class="montant">{{ remun.montant_mois|floatformat }}</td>
+ <td class="montant">{{ remun.montant|floatformat }}</td>
+ <td class="montant">{{ remun.montant_euro_mois|floatformat }}</td>
+ <td class="montant">{{ remun.montant_euro|floatformat }}</td>
+ <td>{{ remun.precision }}</td>
+ </tr>
+{% endfor %}
+
+<tr>
+ <th colspan="5">BSTG - Salaire de mise à disposition</th>
+ <th id="sous-total-aide" class="montant">{{ dossier.get_total_aides_auf|floatformat }}</th>
+ <th>EUR</th>
+</tr>
+
+{% for remun in dossier.get_aides_auf %}
+ <tr class="aide">
+ <td>{{ remun.type }}</td>
+ <td>{{ remun.devise }}</td>
+ <td class="montant">{{ remun.montant_mois|floatformat }}</td>
+ <td class="montant">{{ remun.montant|floatformat }}</td>
+ <td class="montant">{{ remun.montant_euro_mois|floatformat }}</td>
+ <td class="montant">{{ remun.montant_euro|floatformat }}</td>
+ <td>{{ remun.precision }}</td>
+ </tr>
+{% endfor %}
+
+<tr>
+ <th colspan="5">TOTAL</th>
+ <th id="remun-total" class="montant">{{ dossier.get_total_remun|floatformat }}</th>
+ <th>EUR</th>
+</tr>
</div>
<fieldset>
- <h2>Pièces jointes</h2>
- <p class="info">CV, lettre de motivation...</p>
- {% include "dae/pieces.html" %}
+ <h2>Pièces jointes</h2>
+ <ul>
+ {% for pj in dossier.dossierpiece_set.all %}
+ <li><a href="{{ pj.fichier.url }}" target="_blank">{{ pj.nom }}</a></li>
+ {% endfor %}
+ </ul>
+
</fieldset>
<h2 class="section">SECTION 3 - COÛT GLOBAL</h2>
<fieldset>
-
- {% if new %}
- <p>
- Vous devez enregister ce dossier avant de pouvoir détailler le
- coût global.
- </p>
- {% else %}
- <table cellspacing="0" id="global-cost">
- {% include 'dae/embauche-remun.html' %}
- </table>
-
- <select id="type-remun" name="type-remun">
- <option value="">(Ajouter une ligne)</option>
- {% for tr in type_remun %}
- <option value="{{ tr.id }}">{{ tr.nom }}</option>
- {% endfor %}
- </select>
- {% endif %}
-
+ <table cellspacing="0" id="global-cost">
+ {% include 'dae/embauche-remun-consulter.html' %}
+ </table>
</fieldset>
<h2 class="section">SECTION 4 - JUSTIFICATION DE LA DEMANDE (OBLIGATOIRE)</h2>
</tr>
<tr>
<td>
- {% with justificationsNouveauForm as form %}
- {% include "dae/justifications.html" %}
- {% endwith %}
+ {% for j in dossier.justificationnouvelemploye_set.all %}
+ <h4>{{ j.question }}</h4>
+ <p>{{ j.reponse }}</p>
+ {% endfor %}
</td>
<td>
- {% with justificationsAutreForm as form %}
- {% include "dae/justifications.html" %}
- {% endwith %}
+ {% for j in dossier.justificationautreemploye_set.all %}
+ <h4>{{ j.question }}</h4>
+ <p>{{ j.reponse }}</p>
+ {% endfor %}
</td>
</tr>
</table>