8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

Fix, le solde est calculé pour des factures valides

This commit is contained in:
Gabriel Detraz 2018-01-12 16:03:48 +01:00 committed by root
parent f7657a2236
commit cbe541d382

View file

@ -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(