From: Eric Mc Sween Date: Wed, 9 Jan 2013 18:25:25 +0000 (-0500) Subject: [#5108] Utiliser le taux de change d'une année précédente lorsqu'il manque le taux... X-Git-Tag: 1.6.5~10 X-Git-Url: http://git.auf.org/?p=auf_rh_dae.git;a=commitdiff_plain;h=e92cf7718639ca424a964eb6c97450edb244b87e;ds=sidebyside [#5108] Utiliser le taux de change d'une année précédente lorsqu'il manque le taux de change de l'année. --- diff --git a/project/rh/views.py b/project/rh/views.py index ea56d88..03bdd94 100644 --- a/project/rh/views.py +++ b/project/rh/views.py @@ -170,7 +170,6 @@ def rapports_employes_sans_contrat(request): employe = get_employe_from_user(request.user) lookup_params['poste__implantation__region'] = employe.implantation.region - dossiers = rh.Dossier.objects.sans_contrats_ou_echus(**lookup_params) dossiers_ids = [d.id for d in dossiers] employes = rh.Employe.objects.filter(id__in=dossiers_ids).distinct().count() @@ -264,8 +263,11 @@ def rapports_masse_salariale(request): remuns = remun_actives.extra( tables=['rh_tauxchange'], where=[ - 'rh_tauxchange.annee = %s', - 'rh_tauxchange.devise = rh_devise.id' + 'rh_tauxchange.devise = rh_devise.id', + 'rh_tauxchange.annee = ' + '(SELECT MAX(annee) FROM rh_tauxchange ' + 'WHERE devise = rh_devise.id ' + 'AND annee <= %s)', ], params=[annee], select={