mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Add number of article in the display of cotisation
This commit is contained in:
parent
af3da1eafb
commit
bf749fb638
2 changed files with 22 additions and 2 deletions
|
@ -96,6 +96,16 @@ class BaseInvoice(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
|
||||||
)
|
)
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
def name_detailed(self):
|
||||||
|
"""
|
||||||
|
Return:
|
||||||
|
- a list of strings with the name of all article in the invoice
|
||||||
|
and their quantity.
|
||||||
|
"""
|
||||||
|
ventes = self.vente_set.all()
|
||||||
|
strings = ["{} x {}".format(v.number, v.name) for v in ventes]
|
||||||
|
return strings
|
||||||
|
|
||||||
|
|
||||||
# TODO : change facture to invoice
|
# TODO : change facture to invoice
|
||||||
class Facture(BaseInvoice):
|
class Facture(BaseInvoice):
|
||||||
|
|
|
@ -85,7 +85,17 @@ 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>
|
||||||
|
<table class="table-striped">
|
||||||
|
{% for article in facture.name_detailed %}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{{ article }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
</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>
|
||||||
|
@ -115,7 +125,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue