mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
More readable user_account
This commit is contained in:
parent
029bc7cc7c
commit
224374f5e8
@ -12,13 +12,13 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for array in obj %}
|
{% for array in obj %}
|
||||||
{% for tuple in array %}
|
{% for dict in array %}
|
||||||
{% if tuple[0] != 0 %}
|
{% if dict['sum'] != 0 %}
|
||||||
{% set link=url('core:user_account_detail', user_id=profile.id, year=tuple[1].year, month=tuple[1].month) %}
|
{% set link=url('core:user_account_detail', user_id=profile.id, year=dict['date'].year, month=dict['date'].month) %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{ link }}">{{ tuple[1].year }}</a></td>
|
<td><a href="{{ link }}">{{ dict['date'].year }}</a></td>
|
||||||
<td><a href="{{ link }}">{{ tuple[1]|date("E") }}</a></td>
|
<td><a href="{{ link }}">{{ dict['date']|date("E") }}</a></td>
|
||||||
<td><a href="{{ link }}">{{ tuple[0] }} €</a></td>
|
<td><a href="{{ link }}">{{ dict['sum'] }} €</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -427,10 +427,10 @@ class UserAccountView(UserAccountBase):
|
|||||||
date__year=month.year,
|
date__year=month.year,
|
||||||
date__month=month.month
|
date__month=month.month
|
||||||
)
|
)
|
||||||
stats[i].append((
|
stats[i].append({
|
||||||
sum([calc(p) for p in q]),
|
'sum':sum([calc(p) for p in q]),
|
||||||
month
|
'date':month
|
||||||
))
|
})
|
||||||
i += 1
|
i += 1
|
||||||
return stats
|
return stats
|
||||||
|
|
||||||
|
@ -1025,7 +1025,6 @@ class EticketPDFView(CanViewMixin, DetailView):
|
|||||||
self.object = self.get_object()
|
self.object = self.get_object()
|
||||||
eticket = self.object.product.eticket
|
eticket = self.object.product.eticket
|
||||||
user = self.object.customer.user
|
user = self.object.customer.user
|
||||||
print(self.object)
|
|
||||||
code = "%s %s %s %s" % (self.object.customer.user.id, self.object.product.id, self.object.id, self.object.quantity)
|
code = "%s %s %s %s" % (self.object.customer.user.id, self.object.product.id, self.object.id, self.object.quantity)
|
||||||
code += " " + eticket.get_hash(code)[:8].upper()
|
code += " " + eticket.get_hash(code)[:8].upper()
|
||||||
response = HttpResponse(content_type='application/pdf')
|
response = HttpResponse(content_type='application/pdf')
|
||||||
|
Loading…
Reference in New Issue
Block a user