Commit cbe541d3 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

Fix, le solde est calculé pour des factures valides

parent f7657a22
......@@ -413,7 +413,8 @@ class User(FieldPermissionModelMixin, AbstractBaseUser, PermissionsMixin):
somme_debit = Vente.objects.filter(
facture__in=Facture.objects.filter(
user=self,
paiement__in=solde_objects
paiement__in=solde_objects,
valid=True
)
).aggregate(
total=models.Sum(
......@@ -422,7 +423,7 @@ class User(FieldPermissionModelMixin, AbstractBaseUser, PermissionsMixin):
)
)['total'] or 0
somme_credit = Vente.objects.filter(
facture__in=Facture.objects.filter(user=self),
facture__in=Facture.objects.filter(user=self, valid=True),
name="solde"
).aggregate(
total=models.Sum(
......
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