update displayed details about the invoice depending on payment date
Closes #5416
This commit is contained in:
parent
ac581f06bb
commit
1b4583f19c
|
@ -55,7 +55,15 @@
|
|||
{{ invoice.creation_date|iso8601|date:"l j F Y" }}
|
||||
{% if invoice.prelevement_automatique %}
|
||||
<br />
|
||||
Prélèvement automatique effectué le {{ invoice.expiration_date|iso8601|date:"l j F Y" }}
|
||||
{% with expiration_date=invoice.expiration_date|iso8601 %}
|
||||
Prélèvement automatique
|
||||
{% if expiration_date < now %}
|
||||
effectué
|
||||
{% else %}
|
||||
prévu
|
||||
{% endif %}
|
||||
le {{ expiration_date|date:"l j F Y" }}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ class InvoiceView(DetailView):
|
|||
def get_context_data(self):
|
||||
context = super(InvoiceView, self).get_context_data()
|
||||
context['invoice'] = self.invoice
|
||||
context.update({'now': datetime.datetime.now()})
|
||||
return context
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
|
Reference in New Issue