8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-27 07:02:26 +00:00

Get the right mandate when creating voucher.

This commit is contained in:
Hugo Levy-Falk 2019-09-28 13:01:22 +02:00 committed by chirac
parent 5c0a4ce748
commit 6171f42b66
2 changed files with 2 additions and 2 deletions

View file

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

View file

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