mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 23:22:25 +00:00
Create new method to return number + name and add to template
This commit is contained in:
parent
d2ee39359f
commit
777621fcec
2 changed files with 9 additions and 1 deletions
|
@ -96,6 +96,14 @@ class BaseInvoice(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
||||||
)
|
)
|
||||||
return name
|
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
|
# TODO : change facture to invoice
|
||||||
class Facture(BaseInvoice):
|
class Facture(BaseInvoice):
|
||||||
|
|
|
@ -59,7 +59,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% for facture in facture_list %}
|
{% for facture in facture_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'users:profil' userid=facture.user.id %}">{{ facture.user }}</a></td>
|
<td><a href="{% url 'users:profil' userid=facture.user.id %}">{{ facture.user }}</a></td>
|
||||||
<td>{{ facture.name }}</td>
|
<td>{{ facture.name_detailled }}</td>
|
||||||
<td>{{ facture.prix_total }}</td>
|
<td>{{ facture.prix_total }}</td>
|
||||||
<td>{{ facture.paiement }}</td>
|
<td>{{ facture.paiement }}</td>
|
||||||
<td>{{ facture.date }}</td>
|
<td>{{ facture.date }}</td>
|
||||||
|
|
Loading…
Reference in a new issue