X-Git-Url: http://git.auf.org/?p=auf_rh_dae.git;a=blobdiff_plain;f=project%2Fdae%2Fmodels.py;h=ac6878179e7cf5b58f6bddda2362ad2621dcb9ee;hp=382d2d9ebba9165201b83181746de1f2517fa0ab;hb=a6d7aacb6a1b510aacc740c60a2d56d640003be2;hpb=a87582b74ac250a5232938f3383d514cf6d9304a diff --git a/project/dae/models.py b/project/dae/models.py index 382d2d9..ac68781 100644 --- a/project/dae/models.py +++ b/project/dae/models.py @@ -530,9 +530,9 @@ class Dossier(DossierWorkflow, models.Model): def get_salaire_euros(self): try: - tx = rh.TauxChange.objects.filter(implantation=self.poste.implantation, devise=self.devise)[0].taux + tx = self.devise.tauxchange_set.order_by('-annee').filter(implantation=self.poste.implantation)[0].taux except: - tx = 1 + tx = 0 return (float)(tx) * (float)(self.salaire) def get_remunerations_brutes(self): @@ -673,7 +673,7 @@ class Remuneration(models.Model): return round(self.montant / 12, 2) def taux_devise(self): - return self.devise.tauxchange_set.order_by('-annee').all()[0].taux + return self.devise.tauxchange_set.order_by('-annee').filter(implantation=self.dossier.poste.implantation)[0].taux def montant_euro(self): return round(float(self.montant) * float(self.taux_devise()), 2)