Browse Source

Get the right mandate when creating voucher.

bootstrap-accordion-ios
Hugo Levy-Falk 6 years ago
committed by chirac
parent
commit
6171f42b66
  1. 2
      cotisations/utils.py
  2. 2
      cotisations/views.py

2
cotisations/utils.py

@ -99,7 +99,7 @@ def send_mail_invoice(invoice):
def send_mail_voucher(invoice):
"""Creates a voucher from an invoice and sends it by email to the client"""
president = Mandate.get_mandate().president
president = Mandate.get_mandate(invoice.date).president
ctx = {
'asso_name': AssoOption.get_cached_value('name'),
'pres_name': ' '.join([president.name, president.surname]),

2
cotisations/views.py

@ -1068,7 +1068,7 @@ def voucher_pdf(request, invoice, **_kwargs):
_("Could not find a voucher for that invoice.")
)
return redirect(reverse('cotisations:index'))
president = Mandate.get_mandate().president
president = Mandate.get_mandate(invoice.date).president
return render_voucher(request, {
'asso_name': AssoOption.get_cached_value('name'),
'pres_name': ' '.join([president.name, president.surname]),

Loading…
Cancel
Save