+{% with dossier.poste.get_devise.code as code_devise_locale %}
<tr>
<th>Type</th>
<th colspan="2">Devise locale</th>
{% endfor %}
<tr>
- <th colspan="4">Salaire brut</th>
- <th id="sous-total-cout" class="montant">{{ dossier.get_salaire_brut|floatformat:0 }}€</th>
+ <th colspan="2">Salaire brut</th>
+ <th class="montant">{{ dossier.get_local_salaire_brut|floatformat:0 }} {{code_devise_locale }}</th>
+ <th colspan="2" id="sous-total-cout" class="montant">{{ dossier.get_salaire_brut|floatformat:0 }}€</th>
<th></th>
</tr>
{% endfor %}
<tr>
- <th colspan="4">Charges salariales</th>
- <th id="sous-total-aide" class="montant">{{ dossier.get_total_charges_salariales|floatformat:0 }}€</th>
+ <th colspan="2">Charges salariales</th>
+ <th class="montant">{{ dossier.get_total_local_charges_salariales|floatformat:0 }} {{code_devise_locale }}</th>
+ <th colspan="2" id="sous-total-aide" class="montant">{{ dossier.get_total_charges_salariales|floatformat:0 }}€</th>
<th></th>
</tr>
<tr>
- <th colspan="4">Salaire net</th>
- <th id="sous-total-aide" class="montant">{{ dossier.get_salaire_net|floatformat:0 }}€</th>
+ <th colspan="2">Salaire net</th>
+ <th class="montant">{{ dossier.get_local_salaire_net|floatformat:0 }} {{code_devise_locale }}</th>
+ <th colspan="2" id="sous-total-aide" class="montant">{{ dossier.get_salaire_net|floatformat:0 }}€</th>
<th></th>
</tr>
</tr>
{% endfor %}
<tr>
- <th colspan="4">Charges patronales</th>
- <th id="sous-total-cout" class="montant">{{ dossier.get_total_charges_patronales|floatformat:0 }}€</th>
+ <th colspan="2">Charges patronales</th>
+ <th class="montant">{{ dossier.get_total_local_charges_patronales|floatformat:0 }} {{code_devise_locale }}</th>
+ <th colspan="2" id="sous-total-cout" class="montant">{{ dossier.get_total_charges_patronales|floatformat:0 }}€</th>
<th></th>
</tr>
<tr>
- <th colspan="4">Côuts AUF</th>
- <th id="sous-total-cout" class="montant">{{ dossier.get_couts_auf|floatformat:0 }}€</th>
+ <th colspan="2">Côuts AUF</th>
+ <th class="montant">{{ dossier.get_local_couts_auf|floatformat:0 }} {{code_devise_locale }}</th>
+ <th colspan="2" id="sous-total-cout" class="montant">{{ dossier.get_couts_auf|floatformat:0 }}€</th>
<th></th>
</tr>
<td>{{ remun.precision }}</td>
</tr>
{% endfor %}
-
+{% endwith %}
def get_regions(self):
return [self.implantation.region]
+ def get_devise(self):
+ return ValeurPoint.objects.filter(implantation=self.implantation).order_by('annee')[0].devise
class Poste(Poste_):
__doc__ = Poste_.__doc__
ids = [20, ]
return [r for r in self.remunerations_en_cours().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_euros()
- return total
-
def get_charges_patronales(self):
"""
17 Charges patronales
ids = [17, ]
return [r for r in self.remunerations_en_cours().all() if r.type_id in ids]
+ def get_remunerations_tierces(self):
+ """
+ 2 Salaire MAD
+ """
+ return [r for r in self.remunerations_en_cours().all() if r.type_id in (2, )]
+
+ # DEVISE LOCALE
+
+ def get_total_local_charges_salariales(self):
+ total = 0.0
+ for r in self.get_charges_salariales():
+ total += r.montant
+ return total
+
+ def get_total_local_charges_patronales(self):
+ total = 0.0
+ for r in self.get_charges_patronales():
+ total += float(r.montant)
+ return total
+
+ def get_local_salaire_brut(self):
+ """
+ somme des rémuérations brutes
+ """
+ devise = self.poste.get_devise()
+ total = 0.0
+ for r in self.get_remunerations_brutes():
+ if r.devise != devise:
+ return None
+ total += float(r.montant)
+ return total
+
+ def get_local_salaire_net(self):
+ """
+ salaire brut - charges salariales
+ """
+ devise = self.poste.get_devise()
+ total_charges = 0.0
+ for r in self.get_charges_salariales():
+ if r.devise != devise:
+ return None
+ total_charges += float(r.montant)
+ return self.get_local_salaire_brut() - total_charges
+
+ def get_local_couts_auf(self):
+ """
+ salaire net + charges patronales
+ """
+ devise = self.poste.get_devise()
+ total_charges = 0.0
+ for r in self.get_charges_patronales():
+ if r.devise != devise:
+ return None
+ total_charges += float(r.montant)
+ return self.get_local_salaire_net() + total_charges
+
+ def get_total_local_remunerations_tierces(self):
+ devise = self.poste.get_devise()
+ total = 0.0
+ for r in self.get_remunerations_tierces():
+ if r.devise != devise:
+ return None
+ total += float(r.montant)
+ return total
+
+ # DEVISE EURO
+
+ def get_total_charges_salariales(self):
+ total = 0.0
+ for r in self.get_charges_salariales():
+ total += r.montant_euros()
+ return total
+
def get_total_charges_patronales(self):
total = 0.0
for r in self.get_charges_patronales():
total_charges += r.montant_euros()
return self.get_salaire_net() + total_charges
- def get_remunerations_tierces(self):
- """
- 2 Salaire MAD
- """
- return [r for r in self.remunerations_en_cours().all() if r.type_id in (2, )]
-
def get_total_remunerations_tierces(self):
total = 0.0
for r in self.get_remunerations_tierces():