mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-26 14:42:25 +00:00
Fix, le solde est calculé pour des factures valides
This commit is contained in:
parent
f414cec623
commit
247697367d
1 changed files with 3 additions and 2 deletions
|
@ -413,7 +413,8 @@ class User(FieldPermissionModelMixin, AbstractBaseUser, PermissionsMixin):
|
||||||
somme_debit = Vente.objects.filter(
|
somme_debit = Vente.objects.filter(
|
||||||
facture__in=Facture.objects.filter(
|
facture__in=Facture.objects.filter(
|
||||||
user=self,
|
user=self,
|
||||||
paiement__in=solde_objects
|
paiement__in=solde_objects,
|
||||||
|
valid=True
|
||||||
)
|
)
|
||||||
).aggregate(
|
).aggregate(
|
||||||
total=models.Sum(
|
total=models.Sum(
|
||||||
|
@ -422,7 +423,7 @@ class User(FieldPermissionModelMixin, AbstractBaseUser, PermissionsMixin):
|
||||||
)
|
)
|
||||||
)['total'] or 0
|
)['total'] or 0
|
||||||
somme_credit = Vente.objects.filter(
|
somme_credit = Vente.objects.filter(
|
||||||
facture__in=Facture.objects.filter(user=self),
|
facture__in=Facture.objects.filter(user=self, valid=True),
|
||||||
name="solde"
|
name="solde"
|
||||||
).aggregate(
|
).aggregate(
|
||||||
total=models.Sum(
|
total=models.Sum(
|
||||||
|
|
Loading…
Reference in a new issue