# -*- encoding: utf-8 -*-
-import os
import datetime
-import StringIO
-from collections import defaultdict
from datetime import date
from simplejson import dumps
-import warnings
from django.core.exceptions import MultipleObjectsReturned
-from django.core.urlresolvers import reverse
from django.core.paginator import Paginator, InvalidPage
from django.http import Http404, HttpResponse, HttpResponseGone
from django.shortcuts import redirect, render_to_response, get_object_or_404
-from django.views.static import serve
-from django.template import Context, RequestContext
-from django.template.loader import get_template
+from django.template import RequestContext
from django.contrib import messages
-from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType
-from reversion.models import Version
-
from sendfile import sendfile
from auf.django.permissions.decorators import get_object
if not devise or not classement:
raise Http404
- taux_impl = rh.TauxChange.objects.filter(implantation=implantation) \
- .order_by('-annee')
taux = rh.TauxChange.objects.filter(devise=devise).order_by('-annee')
- vp = rh.ValeurPoint.objects.filter(implantation=implantation) \
+ vp = rh.ValeurPoint.objects.filter(implantation=implantation, devise=devise) \
.order_by('-annee')
- if vp.count() * taux.count() * taux_impl.count() == 0:
+ if vp.count() * taux.count() == 0:
raise Http404
classement = get_object_or_404(rh.Classement, pk=classement)
- taux, taux_impl, vp = taux[0].taux, taux_impl[0].taux, vp[0].valeur
+ taux, vp = taux[0].taux, vp[0].valeur
- salaire_euro = round(vp * classement.coefficient * taux_impl, 2)
+ salaire_euro = round(vp * classement.coefficient * taux, 2)
data = dict(salaire_euro=salaire_euro, taux=taux,
salaire_devise=round(salaire_euro / taux, 2))