tx = 1
return (float)(tx) * (float)(self.salaire)
- def get_couts_auf(self):
+ def get_remunerations_brutes(self):
"""
- On retire les MAD BSTG
+ 1 Salaire de base
+ 3 Indemnité de base
+ 4 Indemnité d'expatriation
+ 5 Indemnité pour frais
+ 6 Indemnité de logement
+ 7 Indemnité de fonction
+ 8 Indemnité de responsabilité
+ 9 Indemnité de transport
+ 10 Indemnité compensatrice
+ 11 Indemnité de subsistance
+ 12 Indemnité différentielle
+ 13 Prime d'installation
+ 14 Billet d'avion
+ 15 Déménagement
+ 16 Indemnité de départ
+ 18 Prime de 13ième mois
+ 19 Prime d'intérim
"""
- return [r for r in self.remuneration_set.all() if r.type_id not in (2, )]
-
- def get_total_couts_auf(self):
+ ids = [1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19]
+ return [r for r in self.remuneration_set.all() if r.type_id in ids]
+
+ def get_charges_salariales(self):
+ """
+ 20 Charges salariales ?
+ """
+ ids = [20, ]
+ return [r for r in self.remuneration_set.all() if r.type_id in ids]
+
+ def get_total_charges_salariales(self):
+ total = 0.0
+ for r in self.get_charges_salariales():
+ total += r.montant_euro()
+ return total
+
+ def get_charges_patronales(self):
+ """
+ 17 Charges patronales
+ """
+ ids = [17, ]
+ return [r for r in self.remuneration_set.all() if r.type_id in ids]
+
+ def get_total_charges_patronales(self):
total = 0.0
- for r in self.get_couts_auf():
+ for r in self.get_charges_patronales():
total += r.montant_euro()
return total
- def get_aides_auf(self):
+ def get_salaire_brut(self):
+ """
+ somme des rémuérations brutes
+ """
+ total = 0.0
+ for r in self.get_remunerations_brutes():
+ total += r.montant_euro()
+ return total
+
+ def get_salaire_net(self):
+ """
+ salaire brut - charges salariales
+ """
+ total_charges = 0.0
+ for r in self.get_charges_salariales():
+ total_charges += r.montant_euro()
+ return self.get_salaire_brut() - total_charges
+
+ def get_couts_auf(self):
+ """
+ salaire net + charges patronales
+ """
+ total_charges = 0.0
+ for r in self.get_charges_patronales():
+ total_charges += r.montant_euro()
+ return self.get_salaire_net() + total_charges
+
+ def get_remunerations_tierces(self):
"""
- On récupère les MAD BSTG
+ 2 Salaire MAD
"""
return [r for r in self.remuneration_set.all() if r.type_id in (2, )]
- def get_total_aides_auf(self):
+ def get_total_remunerations_tierces(self):
total = 0.0
- for r in self.get_aides_auf():
+ for r in self.get_remunerations_tierces():
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):
<th>Précision</th>
</tr>
-{% if dossier.get_couts_auf %}
<tr>
- <th colspan="5">Coûts AUF</th>
- <th id="sous-total-cout" class="montant">{{ dossier.get_total_couts_auf|floatformat:0 }}€</th>
+ <th colspan="5">Salaire brut</th>
+ <th id="sous-total-cout" class="montant">{{ dossier.get_salaire_brut|floatformat:0 }}€</th>
<th></th>
</tr>
-{% endif %}
-{% for remun in dossier.get_couts_auf %}
+{% for remun in dossier.get_remunerations_brutes %}
<tr class="cout">
<td>{{ remun.type }}</td>
<td>{{ remun.devise }}</td>
</tr>
{% endfor %}
-{% if dossier.get_aides_auf %}
<tr>
- <th colspan="5">BSTG - Salaire de mise à disposition</th>
- <th id="sous-total-aide" class="montant">{{ dossier.get_total_aides_auf|floatformat:0 }}€</th>
+ <th colspan="5">Charges salariales</th>
+ <th id="sous-total-aide" class="montant">{{ dossier.get_total_charges_salariales|floatformat:0 }}€</th>
<th></th>
</tr>
-{% endif %}
-{% for remun in dossier.get_aides_auf %}
+{% for remun in dossier.get_charges_salariales %}
+ <tr class="aide">
+ <td>{{ remun.type }}</td>
+ <td>{{ remun.devise }}</td>
+ <td class="montant">{{ remun.montant_mois|floatformat:0 }}</td>
+ <td class="montant">{{ remun.montant|floatformat:0 }}</td>
+ <td class="montant">{{ remun.montant_euro_mois|floatformat:0 }}</td>
+ <td class="montant">{{ remun.montant_euro|floatformat:0 }}</td>
+ <td>{{ remun.precision }}</td>
+ </tr>
+{% endfor %}
+
+<tr>
+ <th colspan="5">Charges patronales</th>
+ <th id="sous-total-cout" class="montant">{{ dossier.get_total_charges_patronales|floatformat:0 }}€</th>
+ <th></th>
+</tr>
+
+{% for remun in dossier.get_charges_patronales %}
<tr class="aide">
<td>{{ remun.type }}</td>
<td>{{ remun.devise }}</td>
{% endfor %}
<tr>
- <th colspan="5">TOTAL</th>
- <th id="remun-total" class="montant">{{ dossier.get_total_remun|floatformat:0 }}€</th>
+ <th colspan="5">Côuts AUF</th>
+ <th id="sous-total-cout" class="montant">{{ dossier.get_couts_auf|floatformat:0 }}€</th>
<th></th>
</tr>
+
+
+{% if dossier.get_remunerations_tierces %}
+<tr>
+ <th colspan="5">Autres rémunérations</th>
+ <th id="sous-total-cout" class="montant">{{ dossier.get_total_remunerations_tierces|floatformat:0 }}€</th>
+ <th></th>
+</tr>
+{% endif %}
+
+{% for remun in dossier.get_remunerations_tierces %}
+ <tr class="aide">
+ <td>{{ remun.type }}</td>
+ <td>{{ remun.devise }}</td>
+ <td class="montant">{{ remun.montant_mois|floatformat:0 }}</td>
+ <td class="montant">{{ remun.montant|floatformat:0 }}</td>
+ <td class="montant">{{ remun.montant_euro_mois|floatformat:0 }}</td>
+ <td class="montant">{{ remun.montant_euro|floatformat:0 }}</td>
+ <td>{{ remun.precision }}</td>
+ </tr>
+{% endfor %}
+