diff --git a/cotisations/models.py b/cotisations/models.py index dc415624..531b9672 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -95,6 +95,14 @@ class BaseInvoice(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): Vente.objects.filter(facture=self).values_list("name", flat=True) ) return name + + def name_detailled(self): + """ + Return: a string with the name of the article and the number + of article sold. + """ + vente = Vente.objects.filter(facture=self).get() + return str(vente.number) + " x " + str(vente.name) # TODO : change facture to invoice diff --git a/cotisations/templates/cotisations/aff_cotisations.html b/cotisations/templates/cotisations/aff_cotisations.html index b9a1a810..cb7ae2c8 100644 --- a/cotisations/templates/cotisations/aff_cotisations.html +++ b/cotisations/templates/cotisations/aff_cotisations.html @@ -59,7 +59,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% for facture in facture_list %} {{ facture.user }} - {{ facture.name }} + {{ facture.name_detailled }} {{ facture.prix_total }} {{ facture.paiement }} {{ facture.date }}