Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit c7949ac6 authored by chirac's avatar chirac

Merge branch 'fix_affichage_solde' into 'dev'

Fix affichage du solde

See merge request federez/re2o!311
parents a6f65fd9 783c724f
...@@ -503,7 +503,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, ...@@ -503,7 +503,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
).aggregate( ).aggregate(
total=models.Sum( total=models.Sum(
models.F('prix')*models.F('number'), models.F('prix')*models.F('number'),
output_field=models.FloatField() output_field=models.DecimalField()
) )
)['total'] or 0 )['total'] or 0
somme_credit = Vente.objects.filter( somme_credit = Vente.objects.filter(
...@@ -512,7 +512,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, ...@@ -512,7 +512,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
).aggregate( ).aggregate(
total=models.Sum( total=models.Sum(
models.F('prix')*models.F('number'), models.F('prix')*models.F('number'),
output_field=models.FloatField() output_field=models.DecimalField()
) )
)['total'] or 0 )['total'] or 0
return somme_credit - somme_debit return somme_credit - somme_debit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment