commit
9b4f2ba3da
|
@ -27,7 +27,7 @@
|
||||||
{% for bill in object_list %}
|
{% for bill in object_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{{ bill.number }}</th>
|
<th scope="row">{{ bill.number }}</th>
|
||||||
<td>{{ bill.created_on }}</td>
|
<td>{{ bill.created_on|date:"SHORT_DATE_FORMAT" }}</td>
|
||||||
<td>{{ bill.type }}</td>
|
<td>{{ bill.type }}</td>
|
||||||
<td>{{ bill.total|floatformat:2|localize }}€</td>
|
<td>{{ bill.total|floatformat:2|localize }}€</td>
|
||||||
<td><a class="text-dark" href="{% url 'musician:bill-download' bill.id %}" target="_blank" rel="noopener noreferrer"><i class="fas fa-file-pdf"></i></a></td>
|
<td><a class="text-dark" href="{% url 'musician:bill-download' bill.id %}" target="_blank" rel="noopener noreferrer"><i class="fas fa-file-pdf"></i></a></td>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
import smtplib
|
import smtplib
|
||||||
|
import datetime
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
|
@ -181,6 +182,8 @@ class BillingView(ServiceListView):
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
qs = super().get_queryset()
|
qs = super().get_queryset()
|
||||||
qs = sorted(qs, key=lambda x: x.created_on, reverse=True)
|
qs = sorted(qs, key=lambda x: x.created_on, reverse=True)
|
||||||
|
for q in qs:
|
||||||
|
q.created_on = datetime.datetime.strptime(q.created_on, "%Y-%m-%d")
|
||||||
return qs
|
return qs
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue